Файловый менеджер - Редактировать - /home/umudio/public_html/addinst.php
Назад
<?php session_start(); if (!isset($_SESSION["manager"])) { header("location: ./"); exit(); } ?> <?php include("includes/config.php"); ?> <?php if (isset($_GET['deltab'])) { unset($temp); if (isset($_GET['deltab'])) { $_GET['deltab'] = trim($_GET['deltab']); if (preg_match('/^[0-9]/u', $_GET['deltab'])) { settype($_GET['deltab'], 'int'); $temp = (int)$_GET['deltab']; } } if (!isset($temp)) { echo "Sorry! Wrong Data!"; exit(); } $deltab = $temp; $result = mysqli_query($con, "DELETE from institutions where sn = $deltab"); } $query_dio1 = mysqli_query($con, "SELECT * FROM institutions where status='Secondary School' order by nameadd"); $row_dio1 = mysqli_fetch_assoc($query_dio1); $totalRows_dio1 = mysqli_num_rows($query_dio1); $query_dio2 = mysqli_query($con, "SELECT * FROM institutions where status='Primary/Nursery School' order by nameadd"); $row_dio2 = mysqli_fetch_assoc($query_dio2); $totalRows_dio2 = mysqli_num_rows($query_dio2); $query_dio3 = mysqli_query($con, "SELECT * FROM institutions where status='Health Institution' order by nameadd"); $row_dio3 = mysqli_fetch_assoc($query_dio3); $totalRows_dio3 = mysqli_num_rows($query_dio3); $query_dio4 = mysqli_query($con, "SELECT * FROM institutions where status='Pastoral/Vocational/Social Institution' order by nameadd"); $row_dio4 = mysqli_fetch_assoc($query_dio4); $totalRows_dio4 = mysqli_num_rows($query_dio4); $query_dio5 = mysqli_query($con, "SELECT * FROM institutions where status='Ecclesiastical Establishment' order by nameadd"); $row_dio5 = mysqli_fetch_assoc($query_dio5); $totalRows_dio5 = mysqli_num_rows($query_dio5); $query_dio6 = mysqli_query($con, "SELECT * FROM institutions where status='Media House' order by nameadd"); $row_dio6 = mysqli_fetch_assoc($query_dio6); $totalRows_dio6 = mysqli_num_rows($query_dio6); $query_dio7 = mysqli_query($con, "SELECT * FROM institutions where status='Book Centre' order by nameadd"); $row_dio7 = mysqli_fetch_assoc($query_dio7); $totalRows_dio7 = mysqli_num_rows($query_dio7); $query_dio8 = mysqli_query($con, "SELECT * FROM institutions where status='Chaplaincy' order by nameadd"); $row_dio8 = mysqli_fetch_assoc($query_dio8); $totalRows_dio8 = mysqli_num_rows($query_dio8); $query_dio9 = mysqli_query($con, "SELECT * FROM institutions where status='Tertiary Institution' order by nameadd"); $row_dio9 = mysqli_fetch_assoc($query_dio9); $totalRows_dio9 = mysqli_num_rows($query_dio9); $query_dio10 = mysqli_query($con, "SELECT * FROM institutions where status='Seminary/Formation House' order by nameadd"); $row_dio10 = mysqli_fetch_assoc($query_dio10); $totalRows_dio10 = mysqli_num_rows($query_dio10); $query_dio11 = mysqli_query($con, "SELECT * FROM institutions where status='Other Establishment' order by nameadd"); $row_dio11 = mysqli_fetch_assoc($query_dio11); $totalRows_dio11 = mysqli_num_rows($query_dio11); ?> <!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>Add Institutions</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">Add Institutions</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 include("includes/config.php"); if (isset($_GET['sn'])) { $sn = $_GET['sn']; $delete = "delete from institutions where sn='$sn'"; $run = mysqli_query($con, $delete); if ($delete) { echo "<div class='alert alert-danger'> Institution deleted successfully! </div>"; } } ?> <p><a href="mod-auth">Go back to Admin Dashboard</a></p> <?php if (isset($_POST['addinst'])) { $nameadd = str_replace("'", "''", $_POST['nameadd']); $details = str_replace("'", "''", $_POST['details']); $status = str_replace("'", "''", $_POST['status']); include("includes/config.php"); $feedback = "INSERT INTO institutions (nameadd, details,status) VALUES ('$nameadd','$details','$status')"; $run = mysqli_query($con, $feedback); if ($feedback) { echo "<div class='alert alert-success'> Institution Added Successfully! </div>"; } else { echo "<div class='alert alert-danger'> An error occured, please try again! </div>"; } } ?> <h2>Add Institutions</h2><br> <form id="form1" name="form1" method="post" action=""> <table width="100%" cellpadding="1" cellspacing="2"> <?php for ($i = 1; $i <= 1; $i++) { ?> <tr valign="top"> <td style="text-align:left"><span style="font-weight:bold; color:#009900; font-size:30px;"><?php echo ($i); ?></span></td> <td><b>Name/Address:</b><br /><textarea name="nameadd" cols="60" rows="10"></textarea></td> </tr> <tr valign="top"> <td><b>Status:</b></td> <td><select name="status"> <option value="Secondary School" selected="selected">Secondary School</option> <option value="Primary/Nursery School">Primary/Nursery School</option> <option value="Tertiary Institution">Tertiary Institution</option> <option value="Health Institution">Health Institution</option> <option value="Pastoral/Vocational/Social Institution">Pastoral/Vocational/Social Institution</option> <option value="Ecclesiastical Establishment">Ecclesiastical Establishment</option> <option value="Other Establishment">Other Establishment</option> <option value="Seminary/Formation House">Seminary/Formation House</option> <option value="Media House">Media House</option> <option value="Book Centre">Book Centre</option> <option value="Chaplaincy">Chaplaincy</option> </select></td> </tr> <tr valign="top"> <td> </td> <td><b>Other Details:</b><br /><textarea name="details" cols="60" rows="10"></textarea></td> </tr> <tr> <td colspan="2"> <hr /> </td> </tr> <?php } ?> <tr valign="top"> <td colspan="2"><br> <input style="margin-left: 60px;" name="addinst" type="submit" style="font-size:12px;" class="default-btn-two" id="addnews" value=" Add Institution " /> </td> </tr> </table> </form> <hr /> <p style="color:#990000"><b>Existing Secondary Schools</b></p> <?php if ($totalRows_dio1 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio1['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinst?sn=<?php echo $row_dio1['sn']; ?>">Edit</a> | <a href="addinst?sn=<?php echo $row_dio1['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio1 = mysqli_fetch_assoc($query_dio1)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Primary/Nursery Schools</b></p> <?php if ($totalRows_dio2 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio2['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio2['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio2['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio2 = mysqli_fetch_assoc($query_dio2)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Tertiary Institution</b></p> <?php if ($totalRows_dio9 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio9['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio9['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio9['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio9 = mysqli_fetch_assoc($query_dio9)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Health Institutions</b></p> <?php if ($totalRows_dio3 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio3['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio3['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio3['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio3 = mysqli_fetch_assoc($query_dio3)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Pastoral/Vocational/Social Institutions</b></p> <?php if ($totalRows_dio4 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio4['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio4['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio4['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio4 = mysqli_fetch_assoc($query_dio4)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Ecclesiastical Establishment</b></p> <?php if ($totalRows_dio5 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio5['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio5['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio5['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio5 = mysqli_fetch_assoc($query_dio5)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Media Houses</b></p> <?php if ($totalRows_dio6 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio6['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio6['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio6['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio6 = mysqli_fetch_assoc($query_dio6)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Book Centres</b></p> <?php if ($totalRows_dio7 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio7['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio7['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio7['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio7 = mysqli_fetch_assoc($query_dio7)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Chaplaincies</b></p> <?php if ($totalRows_dio8 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio8['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio8['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio8['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio8 = mysqli_fetch_assoc($query_dio8)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Other Establishments</b></p> <?php if ($totalRows_dio11 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio11['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio11['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio11['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio11 = mysqli_fetch_assoc($query_dio11)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> <hr /> <p style="color:#990000"><b>Existing Seminaries/Formation Houses</b></p> <?php if ($totalRows_dio10 > 0) { ?> <div class="post"> <table width="90%"> <?php do { ?><tr valign="top"> <td style="border-bottom:1px solid #333333;"><?php echo substr(strip_tags($row_dio10['nameadd']), 0, 40); ?></td> <td style="border-bottom:1px solid #333333;"><a href="editinstitution?tab=<?php echo $row_dio10['sn']; ?>">Edit</a> | <a href="listinstituions?deltab=<?php echo $row_dio10['sn']; ?>">Delete</a> </td> </tr> <?php } while ($row_dio10 = mysqli_fetch_assoc($query_dio10)); ?> </table> </div> <div class="post-bot"></div> <?php } else { echo ("None Found!"); } ?> </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
|
Настройка