'.$branch_id;
}
// work time
$commercial_register_sql = mysqli_query($db, "SELECT `commercial_register`.`start_work`, `commercial_register`.`start_work_fri`, `commercial_register`.`end_work`
FROM `branch`
LEFT JOIN `commercial_register` ON `branch`.`commercial_register_id` = `commercial_register`.`id`
WHERE `branch`.`id` = $branch_id"
);
$commercial_register = mysqli_fetch_assoc($commercial_register_sql);
$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;
}
$tabs = $_SESSION['tab'];
if (empty($tabs)) {
$tabs = 1;
}
$not_eq = "=";
if ($tabs == 1) {
$not_eq = "<>";
}
$start_today_time_static = $commercial_register['start_work'];
if ($Day == "Fri") {
$start_today_time_static = $commercial_register['start_work_fri'];
}
$end_today_time_static = $commercial_register['end_work'];
$archives = false;
if (strtotime($today) <= strtotime(date('Y-m-d', strtotime('-1 month', strtotime(date('Y-m-d')))))) {
$archives = true;
}
?>
حجوزات يوم
= Day_ar() ?>
= Today_ar() ?>
0) {
?>
|
23) {
$restart_temp = $start_today_time - 24;
}
if ($restart_temp < 10) {
$start_today_time_temp = "0" . $restart_temp . ":00:00";
} else {
$start_today_time_temp = $restart_temp . ":00:00";
}
$today_temp = $today;
if ($start_today_time > 23) {
$today_temp = $Next;
}
?>
=date((date("H", strtotime($start_today_time_temp)) > 11) ? 'h:i \م' : 'h:i \ص', strtotime($start_today_time_temp))?> |
= $get_emplyee['name'] ?>
|
'$today' AND `work_time_table`.`from_date_time` < '$Next' AND `work_time_table`.`activation_id` = 2");
$time_work = array();
while ($get_time_work = mysqli_fetch_assoc($get_emplyee_time_work)) {
$from = $get_time_work['fromTime'][0] . $get_time_work['fromTime'][1];
$to = $get_time_work['toTime'][0] . $get_time_work['toTime'][1];
for ($from; $from <= $to; $from++) {
$push_time_work = $from . ":00:00";
array_push($time_work, $push_time_work);
}
}
if ($archives) {
include('work/files/book/archives.php');
} else {
$get_tretment_details_sql_state = mysqli_query($db,
"SELECT
`bd`.`day_date`,
`bd`.`day_time`,
`bd`.`branch_id`,
`bd`.`emplyee_id`,
`bd`.`status_id`,
`bd`.`date_time`,
`bd`.`book_v2_id` AS `book_id`,
`bd`.`name`,
`bd`.`mom`,
`bd`.`tretment_id`,
`bd`.`notes`,
`bd`.`date_time` AS `user_date`,
`bd`.`user_book`,
`bd`.`tr_name`,
`bd`.`number`
FROM `books_for_table_2` AS `bd`
WHERE `bd`.`day_date`='$today'
AND (`bd`.`day_time` >= '$start_today_time_sql' AND `bd`.`day_time` <= '$end_today_time_sql')
AND `bd`.`emplyee_id`='$emp_id'
AND `bd`.$branch_sql
AND `bd`.`status_id` != 25
GROUP BY `bd`.`day_time`
ORDER BY `bd`.`day_time`, `bd`.`date_time`
");
}
$tretment_details_state_temp = array();
while ($get_tretment_details_state = mysqli_fetch_assoc($get_tretment_details_sql_state)) {
array_push($tretment_details_state, $get_tretment_details_state);
array_push($tretment_details_state_temp, $get_tretment_details_state);
}
$get_table_sql_state = mysqli_query($db,
"SELECT
`user`.`id`,
`user`.`name`,
`table`.`day_date`,
`table`.`day_time`,
`table`.`notes`,
`table`.`branch_id`,
`table`.`emplyee_id`,
`table`.`status_id`,
`table`.`date_time` AS `time`
FROM `table`
LEFT JOIN `user` ON `user`.`id` = `table`.`user_id`
WHERE `table`.`day_date` = '$today'
AND (`table`.`day_time` >= '$start_today_time_sql' AND `table`.`day_time` <= '$end_today_time_sql')
AND `table`.$branch_sql AND `table`.`emplyee_id` = '$emp_id'
AND `table`.`id` IN (SELECT MAX(`tb`.`id`) FROM `table` AS `tb` WHERE `tb`.`day_date` = '$today'
AND `tb`.`emplyee_id` = '$emp_id' GROUP BY `tb`.`day_time`)
ORDER BY `table`.`day_time` ASC"
);
$open_close_temp = array();
while ($get_table_state = mysqli_fetch_assoc($get_table_sql_state)) {
array_push($open_close_temp, $get_table_state);
}
if ($end_today_time > 23) { // greter than 24 hour
$end_today_time_sql = "23:59:59";
$how_many_left = ($end_today_time - 23) - 1 . ":59:59";
if ($archives) {
include('work/files/book/archives_above_23.php');
} else {
$get_tretment_details_sql_state2 = mysqli_query($db,
"SELECT
`bd`.`day_date`,
`bd`.`day_time`,
`bd`.`branch_id`,
`bd`.`emplyee_id`,
`bd`.`status_id`,
`bd`.`date_time`,
`bd`.`book_v2_id` AS `book_id`,
`bd`.`name`,
`bd`.`mom`,
`bd`.`tretment_id`,
`bd`.`notes`,
`bd`.`user_date`,
`bd`.`user_book`,
`bd`.`tr_name`,
`bd`.`number`
FROM `books_for_table_2` AS `bd`
WHERE `bd`.`day_date` = '$Next'
AND `bd`.`day_time` <= '$how_many_left'
AND `bd`.`emplyee_id`='$emp_id'
AND `bd`.$branch_sql
AND `bd`.`status_id` != 25
GROUP BY `bd`.`day_time`
ORDER BY `bd`.`day_time`, `bd`.`date_time`
");
}
while ($get_tretment_details_state2 = mysqli_fetch_assoc($get_tretment_details_sql_state2)) {
array_push($tretment_details_state, $get_tretment_details_state2);
array_push($tretment_details_state_temp, $get_tretment_details_state2);
}
$get_table_sql_state2 = mysqli_query($db,
"SELECT
`user`.`id`,
`user`.`name`,
`table`.`day_date`,
`table`.`day_time`,
`table`.`notes`,
`table`.`branch_id`,
`table`.`emplyee_id`,
`table`.`status_id`,
`table`.`date_time` AS `time`
FROM `table`
LEFT JOIN `user` ON `user`.`id` = `table`.`user_id`
WHERE `table`.`day_date` = '$Next'
AND `table`.`day_time` <= '$how_many_left'
AND `table`.$branch_sql
AND `table`.`emplyee_id` = '$emp_id'
AND `table`.`id` IN (SELECT MAX(`tb`.`id`) FROM `table` AS `tb` WHERE `tb`.`day_date` = '$Next'
AND `tb`.`emplyee_id` = '$emp_id' GROUP BY `tb`.`day_time`)
ORDER BY `table`.`day_time` ASC"
);
while ($get_table_state2 = mysqli_fetch_assoc($get_table_sql_state2)) {
array_push($open_close_temp, $get_table_state2);
}
}
$branch_id = $get_emplyee['branch_id'];
$open_close_count= 0;
$temp_count = 0;
for ($start_today_time; $start_today_time <= $end_today_time; $start_today_time++) {
$restart_temp = $start_today_time;
if ($start_today_time > 23) {
$restart_temp = $start_today_time - 24;
}
if ($restart_temp < 10) {
$start_today_time_temp = "0" . $restart_temp . ":00:00";
} else {
$start_today_time_temp = $restart_temp . ":00:00";
}
$today_temp = $today;
if ($start_today_time > 23) {
$today_temp = $Next;
}
if (($tretment_details_state_temp[$temp_count]['day_time']) == ($start_today_time_temp) && $tretment_details_state_temp[$temp_count]['emplyee_id'] == $emp_id) {
switch ($tretment_details_state_temp[$temp_count]['status_id']) {
case 4: case 5:
// انتظار
?>
= $tretment_details_state_temp[$temp_count]['tr_name'] ?>
= $tretment_details_state_temp[$temp_count]['name'] ?>
= $tretment_details_state_temp[$temp_count]['number'] ?>
|
= $tretment_details_state_temp[$temp_count]['tr_name'] ?>
= $tretment_details_state_temp[$temp_count]['name'] ?>
= $tretment_details_state_temp[$temp_count]['number'] ?>
|
= $tretment_details_state_temp[$temp_count]['tr_name'] ?>
= $tretment_details_state_temp[$temp_count]['name'] ?>
= $tretment_details_state_temp[$temp_count]['number'] ?>
|
= $tretment_details_state_temp[$temp_count]['tr_name'] ?>
= $tretment_details_state_temp[$temp_count]['name'] ?>
= $tretment_details_state_temp[$temp_count]['number'] ?>
|
= $tretment_details_state_temp[$temp_count]['tr_name'] ?>
= $tretment_details_state_temp[$temp_count]['name'] ?>
|
مغلق بواسطة =$open_close_temp[$open_close_count]['name']?>
|
|
جاري الحجز بواسطة =$open_close_temp[$open_close_count]['name']?>
">
|
|
|
|
|