����JFIF��x�x������Exif��MM�*���� ����E���J����������������(������������������
Server IP : 103.191.208.227 / Your IP : 3.145.92.96 Web Server : LiteSpeed System : Linux emphasis.herosite.pro 4.18.0-553.8.1.lve.el8.x86_64 #1 SMP Thu Jul 4 16:24:39 UTC 2024 x86_64 User : mhmsfzcs ( 1485) PHP Version : 8.1.31 Disable Function : show_source, system, shell_exec, passthru, exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0750) : /home/mhmsfzcs/vflyorions.com/.well-known/../../ssl/../invoice.vflyorion.com/ |
[ Home ] | [ C0mmand ] | [ Upload File ] |
---|
<?php require_once('tcpdf/tcpdf.php'); include 'db.php'; $id = $_GET['id']; $sql = "SELECT * FROM invoice WHERE id=$id"; $result = $conn->query($sql); if ($result->num_rows > 0) { $invoice = $result->fetch_assoc(); $t = $invoice['price'] * 0.09; $tax = $invoice['price'] * 0.18; // Assuming 'amount' is the correct field name $total = $invoice['price'] + $tax; $to = $invoice['email']; // Assuming there's a 'client_email' field in your 'invoices' table $subject = "Your Invoice from Vflyorions Technologies Pvt Ltd"; // Create new PDF document $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetCreator(PDF_CREATOR); $pdf->SetAuthor('Vflyorions Technologies Pvt Ltd'); $pdf->SetTitle('Invoice'); $pdf->SetSubject('Invoice'); // Add a page $pdf->AddPage(); // Set content $html = " <html> <head> <meta charset='UTF-8'> <meta name='viewport' content='width=device-width, initial-scale=1.0'> <title>Invoice</title> <style> body { font-family: Arial, sans-serif; margin: 0; padding: 20px; background-color: #f8f8f8; } .invoice-box { max-width: 800px; margin: auto; padding: 30px; border: 1px solid #eee; box-shadow: 0 0 10px rgba(0, 0, 0, 0.15); background-color: #fff; } .invoice-box table { width: 100%; line-height: inherit; text-align: left; border-collapse: collapse; } .invoice-box table td { padding: 12px; vertical-align: top; } .invoice-box table tr td:nth-child(2) { text-align: right; } .invoice-box table tr.top table td { padding-bottom: 20px; } .invoice-box table tr.information table td { padding-bottom: 40px; } .invoice-box table tr.heading td { background: #eee; border-bottom: 1px solid #ddd; font-weight: bold; } .invoice-box table tr.details td { padding-bottom: 20px; } .invoice-box table tr.item td { border-bottom: 1px solid #eee; } .invoice-box table tr.item.last td { border-bottom: none; } .invoice-box table tr.total td:nth-child(2) { border-top: 2px solid #eee; font-weight: bold; } .title { font-size: 45px; line-height: 45px; color: #333; } .information td { padding: 0 5px 10px 0; } .subtotal, .tax, .total { padding: 10px 5px; } .terms { font-size: 12px; } @media only screen and (max-width: 600px) { .invoice-box table tr.top table td { width: 100%; display: block; text-align: center; } .invoice-box table tr.information table td { width: 100%; display: block; text-align: center; } } @media print { .print-button { display: none; } } </style> </head> <body> <div class='invoice-box'> <div><label><strong>TAX INVOICE</strong></label>    <label style='border: 1px solid gray; padding: 4px;color: gray;'>ORIGINAL FOR RECIPIENT</label></div> <table cellpadding='0' cellspacing='0'> <tr class='top'> <td colspan='5'> <table> <tr> <td class='title'> <img src='logo.png' style='width:100%; max-width:150px;'> </td> <td> <div style='text-align:right;'> <strong>Vflyorions Technologies Pvt Ltd</strong><br> Near Dharampeth mahila Bank, opposite Bank of Baroda,<br> Ward Number 3, Parsodi, Trimurtee Nagar,<br> Nagpur, Maharashtra 440022<br> Mobile: 9146902678<br> GSTIN: 27AAGCV6291H1ZW </div> </td> </tr> </table> </td> </tr> <tr class='information' style='border: 1px solid black;'> <td colspan='5'> <table> <tr> <td style='text-align: left; padding: 0;'> <strong>BILL TO:</strong><br> {$invoice['fullname']}<br> Mobile: {$invoice['contact']} </td> <td style='padding: 0;'> <strong>Invoice No.: {$invoice['invoice_no']}</strong><br> Invoice Date: " . date('d-m-Y') . " </td> </tr> </table> </td> </tr><br> <tr class='heading'> <td style='border-bottom: 1px solid #ddd;'>SERVICES</td> <td style='text-align: center; border-bottom: 1px solid #ddd;'>QTY.</td> <td style='text-align: center; border-bottom: 1px solid #ddd;'>RATE</td> <td style='text-align: center; border-bottom: 1px solid #ddd;'>TAX</td> <td style='text-align: right; border-bottom: 1px solid #ddd;'>AMOUNT</td> </tr> <tr class='item'> <td>{$invoice['plan']}</td> <td style='text-align: center;'>1.0</td> <td style='text-align: center;'>{$invoice['price']}</td> <td style='text-align: center;'>{$tax} (18.0%)</td> <td style='text-align: right;'>{$invoice['price']}</td> </tr> <tr class='subtotal'> <td colspan='4' style='text-align: right; padding-right: 20px;'>SUB TOTAL</td> <td style='text-align: right;'>₹ {$invoice['price']}</td> </tr> <tr class='tax'> <td colspan='4' style='text-align: right; padding-right: 20px;'>CGST @9.0%</td> <td style='text-align: right;'>₹ {$t}</td> </tr> <tr class='tax'> <td colspan='4' style='text-align: right; padding-right: 20px;'>SGST @9.0%</td> <td style='text-align: right;'>₹ {$t}</td> </tr> <tr class='total'> <td colspan='4' style='text-align: right; padding-right: 20px;'>GRAND TOTAL</td> <td style='text-align: right;'>₹ {$total}</td> </tr> <tr class='total'> <td colspan='4' style='text-align: right; padding-right: 20px;'>Received Amount</td> <td style='text-align: right;'>₹ {$total}</td> </tr> <tr class='total'> <td colspan='4' style='text-align: right; padding-right: 20px;'>Balance</td> <td style='text-align: right;'>₹ 0</td> </tr> <tr class='information'> <td colspan='5'> <table> <tr> <td style='padding: 0;'> <strong>Bank Details:</strong><br> Name: Samuel Titus<br> IFSC Code: YESB0000028<br> Account No: 00286300001883<br> Bank: Yes Bank, NAGPUR, MAHARASHTRA </td> </tr> </table> </td> </tr> <tr class='information'> <td colspan='5' class='terms'> Notes:<br> -<br> Terms and Conditions:<br> 1. Once work is placed amount will not be refunded.<br> 2. File name should be same as given in the mail. </td> </tr> </table> </div> </body> </html> "; // Print text using writeHTMLCell() $pdf->writeHTML($html, true, false, true, false, ''); // Close and output PDF document $pdfFilename = 'invoice_' . $invoice['invoice_no'] . '.pdf'; $pdf->Output($pdfFilename, 'F'); // Save the PDF to a file // Email the PDF $headers = "From: anup@vflyorions.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"_1_\"\r\n"; $message = "This is a multi-part message in MIME format.\r\n\r\n"; $message .= "--_1_\r\n"; $message .= "Content-Type: text/plain; charset=\"UTF-8\"\r\n"; $message .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; $message .= "Please find your invoice attached.\r\n\r\n"; $message .= "--_1_\r\n"; // Attach the PDF $file = file_get_contents($pdfFilename); $message .= "Content-Type: application/pdf; name=\"{$pdfFilename}\"\r\n"; $message .= "Content-Transfer-Encoding: base64\r\n"; $message .= "Content-Disposition: attachment; filename=\"{$pdfFilename}\"\r\n\r\n"; $message .= chunk_split(base64_encode($file)) . "\r\n"; $message .= "--_1_--"; if (mail($to, $subject, $message, $headers)) { echo "Email sent successfully."; } else { echo "Failed to send email."; } } else { echo "Invoice not found."; } $conn->close(); ?>