kohjhjhصثقص5572hjkhk7872ثقصثقgdfgdg
Ele57885fddfg872782782782 hjkhj782dfgfghgقفغفغفقhfg555434536
/
home4
/
kisgavwq
/
gpplenergy.com
/
gpadmin
/
includes
/
Upload FileeE
HOME
<?php $required = "<font color='#FF0000' size='1'>*</font>"; $fdata = array(); $conn = mysqli_connect(SYSTEM_DBHOST,SYSTEM_DBUSER,SYSTEM_DBPWD,SYSTEM_DBNAME); /*************************************/ $id=$_GET['id']; $pcquery=mysqli_query($conn, "select * from tbl_category where id='$id'"); $crow=mysqli_fetch_array($pcquery); if ($_POST['stage'] == 3) { if ($_FILES['cat_icon']['name'] != "") { $path = "../img"; $delpath = $path . "/" . $_POST['cat_icono']; @unlink($delpath); $s1 = rand(); $realname = $_FILES['cat_icon']['name']; $realname = $s1 . "_" . $realname; $dest2 = $path . "/" . $realname; move_uploaded_file($_FILES['cat_icon']['tmp_name'], $dest2); $cimg_name = trim($realname); $cimg = $cimg_name; } else { $cimg = trim($_POST['cat_icono']); } if ($_FILES['product_banner']['name'] != "") { $path2 = "../img/pdbanner"; $delpath2 = $path2 . "/" . $_POST['product_bannero']; @unlink($delpath2); $s1 = rand(); $realname2 = $_FILES['product_banner']['name']; $realname2 = $s1 . "_" . $realname2; $dest2 = $path2 . "/" . $realname2; move_uploaded_file($_FILES['product_banner']['tmp_name'], $dest2); $img_name2 = trim($realname2); $imgban = $img_name2; } else { $imgban = trim($_POST['product_bannero']); } $category_name = mysqli_real_escape_string($conn, $_POST['txtname']); $date=date("Y-m-d"); $sql="update tbl_category set category_name='$category_name', cat_icon = '" . $cimg . "', product_banner = '" . $imgban . "', updated_date='$date' where id='$id'"; //print $sql;exit; $rs = mysqli_query($conn, $sql); $msg = "Record Updated Successfully."; print "<script>"; print "self.location = 'pcategory.php?msg=$msg';"; print "</script>"; } ?> <div class="content_header"> <div class="heading flleft">Edit Product Category</div> <div class="heading flright"><a href="<?=$_curpage?>">« Back</a></div> </div> <div class="bodycontent"> <form name="form1" method="post" action="" onsubmit="return validate();" enctype="multipart/form-data"> <?php if ($crow['id'] == "") { ?> <input type="hidden" name="stage" value="2"> <?php } else { ?> <input type="hidden" name="stage" value="3"> <input type="hidden" name="id" value="<?php print $crow['id'] ?>"> <?php } ?> <input type="hidden" name="act" value="editcategory"> <div id="validation_div" class="validation_error"></div> <table width="100%" cellpadding="3" cellspacing="0" border="0" align="center"> <tr> <td align="left" class="label">Category Name</td> <td align="center">:</td> <td align="left"><input type="text" name="txtname" value="<?php echo $crow['category_name']; ?>" size="50" /></td> </tr> <tr> <td align="left" class="label">Category Icon </td> <td align="center">:</td> <td align="left"><input type="file" name="cat_icon" size="50" /> <?php if($crow['cat_icon']!=""){ ?><img src="../img/<?=$crow['cat_icon']; ?>" style="height: 30px;"><?php } ?> <strong style="display: block;">Image width:75px & height:75px</strong> </td> <input type="hidden" name="cat_icono" value="<?=$crow['cat_icon']; ?>"> </tr> <tr> <td align="left" class="label">Category Banner </td> <td align="center">:</td> <td align="left"><input type="file" name="product_banner" size="50" /> <?php if($crow['product_banner']!=""){ ?><img src="../img/pdbanner/<?=$crow['product_banner']; ?>" style="height: 30px;"><?php } ?> <input type="hidden" name="product_bannero" value="<?=$crow['product_banner']; ?>"> <strong style="display: block;">Image width:1350px & height:300px</strong> </td> </tr> <tr> <td colspan="3" align="center"><p><INPUT type="submit" value="Update" class="button" /></p></td> </tr> </table> </form> </div>