= $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_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);
}
}
$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'] ?>
= $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'] ?>
|
= $tretment_details_state_temp[$temp_count]['tr_name'] ?>
= $tretment_details_state_temp[$temp_count]['name'] ?>
|
= $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']?>
">
|
|
|
|
|