is_numeric($id)); $selectedIdsList = implode(',', array_map('intval', $selectedIds)); if (empty($selectedIdsList)) { die('Invalid selection.'); } // Fetch only selected records $query = "SELECT * FROM `road_challans` WHERE id IN ($selectedIdsList) ORDER BY `id` DESC"; $result = $conn->query($query); // Set headers for Excel file download header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=delivery_lead_time_" . date("Ymd_His") . ".xls"); header("Pragma: no-cache"); header("Expires: 0"); // Begin table output echo "
Sl No. | Seller Company | Purchaser Company | Challan No. | Challan Date | Reach Date | Unloaded Date | Unloaded Time | Despatch To Reach Time (Days) | Reach To Unload Time (Days) | Dispatch To Unload Time (Days) |
---|---|---|---|---|---|---|---|---|---|---|
{$index} | " . htmlspecialchars($row['consignorName'] ?? '') . " | " . htmlspecialchars($row['name'] ?? '') . " | " . htmlspecialchars($row['challan_no'] ?? '') . " | " . htmlspecialchars($row['date'] ?? '') . " | " . htmlspecialchars($row['date_of_reach'] ?? '') . " | {$unloaded_date} | {$unloaded_time} | {$days_to_reach} | {$days_to_unload} | {$total_days} |
No matching data found. |