This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html ng-app='bookstore'> | |
<head> | |
<meta charset="utf-8"> | |
<title>Bookstore</title> | |
<!-- Latest compiled and minified CSS --> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? use Bookshop\ShoppingCart, Bookshop\Util; ?> | |
<table class="table"> | |
<thead> | |
<tr> | |
<th> | |
Title | |
</th> | |
<th> | |
Author |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Bookshop\AuthenticationManager; | |
use Bookshop\Util; | |
if (AuthenticationManager::isAuthenticated()) { | |
Util::redirect("index.php"); | |
} | |
$userName = isset($_REQUEST['userName']) ? $_REQUEST['userName'] : null; | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h2>Administrationsbereich</h2> | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-6"> | |
<h3 ng-hide="isEditMode">Neues Buch anlegen</h3> | |
<h3 ng-show="isEditMode">Buch editieren</h3> | |
<form name="bookForm" novalidate> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="navbar" class="navbar-collapse collapse"> | |
<form class="navbar-form navbar-right" ng-submit="login()" ng-controller="LoginCtrl" ng-show="!loggedIn"> | |
<div ng-class="{ 'alert': flash, 'alert-success': flash.type === 'success', 'alert-danger': flash.type === 'error' }" ng-if="flash" ng-bind="flash.message"></div> | |
<div class="form-group"> | |
<input type="text" placeholder="User" class="form-control" ng-model="username"> | |
</div> | |
<div class="form-group"> | |
<input type="password" placeholder="Password" class="form-control" ng-model="password"> | |
</div> | |
<input type="submit" class="btn btn-success" value="Login"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// PAGES Routes | |
Router::scope('/', ['controller' => 'Pages'], function($routes) { | |
$routes->extensions('json'); | |
$routes->connect('/forbidden', ['action'=>'forbidden']); | |
$routes->connect('/unauthorized', ['action'=>'unauthorized']); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* @param string $nameOnCard | |
* @param integer $cardNumber | |
* @return bool | |
*/ | |
protected function processCheckout(string $nameOnCard = null, string $cardNumber = null) : bool { | |
$errors = array(); | |
$nameOnCard = trim($nameOnCard); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Bookshop\ShoppingCart; | |
use Bookshop\Util; | |
use Bookshop\AuthenticationManager; | |
$nameOnCard = isset($_REQUEST['nameOnCard']) ? $_REQUEST['nameOnCard'] : null; | |
$cardNumber = isset($_REQUEST['cardNumber']) ? $_REQUEST['cardNumber'] : null; | |
require_once('views/partials/header.php'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Data; | |
use Bookshop\Category; | |
use Bookshop\Book; | |
use Bookshop\User; | |
/** | |
* DataManager |