MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 3.21.46.68
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/agkeymaker.in/../adowoods.com/wknadmin/images/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/agkeymaker.in/../adowoods.com/wknadmin/images/../manage-header-flash-insert.php
<?php
require_once("../includes/dbsmain.inc.php");
ob_start();
$header_flash_id=$_REQUEST['header_flash_id'];
if(is_post_back()) {
if(!empty($header_flash_id)){
$category_url=ami_crete_url($header_flash_title);	
	////////////****************** 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 header_flash_image_name from tbl_header_flash where 1 and header_flash_id = '$header_flash_id'");
	    @unlink("../header_files/$DelImage");
 		$filename = stripslashes($_FILES['file']['name']); 	
  		$extension = getExtension($filename);
 		$extension = strtolower($extension);		
		$imgNAME = $category_url.rand(1,100).".".$extension;

move_uploaded_file($_FILES['file']['tmp_name'],"../header_files/$imgNAME");
}else{
$imgNAME=db_scalar("select header_flash_image_name from tbl_header_flash where 1 and header_flash_id = '$header_flash_id'");
}
}
/*Logo*/
 if($_SERVER["REQUEST_METHOD"] == "POST")
 {
  $image1 =$_FILES["logo"]["name"];
  $uploadedfile1 = $_FILES['logo']['tmp_name']; 
  if ($image1) {   
      $DelImage1=db_scalar("select header_flash_logo from tbl_header_flash where 1 and header_flash_id = '$header_flash_id'");
      @unlink("../header_files/header_flash_logo/$DelImage1");
    $filename1 = stripslashes($_FILES['logo']['name']);  
      $extension1 = getExtension($filename1);
    $extension1 = strtolower($extension1);    
    $imgNAME1 = $category_url.rand(100,200).".".$extension1;

move_uploaded_file($_FILES['logo']['tmp_name'],"../header_files/header_flash_logo/$imgNAME1");
}else{
$imgNAME1=db_scalar("select header_flash_logo from tbl_header_flash where 1 and header_flash_id = '$header_flash_id'");
}

}

////////////****************** IMAGE RESIZING END HERE *****************************//
	
	
$editsql="update tbl_header_flash set 
			header_flash_title='$header_flash_title',
			header_flash_image_name='$imgNAME',
			header_flash_logo='$imgNAME1',
      header_flash_status='$header_flash_status',
      header_flash_type='Main',
			header_flash_add_date=now()
			where header_flash_id='$_REQUEST[header_flash_id]'";
			db_query($editsql);
			set_session_msg("Header Flash Updated Successfully !");
			header("location:manage-header-flash.php");	
			exit;		
}
else{
$category_url=ami_crete_url($header_flash_title);
	////////////****************** 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 header_flash_image_name from tbl_header_flash where 1 and header_flash_id = '$header_flash_id'");
	    @unlink("../header_files/$DelImage");
 		$filename = stripslashes($_FILES['file']['name']); 	
  		$extension = getExtension($filename);
 		$extension = strtolower($extension);		
		$imgNAME = $category_url.rand(1,100).".".$extension;

move_uploaded_file($_FILES['file']['tmp_name'],"../header_files/$imgNAME");
}
}

/*logo*/

 if($_SERVER["REQUEST_METHOD"] == "POST")
 {
  $image1 =$_FILES["logo"]["name"];
  $uploadedfile1 = $_FILES['logo']['tmp_name']; 
  if ($image1) {   
      $DelImage1=db_scalar("select header_flash_logo from tbl_header_flash where 1 and header_flash_id = '$header_flash_id'");
      @unlink("../header_files/header_flash_logo/$DelImage1");
    $filename1 = stripslashes($_FILES['logo']['name']);  
      $extension1 = getExtension($filename1);
    $extension1 = strtolower($extension1);    
    $imgNAME1 = $category_url.rand(100,200).".".$extension1;

move_uploaded_file($_FILES['logo']['tmp_name'],"../header_files/header_flash_logo/$imgNAME1");
}
}

////////////****************** IMAGE RESIZING END HERE *****************************//
$testsql="insert into tbl_header_flash set 
			header_flash_title='$header_flash_title',
			header_flash_image_name='$imgNAME',
			header_flash_logo='$imgNAME1',
      header_flash_type='Main',
			header_flash_status='$header_flash_status',
			header_flash_add_date=now()";
			db_query($testsql);
			set_session_msg("Header Flash Added Successfully !");
			header("location:manage-header-flash.php");	
			exit;		
    }
}
if($header_flash_id!='') {
	$result = db_query("select * from tbl_header_flash where header_flash_id = '$header_flash_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 Header Flash</div></td>
              </tr>
            </table>
            <div align="right"><a href="manage-header-flash.php" style="font-size:12px; font-weight:bold; margin-right:15px;">Back to Header Flash List</a>&nbsp;</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">&nbsp;</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;">Slider Title:</td>
                  <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="header_flash_title" style="width:350px; height:28px;" type="text" id="header_flash_title"  value="<?=$header_flash_title?>" class="textfield"  ></td>
                </tr>  
                 <?php if($header_flash_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="../header_files/<?=$header_flash_image_name?>" height="70" width="70"  border="0"> </td>
                </tr>
                <? } ?>
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:5px;">Slider Image :</td>
                  <td class="tdData" style="font-size:12px; padding:5px;"><input type="file" name="file" id="file"></td>
                </tr>  

                 <?php if($header_flash_logo){ ?>
                <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="../header_files/header_flash_logo/<?=$header_flash_logo?>" height="70" width="70"  border="0"> </td>
                </tr>
                <? } ?>
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:5px;">Logo Image :</td>
                  <td class="tdData" style="font-size:12px; padding:5px;"><input type="file" name="logo" id="logo"></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="header_flash_status" style="width:200px; height:26px;">
                      <option value="Active" <?php if($header_flash_status=='Active'){ ?> selected="selected" <? } ?>>Active</option>
                      <option value="Inactive" <?php if($header_flash_status=='Inactive'){ ?> selected="selected" <? } ?>>Inactive</option>
                    </select></td>
                </tr>
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:7px;">&nbsp;</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");?>

MMCT - 2023