D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
grandhou
/
www
/
admin
/
Filename :
managehome.php
back
Copy
<?php session_start(); if(strlen($_SESSION['alogin'])==0) { header('location:index.php'); } include('include/constant.php'); include('include/pdo.php'); error_reporting( ~E_NOTICE ); $id = '1'; $stmt_edit = $DB_con->prepare('SELECT * FROM home WHERE id =:uid'); $stmt_edit->execute(array(':uid'=>$id)); $edit_row = $stmt_edit->fetch(PDO::FETCH_ASSOC); extract($edit_row); if(isset($_POST['btn_save_updates'])) { $id = $_POST['txtCityId']; $metatitle = htmlspecialchars($_POST['metatitle'], ENT_QUOTES, 'UTF-8'); $metadesc = htmlspecialchars($_POST['metadesc'], ENT_QUOTES, 'UTF-8'); $mheading = htmlspecialchars($_POST['mheading'], ENT_QUOTES, 'UTF-8'); $headleft = htmlspecialchars($_POST['headleft'], ENT_QUOTES, 'UTF-8'); $contactdet = htmlspecialchars($_POST['contactdet'], ENT_QUOTES, 'UTF-8'); $heading1 = htmlspecialchars($_POST['heading1'], ENT_QUOTES, 'UTF-8'); $description1 = htmlspecialchars($_POST['description1'], ENT_QUOTES, 'UTF-8'); $heading2 = htmlspecialchars($_POST['heading2'], ENT_QUOTES, 'UTF-8'); $description2 = htmlspecialchars($_POST['description2'], ENT_QUOTES, 'UTF-8'); $indescription2 = htmlspecialchars($_POST['indescription2'], ENT_QUOTES, 'UTF-8'); $heading3 = htmlspecialchars($_POST['heading3'], ENT_QUOTES, 'UTF-8'); $description3 = htmlspecialchars($_POST['description3'], ENT_QUOTES, 'UTF-8'); $indescription3 = htmlspecialchars($_POST['indescription3'], ENT_QUOTES, 'UTF-8'); $heading4 = htmlspecialchars($_POST['heading4'], ENT_QUOTES, 'UTF-8'); $description4 = htmlspecialchars($_POST['description4'], ENT_QUOTES, 'UTF-8'); $indescription4 = htmlspecialchars($_POST['indescription4'], ENT_QUOTES, 'UTF-8'); $subheading55 = htmlspecialchars($_POST['subheading55'], ENT_QUOTES, 'UTF-8'); $description55 = htmlspecialchars($_POST['description55'], ENT_QUOTES, 'UTF-8'); $indescription55 = htmlspecialchars($_POST['indescription55'], ENT_QUOTES, 'UTF-8'); $lifetime = htmlspecialchars($_POST['lifetime'], ENT_QUOTES, 'UTF-8'); $story = htmlspecialchars($_POST['story'], ENT_QUOTES, 'UTF-8'); $specialities = htmlspecialchars($_POST['specialities'], ENT_QUOTES, 'UTF-8'); $heading5 = htmlspecialchars($_POST['heading5'], ENT_QUOTES, 'UTF-8'); $description5 = htmlspecialchars($_POST['description5'], ENT_QUOTES, 'UTF-8'); $heading6 = htmlspecialchars($_POST['heading6'], ENT_QUOTES, 'UTF-8'); $description6 = htmlspecialchars($_POST['description6'], ENT_QUOTES, 'UTF-8'); $heading7 = htmlspecialchars($_POST['heading7'], ENT_QUOTES, 'UTF-8'); $contact = htmlspecialchars($_POST['contact'], ENT_QUOTES, 'UTF-8'); $list = htmlspecialchars($_POST['list'], ENT_QUOTES, 'UTF-8'); $heading9 = htmlspecialchars($_POST['heading9'], ENT_QUOTES, 'UTF-8'); $footer = htmlspecialchars($_POST['footer'], ENT_QUOTES, 'UTF-8'); $imgFile2 = $_FILES['image2']['name']; $tmp_dir2 = $_FILES['image2']['tmp_name']; $imgSize2 = $_FILES['image2']['size']; $imgFile3 = $_FILES['image3']['name']; $tmp_dir3 = $_FILES['image3']['tmp_name']; $imgSize3 = $_FILES['image3']['size']; $imgFile4 = $_FILES['image4']['name']; $tmp_dir4 = $_FILES['image4']['tmp_name']; $imgSize4 = $_FILES['image4']['size']; $imgFile5 = $_FILES['image5']['name']; $tmp_dir5 = $_FILES['image5']['tmp_name']; $imgSize5 = $_FILES['image5']['size']; $imgFile8 = $_FILES['image8']['name']; $tmp_dir8 = $_FILES['image8']['tmp_name']; $imgSize8 = $_FILES['image8']['size']; if($imgFile2) { $upload_dir2 = 'upload/'; // upload directory $imgExt2 = strtolower(pathinfo($imgFile2,PATHINFO_EXTENSION)); // get image extension $valid_extensions2 = array('jpeg', 'jpg', 'png', 'gif'); // valid extensions $image2 = rand(1000,1000000).".".$imgExt2; if(in_array($imgExt2, $valid_extensions2)) { if($imgSize2 < 5000000) { unlink($upload_dir2.$edit_row['image2']); move_uploaded_file($tmp_dir2,$upload_dir2.$image2); } else { $errMSG2 = "Sorry, your file is too large it should be less then 5MB"; } } else { $errMSG2 = "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; } } else { // if no image selected the old image remain as it is. $image2 = $edit_row['image2']; // old image from database } if($imgFile3) { $upload_dir3 = 'upload/'; // upload directory $imgExt3 = strtolower(pathinfo($imgFile3,PATHINFO_EXTENSION)); // get image extension $valid_extensions3 = array('jpeg', 'jpg', 'png', 'gif'); // valid extensions $image3 = rand(1000,1000000).".".$imgExt3; if(in_array($imgExt3, $valid_extensions3)) { if($imgSize3 < 5000000) { unlink($upload_dir3.$edit_row['image3']); move_uploaded_file($tmp_dir3,$upload_dir3.$image3); } else { $errMSG3 = "Sorry, your file is too large it should be less then 5MB"; } } else { $errMSG3 = "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; } } else { // if no image selected the old image remain as it is. $image3 = $edit_row['image3']; // old image from database } if($imgFile4) { $upload_dir4 = 'upload/'; // upload directory $imgExt4 = strtolower(pathinfo($imgFile4,PATHINFO_EXTENSION)); // get image extension $valid_extensions4 = array('jpeg', 'jpg', 'png', 'gif'); // valid extensions $image4 = rand(1000,1000000).".".$imgExt4; if(in_array($imgExt4, $valid_extensions4)) { if($imgSize4 < 5000000) { unlink($upload_dir4.$edit_row['image4']); move_uploaded_file($tmp_dir4,$upload_dir4.$image4); } else { $errMSG4 = "Sorry, your file is too large it should be less then 5MB"; } } else { $errMSG4 = "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; } } else { // if no image selected the old image remain as it is. $image4 = $edit_row['image4']; // old image from database } if($imgFile5) { $upload_dir5 = 'upload/'; // upload directory $imgExt5 = strtolower(pathinfo($imgFile5,PATHINFO_EXTENSION)); // get image extension $valid_extensions5 = array('jpeg', 'jpg', 'png', 'gif'); // valid extensions $image5 = rand(1000,1000000).".".$imgExt5; if(in_array($imgExt5, $valid_extensions5)) { if($imgSize5 < 5000000) { unlink($upload_dir5.$edit_row['image5']); move_uploaded_file($tmp_dir5,$upload_dir5.$image5); } else { $errMSG35 = "Sorry, your file is too large it should be less then 5MB"; } } else { $errMSG5 = "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; } } else { // if no image selected the old image remain as it is. $image5 = $edit_row['image5']; // old image from database } if($imgFile8) { $upload_dir8 = 'upload/'; // upload directory $imgExt8 = strtolower(pathinfo($imgFile8,PATHINFO_EXTENSION)); // get image extension $valid_extensions8 = array('jpeg', 'jpg', 'png', 'gif'); // valid extensions $image8 = rand(1000,1000000).".".$imgExt8; if(in_array($imgExt8, $valid_extensions8)) { if($imgSize8 < 5000000) { unlink($upload_dir8.$edit_row['image8']); move_uploaded_file($tmp_dir8,$upload_dir8.$image8); } else { $errMSG8 = "Sorry, your file is too large it should be less then 5MB"; } } else { $errMSG8 = "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; } } else { // if no image selected the old image remain as it is. $image8 = $edit_row['image8']; // old image from database } // if no error occured, continue .... if(!isset($errMSG2) && !isset($errMSG3) && !isset($errMSG4) && !isset($errMSG5) && !isset($errMSG8)) { $stmt = $DB_con->prepare('UPDATE home SET id=:uprop, metatitle=:metatitle, metadesc=:metadesc, mheading=:mheading, headleft=:headleft, contactdet=:contactdet, heading1=:heading1, description1=:description1, heading2=:heading2, description2=:description2, indescription2=:indescription2, image2=:image2, heading3=:heading3, description3=:description3, indescription3=:indescription3, image3=:image3, heading4=:heading4, description4=:description4, indescription4=:indescription4, image4=:image4, subheading55=:subheading55, description55=:description55, indescription55=:indescription55, image5=:image5, lifetime=:lifetime, story=:story, specialities=:specialities, heading5=:heading5, description5=:description5, heading6=:heading6, description6=:description6, heading7=:heading7, contact=:contact, list=:list, image8=:image8, heading9=:heading9, footer=:footer WHERE id=:uid'); $stmt->bindParam(':uprop',$id); $stmt->bindParam(':metatitle',$metatitle); $stmt->bindParam(':metadesc',$metadesc); $stmt->bindParam(':mheading',$mheading); $stmt->bindParam(':headleft',$headleft); $stmt->bindParam(':contactdet',$contactdet); $stmt->bindParam(':heading1',$heading1); $stmt->bindParam(':description1',$description1); $stmt->bindParam(':heading2',$heading2); $stmt->bindParam(':description2',$description2); $stmt->bindParam(':indescription2',$indescription2); $stmt->bindParam(':image2',$image2); $stmt->bindParam(':heading3',$heading3); $stmt->bindParam(':description3',$description3); $stmt->bindParam(':indescription3',$indescription3); $stmt->bindParam(':image3',$image3); $stmt->bindParam(':heading4',$heading4); $stmt->bindParam(':description4',$description4); $stmt->bindParam(':indescription4',$indescription4); $stmt->bindParam(':image4',$image4); $stmt->bindParam(':subheading55',$subheading55); $stmt->bindParam(':description55',$description55); $stmt->bindParam(':indescription55',$indescription55); $stmt->bindParam(':image5',$image5); $stmt->bindParam(':lifetime',$lifetime); $stmt->bindParam(':story',$story); $stmt->bindParam(':specialities',$specialities); $stmt->bindParam(':heading5',$heading5); $stmt->bindParam(':description5',$description5); $stmt->bindParam(':heading6',$heading6); $stmt->bindParam(':description6',$description6); $stmt->bindParam(':heading7',$heading7); $stmt->bindParam(':contact',$contact); $stmt->bindParam(':list',$list); $stmt->bindParam(':image8',$image8); $stmt->bindParam(':heading9',$heading9); $stmt->bindParam(':footer',$footer); $stmt->bindParam(':uid',$id); if($stmt->execute()){ ?> <script> alert('Successfully Updated ...'); window.location.href='managehome.php'; </script> <?php } else{ $errMSG = "Sorry Data Could Not Updated !"; } } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Wedding Photo Sydeny Price Details</title> <link type="text/css" href="bootstrap/css/bootstrap.min.css" rel="stylesheet"> <link type="text/css" href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet"> <link rel="shortcut icon" href="upload/favicon.ico"> <link type="text/css" href="css/theme.css" rel="stylesheet"> <link type="text/css" href="images/icons/css/font-awesome.css" rel="stylesheet"> <link type="text/css" href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600' rel='stylesheet'> <script src="<?php echo $tiny; ?>" referrerpolicy="origin"></script> <script src="tiny.js" type="text/javascript"></script> </head> <body oncontextmenu="return false;"> <script> document.onkeydown = function(e) { if(event.keyCode == 123) { return false; } if(e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)){ return false; } if(e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)){ return false; } if(e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)){ return false; } } </script> <?php include('include/header.php');?> <div class="wrapper"> <div class="container"> <div class="row"> <?php include('include/sidebar.php');?> <div class="span9"> <div class="content"> <div class="module"> <div class="module-head"> <h3>Manage Home Page</h3> </div> <div class="module-body"> <?php if(isset($_POST['submit'])) {?> <div class="alert alert-success"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>Well done!</strong> <?php echo htmlentities($_SESSION['msg']);?><?php echo htmlentities($_SESSION['msg']="");?> </div> <?php } ?> <br /> <form class="form-horizontal row-fluid" method="post" enctype="multipart/form-data" > <?php $Id='1'; $STH = $DB_con->query("select * from home where id='$Id'"); # setting the fetch mode $STH->setFetchMode(PDO::FETCH_OBJ); # showing the results while($row = $STH->fetch()) { $aa="no-image.jpg"; ?> <div class="control-group"> <div class="controls"> <input type="hidden" name="txtCityId" id="txtCityId" value="<?php echo $row->id;?>" class="span8 tip" readonly required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Meta Title</label> <div class="controls"> <input type="text" name="metatitle" id="metatitle" value="<?php echo $row->metatitle;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Meta Description</label> <div class="controls"> <input type="text" name="metadesc" value="<?php echo $row->metadesc;?>" class="span8 tip"> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Header Left Content </label> <div class="controls"> <input type="text" name="headleft" id="headleft" value="<?php echo $row->headleft;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Header Right Content </label> <div class="controls"> <input type="text" name="contactdet" id="contactdet" value="<?php echo $row->contactdet;?>" class="span8 tip" > </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Banner Text</label> <div class="controls"> <input type="text" name="mheading" id="mheading" value="<?php echo $row->mheading;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Heading 1</label> <div class="controls"> <input type="text" name="heading1" id="heading1" value="<?php echo $row->heading1;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Description 1</label> <div class="controls"> <textarea name="description1" id="description1"><?php echo $row->description1;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Heading 2</label> <div class="controls"> <input type="text" name="heading2" id="heading2" value="<?php echo $row->heading2;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Description 2</label> <div class="controls"> <textarea name="description2" id="description2"><?php echo $row->description2;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Inner Page Description 2</label> <div class="controls"> <input type="text" name="indescription2" id="indescription2" value="<?php echo $row->indescription2;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Image 2 ( 800x500 )<br> </label> <div class="controls"> <img src="upload/<?php if(empty($row->image2)){echo $aa;} else{echo $row->image2;}?>" width="50px" height="50px" alt="No Image"/> <input type="file" name="image2" accept="image/*" /> </div> <br> </div> <div class="control-group"> <label class="control-label" for="basicinput">Heading 3</label> <div class="controls"> <input type="text" name="heading3" id="heading3" value="<?php echo $row->heading3;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Description 3</label> <div class="controls"> <textarea name="description3" id="description3"><?php echo $row->description3;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Inner Page Description 3</label> <div class="controls"> <input type="text" name="indescription3" id="indescription3" value="<?php echo $row->indescription3;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Image 3 (800 x 500)<br> </label> <div class="controls"> <img src="upload/<?php if(empty($row->image3)){echo $aa;} else{echo $row->image3;}?>" width="50px" height="50px" alt="No Image"/> <input type="file" name="image3" accept="image/*" /> </div> <br> </div> <div class="control-group"> <label class="control-label" for="basicinput">Heading 4</label> <div class="controls"> <input type="text" name="heading4" id="heading4" value="<?php echo $row->heading4;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Description 4</label> <div class="controls"> <textarea name="description4" id="description4"><?php echo $row->description4;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Inner Page Description 4</label> <div class="controls"> <input type="text" name="indescription4" id="indescription4" value="<?php echo $row->indescription4;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Image 4 (800 x 500)<br> </label> <div class="controls"> <img src="upload/<?php if(empty($row->image4)){echo $aa;} else{echo $row->image4;}?>" width="50px" height="50px" alt="No Image"/> <input type="file" name="image4" accept="image/*" /> </div> <br> </div> <div class="control-group"> <label class="control-label" for="basicinput">Heading 5</label> <div class="controls"> <input type="text" name="subheading55" id="subheading55" value="<?php echo $row->subheading55;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Description 5</label> <div class="controls"> <textarea name="description55" id="description55"><?php echo $row->description55;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Inner Page Description 55</label> <div class="controls"> <input type="text" name="indescription55" id="indescription55" value="<?php echo $row->indescription55;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Image 5 (800 x 500)<br> </label> <div class="controls"> <img src="upload/<?php if(empty($row->image5)){echo $aa;} else{echo $row->image5;}?>" width="50px" height="50px" alt="No Image"/> <input type="file" name="image5" accept="image/*" /> </div> <br> </div> <div class="control-group"> <label class="control-label" for="basicinput">Lifetime</label> <div class="controls"> <textarea name="lifetime" id="lifetime"><?php echo $row->lifetime;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Story</label> <div class="controls"> <textarea name="story" id="story"><?php echo $row->story;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Specialities</label> <div class="controls"> <textarea name="specialities" id="specialities"><?php echo $row->specialities;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Heading 5</label> <div class="controls"> <input type="text" name="heading5" id="heading5" value="<?php echo $row->heading5;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Description 5</label> <div class="controls"> <textarea name="description5" id="description5"><?php echo $row->description5;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Heading 6</label> <div class="controls"> <input type="text" name="heading6" id="heading6" value="<?php echo $row->heading6;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Description 6</label> <div class="controls"> <textarea name="description6" id="description6"><?php echo $row->description6;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Heading 7</label> <div class="controls"> <input type="text" name="heading7" id="heading7" value="<?php echo $row->heading7;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Contact</label> <div class="controls"> <input type="text" name="contact" id="contact" value="<?php echo $row->contact;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">List</label> <div class="controls"> <textarea name="list" id="list"><?php echo $row->list;?></textarea> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Testimonial Image ( 600x437 )<br> </label> <div class="controls"> <img src="upload/<?php if(empty($row->image8)){echo $aa;} else{echo $row->image8;}?>" width="50px" height="50px" alt="No Image"/> <input type="file" name="image8" accept="image/*" /> </div> <br> </div> <div class="control-group"> <label class="control-label" for="basicinput">Heading 9</label> <div class="controls"> <input type="text" name="heading9" id="heading9" value="<?php echo $row->heading9;?>" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Footer </label> <div class="controls"> <textarea name="footer" id="footer"><?php echo $row->footer;?></textarea> </div> </div> <div class="control-group"> <div class="controls"> <button type="submit" name="btn_save_updates" class="btn">Update</button> </div> </div> <?php } ?> </form> </div> </div><!--/.content--> </div><!--/.span9--> </div> </div><!--/.container--> </div><!--/.wrapper--> </div> <?php include('include/footer.php');?> <script src="bootstrap/js/bootstrap.min.js" type="text/javascript"></script> <script> $(document).ready(function() { $('.datatable-1').dataTable(); $('.dataTables_paginate').addClass("btn-group datatable-pagination"); $('.dataTables_paginate > a').wrapInner('<span />'); $('.dataTables_paginate > a:first-child').append('<i class="icon-chevron-left shaded"></i>'); $('.dataTables_paginate > a:last-child').append('<i class="icon-chevron-right shaded"></i>'); } ); </script> <script src="bootstrap/js/script.js" type="text/javascript"></script> </body>