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(); $cid = isset($_GET['cid']) ? $_GET['cid'] : ''; /*************************************/ if ($_POST['stage'] == 2) { $date = date("Y-m-d", strtotime($_POST['dob'])); if ($_FILES['image']['name'] != "") { $path2 = "../Product_Photo"; $delpath2 = $path2 . "/" . $_POST['T2']; @unlink($delpath2); $s1 = rand(); $realname2 = $_FILES['image']['name']; $realname2 = $s1 . "_" . $realname2; $dest2 = $path2 . "/" . $realname2; move_uploaded_file($_FILES['image']['tmp_name'], $dest2); $img_name2 = trim($realname2); $img2 = $img_name2; } else { $img2 = trim($_POST['T2']); } if ($_FILES['datasheet']['name'] != "") { $path = "../Data_sheet"; $delpath = $path . "/" . $_POST['T3']; @unlink($delpath); //$s = rand(); $realname = $_FILES['datasheet']['name']; //$realname = $s . "_" . $realname; $dest = $path . "/" . $realname; move_uploaded_file($_FILES['datasheet']['tmp_name'], $dest); $datasheet_name = trim($realname); $datasheet = $datasheet_name; } else { $datasheet = trim($_POST['T3']); } if ($_FILES['logo']['name'] != "") { $path3 = "../Model_Logo"; $delpath3 = $path3 . "/" . $_POST['T4']; @unlink($delpath3); $s3 = rand(); $realname3 = $_FILES['logo']['name']; $realname3 = $s3 . "_" . $realname3; $dest3 = $path3 . "/" . $realname3; move_uploaded_file($_FILES['logo']['tmp_name'], $dest3); $logo_name3 = trim($realname3); $logo = $logo_name3; } else { $logo = trim($_POST['T4']); } $cat_id = mysqli_real_escape_string($conn, $_POST['cmbcategory']); $subcat_id = mysqli_real_escape_string($conn, $_POST['cmbsubcat']); $product_title = mysqli_real_escape_string($conn, $_POST['title']); $model_name = mysqli_real_escape_string($conn, $_POST['model_name']); $resolution = mysqli_real_escape_string($conn, $_POST['resolution']); $product_overview = mysqli_real_escape_string($conn, $_POST['product_overview']); $basic_specification = mysqli_real_escape_string($conn, $_POST['basic_specification']); $detail_features = mysqli_real_escape_string($conn, $_POST['detail_features']); $created_date =date("Y-m-d"); $display_home=mysqli_real_escape_string($conn, $_POST['chkhome']); $producttype=mysqli_real_escape_string($conn, $_POST['producttype']); $rmark=mysqli_real_escape_string($conn, $_POST['rmark']); $sql="insert into tbl_product(producttype,cat_id, subcat_id, p_remark, product_title, model_name, resolution, image, data_sheet, logo, display_home, product_overview, basic_specification, detail_features, created_date) values('$producttype','$cat_id', '$subcat_id', '$rmark', '$product_title', '$model_name', '$resolution', '$img2', '$datasheet', '$logo', '$display_home', '$product_overview', '$basic_specification', '$detail_features', '$created_date')"; //print $sql;exit; $rs = mysqli_query($conn, $sql); $msg = "Record Added Successfully."; print "<script>"; print "self.location = 'product.php?msg=$msg';"; print "</script>"; } ?> <script type="text/javascript"> function getAllSubcategory(cid){ var url="product_add.php"; if(cid!=''){ self.location="product.php?q=add&cid="+cid; }else{ self.location="product.php?q=add"; } } </script> <div class="content_header"> <div class="heading flleft">Add New Product</div> <div class="heading flright"><a href="<?=$_curpage?>">« Back</a></div> </div> <div class="bodycontent"> <form name="form1" method="post" action="" enctype="multipart/form-data" onsubmit="return validate();"> <?php if ($res['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 $res['id'] ?>"> <?php } ?> <input type="hidden" name="act" value="addtravel"> <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"> <select name="cmbcategory" id="cmbcategory" onChange="getAllSubcategory(this.value)"> <option value="">--Select--</option> <?php $category_query = mysqli_query($conn, "select * from tbl_category order by category_name asc "); while ($crow = mysqli_fetch_assoc($category_query)) { ?> <option value="<?php echo $crow['id']; ?>" <?php if ($crow['id'] == $cid) print "selected"; ?>><?php echo $crow['category_name']; ?></option> <?php } ?> </select> </td> </tr> <tr> <td align="left" class="label">Subcategory Name </td> <td align="center">:</td> <td align="left"> <select name="cmbsubcat" id="subcat" > <option value="">--Select--</option> <?php if (!empty($cid)) { $subcat_query = mysqli_query($conn, "select * from tbl_subcategory where cat_id={$cid} order by subcategory_name asc "); while ($scrow = mysqli_fetch_assoc($subcat_query)) { ?> <option value="<?php echo $scrow['id']; ?>"><?php echo $scrow['subcategory_name']; ?></option> <?php } } ?> </select> </td> </tr> <tr> <td align="left" class="label">Rmark</td> <td align="center">:</td> <td align="left"> <select name="rmark" id="remark"> <option value="">Select</option> </select> </tr> <tr> <td align="left" class="label">Title</td> <td align="center">:</td> <td align="left"><input type="text" name="title" size="50" /></td> </tr> <tr> <td align="left" class="label">Model Name</td> <td align="center">:</td> <td align="left"><input type="text" name="model_name" size="50" /></td> </tr> <tr> <td align="left" class="label">Resolution / Channel</td> <td align="center">:</td> <td align="left"><input type="text" name="resolution" size="50" /></td> </tr> <tr> <td align="left" class="label">Upload Image</td> <td align="center">:</td> <td align="left"> <input type="file" name="image" /> <input type="hidden" name="T2" > <b> (image width should be 486px & height 324px)</b></td> </tr> <tr> <td align="left" class="label">Upload Featured Icon</td> <td align="center">:</td> <td align="left"> <input type="file" name="datasheet" /> <input type="hidden" name="T3" > <b> (image width should be 486px & height 148px)</b> </td> </tr> <!-- <tr> <td align="left" class="label">Upload Model Logo</td> <td align="center">:</td> <td align="left"> <input type="file" name="logo" /> <input type="hidden" name="T4" > </td> </tr> --> <tr> <td align="left" class="label">Select Product Type </td> <td align="center"> </td> <td align="left"><select name="producttype" id="producttype"> <option value="">--Select--</option> <option value="1">Premium</option> <option value="2">Creative</option> <option value="3">10/100Mbps</option> <option value="4">10/100Mbps with 1000Mbps Mix Series</option> <option value="5">10/100/1000Mbps</option> <!-- <option value="3">Switch</option> --> </select></td> </tr> <!-- <tr> <td align="left" class="label">Display in Home Page</td> <td align="center">:</td> <td align="left"> <input type="checkbox" name="chkhome" value="1"/> </td> </tr> --> <tr> <td align="left" class="label" colspan="3">Product Overview <br /> <?php include_once("includes/fckeditor/fckeditor.php") ; echo "\n"; $cntdesc = $fdata['tour_detaildesc']; $ctrl_name = 'product_overview'; $sBasePath = 'includes/fckeditor/'; $oFCKeditor = new FCKeditor($ctrl_name); $oFCKeditor->Height = "250px"; $oFCKeditor->Width = "100%"; $oFCKeditor->BasePath = $sBasePath; $oFCKeditor->Value =$cntdesc; $oFCKeditor->Create(); ?> </td> </tr> <tr> <td align="left" class="label" colspan="3">Features <br /> <?php include_once("includes/fckeditor/fckeditor.php") ; echo "\n"; $cntdesc = $fdata['tour_detaildesc']; $ctrl_name = 'detail_features'; $sBasePath = 'includes/fckeditor/'; $oFCKeditor = new FCKeditor($ctrl_name); $oFCKeditor->Height = "250px"; $oFCKeditor->Width = "100%"; $oFCKeditor->BasePath = $sBasePath; $oFCKeditor->Value =$cntdesc; $oFCKeditor->Create(); ?> </td> </tr> <tr> <td align="left" class="label" colspan="3">Specification<br /> <?php include_once("includes/fckeditor/fckeditor.php") ; echo "\n"; $cntdesc = $fdata['tour_detaildesc']; $ctrl_name = 'basic_specification'; $sBasePath = 'includes/fckeditor/'; $oFCKeditor = new FCKeditor($ctrl_name); $oFCKeditor->Height = "250px"; $oFCKeditor->Width = "100%"; $oFCKeditor->BasePath = $sBasePath; $oFCKeditor->Value =$cntdesc; $oFCKeditor->Create(); ?> </td> </tr> <tr> <td colspan="3">Note:Please Upload the Image of width=640 Pixel and height=482 Pixel</td> </tr> <tr> <td colspan="3" align="center"><p><INPUT type="submit" value="Add" class="button" /></p></td> </tr> </table> </form> </div>