D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
grandhou
/
www
/
admin
/
Filename :
create-page.php
back
Copy
<?php session_start(); include('include/constant.php'); include('include/configpage.php'); if(strlen($_SESSION['alogin'])==0) { header('location:index.php'); } else{ if(isset($_POST['submit'])) { $menu = htmlspecialchars($_POST['Menu'], ENT_QUOTES, 'UTF-8'); $title = htmlspecialchars($_POST['Title'], ENT_QUOTES, 'UTF-8'); $permalink = preg_replace('/[^A-Za-z0-9\-]/', '', $_POST['Permalink']); $description = htmlspecialchars($_POST['Description'], ENT_QUOTES, 'UTF-8'); $metatitle = htmlspecialchars($_POST['metatitle'], ENT_QUOTES, 'UTF-8'); $metadesc = htmlspecialchars($_POST['metadesc'], ENT_QUOTES, 'UTF-8'); // $menu=$_POST['Menu']; // $title= htmlspecialchars($_POST['Title'], ENT_QUOTES, 'UTF-8'); // $permalink=$_POST['Permalink']; // $description=$_POST['Description']; // $metatitle=$_POST['metatitle']; // $metadesc=$_POST['metadesc']; $sql1 = "insert into page (parentmenu,pagetitle,permalink,description,metatitle,metadesc) values('".$menu."','".$title."','".$permalink."','".$description."','".$metatitle."','".$metadesc."')"; // execute query if(mysqli_query($dbhandle,$sql1)) {$_SESSION['msg']="Page Created Successfully !!"; } } ?> <!DOCTYPE html> <html 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>GRAND HOUSE</title> <link href="css/bootstrap.min.css" rel="stylesheet"> <link rel="shortcut icon" href="upload/favicon.ico"> <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 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'> <link rel="stylesheet" href="tinymce/style.css"> <script> $(document).ready(function () { var mySelect = $('#first-disabled2'); $('#special').on('click', function () { mySelect.find('option:selected').prop('disabled', true); mySelect.selectpicker('refresh'); }); $('#special2').on('click', function () { mySelect.find('option:disabled').prop('disabled', false); mySelect.selectpicker('refresh'); }); $('#basic2').selectpicker({ liveSearch: true, maxOptions: 1 }); }); </script> <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>Create 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 } ?> <?php if(isset($_GET['del'])) {?> <div class="alert alert-error"> <button type="button" class="close" data-dismiss="alert">×</button> <strong>Oh snap!</strong> <?php echo htmlentities($_SESSION['delmsg']);?><?php echo htmlentities($_SESSION['delmsg']="");?> <?php } ?> <br /> <form class="form-horizontal row-fluid" method="post" name="createpage" id="createpage" enctype="multipart/form-data"> <div class="control-group"> <label class="control-label" for="basicinput">Parent Menu</label> <div class="controls"> <select name="Menu" class="span8 tip" onChange="getState(this.value)" required> <option value="0">Parent Menu</option> <?php $sql= mysqli_query($dbhandle,"select pagetitle from page where parentmenu='0'"); while ($row=mysqli_fetch_array($sql)) { echo '<option value="' . $row[pagetitle] . '">' . $row[pagetitle] . '</option>'; } ?> </select> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Page Title</label> <div class="controls"> <input type="text" name="Title" placeholder="Enter Page Title" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Perma Link<br>(*Special characters are not allowed)</label> <div class="controls"> <input type="text" name="Permalink" placeholder="Enter Perma Link" class="span8 tip" required> </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Meta Title</label> <div class="controls"> <input type="text" name="metatitle" placeholder="Enter Meta Title" 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" placeholder="Enter Meta Description" class="span8 tip" > </div> </div> <div class="control-group"> <label class="control-label" for="basicinput">Description</label> <div class="controls"> <textarea name="Description" placeholder="Enter Description" id="" cols="30" rows="10"></textarea> <input name="image" type="file" id="upload" class="hidden" onchange=""> </div> </div> <div class="control-group"> <div class="controls"> <button type="submit" name="submit" class="btn">Create</button> </div> </div> </form> </div> </div> </div><!--/.content--> </div><!--/.span9--> </div> </div><!--/.container--> </div><!--/.wrapper--> <?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='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> </body> <?php } ?>