/
var
/
www
/
html
/
admin
/
Upload FileeE
HOME
<?php session_start(); include('../includes/config.php'); if(strlen($_SESSION['alogin'])==0) { header('location:index.php'); } else{ $pid=intval($_GET['id']);// product id if(isset($_POST['submit'])) { $category=$_POST['category']; $subcat=$_POST['subcategory']; $productname=$_POST['productName']; $productcompany=$_POST['productCompany']; $productprice=$_POST['productprice']; $sku=$_POST['sku']; $productpricebd=$_POST['productpricebd']; $productdescription=$_POST['productDescription']; $productscharge=$_POST['productShippingcharge']; $productavailability=$_POST['productAvailability']; $sql=mysqli_query($con,"update products set category='$category',subCategory='$subcat',productName='$productname',sku='$sku',productCompany='$productcompany',productPrice='$productprice',productDescription='$productdescription',shippingCharge='$productscharge',productAvailability='$productavailability',productPriceBeforeDiscount='$productpricebd' where id='$pid' "); $_SESSION['msg']="Product Updated Successfully !!"; } ?> <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta charset="utf-8" /> <title>Tables - Ace Admin</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="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="widget-header"> Update Product </div> <div class="widget-body"> <div class="widget-main"> <form class="form-horizontal row-fluid" name="insertproduct" method="post" enctype="multipart/form-data"> <?php $query=mysqli_query($con,"select products.*,category.categoryName as catname,category.id as cid,subcategory.subcategory as subcatname,subcategory.id as subcatid from products join category on category.id=products.category join subcategory on subcategory.id=products.subCategory where products.id='$pid'"); $cnt=1; while($row=mysqli_fetch_array($query)) { ?> <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="<?php echo htmlentities($row['cid']);?>"><?php echo htmlentities($row['catname']);?></option> <?php $query=mysqli_query($con,"select * from category"); while($rw=mysqli_fetch_array($query)) { if($row['catname']==$rw['categoryName']) { continue; } else{ ?> <option value="<?php echo $rw['id'];?>"><?php echo $rw['categoryName'];?></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> <option value="<?php echo htmlentities($row['subcatid']);?>"><?php echo htmlentities($row['subcatname']);?></option> </select> </div> <div> <label for="form-field-select-1"> Product Name </label> <input type="text" name="productName" placeholder="Enter Product Name" class="form-control" value="<?php echo htmlentities($row['productName']);?>" required> </div> <div> <label for="form-field-select-1"> Product SKU Number </label> <input type="text" name="sku" placeholder="Enter Product Name" class="form-control" value="<?php echo htmlentities($row['sku']);?>" required> </div> <div> <label for="form-field-select-1"> Product Company</label> <input type="text" name="productCompany" placeholder="Enter Product Comapny Name" class="form-control" value="<?php echo htmlentities($row['productCompany']);?>" required> </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" value="<?php echo htmlentities($row['productPriceBeforeDiscount']);?>" 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="<?php echo htmlentities($row['productPrice']);?>" required> </div> <div> <label for="form-field-select-1"> Product Description </label> <textarea name="productDescription" placeholder="Enter Product Description" rows="6" class="form-control"> <?php echo htmlentities($row['productDescription']);?> </textarea> </div> <div style="display:none"> <label for="form-field-select-1"> Product Shipping Charge </label> <input type="hidden" name="productShippingcharge" value="<?php echo htmlentities($row['shippingCharge']);?>" placeholder="Enter Product Shipping Charge" class="form-control" required> </div> <div> <label for="form-field-select-1"> Product Availability</label> <select name="productAvailability" id="productAvailability" class="form-control" required> <option value="<?php echo htmlentities($row['productAvailability']);?>"><?php echo htmlentities($row['productAvailability']);?></option> <option value="In Stock">In Stock</option> <option value="Out of Stock">Out of Stock</option> </select> </div> <div> <label for="form-field-select-1"> Product Image1 </label> <div class="controls"> <img src="productimages/<?php echo htmlentities($pid);?>/<?php echo htmlentities($row['productImage1']);?>" width="250" height="250"> <a href="update-image1.php?id=<?php echo $row['id'];?>">Change Image</a> </div> </div> </div> <div> <label for="form-field-select-1"> Product Image2 </label> <div class="controls"> <img src="productimages/<?php echo htmlentities($pid);?>/<?php echo htmlentities($row['productImage2']);?>" width="250" height="250"> <a href="update-image2.php?id=<?php echo $row['id'];?>">Change Image3</a> </div> </div> </div> <div> <label for="form-field-select-1"> Product Image3 </label> <div class="controls"> <img src="productimages/<?php echo htmlentities($pid);?>/<?php echo htmlentities($row['productImage3']);?>" width="250" height="250"> <a href="update-image3.php?id=<?php echo $row['id'];?>">Change Image3</a> </div> </div> <div> <label for="form-field-select-1"> Product Image4 </label> <div class="controls"> <img src="productimages/<?php echo htmlentities($pid);?>/<?php echo htmlentities($row['productImage4']);?>" width="250" height="250"> <a href="update-image4.php?id=<?php echo $row['id'];?>">Change Image3</a> </div> </div> <div> <label for="form-field-select-1"> Product Image5 </label> <div class="controls"> <img src="productimages/<?php echo htmlentities($pid);?>/<?php echo htmlentities($row['productImage5']);?>" width="250" height="250"> <a href="update-image5.php?id=<?php echo $row['id'];?>">Change Image5</a> </div> </div> <div> <label for="form-field-select-1"> Product Image6 </label> <div class="controls"> <img src="productimages/<?php echo htmlentities($pid);?>/<?php echo htmlentities($row['productImage6']);?>" width="250" height="250"> <a href="update-image6.php?id=<?php echo $row['id'];?>">Change Image6</a> </div> </div> </div> <?php }?> </div> </div> </div> <div class="clearfix form-actions"> <div class="col-md-offset-3 col-md-9"> <button type="submit" name="submit" class="btn">Update</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> </body> <?php } ?>