Example #1
0
 public static function productsDetail()
 {
     $data = filter_input_array(INPUT_GET, self::getIdRules());
     if (self::checkValues($data)) {
         $product = ProductsDB::get($data);
         $images = ImagesDB::getProdutAll(["izdelek_id" => $product["id"]]);
         echo ViewHelper::render("view/anonymous-products-detail.php", ["product" => $product, "images" => $images]);
     } else {
         ViewHelper::redirect(BASE_URL);
     }
 }
Example #2
0
 public static function imageAdd($data = [])
 {
     if (self::checkValues($data)) {
         ImagesDB::insert($data);
         $_SESSION["izdelek_id"] = $data["izdelek_id"];
         self::addActionToDiary($_SESSION["id"], "Prodajalec z id-jem " . $_SESSION["id"] . " je dodal sliko izdelku z id-jem " . $data["izdelek_id"]);
         echo ViewHelper::redirect(BASE_URL . "products/images");
     } else {
         echo ViewHelper::redirect(BASE_URL);
     }
 }