Ejemplo n.º 1
0
         }
     }
     break;
 case "narocilo":
     session_start();
     if ($http_method == "GET" && $param == null) {
         ApiUtils::saveOrder();
     } else {
         if ($http_method == "GET" && $param == "oddani") {
             ApiUtils::orders();
         } else {
             if ($http_method == "GET" && $param == "potrjeni") {
                 ApiUtils::ordersProven();
             } else {
                 if ($http_method == "GET" && $param == "stornirani") {
                     ApiUtils::ordersCancelled();
                 } else {
                     if ($http_method == "GET" && $param != null) {
                         ApiUtils::getOrderProducts($param);
                     } else {
                         // error
                         echo returnError(404, "Unknown request: [{$http_method} {$resource}]");
                     }
                 }
             }
         }
     }
     break;
 default:
     returnError(404, "Invalid resource: " . $resource);
     break;