Example #1
0
 public function updateGet()
 {
     if (!isset($_GET['id'])) {
         $this->registry->template->message = array('type' => 'error_not_found', 'value' => 'Không tồn tại chương trình khuyến mãi này!');
         return;
     }
     $id = (int) $_GET['id'];
     if ($id == 0) {
         $this->registry->template->message = array('type' => 'error_not_found', 'value' => 'Không tồn tại chương trình khuyến mãi này!');
         return;
     }
     $promoDAO = new PromoDAO(DataSource::getInstance());
     $promo = $promoDAO->findById($id);
     if ($promo == NULL) {
         $this->registry->template->message = array('type' => 'error_not_found', 'value' => 'Không tồn tại chương trình khuyến mãi này!');
         return;
     }
     $this->registry->template->promo = $promo;
     $this->registry->template->promo_backup = $promo;
 }