Esempio n. 1
0
 function action_remove()
 {
     session_start();
     $model = $_SESSION['basket'];
     $productId = $_POST['productId'];
     $model->Remove(ProductHelper::PopulateProductViewModel(ProductService::GetById($productId)));
     $_SESSION['basket'] = $model;
 }
Esempio n. 2
0
 public static function GetProductsByOrderId($order_id)
 {
     $orders = OrderListService::GetByOrderId($order_id);
     for ($i = 0; $i < count($orders); $i++) {
         $products[$i] = ProductHelper::PopulateProductViewModel(ProductService::GetById($orders[$i]->product_id));
     }
     return $products;
 }
Esempio n. 3
0
 public static function PopulateReviewViewModel($review)
 {
     $model = new ReviewViewModel();
     $model->id = $review->review_id;
     $model->product = ProductHelper::PopulateProductViewModel(ProductService::GetById($review->product_id));
     $model->account = AccountHelper::PopulateAccountViewModel(AccountService::GetById($review->account_id));
     $model->value = $review->value;
     return $model;
 }
 function action_remove()
 {
     PermissionHelper::Verification('Editor');
     $tovarId = $_GET['tovarId'];
     ProductService::Delete(ProductService::GetById($tovarId));
     header("Location: /product/itemadmin");
 }