Файловый менеджер - Редактировать - /home/umudio/public_html/create-reflections.php
Назад
<?php session_start(); if (isset($_POST["username"]) && isset($_POST["password"])) { $manager = $_POST["username"]; $password = $_POST["password"]; include("includes/config.php"); $cmem = "SELECT id FROM auth WHERE username='$manager' AND password='$password' LIMIT 1"; $run_cmem = mysqli_query($con, $cmem); $count_mem = mysqli_num_rows($run_cmem); if ($count_mem == 1) { while ($row = mysqli_fetch_array($run_cmem)) { $id = $row["id"]; } $_SESSION["id"] = $id; $_SESSION["manager"] = $manager; $_SESSION["password"] = $password; header("location: mod-auth"); exit(); } else { echo "<script>alert('Incorrect Password !!!')</script>"; echo "<script>window.open('./','_self')</script>"; exit(); } } ?> <?php session_start(); if (!isset($_SESSION["manager"])) { header("location: ./"); exit(); } ?> <?php include("includes/config.php"); ?> <!doctype html> <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang=""> <![endif]--> <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang=""> <![endif]--> <!--[if IE 8]> <html class="no-js lt-ie9" lang=""> <![endif]--> <!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> <?php include("includes/pages-header.php"); ?> <div class="header-height"></div> <div class="pager-header"> <div class="container"> <div class="page-content"> <h2>Homilies/Reflections</h2> <p>One thing I ask of the Lord. This I long to dwell in the house of the Lord, <br> all the days of my life.</p> <ol class="breadcrumb"> <li class="breadcrumb-item"><a href="./">Home</a></li> <li class="breadcrumb-item active">Homilies/Reflections</li> </ol> </div> </div> </div><!-- /Page Header --> <!-- /Page Header --> <div class="" style="background-color: #F2F2F2;padding: 47px;"> <div class="row"> <div class="col-lg-9"> <?php if ($_SESSION["id"] == 1) { echo "<p><a href='mod-auth'>Go back to Admin Dashboard</a></p>"; } else if ($_SESSION["id"] == 2) { echo "<p><a href='ref-auth'>Go back to Moderator Dashboard</a></p>"; } ?> <?php include("includes/config.php"); if (isset($_GET['id'])) { $id = $_GET['id']; $delete = "delete from homilies where id='$id'"; $run = mysqli_query($con, $delete); if ($delete) { echo "<div class='alert alert-danger'> Homilies/Reflection deleted successfully! </div>"; } } ?> <?php if (isset($_POST['addreflection'])) { $title = str_replace("'", "''", $_POST['title']); $author = str_replace("'", "''", $_POST['author']); $content = str_replace("'", "''", $_POST['content']); $date = str_replace("'", "''", $_POST['date']); $filename = $_FILES['image']['name']; $filepath = 'repo/' . $filename; move_uploaded_file($_FILES['image']['tmp_name'], $filepath); include("includes/config.php"); global $con; $feedback = "INSERT INTO homilies (date, author, title, content, image) values ('$date','$author','$title','$content','$filepath')"; $run = mysqli_query($con, $feedback); if ($feedback) { echo "<div class='alert alert-success'> Homillies/Reflections added successfully! </div>"; } else { echo "<div class='alert alert-danger'> An error occured, please try again! </div>"; } } ?> <p class="headingbigger"><b>Add Homillies/Reflections</b></p> <form id="form1" name="form1" method="post" action="" enctype="multipart/form-data"> <table width="100%" cellpadding="1" cellspacing="2"> <tr valign="top"> <td style="font-weight:bold; text-align:center">Title</td> <td align="left"><input name="title" type="text" size="70" /><br><br></td> </tr> <tr valign="top"> <td style="font-weight:bold; text-align:center">Author</td> <td align="left"><input name="author" type="text" size="70" /><br><br></td> </tr> <tr valign="top"> <td style="font-weight:bold; text-align:center">Reflection Thumbnail (Image)</td> <td align="left"><input name="image" accept="image/*" type="file" required /><br><br></td> </tr> <tr valign="top"> <td style="font-weight:bold; text-align:center">Writeup</td> <td align="left"><textarea name="content" cols="69" rows="20"></textarea><br></td> </tr> <tr valign="top"> <td style="font-weight:bold; text-align:center">Date</td> <td align="left"><input name="date" type="text" size="70" value="<?php echo (date('Y-m-d')); ?>" id="Dater_op" readonly="readonly" /> <button id="trigger" tabindex="9"><i class="ti-calendar"></i></button> <script type="text/javascript"> Calendar.setup({ inputField: "Dater_op", // ID of the input field ifFormat: "%Y-%m-%d", // the date format button: "trigger" // ID of the button }); </script> </td> </tr> <tr valign="top"> <td colspan="2"><br> <input style="margin-left: 60px;" name="addreflection" type="submit" style="font-size:12px;" class="default-btn-two" id="addnews" value=" Create Reflection " /> </td> </tr> </table> </form> <hr /> <p class="headingbigger"><b>Existing Homilies/Reflections</b></p> <?php include_once 'includes/config.php'; $query = mysqli_query($con, "SELECT * FROM homilies ORDER BY id DESC"); while ($row = mysqli_fetch_array($query)) { ?> <div class="row"> <div class="col-lg-6"><?php echo $row['title']; ?></div> <div class="col-lg-3"><a href="edit-reflections?id=<?php echo $row['id']; ?>">Edit</a></div> <div class="col-lg-3"><a style="color: red;" href="create-reflections?id=<?php echo $row['id']; ?>">Delete</a></div> </div> <?php } ?> </div> <?php include("includes/sidecontent.php") ?> </div> </div> <?php include("includes/footer.php"); ?> <a data-scroll href="#header" id="scroll-to-top"><i class="arrow_up"></i></a> <!-- jQuery Lib --> <script src="js/vendor/jquery-1.12.4.min.js"></script> <!-- Bootstrap JS --> <script src="js/vendor/bootstrap.min.js"></script> <!-- Tether JS --> <script src="js/vendor/tether.min.js"></script> <!-- Imagesloaded JS --> <script src="js/vendor/imagesloaded.pkgd.min.js"></script> <!-- OWL-Carousel JS --> <script src="js/vendor/owl.carousel.min.js"></script> <!-- isotope JS --> <script src="js/vendor/jquery.isotope.v3.0.2.js"></script> <!-- Smooth Scroll JS --> <script src="js/vendor/smooth-scroll.min.js"></script> <!-- venobox JS --> <script src="js/vendor/venobox.min.js"></script> <!-- ajaxchimp JS --> <script src="js/vendor/jquery.ajaxchimp.min.js"></script> <!-- Counterup JS --> <script src="js/vendor/jquery.counterup.min.js"></script> <!-- waypoints js --> <script src="js/vendor/jquery.waypoints.v2.0.3.min.js"></script> <!-- Slick Nav JS --> <script src="js/vendor/jquery.slicknav.min.js"></script> <!-- Nivo Slider JS --> <script src="js/vendor/jquery.nivo.slider.pack.js"></script> <!-- Letter Animation JS --> <script src="js/vendor/letteranimation.min.js"></script> <!-- Wow JS --> <script src="js/vendor/wow.min.js"></script> <!-- Contact JS --> <script src="js/contact.js"></script> <!-- Main JS --> <script src="js/main.js"></script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 5.6.40 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка