Ejemplo n.º 1
0
 public function feedback($id = null)
 {
     if ($_SERVER['REQUEST_METHOD'] == "DELETE") {
         return Feedback_Model::DeleteFeedback($id);
     }
     if (isset($id)) {
         return Products_Model::GetProductById($id);
     }
     return Feedback_Model::GetAllFeedback();
 }
Ejemplo n.º 2
0
 public function DeleteAction($route)
 {
     if ($_SERVER['REQUEST_METHOD'] == 'GET') {
         $t = Products_Model::GetProductById($route[0]);
         $s = $_SESSION['cart']['products_id'][$route[0]];
         $_SESSION['cart']['count'] -= $s;
         $_SESSION['cart']['price'] -= $t['price'] * $s;
         unset($_SESSION['cart']['products_id'][$route[0]]);
         header("Location: " . $_SERVER['HTTP_REFERER']);
         die;
     }
 }
Ejemplo n.º 3
0
 public function DetailAction($route)
 {
     $data = Products_Model::GetProductById($route[0]);
     $res['Content'] = Products_View::GetProductPage($data);
     return $res;
 }