Server IP : 103.53.40.154 / Your IP : 18.227.190.231 Web Server : Apache System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64 User : ppcad7no ( 715) PHP Version : 8.2.25 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home2/ppcad7no/sssktrust.com/wknadmin/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php require_once("../includes/dbsmain.inc.php"); ob_start(); $test_id=$_REQUEST['test_id']; if(is_post_back()) { if(!empty($test_id)){ $category_url=ami_crete_url($test_given_by); ////////////****************** IMAGE RESIZING START HERE *****************************// //********** Code Created By Amitabh Kumar Sinha : Web Developer : Webkey Network Pvt. Ltd. *****************// //********** DATE : 31:07:2014 *****************// //------------FUNCTION TO GET IMAGE EXTENSION START---------------// function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } //------------FUNCTION TO GET IMAGE EXTENSION END---------------// if($_SERVER["REQUEST_METHOD"] == "POST") { $image =$_FILES["file"]["name"]; $uploadedfile = $_FILES['file']['tmp_name']; if ($image) { $DelImage=db_scalar("select test_image_name from tbl_testimonial where 1 and test_id = '$test_id'"); @unlink("../test_images/$DelImage"); $filename = stripslashes($_FILES['file']['name']); $extension = getExtension($filename); $extension = strtolower($extension); $imgNAME = $category_url.".".$extension; move_uploaded_file($_FILES['file']['tmp_name'],"../test_images/$imgNAME"); }else{ $imgNAME=db_scalar("select test_image_name from tbl_testimonial where 1 and test_id = '$test_id'"); } } ////////////****************** IMAGE RESIZING END HERE *****************************// $editsql="update tbl_testimonial set test_given_by='$test_given_by', test_image_name='$imgNAME', test_comp_name='$test_comp_name', test_status='$test_status', test_description='$test_description', test_add_date=now() where test_id='$_REQUEST[test_id]'"; db_query($editsql); set_session_msg("Testmonial Updated Successfully !"); header("location:manage_testimonials.php"); exit; }else{ $category_url=ami_crete_url($test_given_by); ////////////****************** IMAGE RESIZING START HERE *****************************// //********** Code Created By Amitabh Kumar Sinha : Web Developer : Webkey Network Pvt. Ltd. *****************// //********** DATE : 31:07:2014 *****************// //------------FUNCTION TO GET IMAGE EXTENSION START---------------// function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } //------------FUNCTION TO GET IMAGE EXTENSION END---------------// if($_SERVER["REQUEST_METHOD"] == "POST") { $image =$_FILES["file"]["name"]; $uploadedfile = $_FILES['file']['tmp_name']; if ($image) { $DelImage=db_scalar("select test_image_name from tbl_testimonial where 1 and test_id = '$test_id'"); @unlink("../test_images/$DelImage"); $filename = stripslashes($_FILES['file']['name']); $extension = getExtension($filename); $extension = strtolower($extension); $imgNAME = $category_url.".".$extension; move_uploaded_file($_FILES['file']['tmp_name'],"../test_images/$imgNAME"); } } ////////////****************** IMAGE RESIZING END HERE *****************************// $testsql="insert into tbl_testimonial set test_given_by='$test_given_by', test_image_name='$imgNAME', test_comp_name='$test_comp_name', test_status='$test_status', test_description='$test_description', test_add_date=now()"; db_query($testsql); set_session_msg("Testmonial Added Successfully !"); header("location:manage_testimonials.php"); exit; } } if($test_id!='') { $result = db_query("select * from tbl_testimonial where test_id = '$test_id'"); if ($line_raw = mysqli_fetch_array($result)) { @extract($line_raw); } } ?> <script src="ckeditor/ckeditor.js"></script> <style> p.fck { width: 90%; float:left; margin: 0 auto; } </style> <link href="styles.css" rel="stylesheet" type="text/css"> <?php include("top.inc.php");?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td id="pageHead"><div id="txtPageHead">Add/Edit Testimonials</div></td> </tr> </table> <div align="right"><a href="manage_testimonials.php" style="font-size:12px; font-weight:bold; margin-right:15px;">Back to Testimonials List</a> </div> <form name="form1" method="post" enctype="multipart/form-data"> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" class="tableForm"> <tr> <td width="20%" class="tdLabel"> </td> <td width="80%" class="tdData" style="padding-left:7px;"><strong><font color="red"> <?=display_sess_msg();?> </font></strong></td> </tr> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Posted By:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="test_given_by" style="width:350px; height:28px;" type="text" id="test_given_by" value="<?=$test_given_by?>" class="textfield" ></td> </tr> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Company Name:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="test_comp_name" style="width:350px; height:28px;" type="text" id="test_comp_name" value="<?=$test_comp_name?>" class="textfield" ></td> </tr> <?php if($test_image_name){ ?> <tr> <td width="177" class="tdLabel" style="font-size:12px; padding:5px;">Current Image :</td> <td width="721" class="tdData" style="font-size:12px; padding:5px;"><img src="../test_images/<?=$test_image_name?>" height="70" width="70" border="0"> </td> </tr> <? } ?> <tr> <td class="tdLabel" style="font-size:12px; padding:5px;">Image :</td> <td class="tdData" style="font-size:12px; padding:5px;"><input type="file" name="file" id="file"></td> </tr> <?php /*?><tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Mobile No.:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="test_phone" style="width:350px; height:28px;" type="text" id="test_phone" value="<?=$test_phone?>" class="textfield" ></td> </tr> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Country:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="test_country" style="width:350px; height:28px;" type="text" id="test_country" value="<?=$test_country?>" class="textfield" ></td> </tr> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Title:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="test_title" style="width:350px; height:28px;" type="text" id="test_title" value="<?=$test_title?>" class="textfield" ></td> </tr><?php */?> <tr> <td class="tdLabel" style="font-size:12px; padding:7px;">Description:</td> <td class="tdData" style="font-size:12px; padding:7px;"><p class="fck"> <textarea cols="80" id="editor1" name="test_description" rows="10"><?=$test_description?> </textarea> <script> // Replace the <textarea id="editor"> with an CKEditor // instance, using default configurations. CKEDITOR.replace( 'editor1', { uiColor: '#ACACAC', toolbar: [ [ 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ], [ 'FontSize', 'TextColor', 'BGColor' ] ] }); </script> </p></td> </tr> <tr> <td class="tdLabel" style="font-size:12px; padding:7px;">Status:</td> <td class="tdData" style="font-size:12px; padding:7px;"><select name="test_status" style="width:200px; height:26px;"> <option value="Active" <?php if($test_status=='Active'){ ?> selected="selected" <? } ?>>Active</option> <option value="Inactive" <?php if($test_status=='Inactive'){ ?> selected="selected" <? } ?>>Inactive</option> </select></td> </tr> <tr> <td class="tdLabel" style="font-size:12px; padding:7px;"> </td> <td class="tdData" style="font-size:12px; padding:7px;"> <input type="image" name="imageField" src="images/buttons/submit.gif" style="width:100px; margin-bottom:25px;" /></td> </tr> </table> </form> <?php include("bottom.inc.php");?>