#branch_15_button { background-color: #c2df35 !important; color: black; }"; break; case 3: access(2); //echo ""; break; case 4: access(3); //echo ""; break; case 5: access(4); break; } $branch_sql = '`branch_id`='.$branch_id; if ($branch_id == 1) { $branch_sql = '`branch_id`<>'.$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)); $Day_s = 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; } if (strtotime($today) <= strtotime(date('2022-09-30'))) { $archives = true; } ?>
0) { ?>
'$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_id` AS `book_id`, `bd`.`name`, `bd`.`tretment_id`, `bd`.`notes`, `bd`.`user_date` AS `user_date`, `bd`.`user_book`, `bd`.`tr_name`, `bd`.`number` FROM `book_temp` 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` NOT IN (25,26) 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_id` AS `book_id`, `bd`.`name`, `bd`.`tretment_id`, `bd`.`notes`, `bd`.`user_date`, `bd`.`user_book`, `bd`.`tr_name`, `bd`.`number` FROM `book_temp` 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` NOT IN (25,26) 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); } } if ($start_today_time_static == 14) { $all_time = array( 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, ); } else { $all_time = array( 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, ); } $branch_id = $get_emplyee['branch_id']; $open_close_count= 0; $temp_count = 0; if ($branch_id == 6) { $end_today_time = 20*2; } for ($start_today_time = 0; $start_today_time < count($all_time); $start_today_time++) { $restart_temp = $all_time[$start_today_time]; $start_today_time_temp =''; if (($start_today_time%2 == 0)) { if ($restart_temp < 10) { $start_today_time_temp = "0" . $restart_temp . ":00:00"; } else { $start_today_time_temp = $restart_temp . ":00:00"; } } else { if ($restart_temp < 10) { $start_today_time_temp = "0" . $restart_temp . ":30:00"; } else { $start_today_time_temp = $restart_temp . ":30:00"; } } 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: // انتظار ?>
11) ? 'h:i \م' : 'h:i \ص', strtotime($start_today_time_temp))?> 11) ? 'h:i \م' : 'h:i \ص', strtotime($start_today_time_temp_half))?>
user
مغلق بواسطة
متاح
جاري الحجز بواسطة
">
اجازة
غير متاح
(صلاه)
متاح
غير متاح