Hackfut Security File Manager
Current Path:
/home/u126195517/domains/rdnirjaldhulai.com/public_html/applications
home
/
u126195517
/
domains
/
rdnirjaldhulai.com
/
public_html
/
applications
/
📁
..
📁
TCPDF
📁
aarambhappapi
📁
adiappapi
📁
admin_dp
📁
app_icons
📁
bookingapi
📁
client_dp
📄
mbno_script.php
(788 B)
📁
prarambhappapi
📁
rdscontrolers
📁
sanchalakappapi
📄
testing5.php
(11.33 KB)
📄
timechk.php
(748 B)
📁
user_logos
📁
user_photos
Editing: testing5.php
<?php error_reporting(E_ALL); ini_set('display_errors', 1); // Include TCPDF and Database Configurations require_once('TCPDF/tcpdf.php'); //require_once('./rdscontrolers/rotation.php'); require_once './prarambhappapi/controlers/configs/rdndappuserconfig.php'; require_once './prarambhappapi/controlers/configs/prarambhappconfig.php'; $billNo = 10; // Ensure this is properly set $userId = 1; try { $stmt = $RDSAPPUSER->prepare('SELECT * FROM rdnd_user_detail WHERE user_id = :lognm'); $stmt->execute([':lognm' => $userId]); $parinam = $stmt->fetch(PDO::FETCH_ASSOC); if ($parinam) { $fetched_userId = $parinam['user_id']; //$shoplogo = $parinam['user_shop_logo']; $shoplogo = "https://rdnirjaldhulai.com/applications/user_logos/" . $parinam['user_shop_logo']; $shopnam = $parinam['user_shopNm']; $addres = trim(implode(', ', array_filter([$parinam['user_shpNo'], $parinam['user_aptNam'], $parinam['user_buildNo']]))); $addres2 = trim(implode(', ', array_filter([$parinam['user_nearby'], $parinam['user_stretNam'], $parinam['user_landmrk']]))); $contact = $parinam['user_mobileno']; $gstnum = $parinam['user_gst_no']; $gststate = $parinam['user_gst_status']; $area = $parinam['user_area']; $city = $parinam['user_city']; $pin = $parinam['user_pincode']; $state = $parinam['user_state']; } } catch (Exception $ex) { die("Error fetching user details: " . $ex->getMessage()); } // Fetch Bill Details try { $stmt1 = $RDSAPP->prepare('SELECT * FROM wash_bills WHERE bill_no = :bno AND user_id = :uid'); $stmt1->execute([':bno' => $billNo, ':uid' => $userId]); $parinam1 = $stmt1->fetch(PDO::FETCH_ASSOC); if ($parinam1) { $b_date = date('d/m/Y', strtotime($parinam1["date"])); $d_date = date('d/m/Y', strtotime($parinam1["deliv_date"])); $ccode = $parinam1["c_code"] ?? null; $bilstat = $parinam1['work_status']; $sgstrate = $parinam1['s_gst_rate']; $cgstrate = $parinam1['c_gst_rate']; $gstrate = $sgstrate + $cgstrate; $sgstamt = $parinam1['s_gst_amt']; $cgstamt = $parinam1['c_gst_amt']; $gstamt = $sgstamt + $cgstamt; $grndamt = $parinam1['grand_amt']; } } catch (Exception $ex) { die("Error fetching bill details: " . $ex->getMessage()); } if (!empty($ccode)) { try { $stmt2 = $RDSAPPUSER->prepare('SELECT * FROM client_detail WHERE c_code = :ccd'); $stmt2->execute([':ccd' => $ccode]); $parinam2 = $stmt2->fetch(PDO::FETCH_ASSOC); if ($parinam2) { $clientnam = $parinam2["c_name"]; $clientmob = $parinam2["c_mobileno1"]; $cltgstnum = $parinam2["c_gst_no"]; $caddres = trim(implode(', ', array_filter([ $parinam2['c_houseNo'], $parinam2['c_aptNam'], $parinam2['c_buildNo'], $parinam2['c_nearby'], $parinam2['c_stretNam'], $parinam2['c_landmrk'], $parinam2['c_area'], $parinam2['c_city'] ]))); } } catch (Exception $ex) { die("Error fetching client details: " . $ex->getMessage()); } } class PDF extends TCPDF { public $newbno, $newuid; public function setData($b, $u) { $this->newbno = $b; $this->newuid = $u; } public function Header() { global $billNo, $b_date, $d_date, $shoplogo, $shopnam, $addres, $addres2, $area, $city, $pin, $state, $contact, $gstnum, $gststate, $clientnam, $clientmob, $cltgstnum, $bilstat, $caddres; $this->Image($shoplogo, 5, 5, 40); $this->Image($shoplogo, 167, 5, 40); $this->Ln(2); $this->SetFont('helvetica', 'B', 16); $this->Cell(53); $this->Cell(80, 10, $shopnam, 0, 0, 'C'); $this->Ln(8); $this->Cell(53); $this->SetFont('helvetica', '', 10); $this->Cell(85, 10, $addres, 0, 0, 'C'); $this->Ln(6); $this->Cell(53); $this->Cell(85, 10, $addres2, 0, 0, 'C'); $this->Ln(6); $this->Cell(53); $this->Cell(80, 10, "$area, $city, $pin, $state", 0, 0, 'C'); $this->Ln(7); $this->Cell(50); $this->Cell(80, 10, "$contact, GST No.: $gstnum", 0, 0, 'C'); $this->Line(1, 47, 209, 47); $this->SetFont('helvetica', 'B', 12); $this->Ln(10); $this->Cell(50); $this->Cell(80, 10, '( Washing Bill )', 0, 0, 'C'); $this->Ln(12); $this->SetFont('helvetica', '', 10); $this->Cell(20, 0, 'Bill No.', 0, '0', 'L'); $this->Cell(5, 0, ':', 0, '0', 'C'); $this->SetFont('helvetica', 'B', 10); $this->Cell(20, 0, $billNo, 0, '0', 'L'); $this->Cell(95); $this->Cell(20, 0, 'Bill Date', 0, '0', 'L'); $this->Cell(10, 0, ':', 0, '0', 'C'); $this->Cell(20, 0, $b_date, 0, '0', 'L'); $this->Ln(8); $this->Cell(20, 0, 'Name', 0, '0', 'L'); $this->Cell(5, 0, ':', 0, '0', 'C'); $this->SetFont('Helvetica', 'B', 10); $this->Cell(20, 0, $clientnam, 0, '0', 'L'); $this->SetFont('Helvetica','',10); // Move to the right $this->Cell(95); $this->Cell(20,0,'Delivery Date', 0, '0', 'L'); $this->Cell(10,0,':', 0, '0', 'C'); $this->Cell(20,0,$d_date, 0, '0', 'L'); $this->Ln(8); $this->Cell(20,0,'Mobile No.', 0, '0', 'L'); $this->Cell(5,0,':', 0, '0', 'C'); $this->Cell(20,0,$clientmob, 0, '0', 'L'); // Move to the right if(!empty($cltgstnum)) { $this->Cell(95); $this->Cell(20,0,'GST No.', 0, '0', 'L'); $this->Cell(10,0,':', 0, '0', 'C'); $this->Cell(20,0,$cltgstnum, 0, '0', 'L'); } $this->Ln(8); $this->Cell(20,0,'Address', 0, '0', 'L'); $this->Cell(5,0,':', 0, '0', 'C'); $this->Cell(20,0,$caddres, 0, '0', 'L'); $this->Ln(12); $this->Line(1, 93, 209, 93); // $this->Cell(20,0,$bilstat, 0, '0', 'L'); if ($bilstat == 'Pending') { $this->SetTextColor(255, 0, 0); $this->SetFont('helvetica', 'B', 50); $this->StartTransform(); $this->Rotate(45, 60, 150); $this->Text(60, 150, 'P e n d i n g'); $this->StopTransform(); } elseif ($bilstat == 'Delivered') { $this->SetTextColor(0, 255, 0); $this->SetFont('helvetica', 'B', 50); $this->StartTransform(); $this->Rotate(45, 60, 150); $this->Text(60, 150, 'D e l i v e r e d'); $this->StopTransform(); } } public function headerTable() { $this->Ln(85); $this->SetFont('helvetica', 'B', 11); $this->Cell(20, 10, 'Ser No.', 1, 0, 'C'); $this->Cell(90, 10, 'Particulars', 1, 0, 'C'); $this->Cell(20, 10, 'Quantity', 1, 0, 'C'); $this->Cell(30, 10, 'Rate', 1, 0, 'C'); $this->Cell(30, 10, 'Amount', 1, 0, 'C'); // Reduced from 30 $this->Ln(); } public function viewTable($RDSAPP) { $this->SetFont('helvetica', '', 10); $stmt3 = $RDSAPP->prepare('SELECT * FROM wash_bills_dt WHERE bill_no = :bno AND user_id = :uid'); $stmt3->execute([':bno' => $this->newbno, ':uid' => $this->newuid]); $results = $stmt3->fetchAll(); if (count($results) > 0) { $serno = 1; $total = 0; foreach ($results as $res) { $this->Cell(20, 10, $serno++, 1, 0, 'C'); $this->Cell(90, 10, $res['cloth_name'], 1, 0, 'C'); $this->Cell(20, 10, $res['qty'], 1, 0, 'C'); $this->Cell(30, 10, $res['rate'], 1, 0, 'C'); $this->Cell(30, 10, $res['amount'], 1, 0, 'C'); $total += $res['amount']; $this->Ln(); } $this->Ln(10); $this->Cell(135); $this->Cell(20, 0, 'Total Amount', 0, '0', 'L'); $this->Cell(20, 0, '', 0, '0', 'L'); $this->Cell(20, 0, $total, 0, '0', 'L'); $this->Ln(10); } } public function grandAmount() { global $gstrate, $gstamt, $grndamt; $this->Cell(8); $this->Cell(20, 0, 'GST Rate', 0, '0', 'L'); $this->Cell(5, 0, $gstrate, 0, '0', 'L'); $this->Cell(10, 0, '%', 0, '0', 'L'); $this->Cell(93); $this->Cell(20, 0, 'GST Amount', 0, '0', 'L'); $this->Cell(20, 0, '', 0, '0', 'L'); $this->Cell(20, 0, $gstamt, 0, '0', 'L'); $this->Ln(10); $this->Cell(135); $this->Cell(20, 0, 'Grand Amount', 0, '0', 'L'); $this->Cell(20, 0, '', 0, '0', 'L'); $this->Cell(20, 0, $grndamt, 0, '0', 'L'); $this->Ln(10); } // Terms & Conditoins function Terms() { $this->Cell(80,10,'*Conditions Apply',0,'0','L'); // Line break $this->Ln(10); $this->SetFont('Helvetica','',10); $this->Cell(20,0,' 1) Cloths will not be given without receipt.', 0, '0', 'L'); $this->Ln(8); $this->Cell(20,0,'2) If cloths lost or torn half cost will be given.', 0, '0', 'L'); $this->Ln(8); $this->Cell(20,0,'3) We are not responsible for the goods if not collected within one month.', 0, '0', 'L'); $this->Ln(8); $this->Cell(20,0,'4) No colour guarantee. No guarantee for printed saree.', 0, '0', 'L'); $this->Ln(8); $this->Cell(20,0,'5) While every enheavour is made to remove stains and spots from the garments but no guarantee is given.', 0, '0', 'L'); } // Page footer function Footer() { $this->Line(1, 282, 209, 282); $this->SetY(-15); $this->Cell(0, 8, 'Powered by Randhawa Dynamics Incorporation', 0, 0, 'C'); $this->SetFont('Helvetica', 'I', 8); $this->Cell(0, 10, 'Page ' . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), 0, 0, 'C'); } function RotatedText($x, $y, $txt, $angle) { //Text rotated around its origin $this->Rotate($angle,$x,$y); $this->Text($x,$y,$txt); $this->Rotate(0); } } $pdf=new PDF(); $pdf->AddPage(); $pdf->SetFont('Helvetica','',12); //foter page //$pdf->AliasNbPages(); //$pdf->SetFont('Helvetica','B',16); $pdf->headerTable(); $pdf->setData($billNo,$userId); $pdf->viewTable($RDSAPP); $pdf->grandAmount(); $pdf->Terms(); ob_clean(); // Clean any previous output header('Content-Type: application/pdf'); header('Content-Disposition: inline; filename="bill.pdf"'); header('Cache-Control: private, max-age=0, must-revalidate'); header('Pragma: public'); $pdf->Output('bill.pdf', 'I'); ?>
Upload File
Create Folder