芝麻web文件管理V1.00
编辑当前文件:/home/krishnamexports/www/panel/pages/product/product.php
0) { for($i=0;$i<$imagesCount;$i++) { if(!empty($_FILES['image']['name'][$i])){ $imgPro = rand()."_".$_FILES['image']['name'][$i]; move_uploaded_file($_FILES['image']['tmp_name'][$i],"../products/".$imgPro); array_push($producImage,$imgPro); } } } $image = implode('$',$producImage); $product_title_1 = $_POST['product_title_1']; $product_description_1 = $_POST['product_description_1']; $product_title_2 = $_POST['product_title_2']; $product_description_2 = $_POST['product_description_2']; $product_title_3 = $_POST['product_title_3']; $product_description_3 = $_POST['product_description_3']; $product_title_4 = $_POST['product_title_4']; $product_description_4 = $_POST['product_description_4']; $product_title_5 = $_POST['product_title_5']; $product_description_5 = $_POST['product_description_5']; $product_title_6 = $_POST['product_title_6']; $product_description_6 = $_POST['product_description_6']; $product_title_7 = $_POST['product_title_7']; $product_description_7 = $_POST['product_description_7']; $product_title_8 = $_POST['product_title_8']; $product_description_8 = $_POST['product_description_8']; $product_title_9 = $_POST['product_title_9']; $product_description_9 = $_POST['product_description_9']; $product_title_10 = $_POST['product_title_10']; $product_description_10 = $_POST['product_description_10']; $delivery_charge = $_POST['delivery_charge']; $slug_url = mysqli_real_escape_string($cn,$_POST['slug_url']); $sqlUrl = mysqli_query($cn, "select * from tbl_product where slug_url='$slug_url'"); if(mysqli_num_rows($sqlUrl)>0) { echo '
Danger!
Slug Url Already Exist.
'; } else { $sqlSubject = mysqli_query($cn, "insert into `tbl_product` set `category_id`='".$category_id."', `subcategory_id`='".$subcategory_id."', `name`='".$name."', `image`='".$image."', `min_order`='".$min_order."', `max_order`='".$max_order."', `weight`='".$weight."', `skucode`='".$skucode."', `price`='".$price."', `orignalprice`='".$orignalprice."', `stock`='".$stock."', `featured_type`='".$featured_type."', `bulk_order`='".$bulk_order."', `polish_id`='".$polish_id."', `size_id`='".$size_id."', `small_description`='".$small_description."', `delivery_charge`='".$delivery_charge."', `slug_url`='".$slug_url."', `product_title_1`='".$product_title_1."', `product_description_1`='".$product_description_1."', `product_title_2`='".$product_title_2."', `product_description_2`='".$product_description_2."', `product_title_3`='".$product_title_3."', `product_description_3`='".$product_description_3."', `product_title_4`='".$product_title_4."', `product_description_4`='".$product_description_4."', `product_title_5`='".$product_title_5."', `product_description_5`='".$product_description_5."', `product_title_6`='".$product_title_6."', `product_description_6`='".$product_description_6."', `product_title_7`='".$product_title_7."', `product_description_7`='".$product_description_7."', `product_title_8`='".$product_title_8."', `product_description_8`='".$product_description_8."', `product_title_9`='".$product_title_9."', `product_description_9`='".$product_description_9."', `product_title_10`='".$product_title_10."', `product_description_10`='".$product_description_10."'"); if($sqlSubject) { echo '
Success!
Product Added Successfully.
'; } else { echo '
Danger!
Product Not Added. Try Again.
'; } } } if(isset($_POST['edit'])) { $polish_id = ""; $id = $_POST['id']; $category_id = $_POST['category_id']; $subcategory_id = $_POST['subcategory_id']; $name = $_POST['name']; $weight = $_POST['weight']; $min_order = $_POST['min_order']; $max_order = $_POST['max_order']; $skucode = $_POST['skucode']; $price = $_POST['price']; $orignalprice = $_POST['orignalprice']; $stock = $_POST['stock']; $featured_type = 0; if(isset($_POST['featured_type'])){ $featured_type = $_POST['featured_type']; } $bulk_order = $_POST['bulk_order']; if($bulk_order==0) { $polish_id = implode('$',$_POST['polish_id']); } $size_id = implode('$',$_POST['size_id']); $small_description = $_POST['small_description']; $sql = mysqli_query($cn, "select * from tbl_product where id='$id'"); $sqlData = mysqli_fetch_array($sql); $oldImages = explode('$',$sqlData['image']); $producImage = array(); $imagesCount = count($_FILES['image']['name']); if($imagesCount > 0) { for($i=0;$i<$imagesCount;$i++) { if(!empty($_FILES['image']['name'][$i])){ $imgPro = rand()."_".$_FILES['image']['name'][$i]; move_uploaded_file($_FILES['image']['tmp_name'][$i],"../products/".$imgPro); array_push($oldImages,$imgPro); } } } $image = implode('$',$oldImages); $image = ltrim($image,"$"); $image = rtrim($image,"$"); $product_title_1 = $_POST['product_title_1']; $product_description_1 = $_POST['product_description_1']; $product_title_2 = $_POST['product_title_2']; $product_description_2 = $_POST['product_description_2']; $product_title_3 = $_POST['product_title_3']; $product_description_3 = $_POST['product_description_3']; $product_title_4 = $_POST['product_title_4']; $product_description_4 = $_POST['product_description_4']; $product_title_5 = $_POST['product_title_5']; $product_description_5 = $_POST['product_description_5']; $product_title_6 = $_POST['product_title_6']; $product_description_6 = $_POST['product_description_6']; $product_title_7 = $_POST['product_title_7']; $product_description_7 = $_POST['product_description_7']; $product_title_8 = $_POST['product_title_8']; $product_description_8 = $_POST['product_description_8']; $product_title_9 = $_POST['product_title_9']; $product_description_9 = $_POST['product_description_9']; $product_title_10 = $_POST['product_title_10']; $product_description_10 = $_POST['product_description_10']; $delivery_charge = $_POST['delivery_charge']; $slug_url = mysqli_real_escape_string($cn,$_POST['slug_url']); $sqlUrl = mysqli_query($cn, "select * from tbl_product where slug_url='$slug_url' and id!='$id'"); if(mysqli_num_rows($sqlUrl)>0) { echo '
Danger!
Slug Url Already Exist.
'; } else { $sqlSubject = mysqli_query($cn, "update `tbl_product` set `category_id`='".$category_id."', `subcategory_id`='".$subcategory_id."', `name`='".$name."', `image`='".$image."', `min_order`='".$min_order."', `max_order`='".$max_order."', `weight`='".$weight."', `skucode`='".$skucode."', `price`='".$price."', `orignalprice`='".$orignalprice."', `stock`='".$stock."', `featured_type`='".$featured_type."', `bulk_order`='".$bulk_order."', `polish_id`='".$polish_id."', `size_id`='".$size_id."', `small_description`='".$small_description."', `delivery_charge`='".$delivery_charge."', `slug_url`='".$slug_url."', `product_title_1`='".$product_title_1."', `product_description_1`='".$product_description_1."', `product_title_2`='".$product_title_2."', `product_description_2`='".$product_description_2."', `product_title_3`='".$product_title_3."', `product_description_3`='".$product_description_3."', `product_title_4`='".$product_title_4."', `product_description_4`='".$product_description_4."', `product_title_5`='".$product_title_5."', `product_description_5`='".$product_description_5."', `product_title_6`='".$product_title_6."', `product_description_6`='".$product_description_6."', `product_title_7`='".$product_title_7."', `product_description_7`='".$product_description_7."', `product_title_8`='".$product_title_8."', `product_description_8`='".$product_description_8."', `product_title_9`='".$product_title_9."', `product_description_9`='".$product_description_9."', `product_title_10`='".$product_title_10."', `product_description_10`='".$product_description_10."' where `id`='".$id."'"); if($sqlSubject) { echo '
Success!
Product Update Successfully.
'; } else { echo '
Danger!
Product Not Added. Try Again.
'; } } } if(isset($_GET['image_id'])) { $imageName = $_GET['image_id']; $id = $_GET['edit_id']; $sql = mysqli_query($cn, "select * from tbl_product where id='$id'"); $sqlData = mysqli_fetch_array ($sql); $oldImages = explode('$',$sqlData['image']); if (($key = array_search($imageName, $oldImages)) !== false) { unset($oldImages[$key]); } $image = implode('$',$oldImages); mysqli_query($cn,"update `tbl_product` SET `image`='$image' where id='$id'"); header("location:home.php?pages=product&edit_id=".$id); } if(isset($_GET['edit_id'])) { $id = $_GET['edit_id']; $sql = mysqli_query($cn, "select * from tbl_product where id='$id'"); $sqlData = mysqli_fetch_array($sql); $arrayPolish = explode('$',$sqlData['polish_id']); $arraySize = explode('$',$sqlData['size_id']); //$arrayStone = explode('$',$sqlData['stone_id']); } ?>
Add Product
Category
*
Select Category
>
Subcategory
Select Sub Category
>
Product Name
*
Product Image
*
Size must 1000X1000
required >
Choose file
Slug URL
*
Weight
×
" data-image="" data-id="">Set Default
Min. Order Qty
*
Max. Order Qty
*
Product SKU
*
Price
*
Selling Price
*
Stock Available
*
> Yes
> No
Bulk Order
*
> Yes
> No
FEATURED PRODUCT
>
Product Polish
>
Product Size
>
Small Description
</textarea>
Product Description
Product Title 1
" placeholder="Product Title 1">
Product Description 1
Product Title 2
" placeholder="Product Title 2">
Product Description 2
Product Title 3
" placeholder="Product Title 3">
Product Description 3
Product Title 4
" placeholder="Product Title 4">
Product Description 4
Product Title 5
" placeholder="Product Title 5">
Product Description 5
Product Title 6
Product Description 6
Product Title 7
Product Description 7
Product Title 8
Product Description 8
Product Title 9
Product Description 9
Product Title 10
Product Description 10
Delivery Charge
*
">Submit