Файловый менеджер - Редактировать - /home/d46091/invoice.ecogenix.in/transit_loss.php
Назад
<?php require_once('includes/connection.php'); require_once('includes/header.php'); // Search filters $search_conditions = []; $where_sql = ''; // Handle from_date and to_date if (!empty($_GET['from_date']) && !empty($_GET['to_date'])) { $from_date = $conn->real_escape_string($_GET['from_date']); $to_date = $conn->real_escape_string($_GET['to_date']); $search_conditions[] = "DATE(date) BETWEEN '$from_date' AND '$to_date'"; } elseif (!empty($_GET['from_date'])) { $from_date = $conn->real_escape_string($_GET['from_date']); $search_conditions[] = "DATE(date) >= '$from_date'"; } elseif (!empty($_GET['to_date'])) { $to_date = $conn->real_escape_string($_GET['to_date']); $search_conditions[] = "DATE(date) <= '$to_date'"; } // Handle challan_no if (!empty($_GET['challan_no'])) { $challan_no = $conn->real_escape_string($_GET['challan_no']); $search_conditions[] = "challan_no LIKE '%$challan_no%'"; } if (!empty($search_conditions)) { $where_sql = " WHERE " . implode(" AND ", $search_conditions); } $query = "SELECT * FROM `road_challans` $where_sql ORDER BY `id` DESC"; $result = $conn->query($query); ?> <div class="content"> <nav class="navbar navbar-expand-lg navbar-light bg-light mb-4"> <div class="container-fluid"> <button id="sidebarToggle" class="btn btn-outline-secondary d-md-none mr-auto"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand d-md-none" href="#">ECOGENIX</a> </div> </nav> <div class="container-fluid"> <div class="row"> <div class="col-12"> <h2 class="mb-4">Transit Loss Report</h2> </div> </div> <form method="GET" class="row g-3 mb-4"> <div class="col-md-2"> <label class="form-label">From Date</label> <input type="date" name="from_date" value="<?= $_GET['from_date'] ?? '' ?>" class="form-control"> </div> <div class="col-md-2"> <label class="form-label">To Date</label> <input type="date" name="to_date" value="<?= $_GET['to_date'] ?? '' ?>" class="form-control"> </div> <div class="col-md-2"> <label class="form-label">Challan No.</label> <input type="text" name="challan_no" value="<?= $_GET['challan_no'] ?? '' ?>" class="form-control"> </div> <div class="col-md-2 d-flex align-items-end"> <button type="submit" class="btn btn-primary w-100">Search</button> </div> </form> <form method="POST" action="export_transit_loss.php"> <div class="card"> <div class="card-header d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-sm btn-success">Export to Excel</button> </div> <div class="card-body"> <div class="table-responsive"> <table class="table table-striped table-hover table-bordered"> <thead class="table-dark"> <tr> <th><input type="checkbox" id="select_all"> Select All</th> <th>#</th> <th>Seller Company</th> <th>Purchaser Company</th> <th>Challan No.</th> <th>Challan Date</th> <th>Quantity Dispatch</th> <th>Quantity Unloaded</th> <th>Difference (Kgs)</th> <th>Action</th> </tr> </thead> <tbody> <?php if ($result && $result->num_rows > 0) { $index = 1; while ($row = $result->fetch_assoc()) { $qty = is_numeric($row['quantity']) ? (float)$row['quantity'] : 0; $qty_billed = is_numeric($row['quantity_billed']) ? (float)$row['quantity_billed'] : 0; $difference = $qty - $qty_billed; echo "<tr> <td><input type='checkbox' name='selected_ids[]' value='{$row['id']}' class='select_item'></td> <td>{$index}</td> <td>{$row['consignorName']}</td> <td>{$row['name']}</td> <td>{$row['challan_no']}</td> <td>{$row['date']}</td> <td>{$row['quantity']}</td> <td>{$row['quantity_billed']}</td> <td>{$difference}</td> <td><a href='view_report.php?id={$row['id']}' class='btn btn-sm btn-warning'>View</a></td> </tr>"; $index++; } } else { echo '<tr><td colspan="10" class="text-center">No records found.</td></tr>'; } ?> </tbody> </table> </div> </div> </div> </form> </div> </div> <script> document.getElementById('select_all').addEventListener('change', function() { const checkboxes = document.querySelectorAll('.select_item'); checkboxes.forEach(cb => cb.checked = this.checked); }); </script> <?php require_once('includes/footer.php'); ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка