booking/work/files/print/bonds.php

217 lines
5.0 KiB
PHP
Executable File

<?php
$pack_id = $_GET['pack_id'];
if (!empty($pack_id)) {
$get_invoices_sql = mysqli_query($db,
"SELECT
`bonds_details`.`id` AS `bd_id`,
`tretment`.`name`,
`tretment`.`number`,
`bonds`.`id`,
`bonds`.`number_style`,
`branch`.`pu_name`,
`bonds`.`price`,
`bonds`.`date_time`,
`bonds_type`.`name` AS `title`,
`user`.`name` AS `user_name`
FROM `bonds`
LEFT JOIN `user` ON `bonds`.`user_id` = `user`.`id`
LEFT JOIN `bonds_type` ON `bonds_type`.`id` = `bonds`.`bonds_type_id`
LEFT JOIN `bonds_details` ON `bonds_details`.`bonds_id` = `bonds`.`id`
LEFT JOIN `branch` ON `bonds_details`.`branch_id` = `branch`.`id`
LEFT JOIN `tretment` ON `bonds`.`tretment_id` = `tretment`.`id`
WHERE `bonds`.`id` = $pack_id
AND `bonds_details`.`id` IN (SELECT MAX(`bonds_details`.`id`)
FROM `bonds_details`
GROUP BY `bonds_details`.`bonds_id`
)
");
$invoices_row = mysqli_fetch_assoc($get_invoices_sql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>طباعة سند</title>
<!-- Normalize or reset CSS with your favorite library -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/7.0.0/normalize.min.css">
<!-- Load paper.css for happy printing -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/paper-css/0.3.0/paper.css">
<!-- Custom styles for this document -->
<link href="https://fonts.googleapis.com/css?family=Tangerine:700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="assets/css/mo2_style.css">
<style>
body {
font-family: 'Cairo', sans-serif !important;
}
</style>
<style>
@page { size: A4 }
body { font-size: 21pt; font-weight: 700; }
.mo_border { border-bottom: #000 solid 1px; padding-bottom: 15px; margin-bottom:15px; }
/*
@media print{
div#display {
display: flex;
height: auto;
width: 100%;
align-items: center;
}
}
*/
</style>
</head>
<body onload="print_f()" class="A4" dir="rtl" style="margin: 0 320px;">
<section>
<article>
<table width="100%" border="0">
<tbody><tr>
<td colspan="4" height="25px" align="center">
</td>
</tr>
<tr>
<td><img src="<?=$campany_info['logo-sm']?>" style="margin-left: 25px;width: 100%;"></td>
<td colspan="3">
<div class="mo_border"><h3><?=$campany_info['company_name']?></h3></div>
<div class="mo_border"><b>الفرع</b> : <?=$invoices_row['pu_name']?></div>
<div class="mo_border"><b>الرقم الضريبي</b> : <?=$campany_info['vat_number']?></div>
<div class="mo_border" style="display: flex;justify-content: space-between;"><span><b>الموظف</b> : <?=$invoices_row['user_name']?></span></div>
</td>
</tr>
<tr>
<td colspan="4" height="25px" align="center">
</td>
</tr>
</tbody></table>
<div style="text-align: center;">
<h1>
<?=$invoices_row['title']?>
</h1>
</div>
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" height="25px" align="center">
</td>
</tr>
<tr>
<td class="mo_border"><b>رقم الفاتورة</b></td>
<td class="mo_border"><b>التاريخ</b></td>
<td class="mo_border"><b>الوقت</b></td>
<td class="mo_border"><b>العميل</b></td>
<td class="mo_border"><b>جوال العميل</b></td>
</tr>
<tr>
<td class="mo_border"><b><?=$invoices_row['number_style']?></b></td>
<td class="mo_border"><?=date('d-m-y', strtotime($invoices_row['date_time']))?></td>
<td class="mo_border"><?=date((date("H", strtotime($invoices_row['date_time'])) > 11) ? 'h:i \م' : 'h:i \ص', strtotime($invoices_row['date_time']))?></td>
<td class="mo_border"><?=$invoices_row['name']?></td>
<td class="mo_border">0<?=$invoices_row['number']?></td>
</tr>
</tbody>
</table>
<table width="100%" border="0">
<tbody>
<tr>
<td colspan="4" height="25px" align="center">
</td>
</tr>
<tr>
<td class="mo_border" width="9%"><b>م</b></td>
<td class="mo_border" width="35%"><b>النوع</b></td>
<td class="mo_border" width="25%" colspan="2"><b>المبلغ</b></td>
</tr>
<tr>
<td class="mo_border">1</td>
<td class="mo_border">استلام</td>
<td class="mo_border" colspan="2"><?=round($invoices_row['price'],2)?></td>
</tr>
<tr>
<td colspan="4" height="75px" align="center">
</td>
</tr>
<tr>
<td colspan="4" align="center" height="35px">
<br>
--- Check Closed ---
</td>
</tr>
<tr>
<td colspan="4" align="center">
<h3>شكراً لزيارتكم</h3>
<h3></h3>
</td>
</tr>
<tr>
<td colspan="4" height="75px" align="center">
</td>
</tr>
<tr>
<td colspan="4" align="center">
<?=$campany_info['link']?>
</td>
</tr>
<tr>
<td style="direction: ltr;" colspan="4" height="35px" align="center">
<?= date('d-m-Y h:i A', strtotime($date_time));?>
</td>
</tr>
</tbody>
</table>
</article>
</section>
<script type="text/javascript">
window.onafterprint = function(e){
closePrintView();
};
function print_f(){
window.print();
}
function closePrintView() {
window.close();
}
</script>
</body>
</html>
<?php
}
?>