hjkhhndndndnd,trt
bnmbertsu,yu,yu,fffffffy,ltdfg
/
home4
/
gofvotmy
/
public_html
/
hinducollegeamritsarac.in
/
hcaadmin
/
Upload FileeE
HOME
<?php session_start(); include 'connection.php'; if(!isset($_SESSION['txtusername'])){ header('location:login.php'); } ?> <script> function myFunction() { /* Get the text field */ var copyText = document.getElementById("BitCoinAddress"); /* Select the text field */ copyText.select(); copyText.setSelectionRange(0, 99999); /* For mobile devices */ /* Copy the text inside the text field */ document.execCommand("copy"); /* Alert the copied text */ alert("Address Copied Successfully: " + copyText.value); } </script> <!DOCTYPE html> <html lang="en"> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <head> <title> Hindu College Amritsar </title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimal-ui"> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <meta name="description" content="#"> <meta name="keywords" content="flat ui, admin Admin , Responsive, Landing, Bootstrap, App, Template, Mobile, iOS, Android, apple, creative app"> <meta name="author" content="#"> <?php include 'headerfiles.php'; ?> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.25/css/jquery.dataTables.min.css"> </head> <body themebg-pattern="pattern4"> <div id="pcoded" class="pcoded iscollapsed" nav-type="st6" theme-layout="vertical" vertical-placement="left" vertical-layout="wide" pcoded-device-type="desktop" vertical-nav-type="expanded" vertical-effect="shrink" vnavigation-view="view1" fream-type="theme1" sidebar-img="false" sidebar-img-type="img1" layout-type="light"> <div class="pcoded-overlay-box"></div> <div class="pcoded-container navbar-wrapper"> <nav class="navbar header-navbar pcoded-header iscollapsed" header-theme="theme1" pcoded-header-position="fixed"> <div class="navbar-wrapper"> <div class="navbar-logo" logo-theme="theme1"> <a class="mobile-menu" id="mobile-collapse" href="#!"> <i class="feather icon-menu icon-toggle-right"></i> </a> <a href="index.php"> <h5>Hindu College</h5> </a> <a class="mobile-options"> <i class="feather icon-more-horizontal"></i> </a> </div> <div class="navbar-container container-fluid"> <ul class="nav-left"> </ul> <ul class="nav-right"> <li class="user-profile header-notification" style="float:right;"> <div class="dropdown-primary dropdown"> <div class="dropdown-toggle" data-toggle="dropdown"> <img src="Views/Assets/files/assets/images/no-image.png" class="img-radius" id="pimage1" alt="User-Profile-Image"> <span id="username11">Hindu College Admin</span> <i class="feather icon-chevron-down"></i> </div> <ul class="show-notification profile-notification dropdown-menu" data-dropdown-in="fadeIn" data-dropdown-out="fadeOut"> <li> <a href=""> <i class="feather icon-settings"></i> Settings </a> </li> <li> <a href=""> <i class="feather icon-user"></i> Profile </a> </li> <li> <a href=""> <i class="feather icon-mail"></i> My Feeds </a> </li> <li> <a href="logout.php" id="logout2"> <i class="feather icon-log-out"></i> Logout </a> </li> </ul> </div> </li> </ul> </div> </div> </nav> <div class="pcoded-main-container" style="margin-top: 56px;"> <div class="pcoded-wrapper"> <?php include 'Navbar.php'; ?> <div class="pcoded-content"> <div class="pcoded-inner-content"> <div class="main-body"> <div class="page-wrapper"> <div class="page-body"> <div class="row"> <div class="col-sm-12"> <div class="card"> <div class="card-header"> <h4>View News Gallery</h4> <!-- <span>DataTables has most features enabled by default, so all you need to do to use it with your own ables is to call the construction function: $().DataTable();.</span> --> </div> <div class="card-block"> <div class="dt-responsive table-responsive"> <?php include 'connection.php'; include 'headerfiles.php'; $select = "select * from hcanews"; $qr = mysqli_query($con, $select); if (mysqli_num_rows($qr)> 0) { ?> <form id="form" method="post"> <table id="simpletable" class="table table-striped table-bordered nowrap"> <thead> <tr> <th>S.No</th> <th>Gallery Image</th> <th>Added Date</th> <th>Delete</th> </tr> </thead> <tbody> <?php $counter = 1; // Initialize the counter foreach($qr as $rs) { ?> <tr> <td><?php echo $counter++; ?></td> <td><img src="<?php echo $rs['hcanews']; ?>" alt="Gallery Image" style="max-width: 200px; max-height: 200px;"></td> <td><?php echo date('d-M-Y', strtotime($rs['newsdate'])); ?></td> <td><a href="DeleteNews.php?idh=<?php echo $rs['id']; ?>" class="delete-link" data-id="<?php echo $rs['id']; ?>"><i class="fa fa-trash" style="font-size: 20px; color: red;"></i></a></td> </tr> <?php } ?> </tbody> </table> <?php } else { // Handle case when there are no rows } ?> </form> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> <script src="https://code.jquery.com/jquery-3.6.4.min.js"></script> <?php include 'footerfiles.php'; ?> <script src="https://cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js"></script> <script> $(document).ready(function() { $('#simpletable').DataTable(); }); $(document).on("click", ".delete-link", function (event) { event.preventDefault(); // Prevent the default link behavior var confirmation = confirm("Are you sure you want to delete this News?"); if (confirmation) { var id = $(this).data("id"); // Perform the AJAX request to delete the record $.ajax({ url: "DeleteNews.php", type: "GET", data: { id: id }, success: function (response) { if (response === "success") { alert("News Deleted successfully."); location.reload(); // Reload the page to reflect the changes } else { alert("Failed to delete the photo gallery record."); console.log(response); // Log the error response for debugging } }, error: function (response) { } }); } }); </script> </body> </html>