public function index() { if (empty($_GET['seo_url'])) { $this->notFound(); return; } $promoDAO = new PromoDAO(DataSource::getInstance()); $promo = $promoDAO->findBySeoUrl($_GET['seo_url']); if (!$promo) { $this->notFound(); return; } $categoryDAO = new CatDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->cart = $cart; $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $this->registry->template->is_promo_active = TRUE; $this->registry->template->promo = $promo; $this->registry->template->related_promos = $promoDAO->findNewestList(); $this->registry->template->tile_title = $promo['subject']; $this->registry->template->tile_content = 'promo.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function delete() { if ($_SERVER['REQUEST_METHOD'] != 'POST') { echo '0'; return; } $id = (int) $_POST['id']; $catDAO = new CatDAO(DataSource::getInstance()); $catDAO->delete($id); echo '1'; }
public function showError777() { $categoryDAO = new CatDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->cart = $cart; $this->registry->template->tile_title = 'Không có quyền truy cập'; $this->registry->template->tile_content = 'error777.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { $categoryDAO = new CatDAO(DataSource::getInstance()); $globalDAO = new GlobalDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $content = $globalDAO->select('help'); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->content = $content; $this->registry->template->cart = $cart; $this->registry->template->is_help_active = TRUE; $this->registry->template->tile_title = 'Trợ Giúp'; $this->registry->template->tile_content = 'help.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { $categoryDAO = new CatDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $this->registry->template->promo_subject_newest = $promoDAO->findNewestSubject(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->cart = $cart; $this->registry->template->tile_title = __SITE_SLOGAN; $this->registry->template->body_class = 'index-template'; $this->registry->template->body_id = 'index-page'; $this->registry->template->tile_content = 'index.php'; $this->registry->template->show('layout/user.php'); }
public function index() { $categoryDAO = new CatDAO(DataSource::getInstance()); $globalDAO = new GlobalDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $content = $globalDAO->select('contact'); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->content = $content; $this->registry->template->cart = $cart; $this->registry->template->is_contact_active = TRUE; $this->registry->template->facebook_description = 'Ms. Phương Thanh - 0987918796 - pttran87@gmail.com | Ms. Thùy Linh - 0983871412 - ptlinh1412@yahoo.com.vn'; $this->registry->template->tile_title = 'Liên Hệ'; $this->registry->template->tile_content = 'contact.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { $categoryDAO = new CatDAO(DataSource::getInstance()); $globalDAO = new GlobalDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $content = $globalDAO->select('about'); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->content = $content; $this->registry->template->cart = $cart; $this->registry->template->is_about_active = TRUE; $this->registry->template->tile_title = 'Giới Thiệu'; $this->registry->template->body_class = 'page-template'; $this->registry->template->tile_content = 'about.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { if (empty($_GET['seo_url'])) { $this->notFound(); return; } $productDAO = new ProductDAO(DataSource::getInstance()); $product = $productDAO->findBySeoUrl($_GET['seo_url']); if (!$product) { $this->notFound(); return; } $categoryDAO = new CatDAO(DataSource::getInstance()); $brandDAO = new BrandDAO(DataSource::getInstance()); $cat_id = $product['category_id']; $brand_id = $product['brand_id']; $categories_list = $categoryDAO->findByAll_Navigation(); $brands_list = $brandDAO->findByAll(); $products_list_in_cat = $productDAO->findByCatId($cat_id); $products_list_in_brand = $productDAO->findByBrandId($brand_id); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $this->registry->template->cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->brands_list = $brands_list; $this->registry->template->current_cat_id = $cat_id; $this->registry->template->current_brand_id = $brand_id; $this->registry->template->products_list_in_cat = $products_list_in_cat; $this->registry->template->products_list_in_brand = $products_list_in_brand; $this->registry->template->product = $product; $this->registry->template->product_pics = explode_pics($product['pics']); $this->registry->template->tile_title = $categories_list[$cat_id]['name'] . ' / ' . $brands_list[$brand_id] . ' / ' . $product['code']; $this->registry->template->facebook_description = $product['description']; $this->registry->template->facebook_image = __SITE_CONTEXT . __UPLOAD_DIR . get_pic_at($product['pics'], 1); $this->registry->template->body_class = 'product-template'; $this->registry->template->tile_content = 'product.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function index() { echo 'zzzzzzzzzzz 1'; if ($this->findGroupId() > 0) { header('Location: ' . __SITE_CONTEXT . 'admin/dashboard/'); return; } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $username = remove_slashes($_POST['username']); $password = remove_slashes($_POST['password']); $memberDAO = new MemberDAO(DataSource::getInstance()); $group_id = $memberDAO->checkLogin($username, $password); if ($group_id == 0) { // login failed $message = 'Sai username hoặc password!'; $this->registry->template->message = $message; $this->registry->template->username = $username; } else { $_SESSION['member'] = array('group_id' => $group_id); header('Location: ' . __SITE_CONTEXT . 'admin/dashboard/'); return; } } $categoryDAO = new CatDAO(DataSource::getInstance()); $categories_list = $categoryDAO->findByAll_Navigation(); $promoDAO = new PromoDAO(DataSource::getInstance()); $this->registry->template->promo_seo_url_newest = $promoDAO->findNewestSeoUrl(); $cart = getCart(); $this->registry->template->categories_list = $categories_list; $this->registry->template->cart = $cart; $this->registry->template->tile_title = 'Login'; $this->registry->template->body_class = 'page-template'; $this->registry->template->tile_content = 'login.php'; $this->registry->template->tile_footer = 'footer.php'; $this->registry->template->show('layout/user.php'); }
public function sort() { if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->sortPost(); } else { if ($_SERVER['REQUEST_METHOD'] == 'GET') { $this->sortGet(); } } $catDAO = new CatDAO(DataSource::getInstance()); $this->registry->template->cats = $catDAO->findByAll(); $this->registry->template->tile_title = 'Sắp xếp vị trí sản phẩm'; $this->registry->template->tile_content = 'admin/product-sort.php'; $this->registry->template->show('admin/layout/admin.php'); }