MMCT TEAM
Server IP : 2a02:4780:3:1493:0:3736:a38e:7  /  Your IP : 216.73.216.60
Web Server : LiteSpeed
System : Linux sg-nme-web1393.main-hosting.eu 4.18.0-553.84.1.lve.el8.x86_64 #1 SMP Tue Nov 25 18:33:03 UTC 2025 x86_64
User : u926327694 ( 926327694)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : ON
Directory (0755) :  /home/u926327694/domains/smsoft.in/public_html/demo/../alumini/adminweb/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u926327694/domains/smsoft.in/public_html/demo/../alumini/adminweb/login_log_details.php
<?php  
$page_title = 'Login Log List';
include 'header.php';
?>
<div class="content-wrapper">
  <section class="content mt-4">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-12">
          <?php include('alert-msg.php'); ?>
          <div class="card card-primary">
            <div class="card-header">
              <h3 class="card-title"><?php echo $page_title; ?></h3>
            </div>

            <!-- 🔍 Filter Form -->
            <div class="card-body">
              <form method="get" class="row mb-3">
                <?php
                  // Default values
                  $today = date('Y-m-d');
                  $start_date = isset($_GET['start_date']) ? $_GET['start_date'] : $today;
                  $end_date = isset($_GET['end_date']) ? $_GET['end_date'] : $today;
                ?>
                <div class="col-md-3">
                  <label>Start Date</label>
                  <input type="date" name="start_date" class="form-control" value="<?php echo $start_date; ?>">
                </div>
                <div class="col-md-3">
                  <label>End Date</label>
                  <input type="date" name="end_date" class="form-control" value="<?php echo $end_date; ?>">
                </div>
                <div class="col-md-3 align-self-end">
                  <button type="submit" class="btn btn-primary"><i class="fas fa-search"></i> Filter</button>
                  <a href="login_log_details.php" class="btn btn-secondary"><i class="fas fa-sync"></i> Reset</a>
                </div>
              </form>
            </div>

            <!-- 📋 Log Table -->
            <div class="card-body">
              <table class="table table-bordered table-striped main_datatables">
                <thead>
                  <tr>
                    <th>Sr. No.</th>
                    <th>Student Name</th>
                    <th>Roll Number</th>
                    <th>Login Date & Time</th>
                    <th>IP Address</th>
                    <th>Device Info</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  // Build query condition
                  $where = "WHERE DATE(l.login_datetime) BETWEEN '$start_date' AND '$end_date'";

                  $sel_logs = mysqli_query($con,"
                    SELECT l.*, a.name 
                    FROM alumni_login_logs l 
                    LEFT JOIN alumini a ON a.id = l.alumni_id 
                    $where
                    ORDER BY l.id DESC
                  ");

                  $i = 1;
                  while($row_log = mysqli_fetch_array($sel_logs)){
                    ?>
                    <tr>
                      <td><?php echo $i; ?></td>
                      <td><?php echo htmlspecialchars($row_log['name']); ?></td>
                      <td><?php echo htmlspecialchars($row_log['roll_number']); ?></td>
                      <td><?php echo date('d-m-Y h:i A', strtotime($row_log['login_datetime'])); ?></td>
                      <td><?php echo htmlspecialchars($row_log['ip_address']); ?></td>
                      <td style="max-width:300px;"><?php echo htmlspecialchars($row_log['user_agent']); ?></td>
                    </tr>
                    <?php
                    $i++;
                  }
                  ?>
                </tbody>
              </table>
            </div>
            <!-- /.card-body -->
          </div>
        </div>
      </div>
    </div>
  </section>
</div>
<?php include 'footer.php'; ?>

MMCT - 2023