<?php
session_start();
if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== true) {
    header('Location: index.php');
    exit;
}
require 'dbconn.php';

// Fetch all videos
$query = "SELECT id, name FROM joint_secretory ORDER BY id DESC";
$result = $mysqli->query($query);
?>

<!DOCTYPE html>
<html lang="en">
  <head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <title>MKDS-ADMIN</title>
    <!-- plugins:css -->
    <link rel="stylesheet" href="assets/vendors/feather/feather.css">
    <link rel="stylesheet" href="assets/vendors/ti-icons/css/themify-icons.css">
    <link rel="stylesheet" href="assets/vendors/css/vendor.bundle.base.css">
    <link rel="stylesheet" href="assets/vendors/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="assets/vendors/mdi/css/materialdesignicons.min.css">
    <!-- endinject -->
    <!-- Plugin css for this page -->
    <!-- <link rel="stylesheet" href="assets/vendors/datatables.net-bs4/dataTables.bootstrap4.css"> -->
    <link rel="stylesheet" href="assets/vendors/datatables.net-bs5/dataTables.bootstrap5.css">
    <link rel="stylesheet" href="assets/vendors/ti-icons/css/themify-icons.css">
    <link rel="stylesheet" type="text/css" href="assets/js/select.dataTables.min.css">
    <!-- End plugin css for this page -->
    <!-- inject:css -->
    <link rel="stylesheet" href="assets/css/style.css">
    <!-- endinject -->
    <link rel="shortcut icon" href="assets/images/favicon.png" />
    <style>
        .main-panel{
            width:100%;
        }
    </style>
  </head>
  <body>
    <div class="container-scroller">
      
      <!-- partial:partials/_navbar.html -->
      <nav class="navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row">
  <div class="text-center navbar-brand-wrapper d-flex align-items-center justify-content-start">
  <a class="navbar-brand brand-logo me-5" href="index.html" style="font-size: 50px; color: light-blue; font-weight: bold;">
  MKDS
</a>

  <a class="navbar-brand brand-logo-mini" href="index.html">
    <img src="assets/images/mkds.png" alt="logo" style="height: 50px; width: 50px;" />
  </a>
</div>
  <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">
    <button class="navbar-toggler navbar-toggler align-self-center" type="button" data-toggle="minimize">
      <span class="icon-menu"></span>
    </button>
    <ul class="navbar-nav mr-lg-2">
      <li class="nav-item nav-search d-none d-lg-block">
        <div class="input-group">
          <div class="input-group-prepend hover-cursor" id="navbar-search-icon">
            <span class="input-group-text" id="search">
              <i class="icon-search"></i>
            </span>
          </div>
          <input type="text" class="form-control" id="navbar-search-input" placeholder="Search now" aria-label="search" aria-describedby="search">
        </div>
      </li>
    </ul>
    <ul class="navbar-nav navbar-nav-right">
  <li class="nav-item nav-profile dropdown">
    <a class="nav-link dropdown-toggle d-flex align-items-center" href="#" data-bs-toggle="dropdown" id="profileDropdown">
      <i class="ti-menu" style="font-size: 20px;"></i>
    </a>
    <div class="dropdown-menu dropdown-menu-right navbar-dropdown" aria-labelledby="profileDropdown">
      <a class="dropdown-item" href="change_password.php">
        <i class="ti-unlock text-warning"></i> Change Password
      </a>
      <a class="dropdown-item" href="logout.php">
        <i class="ti-power-off text-primary"></i> Logout
      </a>
    </div>
  </li>
</ul>


    <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
      <span class="icon-menu"></span>
    </button>
  </div>
</nav>
      <!-- partial -->
      <div class="container-fluid page-body-wrapper">
        <!-- partial:partials/_sidebar.html -->
 <nav class="sidebar sidebar-offcanvas" id="sidebar">
  <ul class="nav">
    
    <!-- Dashboard -->
    <li class="nav-item">
      <a class="nav-link " href="dashboard.php">
        <i class="icon-grid menu-icon "></i>
        <span class="menu-title">Dashboard</span>
      </a>
    </li>

    <!-- Registered Members -->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#membersMenu" role="button" aria-expanded="false" aria-controls="membersMenu">
        <i class="icon-grid menu-icon"></i>
        <span class="menu-title">Reg. Members</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="membersMenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_members.php">Manage Members</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_members.php">Add Members</a>
          </li>
        </ul>
      </div>
    </li>

<!-- Photo Gallary -->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#photomenu" role="button" aria-expanded="false" aria-controls="photomenu">
        <i class="icon-grid menu-icon"></i>
        <span class="menu-title">Photo Gallary</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="photomenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_project_catagory.php">Manage Catagory</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_project.php">Add Catagory</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_pictures.php">Manage Picture <br > Gallary</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_image_form.php">Add Picture</a>
          </li>
        </ul>
      </div>
    </li>

    <!-- Video Gallary -->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#videomenu" role="button" aria-expanded="false" aria-controls="videomenu">
        <i class="icon-grid menu-icon"></i>
        <span class="menu-title">Video Gallary</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="videomenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_videos.php">Manage Video</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_video.php">Add Video</a>
          </li>
        </ul>
      </div>
    </li>

    <!-- News-->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#newsmenu" role="button" aria-expanded="false" aria-controls="newsmenu">
        <i class="icon-grid menu-icon"></i>
        <span class="menu-title">News</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="newsmenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_news.php">Manage News</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_news.php">Add News</a>
          </li>
        </ul>
      </div>
    </li>

    <!-- Event -->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#eventmenu" role="button" aria-expanded="false" aria-controls="eventmenu">
        <i class="icon-grid menu-icon"></i>
        <span class="menu-title">Events</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="eventmenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_events.php">Manage Events</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_events.php">Add Events</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_event_pictures.php">Manage Events <br> Photos</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_events_picture.php">Add Events <br> Photos</a>
          </li>
        </ul>
      </div>
    </li>

    <!-- Circular -->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#circularmenu" role="button" aria-expanded="false" aria-controls="circularmenu">
        <i class="icon-grid menu-icon"></i>
        <span class="menu-title">Circular</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="circularmenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_circulars.php">Manage Circular</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_circular.php">Add Circular</a>
          </li>
        </ul>
      </div>
    </li>

    <!-- Photo Gallary -->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#birthdaymenu" role="button" aria-expanded="false" aria-controls="birthdaymenu">
        <i class="icon-grid menu-icon"></i>
        <span class="menu-title">Birthday</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="birthdaymenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_birthday.php">Manage Birthday</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_birthday.php">Add Birthday</a>
          </li>
        </ul>
      </div>
    </li>

    <!-- Photo Gallary -->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#homemenu" role="button" aria-expanded="false" aria-controls="homemenu">
        <i class="icon-grid menu-icon"></i>
        <span class="menu-title">HomePage</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="homemenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_pmsg.php">Manage President <br> Message</a>
          </li>
          
        </ul>
      </div>
    </li>

   <!-- Committee -->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#committeeMenu" role="button" aria-expanded="false" aria-controls="committeeMenu">
        <i class="icon-grid menu-icon "></i>
        <span class="menu-title">Committee</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="committeeMenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_president.php">President Details</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_president.php">Add President</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_vice_president.php">Vice President <br>Details</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_vice_president.php">Add Vice President</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_secretory.php">Secretary Details</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_secretory.php">Add Secretary</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_joint_secretory.php">Joint Secretary <br> Details</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_joint_secretory.php">Add Joint Secretary</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_treasurer.php">Treasurer Details</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_treasurer.php">Add Treasurer</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_c_member.php">Members Details</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_commitee_members.php">Add Members</a>
          </li>
        </ul>
      </div>
    </li>

    <!-- Photo Gallary -->
    <li class="nav-item">
      <a class="nav-link " data-bs-toggle="collapse" href="#blogsmenu" role="button" aria-expanded="false" aria-controls="blogsmenu">
        <i class="icon-grid menu-icon"></i>
        <span class="menu-title">Blogs</span>
        <i class="menu-arrow "></i>
      </a>
      <div class="collapse" id="blogsmenu">
        <ul class="nav flex-column sub-menu">
          <li class="nav-item">
            <a class="nav-link text-white" href="manage_blog.php">Manage Blogs</a>
          </li>
          <li class="nav-item">
            <a class="nav-link text-white" href="add_blog.php">Add Blogs</a>
          </li>
        </ul>
      </div>
    </li>

    <!-- Dashboard -->
    <li class="nav-item">
      <a class="nav-link " href="add_aboutus.php">
        <i class="icon-grid menu-icon "></i>
        <span class="menu-title">About Us</span>
      </a>
    </li>

  </ul>
</nav>

        <!-- partial -->
        <div class="main-panel">
          <div class="content-wrapper">
            
   <div class="container">
  <div class="card shadow-sm">
    <div class="card-header bg-primary text-white">
      <strong>Joint Secretory Details</strong>
    </div>
    <div class="card-body p-0">
      <table class="table table-bordered table-striped m-0">
        <thead class="table-light">
          <tr>
            <th>ID</th>
            <th>Joint Secretory Name</th>
            <th>Action</th>
          </tr>
        </thead>
        <tbody>
          <?php if ($result->num_rows > 0): ?>
            <?php $i = 1; while ($row = $result->fetch_assoc()): ?>
              <tr>
                <td><?php echo $i++; ?></td>
                 <td> <a href="joint_secretory_details.php?id=<?php echo $row['id']; ?>"><?php echo htmlspecialchars($row['name']); ?></a></td>
                <td>
                  <a href="edit_joint_secretory.php?id=<?php echo $row['id']; ?>" class="btn btn-sm btn-success">Edit</a>
              <a href="delete_joint_secretory.php?id=<?php echo $row['id']; ?>" 
                 class="btn btn-sm btn-danger" 
                 onclick="return confirm('Are you sure you want to delete joint secretory?');">
                Delete
              </a>
                </td>
              </tr>
            <?php endwhile; ?>
          <?php else: ?>
            <tr><td colspan="3" class="text-center text-muted">No joint Secretory found.</td></tr>
          <?php endif; ?>
        </tbody>
      </table>
    </div>
  </div>
</div>
            
            
          <!-- content-wrapper ends -->
          <!-- partial:partials/_footer.html -->
          <footer class="footer">
  <div class="d-sm-flex justify-content-center justify-content-sm-between">
    <span class="text-muted text-center text-sm-left d-block d-sm-inline-block">© Copyright © 2016 mkdsvadodara.org All rights reserved.</span>
    <span class="float-none float-sm-right d-block mt-1 mt-sm-0 text-center">Designed By : Pooja Infotech</span>
  </div>
</footer>
          <!-- partial -->
        </div>
        <!-- main-panel ends -->
      </div>
      <!-- page-body-wrapper ends -->
    </div>
    <!-- container-scroller -->
    <!-- plugins:js -->
    <script src="assets/vendors/js/vendor.bundle.base.js"></script>
    <!-- endinject -->
    <!-- Plugin js for this page -->
    <script src="assets/vendors/chart.js/chart.umd.js"></script>
    <script src="assets/vendors/datatables.net/jquery.dataTables.js"></script>
    <!-- <script src="assets/vendors/datatables.net-bs4/dataTables.bootstrap4.js"></script> -->
    <script src="assets/vendors/datatables.net-bs5/dataTables.bootstrap5.js"></script>
    <script src="assets/js/dataTables.select.min.js"></script>
    <!-- End plugin js for this page -->
    <!-- inject:js -->
    <script src="assets/js/off-canvas.js"></script>
    <script src="assets/js/template.js"></script>
    <script src="assets/js/settings.js"></script>
    <script src="assets/js/todolist.js"></script>
    <!-- endinject -->
    <!-- Custom js for this page-->
    <script src="assets/js/jquery.cookie.js" type="text/javascript"></script>
    <script src="assets/js/dashboard.js"></script>
    <!-- <script src="assets/js/Chart.roundedBarCharts.js"></script> -->
    <!-- End custom js for this page-->
  </body>
</html>