Файловый менеджер - Редактировать - /home/d46091/invoice.ecogenix.in/print_challan.php
Назад
<?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); // Include database connection require_once('includes/connection.php'); // Check if ID is provided if (!isset($_GET['id']) || empty($_GET['id'])) { header("Location: view_challans.php"); exit(); } $id = mysqli_real_escape_string($conn, $_GET['id']); // Get challan data $query = "SELECT * FROM road_challans WHERE id = '$id'"; $result = mysqli_query($conn, $query); // Check if challan exists if (mysqli_num_rows($result) == 0) { header("Location: view_challans.php"); exit(); } $challan = mysqli_fetch_assoc($result); // echo '<pre>'; // print_r($challan); // die(); // require_once('includes/header.php'); ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>ECOGENIX - Dashboard</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-4Q6Gf2aSP4eDXB8Miphtr37CMZZQ5oXLH2yaXMJ2w8e2ZtHTl7GptT4jmndRuHDT" crossorigin="anonymous"> <link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> .contents { max-width: 700px; /* reduced width */ margin: 0 auto; border: 1px solid #333; padding: 10px; /* reduced padding */ font-size: 12px; /* globally smaller text */ } .header h1 { font-size: 20px; } .info-section { margin-bottom: 15px; } .info-item label { min-width: 70px; } table { width: 100%; border-collapse: collapse; font-size: 11px; /* slightly smaller font in tables */ margin-bottom: 15px; } th, td { padding: 6px 8px; /* tighter padding */ } table, th, td { border: 1px solid #333; } .disclaimer { font-size: 11px; margin-bottom: 15px; } .signature { /* margin-top: 60px; */ margin-top: 40px; /* reduced top margin */ } .btn { padding: 8px 16px; font-size: 14px; } /* Responsive print size control */ @media print { @page { size: A4 portrait; /* or landscape */ margin: 15mm; /* adjust margins as needed */ } body { margin: 0; padding: 0; font-size: 11px; } .content { max-width: 100%; padding: 0; border: none; } .buttons, .no-print { display: none; } .print-logo { opacity: 0.3 !important; max-width: 40px !important; } .print-block { /* display: inline-block; width: 100%; */ page-break-before: always; /* Forces page break BEFORE element */ break-before: page; } table, th, td { border: 1px solid #333; } th { background-color: #2196F3 !important; } .header { text-align: center; } } </style> </head> <body> <div class="contents"> <div class="header"> <h1>ROAD CHALLAN</h1> </div> <?php if ($challan['consignorName'] == 'SWETA JAIN' || $challan['consignorName'] == 'Auto' || $challan['consignorName'] == 'travel') { ?> <div class="" style="text-align: center;"> <div class="info-item"> <h4> <strong> <span style="font-size: 25px;"><?php echo htmlspecialchars($challan['consignorName']); ?></span><br> <?php echo htmlspecialchars($challan['consignorAddress']); ?>, Pincode - <?php echo htmlspecialchars($challan['consignorPincode']); ?><br> Mobile No. - +91 <?php echo htmlspecialchars($challan['consignorPhone']); ?> <!--, Email - <?php echo htmlspecialchars($challan['consignorEmail']); ?>--> <br> <?php if (!empty($challan['consignorGst']) && $challan['consignorGst'] !== 'N/A') { ?> GSTIN - <?php echo htmlspecialchars($challan['consignorGst']); } ?> </strong> </h4> </div> </div> <table style="border: 1px solid;"> <tr> <td rowspan="6" colspan="2"> <h4> <p style="margin-top: -7rem;"><strong>Customer Name: </strong><?php echo htmlspecialchars($challan['name']); ?></p> </h4> <h4> <p style=""><strong>Address: </strong> <?php echo htmlspecialchars($challan['address1']); ?></p> </h4> </td> <td><strong>Challan No.:</strong></td> <td><?php echo htmlspecialchars($challan['challan_no']); ?></td> </tr> <tr> <td><strong>Date:</strong></td> <td><?php echo htmlspecialchars($challan['date']); ?></td> </tr> <tr> <td><strong>Destination:</strong></td> <td><?php echo htmlspecialchars($challan['destination']); ?></td> </tr> <tr> <!-- <td rowspan="3" colspan="2"> </td> --> <td><strong>Vehicle No.:</strong></td> <td><?php echo htmlspecialchars($challan['vehicle_no']); ?></td> </tr> <tr> <td><strong>Driver No.:</strong></td> <td><?php echo htmlspecialchars($challan['driver_no']); ?></td> </tr> <tr> <td><strong>P.O. No.:</strong></td> <td><?php echo htmlspecialchars($challan['purchase_order_no']); ?></td> </tr> </table> <table> <thead> <tr> <th>HSN </th> <th class="">Description of Goods</th> <th class="">Quantity(KG)</th> </tr> </thead> <tbody> <tr> <td style="padding-bottom:100px;"><?php echo htmlspecialchars($challan['hsn']); ?></td> <td style="padding-bottom:100px;"> <?php echo htmlspecialchars($challan['description']); ?> </td> <td style="padding-bottom:100px;"><?php echo htmlspecialchars($challan['quantity']); ?></td> </tr> <?php if (!empty($challan['itemDescription'])): ?> <tr> <td colspan="3"><strong>Note:</strong> <?php echo htmlspecialchars($challan['itemDescription']); ?></td> </tr> <?php endif; ?> </tbody> </table> <div class="disclaimer"> We are not responsible for Quality, Quantity, <br> Weight etc. after delivery of goods. </div> <div class="signature" style="text-align: right; max-width: 1200px; margin: 0 auto;"> <div class="row" style="display: flex; width: 100%;"> <div class="col-md-8" style="flex: 0 0 66.66%; max-width: 66.66%;"></div> <div class="col-md-4" style="flex: 0 0 33.33%; max-width: 33.33%; padding-left: 15px;"> <!-- Digital Signature Container --> <div style="border: 2px solid #ddd; padding: 15px; background-color: white; margin-bottom: 20px;"> <div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 15px;background: linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.5)), url('images/images.png'); background-repeat: no-repeat; background-size: contain;background-position: center;"> <!-- Left side - Name --> <div style="flex: 1; min-width: 0;"> <h2 style="text-align: left; margin: 0; font-size: 10px; font-weight: bold; color: #333; line-height: 1.2; word-wrap: break-word;"> <?php echo htmlspecialchars($challan['consignorName']); ?> </h2> </div> <!-- Right side - Digital signature info --> <div style="flex: 1; text-align: left; min-width: 0;"> <div style="font-size: 6px; color: #666; line-height: 1.3; "> <div style="margin-bottom: 2px;"> <span style="font-weight: bold;">Digitally signed by</span> </div> <div style="margin-bottom: 2px;"> <span style="color: #0066cc; word-wrap: break-word;"><?php echo htmlspecialchars($challan['consignorName']); ?></span> </div> <div style="margin-bottom: 2px;"> <span style="font-size: 5px;">Date: <?php echo htmlspecialchars($challan['sig_datetime']); ?></span> </div> <div> <span style="font-size: 5px;">+05'30'</span> </div> </div> </div> </div> </div> <!-- Signature Image Placeholder --> <!-- <img src="images/signature.png" alt="Signature" style="max-width: 100%; height: auto;"> --> <!-- <div style="text-align: center; margin-bottom: 15px; border: 1px dashed #ccc; padding: 20px; background-color: #fafafa;"> <span style="color: #999; font-style: italic; font-size: 12px;">Signature Image Placeholder</span> </div> --> <!-- Receiver's Signature Label --> <div style="text-align: center; font-size: 14px; color: #333; font-weight: 500; border-top: 1px solid #ddd; padding-top: 10px;"> Receiver's Signature with Seal </div> </div> </div> </div> <?php } else if ($challan['consignorName'] == 'Shri Salasar Commotrade' || $challan['consignorName'] == 'Techlounge') { ?> <table style="border: 1px solid;"> <tr> <td rowspan="3" colspan="2"> <h5>Consignor Name:</h5> <h4> <p><strong><?php echo htmlspecialchars($challan['consignorName']); ?></strong></p> </h4> <h4> <p><strong><?php echo htmlspecialchars($challan['consignorAddress']); ?>, Pincode - <?php echo htmlspecialchars($challan['consignorPincode']); ?><br> Mobile No. - +91 <?php echo htmlspecialchars($challan['consignorPhone']); ?>, <br>Email - <?php echo htmlspecialchars($challan['consignorEmail']); ?><br> <?php if (!empty($challan['consignorGst']) && $challan['consignorGst'] !== 'N/A') { ?> GSTIN - <?php echo htmlspecialchars($challan['consignorGst']); } ?></strong></p> </h4> </td> <td><strong>Challan No.:</strong></td> <td><?php echo htmlspecialchars($challan['challan_no']); ?></td> </tr> <tr> <td><strong>Challan Date:</strong></td> <td><?php echo htmlspecialchars($challan['date']); ?></td> </tr> <tr> <td><strong>Purchase Order No.:</strong></td> <td><?php echo htmlspecialchars($challan['purchase_order_no']); ?></td> </tr> <tr> <td rowspan="3" colspan="2"> <h5>Consignee Name:</h5> <h4> <p><strong><?php echo htmlspecialchars($challan['name']); ?></strong></p> </h4> <h4> <p><strong><?php echo htmlspecialchars($challan['address1']); ?></strong></p> </h4> </td> <td><strong>Vehicle No.:</strong></td> <td><?php echo htmlspecialchars($challan['vehicle_no']); ?></td> </tr> <tr> <td><strong>Driver Mobile No.:</strong></td> <td><?php echo htmlspecialchars($challan['driver_no']); ?></td> </tr> <tr> <td><strong>Destination:</strong></td> <td><?php echo htmlspecialchars($challan['destination']); ?></td> </tr> </table> <table> <thead> <tr> <th style="background-color: #2196F3;color:#f2f2f2">Bags</th> <th style="background-color: #2196F3;color:#f2f2f2">Description of Goods</th> <th style="background-color: #2196F3;color:#f2f2f2">HSN </th> </tr> </thead> <tbody> <tr> <td style="padding-bottom:10px;"><?php echo htmlspecialchars($challan['bags']); ?> Bags</td> <td style="padding-bottom:100px;"> <?php echo htmlspecialchars($challan['description']); ?> </td> <td style="padding-bottom:100px;"><?php echo htmlspecialchars($challan['hsn']); ?></td> </tr> <?php if (!empty($challan['itemDescription'])): ?> <tr> <td colspan="3"><strong>Note:</strong> <?php echo htmlspecialchars($challan['itemDescription']); ?></td> </tr> <?php endif; ?> </tbody> </table> <div class="disclaimer"> We are not responsible for Quality, Quantity, <br> Weight etc. after delivery of goods. <br> <br> <strong> Emergency Contact No.(24X7) - +91 8538976655 <br> In case Driver is not reachable or does not pickup the call. </strong> </div> <div class="signature" style="text-align: right; max-width: 1200px; margin: 0 auto;"> <div class="row" style="display: flex; width: 100%;"> <div class="col-md-8" style="flex: 0 0 66.66%; max-width: 66.66%;"></div> <div class="col-md-4" style="flex: 0 0 33.33%; max-width: 33.33%; padding-left: 15px;"> <!-- Digital Signature Container --> <div style="border: 2px solid #ddd; padding: 15px; background-color: white; margin-bottom: 20px;"> <!-- Insert image above content to mimic background --> <div style="text-align: center; margin-bottom: 10px;"> <img src="images/images.png" class="print-logo" alt="Signature Logo" style="max-width: 50px;margin: auto; height: auto; position: absolute;opacity: 0.6;"> </div> <style> @media print { .print-logo { display: block !important; margin-left: 50px !important; opacity: 0.4 !important; /* max-width: 30px; */ /* position: absolute; */ } } </style> <!-- Content layout --> <div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 15px;"> <!-- Left side - Name --> <div style="flex: 1; min-width: 0;"> <h2 style="text-align: left; margin: 0; font-size: 10px; font-weight: bold; color: #333; line-height: 1.2; word-wrap: break-word;"> PREMLATA DEVI KHIRWAL </h2> </div> <!-- Right side - Digital signature info --> <div style="flex: 1; text-align: left; min-width: 0;"> <div style="font-size: 6px; color: #666; line-height: 1.3;"> <div style="margin-bottom: 2px;"> <span style="font-weight: bold;">Digitally signed by</span> </div> <div style="margin-bottom: 2px;"> <span style="color: #0066cc; word-wrap: break-word;">PREMLATA DEVI KHIRWAL</span> </div> <div style="margin-bottom: 2px;"> <span style="font-size: 5px;">Date: <?php echo htmlspecialchars($challan['sig_datetime']); ?></span> </div> <div> <span style="font-size: 5px;">+05'30'</span> </div> </div> </div> </div> </div> <!-- Signature Image Placeholder --> <!-- <img src="images/signature.png" alt="Signature" style="max-width: 100%; height: auto;"> --> <!-- <div style="text-align: center; margin-bottom: 15px; border: 1px dashed #ccc; padding: 20px; background-color: #fafafa;"> <span style="color: #999; font-style: italic; font-size: 12px;">Signature Image Placeholder</span> </div> --> <!-- Receiver's Signature Label --> <div style="text-align: center; font-size: 14px; color: #333; font-weight: 500; border-top: 1px solid #ddd; padding-top: 10px;"> Receiver's Signature with Seal </div> </div> </div> </div> <?php } else { ?> <div class="" style="text-align: center;"> <div class="info-item"> <h4> <strong> <span style="font-size: 25px;"><?php echo htmlspecialchars($challan['consignorName']); ?></span><br> <?php echo htmlspecialchars($challan['consignorAddress']); ?>, Pincode - <?php echo htmlspecialchars($challan['consignorPincode']); ?><br> Mobile No. - +91 <?php echo htmlspecialchars($challan['consignorPhone']); ?> <!--, Email - <?php echo htmlspecialchars($challan['consignorEmail']); ?>--> <br> <?php if (!empty($challan['consignorGst']) && $challan['consignorGst'] !== 'N/A') { ?> GSTIN - <?php echo htmlspecialchars($challan['consignorGst']); } ?> </strong> </h4> </div> </div> <table style="border: 1px solid;"> <tr> <td rowspan="6" colspan="2"> <h4> <p style="margin-top: -7rem;"><strong>Customer Name: </strong><?php echo htmlspecialchars($challan['name']); ?></p> </h4> <h4> <p style=""><strong>Address: </strong> <?php echo htmlspecialchars($challan['address1']); ?></p> </h4> </td> <td><strong>Challan No.:</strong></td> <td><?php echo htmlspecialchars($challan['challan_no']); ?></td> </tr> <tr> <td><strong>Date:</strong></td> <td><?php echo htmlspecialchars($challan['date']); ?></td> </tr> <tr> <td><strong>Destination:</strong></td> <td><?php echo htmlspecialchars($challan['destination']); ?></td> </tr> <tr> <!-- <td rowspan="3" colspan="2"> </td> --> <td><strong>Vehicle No.:</strong></td> <td><?php echo htmlspecialchars($challan['vehicle_no']); ?></td> </tr> <tr> <td><strong>Driver No.:</strong></td> <td><?php echo htmlspecialchars($challan['driver_no']); ?></td> </tr> <tr> <td><strong>P.O. No.:</strong></td> <td><?php echo htmlspecialchars($challan['purchase_order_no']); ?></td> </tr> </table> <table> <thead> <tr> <th>HSN </th> <th class="">Description of Goods</th> <th class="">Quantity(KG)</th> </tr> </thead> <tbody> <tr> <td style="padding-bottom:100px;"><?php echo htmlspecialchars($challan['hsn']); ?></td> <td style="padding-bottom:100px;"> <?php echo htmlspecialchars($challan['description']); ?> </td> <td style="padding-bottom:100px;"><?php echo htmlspecialchars($challan['quantity']); ?></td> </tr> <?php if (!empty($challan['itemDescription'])): ?> <tr> <td colspan="3"><strong>Note:</strong> <?php echo htmlspecialchars($challan['itemDescription']); ?></td> </tr> <?php endif; ?> </tbody> </table> <div class="disclaimer"> We are not responsible for Quality, Quantity, <br> Weight etc. after delivery of goods. </div> <div class="signature" style="text-align: right; max-width: 1200px; margin: 0 auto;"> <div class="row" style="display: flex; width: 100%;"> <div class="col-md-8" style="flex: 0 0 66.66%; max-width: 66.66%;"></div> <div class="col-md-4" style="flex: 0 0 33.33%; max-width: 33.33%; padding-left: 15px;"> <!-- Digital Signature Container --> <div style="border: 2px solid #ddd; padding: 15px; background-color: white; margin-bottom: 20px;"> <div style="display: flex; justify-content: space-between; align-items: flex-start; gap: 15px;background: linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.5)), url('images/images.png'); background-repeat: no-repeat; background-size: contain;background-position: center;"> <!-- Left side - Name --> <div style="flex: 1; min-width: 0;"> <h2 style="text-align: left; margin: 0; font-size: 10px; font-weight: bold; color: #333; line-height: 1.2; word-wrap: break-word;"> <?php echo htmlspecialchars($challan['consignorName']); ?> </h2> </div> <!-- Right side - Digital signature info --> <div style="flex: 1; text-align: left; min-width: 0;"> <div style="font-size: 6px; color: #666; line-height: 1.3; "> <div style="margin-bottom: 2px;"> <span style="font-weight: bold;">Digitally signed by</span> </div> <div style="margin-bottom: 2px;"> <span style="color: #0066cc; word-wrap: break-word;"><?php echo htmlspecialchars($challan['consignorName']); ?></span> </div> <div style="margin-bottom: 2px;"> <span style="font-size: 5px;">Date: <?php echo htmlspecialchars($challan['sig_datetime']); ?></span> </div> <div> <span style="font-size: 5px;">+05'30'</span> </div> </div> </div> </div> </div> <!-- Signature Image Placeholder --> <!-- <img src="images/signature.png" alt="Signature" style="max-width: 100%; height: auto;"> --> <!-- <div style="text-align: center; margin-bottom: 15px; border: 1px dashed #ccc; padding: 20px; background-color: #fafafa;"> <span style="color: #999; font-style: italic; font-size: 12px;">Signature Image Placeholder</span> </div> --> <!-- Receiver's Signature Label --> <div style="text-align: center; font-size: 14px; color: #333; font-weight: 500; border-top: 1px solid #ddd; padding-top: 10px;"> Receiver's Signature with Seal </div> </div> </div> </div> <?php } ?> <div class="buttons no-print"> <button onclick="window.print();" class="btn">Print</button> <button onclick="window.location.href='challan.php';" class="btn" style="background-color: #2196F3;">Back to List</button> </div> <script> // Automatically trigger print when page loads window.onload = function() { window.print(); } </script> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.6/dist/js/bootstrap.bundle.min.js" integrity="sha384-j1CDi7MgGQ12Z7Qab0qlWQ/Qqz24Gc6BM0thvEMVjHnfYGF0rmFCozFSxQBxwHKO" crossorigin="anonymous"></script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка