D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
vitalityhealth
/
www
/
superadmin
/
Filename :
add-faq.php
back
Copy
<?php include 'cn.php'; session_start(); $user=$_SESSION['username']; if(isset($_SESSION['username'])) { if(isset($_POST['submit'])) { // print_r($_POST); // die(); date_default_timezone_set('Asia/Kolkata'); $curdate= date('d-m-Y H:i'); $filename1 = $_FILES['file1']['name']; // Upload file move_uploaded_file($_FILES['file1']['tmp_name'],'service/'.$filename1); $question= addslashes($_POST['question']); $answer= addslashes($_POST['content']); $title= addslashes($_POST['title']); $sql = "INSERT INTO `faq`(`title`,`question`, `answer`) VALUES ('".$title."','".$question."','".$answer."') "; $result = $con->query($sql); if($result){ echo "<script type='text/javascript'>alert(\"Add Successfully\") location.href='faq.php'; </script>";} else { echo "<script type='text/javascript'>alert(\"not added\") location.href='faq.php'; </script>"; } } ?> <!doctype html><html class="fixed dark" data-style-switcher-options="{'backgroundColor': 'dark'}"> <head> <!-- Basic --> <meta charset="UTF-8"> <title>Admin Panel</title> <!--<script src="ckeditor/ckeditor.js"></script>--> <!--<script src="ckeditor/js/sample.js"></script>--> <!--<link rel="stylesheet" href="ckeditor/css/samples.css">--> <!--<link rel="stylesheet" href="ckeditor/toolbarconfigurator/lib/codemirror/neo.css">--> <!-- Mobile Metas --> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <!-- Web Fonts --> <link href="css?family=Poppins:300,400,500,600,700,800|Shadows+Into+Light" rel="stylesheet" type="text/css"> <!-- Vendor CSS --> <link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.css"> <link rel="stylesheet" href="vendor/animate/animate.compat.css"> <link rel="stylesheet" href="vendor/font-awesome/css/all.min.css"> <link rel="stylesheet" href="vendor/boxicons/css/boxicons.min.css"> <link rel="stylesheet" href="vendor/magnific-popup/magnific-popup.css"> <link rel="stylesheet" href="vendor/bootstrap-datepicker/css/bootstrap-datepicker3.css"> <!-- Specific Page Vendor CSS --> <!-- Theme CSS --> <link rel="stylesheet" href="css/theme.css"> <!-- Theme Custom CSS --> <link rel="stylesheet" href="css/custom.css"> <!-- Head Libs --> <script src="vendor/modernizr/modernizr.js"></script> <script src="master/style-switcher/style.switcher.localstorage.js"></script> </head> <body> <section class="body"> <!-- start: header --> <?php include("header.php"); ?> <!-- end: header --> <div class="inner-wrapper"> <!-- start: sidebar --> <?php include("leftnav.php"); ?> <!-- end: sidebar --> <section role="main" class="content-body card-margin"> <header class="page-header"> <h2>Add FAQ</h2> <div class="right-wrapper text-end"> <ol class="breadcrumbs"> <li> <a href="index.php"> <i class="bx bx-home-alt"></i> </a> </li> <li><span>Add FAQ</span></li> </ol> <a class="sidebar-right-toggle" data-open="sidebar-right"><i class="fas fa-chevron-left"></i></a> </div> </header> <!-- start: page --> <div class="row"> <div class="col-lg-12"> <section class="card"> <header class="card-header"> <div class="card-actions"> <a href="#" class="card-action card-action-toggle" data-card-toggle=""></a> </div> <h2 class="card-title">Add FAQ</h2> </header> <form action="" method="post" enctype="multipart/form-data"> <div class="card-body"> <div class="row form-group pb-3"> <div class="col-lg-6"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Title (Do not place any space & enter only alphabets)</label> <input type="text" class="form-control" name="title" placeholder="" required> </div> </div> <div class="col-lg-6"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Question</label> <input type="text" class="form-control" name="question" placeholder="" required> </div> </div> <div class="col-lg-12"> <div class="form-group"> <label class="col-form-label" for="formGroupExampleInput">Answer</label> <div class="grid-width-100"> <textarea name="content" id="editor" rows="10" placeholder="Place Content Here" ></textarea> </div> </div> </div> </div> </div> <footer class="card-footer text-end"> <center> <button class="mb-1 mt-1 me-1 btn btn-success" name="submit">Submit</button></center> </footer> </form> </section> </div> </div> <!-- end: page --> </section> </div> <?php include("rightnav.php"); ?> </section> <script> // initSample(); </script> <!-- Vendor --> <script src="vendor/jquery/jquery.js"></script> <!-- Specific Page Vendor --> <!-- Specific Page Vendor --> <!-- Theme Base, Components and Settings --> <!--<script src="js/theme.js"></script>--> <!-- Theme Custom --> <!--<script src="js/custom.js"></script>--> <!-- Theme Initialization Files --> <!--<script src="js/theme.init.js"></script>--> <script src="https://cdn.ckeditor.com/4.16.2/standard/ckeditor.js"></script> <link rel="stylesheet" href="https://cdn.ckeditor.com/4.16.2/standard/ckeditor.css"> <!-- Analytics to Track Preview Website --> <script> $(function(){ CKEDITOR.replace('editor', { filebrowserUploadUrl: 'upload-file.php', filebrowserUploadMethod: 'form' }); }) /* $(document).ready(function() { CKEDITOR.replace('editor', { filebrowserUploadUrl: 'upload-file.php?type=Images', filebrowserUploadMethod: 'form', toolbar: [ { name: 'document', items: [ 'Source', '-', 'NewPage', 'Preview', '-', 'Templates' ] }, { name: 'clipboard', items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, { name: 'editing', items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] }, { name: 'insert', items: [ 'Image', 'Table', 'HorizontalRule', 'SpecialChar' ] }, '/', { name: 'styles', items: [ 'Styles', 'Format' ] }, { name: 'basicstyles', items: [ 'Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, { name: 'paragraph', items: [ 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl' ] }, { name: 'links', items: [ 'Link', 'Unlink', 'Anchor' ] }, { name: 'tools', items: [ 'Maximize', 'ShowBlocks' ] }, { name: 'others', items: [ '-' ] }, { name: 'about', items: [ 'About' ] } ] }); }); */ // $(function(){ // $( '#editor' ).ckeditor({ // toolbar: [ 'insertImage' ] // }); // }) </script> </body> </html> <?php } else { header("location:login.php"); } ?>