Server IP : 103.53.40.154 / Your IP : 3.133.146.94 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/aiidm.in/../twizofind.com/../adowoods.com/wknadmin/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php require_once("../includes/dbsmain.inc.php"); ob_start(); $press_rel_id=$_REQUEST['press_rel_id']; if(is_post_back()) { function getExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } if(!empty($press_rel_id)){ $image =$_FILES["press_rel_image"]["name"]; $imgToDel=db_scalar("SELECT press_rel_image FROM tbl_press_realeases WHERE press_rel_id='$press_rel_id'"); if($image){ @unlink("../news/$imgToDel"); @unlink("../news/large/$imgToDel"); $uploadedfile = $_FILES['press_rel_image']['tmp_name']; $filename = stripslashes($_FILES['press_rel_image']['name']); $extension = getExtension($filename); $extension = strtolower($extension); $imgNAME = substr(md5($category_url.time().rand(1,10)),0,14).".".$extension; move_uploaded_file($_FILES['press_rel_image']['tmp_name'],"../news/$imgNAME"); }else{ $imgNAME=$imgToDel; } $press_live_url=ami_crete_url($press_live_url); $ednewssql="update tbl_press_realeases set press_rel_name='$press_rel_name', press_live_url='$press_live_url', press_rel_image='$imgNAME', press_rel_type='$press_rel_type', press_rel_url='$press_rel_url', press_headline_url='$press_headline_url', press_rel_desc='$press_rel_desc', press_rel_status='$press_rel_status', press_rel_add_date=now() where press_rel_id='$_REQUEST[press_rel_id]'"; db_query($ednewssql); set_session_msg("News Updated Successfully !"); header("location:manage_news.php"); exit; }else{ $image =$_FILES["press_rel_image"]["name"]; if($image){ $uploadedfile = $_FILES['press_rel_image']['tmp_name']; $filename = stripslashes($_FILES['press_rel_image']['name']); $extension = getExtension($filename); $extension = strtolower($extension); $imgNAME = substr(md5($category_url.time().rand(1,10)),0,14).".".$extension; move_uploaded_file($_FILES['press_rel_image']['tmp_name'],"../news/$imgNAME"); } $press_live_url=ami_crete_url($press_live_url); $sql="insert into tbl_press_realeases set press_rel_name='$press_rel_name', press_live_url='$press_live_url', press_rel_image='$imgNAME', press_rel_type='$press_rel_type', press_rel_url='$press_rel_url', press_headline_url='$press_headline_url', press_rel_status='$press_rel_status', press_rel_desc='$press_rel_desc', press_rel_add_date=now()"; db_query($sql); set_session_msg("News Added Successfully !"); header("location:manage_news.php"); exit; } } if($press_rel_id!='') { $result = db_query("select * from tbl_press_realeases where press_rel_id = '$press_rel_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 News</div></td> </tr> </table> <div align="right"><a href="manage_news.php" style="font-size:12px; font-weight:bold; margin-right:15px;">Back to News 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;">Blog Title:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="press_rel_name" style="width:350px; height:28px;" type="text" id="press_rel_name" value="<?=$press_rel_name?>" class="textfield" ></td> </tr> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Media Blog Url Text:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="press_live_url" style="width:350px; height:28px;" type="text" id="press_live_url" value="<?=$press_live_url?>" class="textfield" ></td> </tr> <?php if(!empty($press_rel_image)){?> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Current Image :</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"> <img src="../news/<?=$press_rel_image?>" style="width:200px;height:160px" /> </td> </tr> <?php }?> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Upload Image :</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"> <input name="press_rel_image" style="width:350px; height:28px;" type="file" id="press_rel_image" value="" class="textfield" ></td> </tr> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Media Type.:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><select class="gcl bd6" name="press_rel_type" id="press_rel_type" style="width:350px; height:28px;"> <option value="Print Media" selected="selected">Print Media</option> <option value="Electronic Media" <?php if($press_rel_type=='Electronic Media'){ ?> selected="selected" <? } ?>>Electronic Media</option> </select></td> </tr> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Headline:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="press_headline_url" style="width:350px; height:28px;" type="text" id="press_headline_url" value="<?=$press_headline_url?>" class="textfield" ></td> </tr> <tr> <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">News Coverage URL:</td> <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="press_rel_url" style="width:350px; height:28px;" type="text" id="press_rel_url" value="<?=$press_rel_url?>" class="textfield" ></td> </tr> <tr> <td class="tdLabel" style="font-size:12px; padding:7px;">News Coverage Detail:</td> <td class="tdData" style="font-size:12px; padding:7px;"><p class="fck"> <textarea cols="80" id="editor1" name="press_rel_desc" rows="10"><?=$press_rel_desc?> </textarea> <script> // Replace the <textarea id="editor"> with an CKEditor // instance, using default configurations. CKEDITOR.replace( 'editor1'); </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="press_rel_status" style="width:200px; height:26px;"> <option value="Active" <?php if($press_rel_status=='Active'){ ?> selected="selected" <? } ?>>Active</option> <option value="Inactive" <?php if($press_rel_status=='Inactive'){ ?> selected="selected" <? } ?>>Inactive</option> </select></td> </tr> <input type="hidden" name="press_rel_id" value="<?=$press_rel_id?>" /> <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");?>