908 lines
65 KiB
PHP
Executable File
908 lines
65 KiB
PHP
Executable File
<?php
|
|
require_once('fixed/config/go_con.php');
|
|
access(30);
|
|
|
|
$today = date("Y-m-d");
|
|
if (!empty($_GET['d'])) {
|
|
$today = $_GET['d'];
|
|
if (DateTime::createFromFormat('Y-m-d', $today) == false) {
|
|
$today = date("Y-m-d");
|
|
}
|
|
}
|
|
|
|
$user_id = $_GET['u'];
|
|
if (!empty($user_id)) {
|
|
if (!is_numeric($user_id)) {
|
|
echo "<script>alert('حدث خطا')</script>";
|
|
}
|
|
} else {
|
|
echo "<script>alert('حدث خطا')</script>";
|
|
}
|
|
|
|
|
|
$Next = date('Y-m-d', strtotime('+1 day', strtotime($today)));
|
|
$Previous = date('Y-m-d', strtotime('-1 day', strtotime($today)));
|
|
$Day = date('D', strtotime($today));
|
|
|
|
|
|
function Day_ar()
|
|
{
|
|
global $Day;
|
|
$find = array("Sat", "Sun", "Mon", "Tue", "Wed", "Thu", "Fri");
|
|
$replace = array("السبت", "الأحد", "الإثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة");
|
|
$ar_day_format = $Day;
|
|
$Day_ar = str_replace($find, $replace, $ar_day_format);
|
|
|
|
return $Day_ar;
|
|
}
|
|
|
|
function Today_ar()
|
|
{
|
|
global $today;
|
|
$Today_ar = date('d-m-Y', strtotime($today));
|
|
return $Today_ar;
|
|
}
|
|
|
|
$error = 0;
|
|
$data = array();
|
|
|
|
$get_invoices_sql = mysqli_query($db,
|
|
"SELECT
|
|
`user`.`name`,
|
|
`branch`.`branch_name`
|
|
FROM `user`
|
|
INNER JOIN `emplyee` ON `user`.`emplyee_id` = `emplyee`.`id`
|
|
INNER JOIN `branch` ON `emplyee`.`branch_id` = `branch`.`id`
|
|
WHERE `user`.`id` = $user_id
|
|
");
|
|
while ($get_invoices = mysqli_fetch_assoc($get_invoices_sql)) {
|
|
$data['info']['name'] = $get_invoices['name'];
|
|
$data['info']['branch'] = $get_invoices['branch_name'];
|
|
}
|
|
|
|
$get_invoices_sql = mysqli_query($db,
|
|
"SELECT
|
|
`branch`.`id`,
|
|
`branch`.`branch_name`
|
|
FROM `branch` WHERE `branch`.`id` <> 1
|
|
");
|
|
while ($get_invoices = mysqli_fetch_assoc($get_invoices_sql)) {
|
|
$data['branchs'][$get_invoices['id']] = array(
|
|
'branch_name' => $get_invoices['branch_name'],
|
|
'inv_d' => array(),
|
|
'bond_d' => array(),
|
|
'back_d' => array(),
|
|
'bond_back_d' => array(),
|
|
);
|
|
}
|
|
|
|
foreach ($data['branchs'] as $key => $value) {
|
|
$get_invoices_sql = mysqli_query($db,
|
|
"SELECT
|
|
`invoices`.`number_style`, `invoices_details_has_how_pay`.`pay`, `invoices_details_has_how_pay`.`how_pay_id`,`invoices_details`.`invoices_status_id`
|
|
FROM `invoices_details_has_how_pay`
|
|
INNER JOIN `invoices_details` ON `invoices_details_has_how_pay`.`invoices_details_id` = `invoices_details`.`id`
|
|
INNER JOIN `invoices` ON `invoices_details`.`invoices_id` = `invoices`.`id`
|
|
WHERE `invoices_details_has_how_pay`.`user_id` = $user_id
|
|
AND ((`invoices_details_has_how_pay`.`date_time` LIKE '$today%' AND `invoices_details_has_how_pay`.`date_time` >= '$today 03:00:00') OR (`invoices_details_has_how_pay`.`date_time` LIKE '$Next%' AND `invoices_details_has_how_pay`.`date_time` < '$Next 03:00:00'))
|
|
AND `invoices_details`.`branch_id` = $key
|
|
");
|
|
if (mysqli_num_rows($get_invoices_sql) > 0) {
|
|
while ($get_invoices = mysqli_fetch_assoc($get_invoices_sql)) {
|
|
switch ($get_invoices['invoices_status_id']) {
|
|
case '1':
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data['branchs'][$key]['inv_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data['branchs'][$key]['inv_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
case '3': case '4':
|
|
$data['branchs'][$key]['inv_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] += $get_invoices['pay'];
|
|
break;
|
|
case '6': case '7': case '8': case '9':
|
|
$data['branchs'][$key]['inv_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
case '2':
|
|
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data['branchs'][$key]['inv_cre'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data['branchs'][$key]['inv_cre'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
case '3': case '4':
|
|
$data['branchs'][$key]['inv_cre'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] += $get_invoices['pay'];
|
|
break;
|
|
case '6': case '7': case '8': case '9':
|
|
$data['branchs'][$key]['inv_cre'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
case '3':
|
|
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data['branchs'][$key]['back_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] -= $get_invoices['pay'];
|
|
$data['totals']['revenue'] -= $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data['branchs'][$key]['back_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] -= $get_invoices['pay'];
|
|
$data['totals']['revenue'] -= $get_invoices['pay'];
|
|
break;
|
|
case '3': case '4':
|
|
$data['branchs'][$key]['back_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] -= $get_invoices['pay'];
|
|
break;
|
|
case '5':
|
|
$data['branchs'][$key]['back_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['inv_total'] -= $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
$get_invoices_sql = mysqli_query($db,
|
|
"SELECT
|
|
`bonds`.`number_style`, `bonds_details_has_how_pay`.`pay`, `bonds_details_has_how_pay`.`how_pay_id`, `bonds_details`.`bonds_status_id`
|
|
FROM `bonds_details_has_how_pay`
|
|
INNER JOIN `bonds_details` ON `bonds_details_has_how_pay`.`bonds_details_id` = `bonds_details`.`id`
|
|
INNER JOIN `bonds` ON `bonds_details`.`bonds_id` = `bonds`.`id`
|
|
WHERE `bonds_details_has_how_pay`.`user_id` = $user_id
|
|
AND ((`bonds_details_has_how_pay`.`date_time` LIKE '$today%' AND `bonds_details_has_how_pay`.`date_time` >= '$today 03:00:00') OR (`bonds_details_has_how_pay`.`date_time` LIKE '$Next%' AND `bonds_details_has_how_pay`.`date_time` < '$Next 03:00:00'))
|
|
AND `bonds_details`.`branch_id` = $key
|
|
");
|
|
if (mysqli_num_rows($get_invoices_sql) > 0) {
|
|
while ($get_invoices = mysqli_fetch_assoc($get_invoices_sql)) {
|
|
switch ($get_invoices['bonds_status_id']) {
|
|
case '1':
|
|
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data['branchs'][$key]['bond_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data['branchs'][$key]['bond_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
case '3': case '4':
|
|
$data['branchs'][$key]['bond_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] += $get_invoices['pay'];
|
|
break;
|
|
case '6': case '7': case '8': case '9':
|
|
$data['branchs'][$key]['bond_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
case '2':
|
|
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data['branchs'][$key]['bond_cre'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data['branchs'][$key]['bond_cre'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
case '3': case '4':
|
|
$data['branchs'][$key]['bond_cre'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] += $get_invoices['pay'];
|
|
break;
|
|
case '6': case '7': case '8': case '9':
|
|
$data['branchs'][$key]['bond_cre'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] += $get_invoices['pay'];
|
|
$data['totals']['revenue'] += $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
case '3':
|
|
|
|
switch ($get_invoices['how_pay_id']) {
|
|
case '1':
|
|
$data['branchs'][$key]['bond_back_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] -= $get_invoices['pay'];
|
|
$data['totals']['revenue'] -= $get_invoices['pay'];
|
|
break;
|
|
case '2':
|
|
$data['branchs'][$key]['bond_back_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] -= $get_invoices['pay'];
|
|
$data['totals']['revenue'] -= $get_invoices['pay'];
|
|
break;
|
|
case '3': case '4':
|
|
$data['branchs'][$key]['bond_back_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] -= $get_invoices['pay'];
|
|
break;
|
|
case '5':
|
|
$data['branchs'][$key]['bond_back_d'][$get_invoices['number_style']]['payments'][$get_invoices['how_pay_id']] = $get_invoices['pay'];
|
|
$data['totals']['bond_total'] -= $get_invoices['pay'];
|
|
break;
|
|
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
break;
|
|
|
|
default:
|
|
$error++;
|
|
break;
|
|
}
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en" dir="rtl">
|
|
<?php require_once('fixed/head/go.php'); ?>
|
|
<body class="rtl">
|
|
<style>
|
|
thead {
|
|
vertical-align: middle !important;
|
|
}
|
|
tr {
|
|
border-color: #bfbbbb !important;
|
|
}
|
|
.table-bordered td, .table-bordered th {
|
|
border-color: #bfbbbb !important;
|
|
}
|
|
</style>
|
|
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@mdi/font@6.5.95/css/materialdesignicons.min.css">
|
|
<?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="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<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>
|
|
إيرادات يوم
|
|
<?= Day_ar() ?>
|
|
<br />
|
|
<?= Today_ar() ?>
|
|
</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="daily_user_d?d=<?= $Previous ?>&u=<?= $user_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="daily_user_d?d=<?= $Next ?>&u=<?= $user_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="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">
|
|
<tr>
|
|
<th colspan="10" scope="col">معلومات الموظف</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" colspan="2">رقم الموظف</th>
|
|
<th scope="col" colspan="2">الاسم</th>
|
|
<th scope="col">الفرع الاساسي</th>
|
|
<th scope="col">الفواتير</th>
|
|
<th scope="col" colspan="2">أرصدة دائنة - عملاء</th>
|
|
<th scope="col" colspan="2">إجمالي المتحصلات</th>
|
|
</tr>
|
|
<tr style="background-color:#ffffff;">
|
|
<td colspan="2"></td>
|
|
<td colspan="2"><?=$data['info']['name']?></td>
|
|
<td><?=$data['info']['branch']?></td>
|
|
<td><?=!empty($data['totals']['inv_total'])? $data['totals']['inv_total']: 0?></td>
|
|
<td colspan="2"><?=!empty($data['totals']['bond_total'])? $data['totals']['bond_total']: 0?></td>
|
|
<td colspan="2"><?=!empty($data['totals']['revenue'])? $data['totals']['revenue']: 0?></td>
|
|
</tr>
|
|
<tr style="background-color:#000;">
|
|
<td colspan="10"></td>
|
|
</tr>
|
|
</thead>
|
|
<?php
|
|
foreach ($data['branchs'] as $key => $value) {
|
|
if(!empty($data['branchs'][$key]['inv_d']) || !empty($data['branchs'][$key]['bond_d'])
|
|
|| !empty($data['branchs'][$key]['inv_cre']) || !empty($data['branchs'][$key]['bond_cre'])
|
|
|| !empty($data['branchs'][$key]['back_d']) || !empty($data['branchs'][$key]['bond_back_d'])) {
|
|
?>
|
|
<thead class="table-primary">
|
|
<tr>
|
|
<th scope="col" colspan="10" style="background:rgb(105 36 36 / 19%) !important"><?=$data['branchs'][$key]['branch_name']?></th>
|
|
</tr>
|
|
<?php
|
|
if(!empty($data['branchs'][$key]['inv_d'])) {
|
|
?>
|
|
<tr>
|
|
<th scope="col" colspan="2">الفواتير</th>
|
|
<th style="background-color:#000;" scope="col" colspan="8"></th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="3">رقم الفاتورة</th>
|
|
<th scope="col" colspan="9">الصادر</th>
|
|
<th scope="col" rowspan="3">الاجمالي</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="2">كاش</th>
|
|
<th scope="col" rowspan="2">شبكة</th>
|
|
<th scope="col" colspan="5">تحويل</th>
|
|
<th scope="col" rowspan="2">رصيد</th>
|
|
<th scope="col" rowspan="2">اخرى</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col">ساب 56001</th>
|
|
<th scope="col">الراجحي 66443</th>
|
|
<th scope="col">الاهلي 00100</th>
|
|
<th scope="col">الانماء 06000</th>
|
|
<th scope="col">سداد اونلاين</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$t1 = 0;
|
|
$t2 = 0;
|
|
$t3 = 0;
|
|
$t4 = 0;
|
|
$t5 = 0;
|
|
$t6 = 0;
|
|
$t7 = 0;
|
|
$t8 = 0;
|
|
$t9 = 0;
|
|
foreach ($data['branchs'][$key]['inv_d'] as $key2 => $value2) {
|
|
$temp_1 = !empty($data['branchs'][$key]['inv_d'][$key2]['payments'][1])? $data['branchs'][$key]['inv_d'][$key2]['payments'][1]: 0;
|
|
$temp_2 = !empty($data['branchs'][$key]['inv_d'][$key2]['payments'][2])? $data['branchs'][$key]['inv_d'][$key2]['payments'][2]: 0;
|
|
$temp_3 = !empty($data['branchs'][$key]['inv_d'][$key2]['payments'][6])? $data['branchs'][$key]['inv_d'][$key2]['payments'][6]: 0;
|
|
$temp_4 = !empty($data['branchs'][$key]['inv_d'][$key2]['payments'][7])? $data['branchs'][$key]['inv_d'][$key2]['payments'][7]: 0;
|
|
$temp_5 = !empty($data['branchs'][$key]['inv_d'][$key2]['payments'][8])? $data['branchs'][$key]['inv_d'][$key2]['payments'][8]: 0;
|
|
$temp_6 = !empty($data['branchs'][$key]['inv_d'][$key2]['payments'][9])? $data['branchs'][$key]['inv_d'][$key2]['payments'][9]: 0;
|
|
$temp_6 = !empty($data['branchs'][$key]['inv_d'][$key2]['payments'][10])? $data['branchs'][$key]['inv_d'][$key2]['payments'][10]: 0;
|
|
$temp_7 = (!empty($data['branchs'][$key]['inv_d'][$key2]['payments'][4])? $data['branchs'][$key]['inv_d'][$key2]['payments'][4]: 0) +
|
|
(!empty($data['branchs'][$key]['inv_d'][$key2]['payments'][3])? $data['branchs'][$key]['inv_d'][$key2]['payments'][3]: 0);
|
|
$temp_8 = !empty($data['branchs'][$key]['inv_d'][$key2]['payments']['else'])? $data['branchs'][$key]['inv_d'][$key2]['payments']['else']: 0;
|
|
$temp_9 = $temp_1+$temp_2+$temp_3+$temp_4+$temp_5+$temp_6+$temp_7;
|
|
?>
|
|
<tr>
|
|
<td><a href="invoice_search?number=<?=$key2?>"><?=$key2?></a></td>
|
|
<td><?=$temp_1?></td>
|
|
<td><?=$temp_2?></td>
|
|
<td><?=$temp_3?></td>
|
|
<td><?=$temp_4?></td>
|
|
<td><?=$temp_5?></td>
|
|
<td><?=$temp_6?></td>
|
|
<td><?=$temp_7?></td>
|
|
<td><?=$temp_8?></td>
|
|
<td><?=$temp_9?></td>
|
|
</tr>
|
|
<?php
|
|
$t1 += $temp_1;
|
|
$t2 += $temp_2;
|
|
$t3 += $temp_3;
|
|
$t4 += $temp_4;
|
|
$t5 += $temp_5;
|
|
$t6 += $temp_6;
|
|
$t7 += $temp_7;
|
|
$t8 += $temp_8;
|
|
$t9 += $temp_9;
|
|
}
|
|
?>
|
|
<tr>
|
|
<td>المجموع</td>
|
|
<td><?=$t1?></td>
|
|
<td><?=$t2?></td>
|
|
<td><?=$t3?></td>
|
|
<td><?=$t4?></td>
|
|
<td><?=$t5?></td>
|
|
<td><?=$t6?></td>
|
|
<td><?=$t7?></td>
|
|
<td><?=$t8?></td>
|
|
<td><?=$t9?></td>
|
|
</tr>
|
|
</tbody>
|
|
<?php
|
|
}
|
|
?>
|
|
<?php
|
|
if(!empty($data['branchs'][$key]['inv_cre'])) {
|
|
?>
|
|
<thead class="table-primary">
|
|
<tr>
|
|
<th scope="col" colspan="2">اشعارات مدين</th>
|
|
<th style="background-color:#000;" scope="col" colspan="8"></th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="3">لرقم الفاتورة</th>
|
|
<th scope="col" colspan="8">الصادر</th>
|
|
<th scope="col" rowspan="3">الاجمالي</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="2">كاش</th>
|
|
<th scope="col" rowspan="2">شبكة</th>
|
|
<th scope="col" colspan="4">تحويل</th>
|
|
<th scope="col" rowspan="2">رصيد</th>
|
|
<th scope="col" rowspan="2">اخرى</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col">ساب 56001</th>
|
|
<th scope="col">الراجحي 66443</th>
|
|
<th scope="col">الاهلي 00100</th>
|
|
<th scope="col">الانماء 06000</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$t1 = 0;
|
|
$t2 = 0;
|
|
$t3 = 0;
|
|
$t4 = 0;
|
|
$t5 = 0;
|
|
$t6 = 0;
|
|
$t7 = 0;
|
|
$t8 = 0;
|
|
$t9 = 0;
|
|
foreach ($data['branchs'][$key]['inv_cre'] as $key2 => $value2) {
|
|
$temp_1 = !empty($data['branchs'][$key]['inv_cre'][$key2]['payments'][1])? $data['branchs'][$key]['inv_cre'][$key2]['payments'][1]: 0;
|
|
$temp_2 = !empty($data['branchs'][$key]['inv_cre'][$key2]['payments'][2])? $data['branchs'][$key]['inv_cre'][$key2]['payments'][2]: 0;
|
|
$temp_3 = !empty($data['branchs'][$key]['inv_cre'][$key2]['payments'][6])? $data['branchs'][$key]['inv_cre'][$key2]['payments'][6]: 0;
|
|
$temp_4 = !empty($data['branchs'][$key]['inv_cre'][$key2]['payments'][7])? $data['branchs'][$key]['inv_cre'][$key2]['payments'][7]: 0;
|
|
$temp_5 = !empty($data['branchs'][$key]['inv_cre'][$key2]['payments'][8])? $data['branchs'][$key]['inv_cre'][$key2]['payments'][8]: 0;
|
|
$temp_6 = !empty($data['branchs'][$key]['inv_cre'][$key2]['payments'][9])? $data['branchs'][$key]['inv_cre'][$key2]['payments'][9]: 0;
|
|
$temp_7 = (!empty($data['branchs'][$key]['inv_cre'][$key2]['payments'][4])? $data['branchs'][$key]['inv_cre'][$key2]['payments'][4]: 0) +
|
|
(!empty($data['branchs'][$key]['inv_cre'][$key2]['payments'][3])? $data['branchs'][$key]['inv_cre'][$key2]['payments'][3]: 0);
|
|
$temp_8 = !empty($data['branchs'][$key]['inv_cre'][$key2]['payments']['else'])? $data['branchs'][$key]['inv_cre'][$key2]['payments']['else']: 0;
|
|
$temp_9 = $temp_1+$temp_2+$temp_3+$temp_4+$temp_5+$temp_6+$temp_7;
|
|
?>
|
|
<tr>
|
|
<td><a href="invoice_search?number=<?=$key2?>"><?=$key2?></a></td>
|
|
<td><?=$temp_1?></td>
|
|
<td><?=$temp_2?></td>
|
|
<td><?=$temp_3?></td>
|
|
<td><?=$temp_4?></td>
|
|
<td><?=$temp_5?></td>
|
|
<td><?=$temp_6?></td>
|
|
<td><?=$temp_7?></td>
|
|
<td><?=$temp_8?></td>
|
|
<td><?=$temp_9?></td>
|
|
</tr>
|
|
<?php
|
|
$t1 += $temp_1;
|
|
$t2 += $temp_2;
|
|
$t3 += $temp_3;
|
|
$t4 += $temp_4;
|
|
$t5 += $temp_5;
|
|
$t6 += $temp_6;
|
|
$t7 += $temp_7;
|
|
$t8 += $temp_8;
|
|
$t9 += $temp_9;
|
|
}
|
|
?>
|
|
<tr>
|
|
<td>المجموع</td>
|
|
<td><?=$t1?></td>
|
|
<td><?=$t2?></td>
|
|
<td><?=$t3?></td>
|
|
<td><?=$t4?></td>
|
|
<td><?=$t5?></td>
|
|
<td><?=$t6?></td>
|
|
<td><?=$t7?></td>
|
|
<td><?=$t8?></td>
|
|
<td><?=$t9?></td>
|
|
</tr>
|
|
</tbody>
|
|
<?php
|
|
}
|
|
?>
|
|
<?php
|
|
if(!empty($data['branchs'][$key]['back_d'])) {
|
|
?>
|
|
<thead class="table-primary">
|
|
<tr>
|
|
<th scope="col" colspan="2">مرتجعات</th>
|
|
<th style="background-color:#000;" scope="col" colspan="8"></th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="2">رقم الفاتورة</th>
|
|
<th colspan="5" scope="col">المرتجع</th>
|
|
<th colspan="4" scope="col" rowspan="2">الاجمالي</th>
|
|
</tr>
|
|
<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
|
|
$t1 = 0;
|
|
$t2 = 0;
|
|
$t3 = 0;
|
|
$t4 = 0;
|
|
foreach ($data['branchs'][$key]['back_d'] as $key2 => $value2) {
|
|
$temp_1 = !empty($data['branchs'][$key]['back_d'][$key2]['payments'][1])? $data['branchs'][$key]['back_d'][$key2]['payments'][1]: 0;
|
|
$temp_2 = !empty($data['branchs'][$key]['back_d'][$key2]['payments'][2])? $data['branchs'][$key]['back_d'][$key2]['payments'][2]: 0;
|
|
$temp_3 = !empty($data['branchs'][$key]['back_d'][$key2]['payments'][5])? $data['branchs'][$key]['back_d'][$key2]['payments'][5]: 0;
|
|
$temp_4 = (!empty($data['branchs'][$key]['back_d'][$key2]['payments'][4])? $data['branchs'][$key]['back_d'][$key2]['payments'][4]: 0) +
|
|
(!empty($data['branchs'][$key]['back_d'][$key2]['payments'][3])? $data['branchs'][$key]['back_d'][$key2]['payments'][3]: 0);
|
|
$temp_5 = !empty($data['branchs'][$key]['back_d'][$key2]['payments']['else'])? $data['branchs'][$key]['back_d'][$key2]['payments']['else']: 0;
|
|
$temp_6 = $temp_1+$temp_2+$temp_3+$temp_4+$temp_5;
|
|
?>
|
|
<tr>
|
|
<td><a href="invoice_search?number=<?=$key2?>"><?=$key2?></a></td>
|
|
<td><?=$temp_1?></td>
|
|
<td><?=$temp_2?></td>
|
|
<td><?=$temp_3?></td>
|
|
<td><?=$temp_4?></td>
|
|
<td><?=$temp_5?></td>
|
|
<td colspan="4"><?=$temp_6?></td>
|
|
</tr>
|
|
<?php
|
|
$t1 += $temp_1;
|
|
$t2 += $temp_2;
|
|
$t3 += $temp_3;
|
|
$t4 += $temp_4;
|
|
$t5 += $temp_5;
|
|
$t6 += $temp_6;
|
|
}
|
|
?>
|
|
<tr>
|
|
<td>المجموع</td>
|
|
<td><?=$t1?></td>
|
|
<td><?=$t2?></td>
|
|
<td><?=$t3?></td>
|
|
<td><?=$t4?></td>
|
|
<td><?=$t5?></td>
|
|
<td colspan="4"><?=$t6?></td>
|
|
</tr>
|
|
</tbody>
|
|
|
|
<?php
|
|
}
|
|
?>
|
|
<thead class="table-primary">
|
|
<?php
|
|
if(!empty($data['branchs'][$key]['bond_d'])) {
|
|
?>
|
|
<tr>
|
|
<th scope="col" colspan="2">الأرصدة</th>
|
|
<th style="background-color:#000;" scope="col" colspan="8"></th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="3">رقم السند</th>
|
|
<th scope="col" colspan="8">الصادر</th>
|
|
<th scope="col" rowspan="3">الاجمالي</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="2">كاش</th>
|
|
<th scope="col" rowspan="2">شبكة</th>
|
|
<th scope="col" colspan="4">تحويل</th>
|
|
<th scope="col" rowspan="2">رصيد</th>
|
|
<th scope="col" rowspan="2">اخرى</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col">ساب 56001</th>
|
|
<th scope="col">الراجحي 66443</th>
|
|
<th scope="col">الاهلي 00100</th>
|
|
<th scope="col">الانماء 06000</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$t1 = 0;
|
|
$t2 = 0;
|
|
$t3 = 0;
|
|
$t4 = 0;
|
|
$t5 = 0;
|
|
$t6 = 0;
|
|
$t7 = 0;
|
|
$t8 = 0;
|
|
$t9 = 0;
|
|
foreach ($data['branchs'][$key]['bond_d'] as $key2 => $value2) {
|
|
$temp_1 = !empty($data['branchs'][$key]['bond_d'][$key2]['payments'][1])? $data['branchs'][$key]['bond_d'][$key2]['payments'][1]: 0;
|
|
$temp_2 = !empty($data['branchs'][$key]['bond_d'][$key2]['payments'][2])? $data['branchs'][$key]['bond_d'][$key2]['payments'][2]: 0;
|
|
$temp_3 = !empty($data['branchs'][$key]['bond_d'][$key2]['payments'][6])? $data['branchs'][$key]['bond_d'][$key2]['payments'][6]: 0;
|
|
$temp_4 = !empty($data['branchs'][$key]['bond_d'][$key2]['payments'][7])? $data['branchs'][$key]['bond_d'][$key2]['payments'][7]: 0;
|
|
$temp_5 = !empty($data['branchs'][$key]['bond_d'][$key2]['payments'][8])? $data['branchs'][$key]['bond_d'][$key2]['payments'][8]: 0;
|
|
$temp_6 = !empty($data['branchs'][$key]['bond_d'][$key2]['payments'][9])? $data['branchs'][$key]['bond_d'][$key2]['payments'][9]: 0;
|
|
$temp_7 = (!empty($data['branchs'][$key]['bond_d'][$key2]['payments'][4])? $data['branchs'][$key]['bond_d'][$key2]['payments'][4]: 0) +
|
|
(!empty($data['branchs'][$key]['bond_d'][$key2]['payments'][3])? $data['branchs'][$key]['bond_d'][$key2]['payments'][3]: 0);
|
|
$temp_8 = !empty($data['branchs'][$key]['bond_d'][$key2]['payments']['else'])? $data['branchs'][$key]['bond_d'][$key2]['payments']['else']: 0;
|
|
$temp_9 = $temp_1+$temp_2+$temp_3+$temp_4+$temp_5+$temp_6+$temp_7;
|
|
?>
|
|
<tr>
|
|
<td><a href="bond_search?number=<?=$key2?>"><?=$key2?></a></td>
|
|
<td><?=$temp_1?></td>
|
|
<td><?=$temp_2?></td>
|
|
<td><?=$temp_3?></td>
|
|
<td><?=$temp_4?></td>
|
|
<td><?=$temp_5?></td>
|
|
<td><?=$temp_6?></td>
|
|
<td><?=$temp_7?></td>
|
|
<td><?=$temp_8?></td>
|
|
<td><?=$temp_9?></td>
|
|
</tr>
|
|
<?php
|
|
$t1 += $temp_1;
|
|
$t2 += $temp_2;
|
|
$t3 += $temp_3;
|
|
$t4 += $temp_4;
|
|
$t5 += $temp_5;
|
|
$t6 += $temp_6;
|
|
$t7 += $temp_7;
|
|
$t8 += $temp_8;
|
|
$t9 += $temp_9;
|
|
}
|
|
?>
|
|
<tr>
|
|
<td>المجموع</td>
|
|
<td><?=$t1?></td>
|
|
<td><?=$t2?></td>
|
|
<td><?=$t3?></td>
|
|
<td><?=$t4?></td>
|
|
<td><?=$t5?></td>
|
|
<td><?=$t6?></td>
|
|
<td><?=$t7?></td>
|
|
<td><?=$t8?></td>
|
|
<td><?=$t9?></td>
|
|
</tr>
|
|
</tbody>
|
|
<?php
|
|
}
|
|
?>
|
|
<?php
|
|
if(!empty($data['branchs'][$key]['bond_cre'])) {
|
|
?>
|
|
<thead class="table-primary">
|
|
<tr>
|
|
<th scope="col" colspan="2">اضافات للارصدة</th>
|
|
<th style="background-color:#000;" scope="col" colspan="8"></th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="3">لرقم السند</th>
|
|
<th scope="col" colspan="8">الصادر</th>
|
|
<th scope="col" rowspan="3">الاجمالي</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="2">كاش</th>
|
|
<th scope="col" rowspan="2">شبكة</th>
|
|
<th scope="col" colspan="4">تحويل</th>
|
|
<th scope="col" rowspan="2">رصيد</th>
|
|
<th scope="col" rowspan="2">اخرى</th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col">ساب 56001</th>
|
|
<th scope="col">الراجحي 66443</th>
|
|
<th scope="col">الاهلي 00100</th>
|
|
<th scope="col">الانماء 06000</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$t1 = 0;
|
|
$t2 = 0;
|
|
$t3 = 0;
|
|
$t4 = 0;
|
|
$t5 = 0;
|
|
$t6 = 0;
|
|
$t7 = 0;
|
|
$t8 = 0;
|
|
$t9 = 0;
|
|
foreach ($data['branchs'][$key]['bond_cre'] as $key2 => $value2) {
|
|
$temp_1 = !empty($data['branchs'][$key]['bond_cre'][$key2]['payments'][1])? $data['branchs'][$key]['bond_cre'][$key2]['payments'][1]: 0;
|
|
$temp_2 = !empty($data['branchs'][$key]['bond_cre'][$key2]['payments'][2])? $data['branchs'][$key]['bond_cre'][$key2]['payments'][2]: 0;
|
|
$temp_3 = !empty($data['branchs'][$key]['bond_cre'][$key2]['payments'][6])? $data['branchs'][$key]['bond_cre'][$key2]['payments'][6]: 0;
|
|
$temp_4 = !empty($data['branchs'][$key]['bond_cre'][$key2]['payments'][7])? $data['branchs'][$key]['bond_cre'][$key2]['payments'][7]: 0;
|
|
$temp_5 = !empty($data['branchs'][$key]['bond_cre'][$key2]['payments'][8])? $data['branchs'][$key]['bond_cre'][$key2]['payments'][8]: 0;
|
|
$temp_6 = !empty($data['branchs'][$key]['bond_cre'][$key2]['payments'][9])? $data['branchs'][$key]['bond_cre'][$key2]['payments'][9]: 0;
|
|
$temp_7 = (!empty($data['branchs'][$key]['bond_cre'][$key2]['payments'][4])? $data['branchs'][$key]['bond_cre'][$key2]['payments'][4]: 0) +
|
|
(!empty($data['branchs'][$key]['bond_cre'][$key2]['payments'][3])? $data['branchs'][$key]['bond_cre'][$key2]['payments'][3]: 0);
|
|
$temp_8 = !empty($data['branchs'][$key]['bond_cre'][$key2]['payments']['else'])? $data['branchs'][$key]['bond_cre'][$key2]['payments']['else']: 0;
|
|
$temp_9 = $temp_1+$temp_2+$temp_3+$temp_4+$temp_5+$temp_6+$temp_7;
|
|
?>
|
|
<tr>
|
|
<td><a href="bond_search?number=<?=$key2?>"><?=$key2?></a></td>
|
|
<td><?=$temp_1?></td>
|
|
<td><?=$temp_2?></td>
|
|
<td><?=$temp_3?></td>
|
|
<td><?=$temp_4?></td>
|
|
<td><?=$temp_5?></td>
|
|
<td><?=$temp_6?></td>
|
|
<td><?=$temp_7?></td>
|
|
<td><?=$temp_8?></td>
|
|
<td><?=$temp_9?></td>
|
|
</tr>
|
|
<?php
|
|
$t1 += $temp_1;
|
|
$t2 += $temp_2;
|
|
$t3 += $temp_3;
|
|
$t4 += $temp_4;
|
|
$t5 += $temp_5;
|
|
$t6 += $temp_6;
|
|
$t7 += $temp_7;
|
|
$t8 += $temp_8;
|
|
$t9 += $temp_9;
|
|
}
|
|
?>
|
|
<tr>
|
|
<td>المجموع</td>
|
|
<td><?=$t1?></td>
|
|
<td><?=$t2?></td>
|
|
<td><?=$t3?></td>
|
|
<td><?=$t4?></td>
|
|
<td><?=$t5?></td>
|
|
<td><?=$t6?></td>
|
|
<td><?=$t7?></td>
|
|
<td><?=$t8?></td>
|
|
<td><?=$t9?></td>
|
|
</tr>
|
|
</tbody>
|
|
<?php
|
|
}
|
|
?>
|
|
<?php
|
|
if(!empty($data['branchs'][$key]['bond_back_d'])) {
|
|
?>
|
|
<thead class="table-primary">
|
|
<tr>
|
|
<th scope="col" colspan="2">مرتجعات ارصدة</th>
|
|
<th style="background-color:#000;" scope="col" colspan="8"></th>
|
|
</tr>
|
|
<tr>
|
|
<th scope="col" rowspan="2">رقم السند</th>
|
|
<th colspan="5" scope="col">المرتجع</th>
|
|
<th colspan="4" scope="col" rowspan="2">الاجمالي</th>
|
|
</tr>
|
|
<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
|
|
$t1 = 0;
|
|
$t2 = 0;
|
|
$t3 = 0;
|
|
$t4 = 0;
|
|
$t5 = 0;
|
|
$t6 = 0;
|
|
foreach ($data['branchs'][$key]['bond_back_d'] as $key2 => $value2) {
|
|
$temp_1 = !empty($data['branchs'][$key]['bond_back_d'][$key2]['payments'][1])? $data['branchs'][$key]['bond_back_d'][$key2]['payments'][1]: 0;
|
|
$temp_2 = !empty($data['branchs'][$key]['bond_back_d'][$key2]['payments'][2])? $data['branchs'][$key]['bond_back_d'][$key2]['payments'][2]: 0;
|
|
$temp_3 = !empty($data['branchs'][$key]['bond_back_d'][$key2]['payments'][5])? $data['branchs'][$key]['bond_back_d'][$key2]['payments'][5]: 0;
|
|
$temp_4 = (!empty($data['branchs'][$key]['bond_back_d'][$key2]['payments'][4])? $data['branchs'][$key]['bond_back_d'][$key2]['payments'][4]: 0) +
|
|
(!empty($data['branchs'][$key]['bond_back_d'][$key2]['payments'][3])? $data['branchs'][$key]['bond_back_d'][$key2]['payments'][3]: 0);
|
|
$temp_5 = !empty($data['branchs'][$key]['bond_back_d'][$key2]['payments']['else'])? $data['branchs'][$key]['bond_back_d'][$key2]['payments']['else']: 0;
|
|
$temp_6 = $temp_1+$temp_2+$temp_3+$temp_4+$temp_5;
|
|
?>
|
|
<tr>
|
|
<td><a href="bond_search?number=<?=$key2?>"><?=$key2?></a></td>
|
|
<td><?=$temp_1?></td>
|
|
<td><?=$temp_2?></td>
|
|
<td><?=$temp_3?></td>
|
|
<td><?=$temp_4?></td>
|
|
<td><?=$temp_5?></td>
|
|
<td colspan="4"><?=$temp_6?></td>
|
|
</tr>
|
|
<?php
|
|
$t1 += $temp_1;
|
|
$t2 += $temp_2;
|
|
$t3 += $temp_3;
|
|
$t4 += $temp_4;
|
|
$t5 += $temp_5;
|
|
$t6 += $temp_6;
|
|
}
|
|
?>
|
|
<tr>
|
|
<td>المجموع</td>
|
|
<td><?=$t1?></td>
|
|
<td><?=$t2?></td>
|
|
<td><?=$t3?></td>
|
|
<td><?=$t4?></td>
|
|
<td><?=$t5?></td>
|
|
<td colspan="4"><?=$t6?></td>
|
|
</tr>
|
|
</tbody>
|
|
|
|
<?php
|
|
}
|
|
}
|
|
}
|
|
?>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php require_once('fixed/footer/go.php'); ?>
|
|
</div>
|
|
</div>
|
|
<?php require_once('fixed/js/go.php'); ?>
|
|
<script>
|
|
$("#Select-date").change(function() {
|
|
var SelectedDate = $(this).val();
|
|
window.location = 'daily_user_d?u=<?= $user_id ?>&d=' + SelectedDate
|
|
});
|
|
</script>
|
|
</body>
|
|
</html>
|