Beispiel #1
0
 public static function orderCancelledDetail()
 {
     $rules = ["id" => ['filter' => FILTER_VALIDATE_INT, 'options' => ['min_range' => 1]]];
     $data = filter_input_array(INPUT_POST, $rules);
     if ($data == null) {
         $data["id"] = $_SESSION["pid"];
     }
     if (self::checkValues($data)) {
         $order = OrdersDB::get($data);
         echo ViewHelper::render("view/customer-order-detail-cancelled.php", ["order" => $order, "products" => OrdersDB::getOrderProducts(["narocilo_id" => $data["id"]]), "user" => UsersDB::get(["id" => $order["uporabnik_id"]])]);
     } else {
         ViewHelper::redirect(BASE_URL);
     }
 }
Beispiel #2
0
 public static function getOrderProducts($narocilo_id)
 {
     $izdelki = OrdersDB::getOrderProducts(["narocilo_id" => $narocilo_id]);
     http_response_code(200);
     echo json_encode($izdelki);
 }