Merge code

This commit is contained in:
VE10-Sanjeev 2023-12-01 14:53:47 +05:30
commit 097faaa6cd
2 changed files with 52 additions and 57 deletions

View File

@ -141,13 +141,13 @@ public function download_details()
$configA4 = [
'mode' => 'utf-8',
'format' => 'A4',
'format' => [101.6 * 2, 152.4 * 4], // 2x4 inches for each label
'default_font_size' => 12,
'default_font' => 'Arial',
'margin_left' => 10, // Adjusted margin for better fit
'margin_right' => 10, // Adjusted margin for better fit
'margin_top' => 10, // Adjusted margin for better fit
'margin_bottom' => 10, // Adjusted margin for better fit
'margin_left' => 0,
'margin_right' => 0,
'margin_top' => 0,
'margin_bottom' => 0,
'margin_header' => 0,
'margin_footer' => 0,
'orientation' => 'P', // Portrait
@ -167,8 +167,9 @@ public function download_details()
}
if (!empty($customerDetails)) {
$html = view('print_addresses_form', ['customerDetails' => $customerDetails , 'action' => $action ]);
$html = view('print_addresses_form', ['customerDetails' => $customerDetails , 'action' => $action , 'pdf' => $pdf]);
// Add the current scheme's details to the PDF
// echo $html;die;
// $pdf->AddPage();
$pdf->WriteHTML($html);
// Set the PDF filename

View File

@ -6,20 +6,17 @@
<?php if($action == 2) { ?>
<style>
.aside-content{
border-bottom: 3px solid #ffffff;
}
.invoice {
width: 48%; /* Set the width of each label */
width: 48%;
height: 150px;
/* height: 300px; Set the height of each label */
/* box-sizing: border-box; */
border: 1px solid #000;
/* margin: 1%; Add margin for spacing between labels */
margin-left: 2px;
float: left;
page-break-inside: avoid;
padding-left : 5px;
/* margin: 20px auto; */
/* border: 1px solid #000; */
border: 1px solid #FFFF00
/* padding:10px; */
padding-right: 2px !important;
border: 2px solid #FFFF00;
box-sizing: border-box;
}
.header {
@ -53,47 +50,44 @@
</head>
<body>
<div class="page-container">
<?php
// Assuming $customerDetails is an array of customer details
$customerCount = count($customerDetails);
$labelsPerRow = 2;
for ($i = 0; $i < $customerCount; $i++) :
if ($i % $labelsPerRow == 0) {
echo '<div class="row">';
}
?>
<div class="invoice">
<div class="page-container">
<?php
// Assuming $customerDetails is an array of customer details
$customerCount = count($customerDetails);
$labelsPerRow = 2;
for ($i = 0; $i < $customerCount; $i++) :
if ($i % $labelsPerRow == 0) {
echo '<div class="row aside-content">';
}
?>
<div class="invoice">
<div class="bill-details">
<!-- <div style="margin-bottom:5px;">To:</div> -->
<?= $customerDetails[$i]['customer_name'] ?>
<?= $customerDetails[$i]['address_1'] ?>,
<?= $customerDetails[$i]['address_2'] ?>,
<?= $customerDetails[$i]['city'] ?>,
<?= $customerDetails[$i]['state'] ?> -
<?= $customerDetails[$i]['postal_code'] ?>
<?php if($customerDetails[$i]['mobile_no'])
{
echo'Mobile : '.$customerDetails[$i]['mobile_no'];
} ?>
</div>
<div class="bill-details">
<!-- <div style="margin-bottom:5px;">To:</div> -->
<?= $customerDetails[$i]['customer_name'] ?>
<?= $customerDetails[$i]['address_1'] ?>,
<?= $customerDetails[$i]['address_2'] ?>,
<?= $customerDetails[$i]['city'] ?>,
<?= $customerDetails[$i]['state'] ?> -
<?= $customerDetails[$i]['postal_code'] ?>
<?php if($customerDetails[$i]['mobile_no'])
{
echo'Mobile : '.$customerDetails[$i]['mobile_no'];
} ?>
</div>
<div class="header">
<!-- <img src="https://vijayabharathambooks.com/wp-content/uploads/2021/09/vijaya-bharatham-logo-8pt.png" alt="Business Logo" class="business-logo"><br> -->
<div style="float:left; width:80px;margin-right:10px;"><img src="https://vbp.venbait.in/wp-content/uploads/2023/05/1111.png" alt="Business Logo" class="business-logo"/></div>
<div style="text-align:left;font-size:12px;">From<br/>
<?= $customerDetails[$i]['address'] ?>
<?= $customerDetails[$i]['city'] ?> - <?= $customerDetails[$i]['postal_code'] ?></div>
</div>
</div>
<?php
if (($i + 1) % $labelsPerRow == 0 || ($i + 1) == $customerCount) {
echo '</div>';
}
endfor; ?>
<div class="header">
<!-- <img src="https://vijayabharathambooks.com/wp-content/uploads/2021/09/vijaya-bharatham-logo-8pt.png" alt="Business Logo" class="business-logo"><br> -->
<div style="float:left; width:80px;margin-right:10px;"><img src="https://vbp.venbait.in/wp-content/uploads/2023/05/1111.png" alt="Business Logo" class="business-logo"/></div>
<div style="text-align:left;font-size:12px;">From<br/>
<?= $customerDetails[$i]['address'] ?>
<?= $customerDetails[$i]['city'] ?> - <?= $customerDetails[$i]['postal_code'] ?></div>
</div>
</div>
<?php
if (($i + 1) % $labelsPerRow == 0 || ($i + 1) == $customerCount) {
echo '</div>';
}
endfor; ?>
</div>
</body>
<?php } ?>
@ -108,7 +102,7 @@
width: 4in;
/* height: 6in; */
margin: 20px auto;
border: 1px solid #000;
border: 1px solid #FFFF00;
padding:15px;
box-sizing: border-box;
}