Esempio n. 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 sản phẩm 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 sản phẩm này!');
         return;
     }
     $productDAO = new ProductDAO(DataSource::getInstance());
     $product = $productDAO->findById($id);
     if (!$product) {
         $this->registry->template->message = array('type' => 'error_not_found', 'value' => 'Không tồn tại sản phẩm này!');
         return;
     }
     $this->registry->template->product = $product;
     $this->registry->template->product_backup = $product;
 }