File "employees.php"

Full path: /home/eshuaesb/public_html/www.mhawaterpark.com/admin/employees.php
File size: 0 KB (3.96 KB bytes)
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Editor   Back

<?php include("auth.php") ?>
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0" name="viewport">

  <title>Employee List</title>
  <meta content="" name="description">
  <meta content="" name="keywords">
  <?php include("templates/inc.php"); ?>
  <script src="scripts/create-user.js" type="text/javascript" language="javascript"></script>

</head>

<body>

  <!-- ======= Header ======= -->
  <?php
  include("templates/header.php");
  ?>

  <!-- End Header -->

  <!-- ======= Sidebar ======= -->
  <?php
  include("templates/sidebar.php");

  ?>
  <!-- End Sidebar-->

  <main id="main" class="main">

    <div class="pagetitle">
      <h1>Employee List</h1>
      <nav>
        <ol class="breadcrumb">
          <li class="breadcrumb-item"><a href="dashboard.php">Dashboard</a></li>
          <li class="breadcrumb-item">Employee List</li>

        </ol>
      </nav>
      <hr>
    </div><!-- End Page Title -->

    <section class="section">
      <a href="create-user.php">
        <button type="button" class="btn btn-primary"><i class="bi bi-plus me-1"></i>Add New</button>
      </a></br></br>

      <section class="section">
        <div class="row">
          <div class="col-lg-12">

            <div class="card">
              <div class="card-body table-responsive" id="records">
                <h5 class="card-title">Employee List</h5>
                <!-- Table with stripped rows -->
                <table class="table datatable table-striped">
                  <thead>
                    <tr>
                      <th scope="col">Sl</th>
                      <!--<th scope="col">Role</th>-->
                      <th scope="col">Name</th>
                      <th scope="col">Mobile</th>
                      <th scope="col">Address</th>
                      <th scope="col">Aadhar</th>
                      <th scope="col">Action</th>

                    </tr>
                  </thead>

                  <tbody>
                    <?php
                    require "conn.php";

                    $sl = 1;
                    $sql = "select * from tbl_employee where deleted_at is NULL order by id desc";

                    $rs = mysqli_query($conn, $sql);
                    while ($row = mysqli_fetch_assoc($rs)) {
                      echo "<tr>";
                      echo '<td>' . $sl . '</td>';
                      echo '<td>' . $row['emp_name'] . '</td>';
                      echo '<td>' . $row['emp_mobile'] . '</td>';
                      echo '<td>' . $row['emp_address'] . '</td>';
                      echo '<td>' . $row['emp_aadhar'] . '</td>';
                      echo '<td>
                      <a href="create-user.php?action='.base64_encode("Edit").'&id=' . base64_encode($row['id']) .'" ><button id=' . $row['id'] . ' class="btn btn-primary"><i class="bi bi-pen"></i></button></a>
                      <button id=' . $row['id'] . ' class="btn btn-danger DELETE"><i class="bi bi-trash"></i></button></td>';
                      echo "</tr>";
                      $sl++;
                    }
                    ?>

                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </div>

      </section>

  </main><!-- End #main -->

  <!-- ======= Footer ======= -->
  <?php
  include("templates/footer.php");
  ?>
  <!-- End Footer -->


  <?php include("templates/vendors.php"); ?>


  <!-- <script>
document.querySelectorAll('.delete').forEach(button => button.addEventListener('click', () => {
    if(confirm("Are you sure you want to delete this item?")) {
        console.log("Deleting item with ID: " + button.id);
        // Perform deletion action here
    } else {
        console.log("Deletion canceled.");
        return; // Exit the function, preventing further execution
    }
}));
</script> -->

</body>

</html>