264 lines
6.4 KiB
PHP
264 lines
6.4 KiB
PHP
<?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%"><b>السعر</b></td>
|
|
<td class="mo_border" width="25%"><b>الإجمالي شامل الضريبة</b></td>
|
|
</tr>
|
|
|
|
<?php
|
|
$count = 1;
|
|
$bonds_details_id = $invoices_row['bd_id'];
|
|
$get_bonds_details_has_packages_sql = mysqli_query($db,
|
|
"SELECT
|
|
`packages`.`name`,
|
|
`packages`.`price`
|
|
|
|
FROM `bonds_details_has_packages`
|
|
LEFT JOIN `packages` ON `bonds_details_has_packages`.`packages_id` = `packages`.`id`
|
|
LEFT JOIN `bonds_details` ON `bonds_details`.`id` = `bonds_details_has_packages`.`bonds_details_id`
|
|
WHERE `bonds_details_has_packages`.`bonds_details_id` = $bonds_details_id
|
|
AND `bonds_details`.`id` IN (SELECT MAX(`id`) FROM `bonds_details` GROUP BY `bonds_details`.`bonds_id`)"
|
|
);
|
|
|
|
$total = 0;
|
|
while ($bonds_details_has_packages_row = mysqli_fetch_assoc($get_bonds_details_has_packages_sql)) {
|
|
?>
|
|
<tr>
|
|
<td class="mo_border"><?=$count?></td>
|
|
<td class="mo_border"><?=$bonds_details_has_packages_row['name']?></td>
|
|
<td class="mo_border"><?=round($bonds_details_has_packages_row['price'],2)?></td>
|
|
<?php
|
|
if (!empty($vat)) {
|
|
?>
|
|
<td class="mo_border"><?=round($bonds_details_has_packages_row['price'] + ($bonds_details_has_packages_row['price']*$vat/100),2)?></td>
|
|
<?php
|
|
}
|
|
?>
|
|
</tr>
|
|
<?php
|
|
$total += $bonds_details_has_packages_row['price'];
|
|
$count++;
|
|
}
|
|
?>
|
|
|
|
<tr>
|
|
<td class="mo_border"></td>
|
|
<td class="mo_border">الإجمالي</td>
|
|
<td class="mo_border"><?=round($total,2)?></td>
|
|
<?php
|
|
if (!empty($vat)) {
|
|
?>
|
|
<td class="mo_border"><?=round(($total) + (($total)*$vat/100),2)?></td>
|
|
<?php
|
|
}
|
|
?>
|
|
</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
|
|
}
|
|
?>
|