A-105
div -- end message-green --
-- start product-table ..................................................................................... -- form id=mainform action=
table border=0 width=100 cellpadding=0 cellspacing=0 id=product-table tr
th class=table-header-repeat line-left minwidth-1a href=Nama Usera
th th class=table-header-repeat line-lefta href=Usernameath
th class=table-header-repeat line-left minwidth-1a href=Alamatath th class=table-header-repeat line-lefta href=Emailath
th class=table-header-repeat line-lefta href=Roleath th class=table-header-repeat line-lefta href=Tanggal Lahirath
th class=table-header-repeat line-lefta href=Toolsath tr
?php controller = new userCtrl;
allProduk = controller-getAllUser; foreach allProduk as value {
echo tr; echo td . value-getNaMauser . td . td . value-getUserName . td .
td . value-getALamaT . td . td . value-getEmail . td . td . value-getRole . td . td . dated-M-Y, strtotimevalue-getTgLlAhIr . td .
tda href=addUser.php?idUser= . value-getIdUser . title=Edit class=icon- 1 info-tooltipaa href=deleteUser.php?idUser= . value-getIdUser . title=Delete class=icon-2
info-tooltipatd; echo tr;
} ?
table -- end product-table................................... --
form div
-- end content-table -- div class=cleardiv
div -- end content-table-inner ............................................END --
td td id=tbl-border-righttd
tr tr
th class=sized bottomleftth td id=tbl-border-bottomnbsp;td
th class=sized bottomrightth tr
table div class=clearnbsp;div
div -- end content --
div class=clearnbsp;div div
-- end content-outer........................................................END -- ?php
include footer.php; ?
52. Category Control
?php include ..controllerconfig.php;
include_once ..modelvis_CategoryModel.class.php; class categoryCtrl {
public model; public config;
public function __construct { this-model = new vis_CategoryModel;
this-config = new config; }
public function getAllCategory { global model;
A-106
query = SELECT FROM category; return vis_CategoryModel::findBySqlthis-config-getPdo, query;
} public function addCategorynamA {
cat = new vis_CategoryModel; cat-setNamAnamA;
insertIntoDatabase = cat-insertIntoDatabasethis-config-getPdo; return insertIntoDatabase;
} public function deleteCategorynama {
cat = new vis_CategoryModel; cat-setNamAnama;
deleteFromDatabase = cat-deleteFromDatabasethis-config-getPdo; return deleteFromDatabase;
} }
?
53. Check out Control
?php include ..controllerconfig.php;
include_once ..modelvis_CheckoutModel.class.php; class checkoutCtrl {
public model; public config;
public function __construct { this-model = new vis_CheckoutModel;
this-config = new config; }
public function getAllCategory { global model;
query = SELECT FROM checkout; return vis_CheckoutModel::findBySqlthis-config-getPdo, query;
} public function addCategoryidCheckout,aLamaTShipping, idUser, total, typeshipping {
cat = new vis_CheckoutModel; cat-setIdCheckoutidCheckout;
cat-setALamaTShippingaLamaTShipping; cat-setIdUseridUser;
cat-setTglCheckoutdateY-m-d; cat-setTotaltotal;
cat-setTypeShippingtypeshipping; insertIntoDatabase = cat-insertIntoDatabasethis-config-getPdo;
return insertIntoDatabase; }
public function deleteCategoryidCheckout { cat = new vis_CheckoutModel;
cat-setIdCheckoutidCheckout; deleteFromDatabase = cat-deleteFromDatabasethis-config-getPdo;
return deleteFromDatabase; }
} ?
54. Check out detail
?php include_once ..controllerconfig.php;
include_once ..modelvis_ShoppingCartDetailsModel.class.php; class detailsCtrl {
public model; public config;
public function __construct { this-model = new vis_ShoppingCartDetailsModel;
this-config = new config; }
public function getAllCategory { global model;
query = SELECT FROM shoppingcartdetails; return vis_ShoppingCartDetailsModel::findBySqlthis-config-getPdo, query;
A-107
} public function getDetilsByIDidCheckout {
query = SELECT FROM shoppingcartdetails WHERE idCheckout = idCheckout; return vis_ShoppingCartDetailsModel::findBySqlthis-config-getPdo, query;
} public function addCategoryidCheckout, idProdUk, jUmLaH {
cat = new vis_ShoppingCartDetailsModel; cat-setIdCheckoutidCheckout;
cat-setIdProdUkidProdUk; cat-setJUmLaHjUmLaH;
insertIntoDatabase = cat-insertIntoDatabasethis-config-getPdo; return insertIntoDatabase;
} public function deleteCategoryidCheckoutDetails {
cat = new vis_ShoppingCartDetailsModel; cat-setIdCheckoutDetailsidCheckoutDetails;
deleteFromDatabase = cat-deleteFromDatabasethis-config-getPdo; return deleteFromDatabase;
} }
?
55. Config