private static function storeSwitcher($storeType) { switch ($storeType) { case self::STORE_TYPE_CONTROLLER: return ControllerStore::getInstance(); break; case self::STORE_TYPE_MODEL: return ModelStore::getInstance(); break; case self::STORE_TYPE_LIBRARY: return LibraryStore::getInstance(); break; default: return false; } }
<?php require_once 'header.php'; $controller = new ControllerStore(); $stores = $controller->getStoreFeatured(); ?> <!DOCTYPE html> <html lang="en"><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="description" content=""> <meta name="author" content=""> <link rel="shortcut icon" href="bootstrap/images/favicon.ico" type="image/x-icon" /> <title>2CITY ADMIN</title> <!-- Bootstrap core CSS --> <link href="bootstrap/css/bootstrap.css" rel="stylesheet"> <!-- Custom styles for this template --> <link href="bootstrap/css/navbar-fixed-top.css" rel="stylesheet"> <link href="bootstrap/css/custom.css" rel="stylesheet"> <!-- Just for debugging purposes. Don't actually copy this line! --> <!--[if lt IE 9]><script src="../../assets/js/ie8-responsive-file-warning.js"></script><![endif]--> <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<?php require_once 'header.php'; $controller = new ControllerStore(); $controllerCategory = new ControllerCategory(); $categories = $controllerCategory->getCategories(); $extras = new Extras(); $store_id = $extras->decryptQuery1(KEY_SALT, $_SERVER['QUERY_STRING']); if ($store_id != null) { $store = $controller->getStoreByStoreId($store_id); if (isset($_POST['submit'])) { $itm = $store; $itm->store_name = htmlspecialchars(trim(strip_tags($_POST['store_name'])), ENT_QUOTES); $itm->store_address = htmlspecialchars(trim(strip_tags($_POST['store_address'])), ENT_QUOTES); $store_desc = preg_replace('~[\\r\\n]+~', '', $_POST['store_desc']); $itm->store_desc = htmlspecialchars(trim(strip_tags($store_desc))); $itm->lat = trim(strip_tags($_POST['lat'])); $itm->lon = htmlspecialchars(trim(strip_tags($_POST['lon'])), ENT_QUOTES); $itm->created_at = time(); $itm->website = $extras->removeHttp(htmlspecialchars(trim(strip_tags($_POST['website'])), ENT_QUOTES)); $itm->phone_no = htmlspecialchars(trim(strip_tags($_POST['phone_no'])), ENT_QUOTES); $itm->email = trim(strip_tags($_POST['email'])); $itm->sms_no = trim(strip_tags($_POST['sms_no'])); $itm->category_id = trim(strip_tags($_POST['category_id'])); $itm->updated_at = time(); $itm->featured = trim(strip_tags($_POST['featured'])); $controller->updateStore($itm); echo "<script type='text/javascript'>location.href='stores.php';</script>"; } } else { echo "<script type='text/javascript'>location.href='403.php';</script>";
<?php require_once 'header.php'; $controller = new ControllerStore(); $controllerReview = new ControllerReview(); $controllerUser = new ControllerUser(); if (!empty($_SERVER['QUERY_STRING'])) { $extras = new Extras(); $store_id = $extras->decryptQuery1(KEY_SALT, $_SERVER['QUERY_STRING']); $review_delete = $extras->decryptQuery2(KEY_SALT, $_SERVER['QUERY_STRING']); $reviews = $controllerReview->getReviewsByStoreId($store_id); $store = $controller->getStoreByStoreId($store_id); if ($review_delete != null) { $store_id = $review_delete[0]; $review_id = $review_delete[1]; $controllerReview->deleteReview($review_id, 1); $viewUrl = $extras->encryptQuery1(KEY_SALT, 'store_id', $store_id, 'store_reviews_view.php'); echo "<script type='text/javascript'>location.href='{$viewUrl}';</script>"; } if ($store_id == null) { echo "<script type='text/javascript'>location.href='403.php';</script>"; } } ?> <!DOCTYPE html> <html lang="en"><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<?php require_once 'header.php'; $controller = new ControllerPhoto(); $controllerStore = new ControllerStore(); $extras = new Extras(); $store_id = $extras->decryptQuery1(KEY_SALT, $_SERVER['QUERY_STRING']); $photo_store_delete = $extras->decryptQuery2(KEY_SALT, $_SERVER['QUERY_STRING']); if ($store_id != null) { $photos_store = $controller->getPhotosByStoreId($store_id); $selected_store = $controllerStore->getStoreByStoreId($store_id); } if ($photo_store_delete != null) { $store_id = $photo_store_delete[0]; $photo_id = $photo_store_delete[1]; $controller->deletePhoto($photo_id, 1); $viewUrl = $extras->encryptQuery1(KEY_SALT, 'store_id', $store_id, 'photo_store_view.php'); echo "<script type='text/javascript'>location.href='{$viewUrl}';</script>"; } if ($store_id == null && $photo_store_delete == null) { echo "<script type='text/javascript'>location.href='403.php';</script>"; } ?> <!DOCTYPE html> <html lang="en"><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1">
<?php require_once 'header.php'; $controller = new ControllerStore(); $controllerPhoto = new ControllerPhoto(); $controllerRating = new ControllerRating(); $stores = $controller->getStores(); if (!empty($_SERVER['QUERY_STRING'])) { $extras = new Extras(); $store_id = $extras->decryptQuery1(KEY_SALT, $_SERVER['QUERY_STRING']); $store_id_featured = $extras->decryptQuery2(KEY_SALT, $_SERVER['QUERY_STRING']); if ($store_id != null) { $controller->deleteStore($store_id, 1); echo "<script type='text/javascript'>location.href='stores.php';</script>"; } if ($store_id_featured != null) { $itm = new Store(); $itm->store_id = $store_id_featured[0]; $itm->featured = $store_id_featured[1] == "yes" ? 0 : 1; $res = $controller->updateStoreFeatured($itm); echo "<script type='text/javascript'>location.href='stores.php';</script>"; } // if($store_id_featured == null && $store_id == null) { // echo "<script type='text/javascript'>location.href='403.php';</script>"; // } } $begin = 0; $page = 1; $count = count($stores); $pages = intval($count / Constants::NO_OF_ITEMS_PER_PAGE); $search_criteria = "";
<?php require_once 'header.php'; $controller = new ControllerStore(); $controllerCategory = new ControllerCategory(); $categories = $controllerCategory->getCategories(); $extras = new Extras(); if (isset($_POST['submit'])) { $itm = new Store(); $itm->store_name = htmlspecialchars(trim(strip_tags($_POST['store_name'])), ENT_QUOTES); $itm->store_address = htmlspecialchars(trim(strip_tags($_POST['store_address'])), ENT_QUOTES); $store_desc = preg_replace('~[\\r\\n]+~', '', $_POST['store_desc']); $itm->store_desc = htmlspecialchars(trim(strip_tags($store_desc))); $itm->lat = trim(strip_tags($_POST['lat'])); $itm->lon = htmlspecialchars(trim(strip_tags($_POST['lon'])), ENT_QUOTES); $itm->created_at = time(); $itm->website = $extras->removeHttp(htmlspecialchars(trim(strip_tags($_POST['website'])), ENT_QUOTES)); $itm->phone_no = htmlspecialchars(trim(strip_tags($_POST['phone_no'])), ENT_QUOTES); $itm->email = trim(strip_tags($_POST['email'])); $itm->sms_no = trim(strip_tags($_POST['sms_no'])); $itm->category_id = trim(strip_tags($_POST['category_id'])); $itm->updated_at = time(); $itm->featured = trim(strip_tags($_POST['featured'])); $controller->insertStore($itm); echo "<script type='text/javascript'>location.href='stores.php';</script>"; } ?> <!DOCTYPE html> <html lang="en"><head>