booking/work/files/reports/custom_reports/عرض الشتاء.php

234 lines
11 KiB
PHP
Executable File

<?php
require_once('fixed/config/go_con.php');
$branch_id = $_GET['b'];
if (!empty($_GET['b'])) {
$branch_id = $_GET['b'];
if (!is_numeric($branch_id)) {
$branch_id = 1;
}
} else {
$branch_id = 1;
}
$branch_sql = '=' . $branch_id;
if ($branch_id == 1) {
$branch_sql = '<>' . $branch_id;
}
?>
<!DOCTYPE html>
<html lang="en" dir="rtl">
<?php require_once('fixed/head/go.php'); ?>
<body class="rtl">
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@mdi/font@6.5.95/css/materialdesignicons.min.css">
<style>
a.active {
background-color: #e6edef;
}
h1 {
background: #24695c;
padding-right: 10px;
color: white;
margin-left: 10px;
font-weight: bold;
}
</style>
<?php require_once('fixed/loader/go.php'); ?>
<div class="page-wrapper" id="pageWrapper">
<?php require_once('fixed/header/go.php'); ?>
<div class="page-body-wrapper">
<?php require_once('fixed/sidebar/go.php'); ?>
<div class="page-body">
<div class="container-fluid">
<div class="email-wrap bookmark-wrap">
<div class="row">
<div class="col-12 col-sm-12 col-md-12 col-lg-10 col-xl-10">
<div class="card">
<div class="tab-content" id="profile-tabContent">
<div class="tab-pane fade show active" id="all">
<div class="card-body new-user order-list text-center">
<div class="row">
<div class="col-12 col-sm-12 col-md-3 col-lg-4 col-xl-4">
</div>
<div class="page-title mb-3 col-12 col-sm-12 col-md-6 col-lg-4 col-xl-4">
<i class="mdi mdi-monitor mr-2">
</i>
<h4>
عرض الشتاء 50%
<br />
</h4>
</div>
<div class="col-12 col-sm-12 col-md-3 col-lg-4 col-xl-4">
</div>
</div>
<div class="row">
<div class="col-12 col-sm-12 col-md-2 col-lg-3 col-xl-3">
</div>
<div class="col-2 col-sm-2 col-md-1 col-lg-1 col-xl-1">
<a class="btn btn-danger btn-round waves-effect waves-light col-12"
href="custom_report?s=20&date=<?= $Previous ?>&b=<?= $branch_id ?>"
style="padding: 0.375rem 0.75rem;">-</a>
</div>
<div class="col-8 col-sm-8 col-md-6 col-lg-4 col-xl-4">
<input id="Select-date" class="form-control" type="date" value=""
style="text-align: center !important;">
</div>
<div class="col-2 col-sm-2 col-md-1 col-lg-1 col-xl-1">
<a class="btn btn-primary btn-round waves-effect waves-light col-12"
href="custom_report?s=20&date=<?= $Next ?>&b=<?= $branch_id ?>"
style="padding: 0.375rem 0.75rem;">+</a>
</div>
<div class="col-12 col-sm-12 col-md-2 col-lg-3 col-xl-3">
</div>
</div>
</div>
<div class="tab-content">
<div class="tab-pane p-3 active" id="tab<?= $tabs ?>" role="tabpanel">
<div class="card-body new-user order-list">
<div class="table-responsive">
<table class="table table-bordered text-center" style="vertical-align: middle;">
<thead class="table-primary" style="vertical-align: middle;">
<tr>
<th scope="col">#</th>
<th scope="col">رقم الفاتورة</th>
<th scope="col">السعر</th>
<th scope="col">اسم العميل</th>
<th scope="col">رقم العميل</th>
</tr>
</thead>
<tbody>
<?php
$total = 0;
$get_book_details_sql = mysqli_query(
$db,
"SELECT
`invoices`.`number_style`,
`invoices`.`price`,
`tretment`.`name`,
`tretment`.`number`
FROM `invoices_discount_details_has_db_tables`
INNER JOIN `invoices_discount_details` ON `invoices_discount_details_has_db_tables`.`invoices_discount_details_id` = `invoices_discount_details`.`id`
INNER JOIN `invoices_discount` ON `invoices_discount`.`id` = `invoices_discount_details`.`invoices_discount_id`
INNER JOIN `invoices_details` ON `invoices_details`.`id` = `invoices_discount`.`invoices_details_id`
INNER JOIN `invoices` ON `invoices_details`.`invoices_id` = `invoices`.`id`
INNER JOIN `invoices_has_book` ON `invoices_has_book`.`invoices_id` = `invoices_details`.`invoices_id`
INNER JOIN `book` ON `invoices_has_book`.`book_id` = `book`.`id`
INNER JOIN `tretment` ON `book`.`tretment_id` = `tretment`.`id`
WHERE `invoices_discount_details_has_db_tables`.`db_tables_id` = 8 AND `invoices_discount_details_has_db_tables`.`db_tables_id_to_id` = 25
AND `invoices_details`.`branch_id` $branch_sql
GROUP BY `invoices_details`.`invoices_id`
"
);
$count = 1;
while ($get_book_details = mysqli_fetch_assoc($get_book_details_sql)) {
?>
<tr>
<th scope="row">
<?= $count ?>
</th>
<td>
<?= $get_book_details['number_style'] ?>
</td>
<td>
<?= $get_book_details['price'] ?>
</td>
<td>
<?= $get_book_details['name'] ?>
</td>
<td>
<?= $get_book_details['number'] ?>
</td>
</tr>
<?php
$count++;
}
?>
</tbody>
</table>
</div>
<hr>
<h3>السندات</h3>
<div class="table-responsive">
<table class="table table-bordered text-center" style="vertical-align: middle;">
<thead class="table-primary" style="vertical-align: middle;">
<tr>
<th scope="col">#</th>
<th scope="col">رقم السند</th>
<th scope="col">السعر</th>
<th scope="col">اسم العميل</th>
<th scope="col">رقم العميل</th>
</tr>
</thead>
<tbody>
<?php
$total = 0;
$get_book_details_sql = mysqli_query(
$db,
"SELECT
`bonds`.`number_style`,
`bonds`.`price`,
`tretment`.`name`,
`tretment`.`number`
FROM `bonds`
INNER JOIN `tretment` ON `bonds`.`tretment_id` = `tretment`.`id`
WHERE `bonds`.`notes` LIKE '%winter%'
GROUP BY `bonds`.`id`
"
);
$count = 1;
while ($get_book_details = mysqli_fetch_assoc($get_book_details_sql)) {
?>
<tr>
<th scope="row">
<?= $count ?>
</th>
<td>
<?= $get_book_details['number_style'] ?>
</td>
<td>
<?= $get_book_details['price'] ?>
</td>
<td>
<?= $get_book_details['name'] ?>
</td>
<td>
<?= $get_book_details['number'] ?>
</td>
</tr>
<?php
$count++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php require_once('fixed/footer/go.php'); ?>
</div>
</div>
<?php require_once('fixed/js/go.php'); ?>
<?php require_once('fixed/waiting_ajax/go.php'); ?>
<script>
$("#Select-date").change(function () {
var SelectedDate = $(this).val();
window.location = 'custom_report?s=20&b=<?= $branch_id ?>&date=' + SelectedDate
});
</script>
</body>
</html>