vb_book/app/Views/print_addresses_form.php
2024-12-17 12:25:14 +05:30

231 lines
8.7 KiB
PHP
Executable File

<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shipping Label Template</title>
<?php if($action == 2) { ?>
<style>
.aside-content{
border-bottom: 3px solid #ffffff;
}
.invoice {
width: 48%;
height: 273px;
margin-left: 2px;
float: left;
page-break-inside: avoid;
padding-right: 2px !important;
border: 4px solid #fff;
box-sizing: border-box;
}
.header {
text-align: center;
background:#fff!important;
}
.bill-details {
margin-bottom: 20px;
margin-top: 30px;
margin-left: 10px;
}
.customer-details {
margin-top: 20px;
}
.row {
clear: both;
}
.page-container {
width: 98%; /* Set the width of the A4 sheet */
margin: 2%; /* Add margin for spacing between A4 sheet and labels */
}
.business-logo {
max-width:175px;
height: auto;
width:100%;
}
</style>
</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 aside-content">';
}
?>
<div class="invoice">
<div class="bill-details">
<!-- <div style="margin-bottom:5px;">To:</div> -->
<?= $customerDetails[$i]['customer_name'] ?>
<?= $customerDetails[$i]['membership_id'] ?><br>
<?= $customerDetails[$i]['address_1'] ?>,<br>
<?php if (!empty($customerDetails[$i]['address_2'])) : ?>
<?= $customerDetails[$i]['address_2'] ?>,<br>
<?php endif; ?>
<?= $customerDetails[$i]['city'] ?>,
<?= $customerDetails[$i]['state_name'] ?>
<?= $customerDetails[$i]['postal_code'] ? " - ".$customerDetails[$i]['postal_code'] : ""?>
<?php if($customerDetails[$i]['email']) { ?><br>
<?php echo'Email : '.$customerDetails[$i]['email']; ?>
<?php } ?>
<?php if($customerDetails[$i]['mobile_no']) { ?><br>
<?php echo'Mobile : '.$customerDetails[$i]['mobile_no']; ?>
<?php } ?>
</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="<?= base_url('public/uploads/1111.png') ?>" alt="Business Logo" class="business-logo"/>
</div>
<div style="text-align:left;font-size:12px;">From<br/>
<?= $customerDetails[$i]['company_name']; ?><br>
<?php if (isset($customerDetails[$i]['company_address'])) : ?>
<?= $customerDetails[$i]['company_address']; ?><br>
<?php else : ?>
Company Address Not Available<br>
<?php endif; ?>
<?php if (isset($customerDetails[$i]['company_city'])) : ?>
<?= $customerDetails[$i]['company_city']; ?> -
<?php else : ?>
City Not Available -
<?php endif; ?>
<?php if (isset($customerDetails[$i]['company_postal_code'])) : ?>
<?= $customerDetails[$i]['company_postal_code']; ?><br>
<?php else : ?>
Postal Code Not Available<br>
<?php endif; ?>
<?= 'Mobile : ' . $customerDetails[$i]['company_mobile_no']; ?></div>
</div>
</div>
<?php
if (($i + 1) % $labelsPerRow == 0 || ($i + 1) == $customerCount) {
echo '</div>';
}
endfor; ?>
</div>
</body>
<?php } ?>
<?php if($action == 1) { ?>
<style>
body{
font-family:Helvetica!important;
line-height:24px;
color:#000!important;
}
.invoice {
width: 4in;
/* height: 6in; */
margin: 20px auto;
border: 1px solid #fff;
padding:15px;
box-sizing: border-box;
}
.header {
text-align: center;
background:#fff!important;
}
.business-logo {
max-width:175px;
height: auto;
width:100%;
}
.bill-details {
margin-bottom: 20px;
font-size:12px;
}
.customer-details {
margin-top: 20px;
}
.row {
clear: both;
}
</style>
</head>
<body>
<div class="page-container">
<?php
// Assuming $customerDetails is an array of customer details
$customerCount = count($customerDetails);
for ($i = 0; $i < $customerCount; $i++) :
?>
<div class="invoice">
<div class="bill-details">
<!-- <div style="margin-bottom:5px;">To:</div> -->
<?= $customerDetails[$i]['customer_name'] ?><br>
<?= $customerDetails[$i]['address_1'] ?>,
<?php if (!empty($customerDetails[$i]['address_2'])) : ?>
<?= $customerDetails[$i]['address_2'] ?>,
<?php endif; ?><br>
<?= $customerDetails[$i]['city'] ?>,
<?= $customerDetails[$i]['state_name'] ?>
<?= $customerDetails[$i]['postal_code'] ? "-".$customerDetails[$i]['postal_code'] : ""?>
<?php if($customerDetails[$i]['email']) { ?><br>
<?php echo'Email : '.$customerDetails[$i]['email']; ?>
<?php } ?>
<?php if($customerDetails[$i]['mobile_no']) { ?><br>
<?php echo'Mobile : '.$customerDetails[$i]['mobile_no']; ?>
<?php } ?>
</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="<?= base_url('public/uploads/vijayabharathampdf.png') ?>" alt="Business Logo" class="business-logo"/></div> -->
<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]['company_name']; ?><br>
<?php if (isset($customerDetails[$i]['company_address'])) : ?>
<?= $customerDetails[$i]['company_address']; ?><br>
<?php else : ?>
Company Address Not Available<br>
<?php endif; ?>
<?php if (isset($customerDetails[$i]['company_city'])) : ?>
<?= $customerDetails[$i]['company_city']; ?> -
<?php else : ?>
City Not Available -
<?php endif; ?>
<?php if (isset($customerDetails[$i]['company_postal_code'])) : ?>
<?= $customerDetails[$i]['company_postal_code']; ?><br>
<?php else : ?>
Postal Code Not Available<br>
<?php endif; ?>
<?= 'Mobile : ' . $customerDetails[$i]['company_mobile_no']; ?>
</div>
</div>
</div>
<?php endfor; ?>
</div>
</body>
<?php } ?>
</html>