intcast($_REQUEST['pid']); } if(!isset($pageid)) { header("location: ../error/4/"); exit; } if(isset($_POST['csrf'])) { if($_POST['csrf'] === $_SESSION['uuid']) { if(isset($_POST['id']) && !empty($_POST['id'])) { if(isset($_FILES['product_image']) && !empty($_FILES['product_image'])) { $name = $cryptography->uniqueID() . '-'. basename($_FILES['product_image']["name"]); if(!empty($name)) { if(stripos($name,'.png',-4) || stripos($name,'.jpg',-4) || stripos($name,'.gif',-4)) { if ($_FILES['product_image']['error'] == UPLOAD_ERR_OK) { $tmp_name = $_FILES['product_image']["tmp_name"]; move_uploaded_file($tmp_name, UPLOAD_DIR. "/$name"); $product_image = $name; } } } } if(isset($_FILES['product_image_2']) && !empty($_FILES['product_image_2'])) { $name = $cryptography->uniqueID() . '-'. basename($_FILES['product_image_2']["name"]); if(!empty($name)) { if(stripos($name,'.png',-4) || stripos($name,'.jpg',-4) || stripos($name,'.gif',-4)) { if ($_FILES['product_image_2']['error'] == UPLOAD_ERR_OK) { $tmp_name = $_FILES['product_image_2']["tmp_name"]; move_uploaded_file($tmp_name, UPLOAD_DIR. "/$name"); $product_image_2 = $name; } } } } if(isset($_FILES['product_image_3']) && !empty($_FILES['product_image_3'])) { $name = $cryptography->uniqueID() . '-'. basename($_FILES['product_image_3']["name"]); if(!empty($name)) { if(stripos($name,'.png',-4) || stripos($name,'.jpg',-4) || stripos($name,'.gif',-4)) { if ($_FILES['product_image_3']['error'] == UPLOAD_ERR_OK) { $tmp_name = $_FILES['product_image_3']["tmp_name"]; move_uploaded_file($tmp_name, UPLOAD_DIR. "/$name"); $product_image_3 = $name; } } } } if(isset($_FILES['featured_image']) && !empty($_FILES['featured_image'])) { $name = $cryptography->uniqueID() . '-'. basename($_FILES['featured_image']["name"]); if(!empty($name)) { if(stripos($name,'.png',-4) || stripos($name,'.jpg',-4) || stripos($name,'.gif',-4)) { if ($_FILES['featured_image']['error'] == UPLOAD_ERR_OK) { $tmp_name = $_FILES['featured_image']["tmp_name"]; move_uploaded_file($tmp_name, UPLOAD_DIR. "/$name"); $featured_image = $name; } } } } $id = $db->clean($_POST["id"],'encode'); $product_featured = ''; $product_featured_carousel = ''; $product_title = $db->clean($_POST["product_title"],'encode'); $product_description = $db->clean($_POST["product_description"],'html'); $product_price = $db->clean($_POST["product_price"],'encode'); $product_stock = $db->clean($_POST["product_stock"],'encode'); $product_category = $db->clean($_POST["product_category"],'encode'); $product_catno = $db->clean($_POST["product_catno"],'encode'); $product_format = $db->clean($_POST["product_format"],'encode'); $product_type = $db->clean($_POST["product_type"],'encode'); $product_weight = $db->clean($_POST["product_weight"],'encode'); $product_condition = $db->clean($_POST["product_condition"],'encode'); $product_ean = $db->clean($_POST["product_ean"],'encode'); if(isset($_POST["product_featured"])) { $product_featured = $db->clean($_POST["product_featured"],'encode'); } if(isset($_POST["product_featured_carousel"])) { $product_featured_carousel = $db->clean($_POST["product_featured_carousel"],'encode'); } $table = 'shop'; $columns = ['product.title','product.description','product.price','product.stock','product.category','product.catno','product.format','product.type','product.weight','product.condition','product.ean','product.featured','product.featured.carousel']; $values = [$product_title,$product_description,$product_price,$product_stock,$product_category,$product_catno,$product_format,$product_type,$product_weight,$product_condition,$product_ean,$product_featured,$product_featured_carousel]; if(isset($product_image)) { array_push($columns, 'product.image'); array_push($values, $product_image); } if(isset($product_image_2)) { array_push($columns, 'product.image.2'); array_push($values, $product_image_2); } if(isset($product_image_3)) { array_push($columns, 'product.image.3'); array_push($values, $product_image_3); } if(isset($featured_image)) { array_push($columns, 'product.featured.image'); array_push($values, $featured_image); } // update shop item $db->update($table,$columns,$values,$id); $success = "Shop item successfully updated."; } } } $table = 'shop'; $column = 'id'; $value = $pageid; $operator = '*'; $result = $db->select($table,$operator,$column,$value); $result_categories = $db->query("SELECT * from `shop.categories` ORDER BY id DESC"); ?>
".$errors."
"; } if(isset($success)) { echo "
".$success."
"; } ?>

clean($result[0]['product.title'],'encode');?>

Show more options
clean($result[0]['product.featured'],'encode') == '1') { echo "checked"; } ?>>
clean($result[0]['product.featured.carousel'],'encode') == '1') { echo "checked"; } ?>>