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 | |
//as soon as shopping cart is referenced the session context is created | |
SessionContext::create(); | |
/** | |
* ShoppingCart | |
* | |
* | |
* @package |
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 | |
//as soon as shopping cart is referenced the session context is created | |
SessionContext::create(); | |
/** | |
* ShoppingCart | |
* | |
* | |
* @package |
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 | |
$orderId = isset($_REQUEST['orderId']) ? $_REQUEST['orderId'] : null; | |
require_once('views/partials/header.php'); | |
?> | |
<div class="page-header"> | |
<h2>Success!</h2> | |
</div> |
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
/** | |
* place query | |
* | |
* note: using prepared statements | |
* see the filtering in bindValue() | |
* | |
* @return mixed | |
*/ | |
private static function query($connection, $query, $parameters = array()) { | |
$statement = $connection->prepare($query); |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>SCM4 Book Shop</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet"> | |
<link href="assets/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet"> |
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 Bookshop; | |
/** | |
* BaseObject | |
* | |
* handles magic functions | |
*/ | |
class BaseObject { |
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 $type 'categories', 'books', 'users' | |
* @return array | |
*/ | |
private static function getMockData(string $type) : array { | |
$data = array(); | |
switch ($type) { | |
case 'categories' : | |
$data = array(1 => new Category(1, "Mobile & Wireless Computing1"), |
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 App\Routing\Filter; | |
use Cake\Event\Event; | |
use Cake\Routing\DispatcherFilter; | |
class RESTFilter extends DispatcherFilter | |
{ | |
public function beforeDispatch(Event $event) | |
{ |
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
//zu Beginn | |
/* needed to prevent CORS errors, when cakephp throws an exception */ | |
header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']); | |
header('Access-Control-Allow-Methods: *'); | |
header('Access-Control-Allow-Credentials: true'); | |
header('Access-Control-Allow-Request-Method: *'); | |
header('Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization'); | |
... | |
//am Ende |
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 of Hannes</title> | |
</head> | |
<body> | |
<header> | |
<h1>Bookstore</h1> |