199 lines
6.5 KiB
PHP
199 lines
6.5 KiB
PHP
|
|
|
|
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>A simple, clean, and responsive HTML invoice template</title>
|
|
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
|
|
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
|
|
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
|
|
|
|
|
|
|
|
|
|
|
|
<style>
|
|
table{
|
|
width:100%;
|
|
}
|
|
.first{
|
|
width: 30%;
|
|
|
|
|
|
}
|
|
.invoice-box {
|
|
max-width: 800px;
|
|
margin: auto;
|
|
padding: 30px;
|
|
border: 1px solid black;
|
|
box-shadow: 0 0 10px rgba(0, 0, 0, .15);
|
|
font-size: 16px;
|
|
line-height: 24px;
|
|
font-family: 'Helvetica Neue', 'Helvetica', Helvetica, Arial, sans-serif;
|
|
color: #555;
|
|
background-color: white;
|
|
}
|
|
|
|
|
|
.donation {
|
|
font-size: 30px;
|
|
}
|
|
.date{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 20%;
|
|
}
|
|
.receiptno{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 12%;
|
|
}
|
|
.donatedby{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 75%;
|
|
}
|
|
.address{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 72%;
|
|
}
|
|
.city{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 31%;
|
|
}
|
|
.state{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 26%;
|
|
}
|
|
.pincode{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 13%;
|
|
}
|
|
.amt{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 50%;
|
|
}
|
|
.amtinword{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 74%;
|
|
}
|
|
.cause{
|
|
background: transparent;
|
|
border: none;
|
|
border-bottom: 1px solid #000000;
|
|
width: 61%;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="invoice-box">
|
|
<table>
|
|
<tr>
|
|
<td class="first">
|
|
</br>
|
|
<center> <img src="<?= base_url() ?>/public/assets/receipt/donation.png" width="100" height="100"></center> </br>
|
|
|
|
<center> <h3><?= $admindata['org_name'] ?></h3></center>
|
|
<center> <?= $admindata['address'] ?>,<?= $admindata['city'] ?>,</center>
|
|
<center> <?= $admindata['state'] ?>-<?= $admindata['pin_code'] ?>.</center>
|
|
<center class="mailfont"> Email :<?= $admindata['email'] ?></center>
|
|
<center class="mailfont"> GSTIN :<?= $admindata['gstin'] ?></center>
|
|
</td>
|
|
|
|
<td class="secend">
|
|
<center> <h2>Donation Receipt</h2></center></br>
|
|
Date : <input type="text" class="date" value="<?= $receipt['date'] ?>" readonly>
|
|
|
|
|
|
Receipt No : <input type="text" class="receiptno" value=" <?= $receipt['receipt_id'] ?>" readonly> </br></br>
|
|
Donated by : <input type="text" class="donatedby" value=" <?= $donordata['name'] ?>" readonly></br>
|
|
Street Address : <input type="text" class="address" value=" <?= $donordata['address'] ?>" readonly> </br>
|
|
City :
|
|
<input type="text" class="city" value="<?= $donordata['city'] ?>" readonly>
|
|
State : <input type="text" class="state" value="<?= $donordata['state'] ?>" readonly>
|
|
Pin : <input type="text" class="pincode" value="<?= $donordata['pin_code'] ?>" readonly></br>
|
|
Amount Received By Charity :
|
|
<input type="text" class="amt" value=" <?= $receipt['amount'] ?>" readonly></br>
|
|
|
|
Amount in Words :
|
|
<!-- call the function here -->
|
|
<?php
|
|
|
|
$number = $receipt['amount'];
|
|
$no = floor($number);
|
|
$point = round($number - $no, 2) * 100;
|
|
$hundred = null;
|
|
$digits_1 = strlen($no);
|
|
$i = 0;
|
|
$str = array();
|
|
$words = array('0' => '', '1' => 'one', '2' => 'two',
|
|
'3' => 'three', '4' => 'four', '5' => 'five', '6' => 'six',
|
|
'7' => 'seven', '8' => 'eight', '9' => 'nine',
|
|
'10' => 'ten', '11' => 'eleven', '12' => 'twelve',
|
|
'13' => 'thirteen', '14' => 'fourteen',
|
|
'15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen',
|
|
'18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty',
|
|
'30' => 'thirty', '40' => 'forty', '50' => 'fifty',
|
|
'60' => 'sixty', '70' => 'seventy',
|
|
'80' => 'eighty', '90' => 'ninety');
|
|
$digits = array('', 'hundred', 'thousand', 'lakh', 'crore');
|
|
while ($i < $digits_1) {
|
|
$divider = ($i == 2) ? 10 : 100;
|
|
$number = floor($no % $divider);
|
|
$no = floor($no / $divider);
|
|
$i += ($divider == 10) ? 1 : 2;
|
|
if ($number) {
|
|
$plural = (($counter = count($str)) && $number > 9) ? 's' : null;
|
|
$hundred = ($counter == 1 && $str[0]) ? ' and ' : null;
|
|
$str [] = ($number < 21) ? $words[$number] .
|
|
" " . $digits[$counter] . $plural . " " . $hundred
|
|
:
|
|
$words[floor($number / 10) * 10]
|
|
. " " . $words[$number % 10] . " "
|
|
. $digits[$counter] . $plural . " " . $hundred;
|
|
} else $str[] = null;
|
|
}
|
|
$str = array_reverse($str);
|
|
$result = implode('', $str);
|
|
$points = ($point) ?
|
|
"." . $words[$point / 10] . " " .
|
|
$words[$point = $point % 10] : '';
|
|
$get_amount = $result . "Rupees " . $points;
|
|
?>
|
|
<input type="text" class="amtinword" value="<?= $get_amount ?>" readonly> </br>
|
|
Discription of Donation :
|
|
<input type="text" class="cause" value="<?= $causedata['cause_name']; ?>" readonly></br></br>
|
|
|
|
|
|
|
|
|
|
|
|
Authorized Signature : <img src="<?=base_url()?>/<?=$admindata['signature']?>" width="170" height="36">
|
|
</br></br>
|
|
<center class="mailfont">"Thank You For Your Donation"</center>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
|