/
var
/
www
/
html
/
admin
/
Upload FileeE
HOME
<?php session_start(); include('../Mplusedata&base/config.php'); if(strlen($_SESSION['alogin'])==0) { header('location:index.php'); } else{ if(isset($_POST['submit'])) { $category=$_POST['category']; $subcat=$_POST['subcategory']; $productname=$_POST['productName']; $productNamee=$_POST['productNamee']; $sku=$_POST['sku']; $productcompany=$_POST['productCompany']; $productCompanye=$_POST['productCompanye']; $productprice=$_POST['productprice']; $productpricebd=$_POST['productpricebd']; $productdescription=$_POST['productDescription']; $productDescriptione=$_POST['productDescriptione']; $shore_desc=$_POST['shore_desc']; $shore_desc_e=$_POST['shore_desc_e']; $productimage1=$_FILES["productimage1"]["name"]; $productimage2=$_FILES["productimage2"]["name"]; $productimage3=$_FILES["productimage3"]["name"]; $productimage4=$_FILES["productimage4"]["name"]; $productimage5=$_FILES["productimage5"]["name"]; $productimage6=$_FILES["productimage6"]["name"]; //for getting product id $query=mysqli_query($con,"select max(id) as pid from products"); $result=mysqli_fetch_array($query); $productid=$result['pid']+1; $dir="productimages/$productid"; mkdir($dir);// directory creation for product images move_uploaded_file($_FILES["productimage1"]["tmp_name"],"productimages/$productid/".$_FILES["productimage1"]["name"]); move_uploaded_file($_FILES["productimage2"]["tmp_name"],"productimages/$productid/".$_FILES["productimage2"]["name"]); move_uploaded_file($_FILES["productimage3"]["tmp_name"],"productimages/$productid/".$_FILES["productimage3"]["name"]); move_uploaded_file($_FILES["productimage4"]["tmp_name"],"productimages/$productid/".$_FILES["productimage4"]["name"]); move_uploaded_file($_FILES["productimage5"]["tmp_name"],"productimages/$productid/".$_FILES["productimage5"]["name"]); move_uploaded_file($_FILES["productimage6"]["tmp_name"],"productimages/$productid/".$_FILES["productimage6"]["name"]); //$productscharge=$_POST['productShippingcharge']; $productavailability='In Stock';//$_POST['productAvailability']; $vedio=$_POST['vedio']; $offer=$_POST['offer']; $campaign=$_POST['campaign']; $sql=mysqli_query($con,"insert into products (category,subCategory,productName,productNamee,sku,productCompany,productCompanye,productPrice,productPriceBeforeDiscount,productDescription, productDescriptione,productImage1,productImage2,productImage3,productImage4,productImage5,productImage6,productavailability,vedio,offer,campaign) values('$category','$subcat','$productname','$productNamee','$sku','$productcompany','$productCompanye','$productprice','$productpricebd','$productdescription', '$productDescriptione','$productimage1','$productimage2','$productimage3','$productimage4','$productimage5','$productimage6','$productavailability','$vedio','$offer','$campaign' ,shore_desc='$shore_desc',shore_desc_e='$shore_desc_e')"); $_SESSION['msg']="Product Inserted Successfully !!"; } /*, ', */ ?> <!DOCTYPE html> <html lang="en"> <head> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <script type="text/javascript" language="JavaScript1.2" src="../stmenu.js"></script> <script src="https://cdn.ckeditor.com/ckeditor5/11.0.1/classic/ckeditor.js"></script> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta charset="utf-8" /> <title>Insert Product || ANN</title> <meta name="description" content="Static & Dynamic Tables" /> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <!-- bootstrap & fontawesome --> <link rel="shortcut icon" type="image/x-icon" href="logo/logo2.jpg"> <link rel="stylesheet" href="assets/css/bootstrap.min.css" /> <link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" /> <!-- page specific plugin styles --> <!-- text fonts --> <link rel="stylesheet" href="assets/css/fonts.googleapis.com.css" /> <!-- ace styles --> <link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" /> <!--[if lte IE 9]> <link rel="stylesheet" href="assets/css/ace-part2.min.css" class="ace-main-stylesheet" /> <![endif]--> <link rel="stylesheet" href="assets/css/ace-skins.min.css" /> <link rel="stylesheet" href="assets/css/ace-rtl.min.css" /> <!--[if lte IE 9]> <link rel="stylesheet" href="assets/css/ace-ie.min.css" /> <![endif]--> <!-- inline styles related to this page --> <!-- ace settings handler --> <script src="assets/js/ace-extra.min.js"></script> <!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries --> <!--[if lte IE 8]> <script src="assets/js/html5shiv.min.js"></script> <script src="assets/js/respond.min.js"></script> <![endif]--> </head> <body class="no-skin"> <?php include("topheader.php");?> <div class="main-container ace-save-state" id="main-container"> <script type="text/javascript"> try{ace.settings.loadState('main-container')}catch(e){} </script> <?php include("leftheader.php");?> <div class="main-content"> <div class="main-content-inner"> <div class="page-content"> <div class="row"> <div class="col-xs-12"> <!-- PAGE CONTENT BEGINS --> <div class="hr hr-18 dotted hr-double"></div> <div class="row"> <div class="col-xs-12"> <div class="module-head"> <h3><span class="widget-toolbar"> <?php if(isset($_POST['submit'])) {?> <div class="alert alert-success"> <button type="button" class="close" data-dismiss="alert">�</button> <strong>Well done!</strong> <?php echo htmlentities($_SESSION['msg']);?><?php echo htmlentities($_SESSION['msg']="");?> </div> <?php } ?> <?php if(isset($_GET['del'])) {?> <div class="alert alert-error"> <button type="button" class="close" data-dismiss="alert">�</button> <strong>Oh snap!</strong> <?php echo htmlentities($_SESSION['delmsg']);?><?php echo htmlentities($_SESSION['delmsg']="");?> </div> <?php } ?> </span></h3> </div> <div class="row"> <div class="col-xs"> <div class="col-xs-12 "> <div class="widget-box"> <div class="table-header"> Insert Product </div> <div class="widget-body"> <div class="widget-main"> <form class="form-horizontal row-fluid" name="insertproduct" method="post" style="padding:30px;font-size:18px;line-height:35px" enctype="multipart/form-data"> <div> <label for="form-field-select-1">Category</label> <select name="category" class="form-control" id="form-field-select-1" onChange="getSubcat(this.value);" required> <option value="">Select Category</option> <?php $query=mysqli_query($con,"select * from category"); while($row=mysqli_fetch_array($query)) {?> <option value="<?php echo $row['id'];?>"><?php echo $row['categoryName'];?> / <?php echo $row['categoryDescription'];?></option> <?php } ?> </select> </div> <div> <script> function getSubcat(val) { $.ajax({ type: "POST", url: "get_subcat.php", data:'cat_id='+val, success: function(data){ $("#subcategory").html(data); } }); } function selectCountry(val) { $("#search-box").val(val); $("#suggesstion-box").hide(); } </script> <label for="form-field-select-1">Sub Category</label> <select name="subcategory" id="subcategory" class="form-control" required> </select> </div> <div> <label for="form-field-select-1"> Product Name (arabic) </label> <input type="text" name="productName" placeholder="Enter Product Name" class="form-control" required> </div> <div> <label for="form-field-select-1"> Product Name (Englsih) </label> <input type="text" name="productNamee" placeholder="Enter Product Name" class="form-control" required> </div> <div> <label for="form-field-select-1"> Width (CM) </label> <input type="text" name="sku" placeholder="Enter Product Name" class="form-control" value="0" > </div> <div> <label for="form-field-select-1"> Length (CM)</label> <input type="text" name="productCompany" placeholder="Enter Product Comapny Name" class="form-control" value="0"> </div> <div> <label for="form-field-select-1"> Product Price <mark>Before Discount</mark> </label> <input type="text" name="productpricebd" placeholder="Enter Product Price" class="form-control" required> </div> <div> <label for="form-field-select-1"> Product Price <mark>After Discount(Selling Price)</mark> </label> <input type="text" name="productprice" placeholder="Enter Product Price" class="form-control" value="0" required> </div> <div> <label for="form-field-select-1"> Brief desc (arabic) </label> <input type="text" name="shore_desc" class="form-control" required value="<?php echo $row['shore_desc'];?>"> </div> <div> <label for="form-field-select-1"> Brief desc (�Engklish) </label> <input type="text" name="shore_desc_e" class="form-control" required value="<?php echo $row['shore_desc_e'];?>"> </div> <div> <label for="form-field-select-1"> Product Description(����) </label> <textarea id="editor2" name="productDescription" placeholder="Enter Product Description" rows="6" class="form-control"> </textarea> </div> <div> <label for="form-field-select-1"> Product Description(Englsih) </label> <textarea id="editor" name="productDescriptione" placeholder="Enter Product Description" rows="6" class="form-control"> </textarea> </div> <div> <label for="form-field-select-1"> Product Availability</label> <select name="productAvailability" id="productAvailability" class="form-control" required> <option value="">Select</option> <option value="In Stock" selected>In Stock</option> <option value="Out of Stock">Out of Stock</option> </select> </div> <div> <label for="form-field-select-1"> Add offer</label> <select name="offer" id="offer" class="form-control" required> <option value="">Select</option> <option value="yes">Yes</option> <option value="no" selected>No</option> </select> </div> <div> <label for="form-field-select-1"> New Collection</label> <select name="campaign" id="campaign" class="form-control" required> <option value="">Select</option> <option value="yes">Yes</option> <option value="no" selected >No</option> </select> </div> <div> <label for="form-field-select-1"> Vedio Link</label> <input type="text" name="vedio" placeholder="Enter Vedio Link" class="form-control" > </div> <div> <label for="form-field-select-1"> Product Image1 </label> <input type="file" name="productimage1" id="productimage1" value="" class="form-control" > </div> <div> <label for="form-field-select-1"> Product Image2 </label> <input type="file" name="productimage2" class="form-control" > </div> <div> <label for="form-field-select-1"> Product Image3 </label> <input type="file" name="productimage3" class="form-control" > <label for="form-field-select-1"> Product Image4 </label> <input type="file" name="productimage4" class="form-control" > <label for="form-field-select-1"> Product Image5 </label> <input type="file" name="productimage5" class="form-control" > <label for="form-field-select-1"> Product Image6 </label> <input type="file" name="productimage6" class="form-control" > </div> </div> </div> </div> <div class="clearfix form-actions"> <div class="col-md-offset col-md-12"> <button type="submit" name="submit" class="btn form-control">Insert</button> </form> </div> </div> </div><!-- /.span --> </div><!-- /.row --> </div> <script src="scripts/jquery-1.9.1.min.js" type="text/javascript"></script> <script src="scripts/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script> <script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script src="scripts/flot/jquery.flot.js" type="text/javascript"></script> <script src="scripts/datatables/jquery.dataTables.js"></script> <script> $(document).ready(function() { $('.datatable-1').dataTable(); $('.dataTables_paginate').addClass("btn-group datatable-pagination"); $('.dataTables_paginate > a').wrapInner('<span />'); $('.dataTables_paginate > a:first-child').append('<i class="icon-chevron-left shaded"></i>'); $('.dataTables_paginate > a:last-child').append('<i class="icon-chevron-right shaded"></i>'); } ); </script> <script> ClassicEditor .create( document.querySelector( '#editor' ) ) .catch( error => { console.error( error ); } ); ClassicEditor .create( document.querySelector( '#editor2' ) ) .catch( error => { console.error( error ); } ); </script> </body> <?php } ?>