167 lines
6.2 KiB
PHP
167 lines
6.2 KiB
PHP
<?php
|
|
require_once('../../../fixed/config/go_con.php');
|
|
|
|
$number = mysqli_real_escape_string($db, $_POST['number']);
|
|
|
|
if (!empty($number)) {
|
|
|
|
$get_tretment_sql = mysqli_query($db, "SELECT
|
|
`tretment`.`name` AS `tr_name`,
|
|
`book`.`id`,
|
|
`book_details`.`day_date`,
|
|
`book_details`.`day_time`,
|
|
`book`.`notes`,
|
|
`emplyee`.`id` AS `emp_id`,
|
|
`emplyee`.`his_img`,
|
|
`emplyee`.`name`AS `emp_name`,
|
|
`services`.`name`,
|
|
`services`.`price`,
|
|
`status`.`id` AS `state`,
|
|
`status`.`small_name` AS `state_string`
|
|
|
|
|
|
FROM `tretment`
|
|
LEFT JOIN `book` ON `book`.`tretment_id` = `tretment`.`id`
|
|
LEFT JOIN `book_details` ON `book`.`id` = `book_details`.`book_id`
|
|
LEFT JOIN `services` ON `book_details`.`services_id` = `services`.`id`
|
|
LEFT JOIN `emplyee` ON `book_details`.`emplyee_id` = `emplyee`.`id`
|
|
LEFT JOIN `status` ON `book_details`.`status_id` = `status`.`id`
|
|
LEFT JOIN `branch` ON `book_details`.`branch_id` = `branch`.`id`
|
|
|
|
WHERE `tretment`.`number` = '$number'
|
|
AND `branch`.`commercial_register_id`= '$commercial_register_id'
|
|
AND `book_details`.`id` IN (SELECT MAX(`book_details`.`id`) FROM `book_details` GROUP BY `book_details`.`book_id`)
|
|
ORDER BY `book_details`.`day_date` DESC, `book_details`.`day_time` DESC /*booking_details.day_date DESC, booking_details.day_time DESC*/");
|
|
|
|
|
|
|
|
if (mysqli_num_rows($get_tretment_sql) > 0) {
|
|
?>
|
|
|
|
<table class="table table-bordered mb-0 table-centered text-center">
|
|
<thead>
|
|
<tr class="align-self-center">
|
|
<th>#</th>
|
|
<th>الاسم</th>
|
|
<th>التاريخ</th>
|
|
<th>الوقت</th>
|
|
<th>الفني</th>
|
|
<th>الخدمة</th>
|
|
<th>السعر</th>
|
|
<th>الخصم</th>
|
|
<th>سبب الخصم</th>
|
|
<th>الضريبة</th>
|
|
<th>الإجمالي</th>
|
|
<th>ملاحظات</th>
|
|
<th>الحالة</th>
|
|
<th>تفاصيل</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<?php
|
|
$count = 1;
|
|
while ($booking_row = mysqli_fetch_assoc($get_tretment_sql)) {
|
|
?>
|
|
<tr>
|
|
<td><?=$count?></td>
|
|
<td><?=$booking_row['tr_name']?></td>
|
|
|
|
<td><?=$booking_row['day_date']?></td>
|
|
<td><?=$booking_row['day_time']?></td>
|
|
<td><img src="uploads/emplyee/<?=$booking_row['emp_id']?>/face/<?=$booking_row['his_img']?>" alt="emp_img" class="thumb-sm rounded-circle mr-2"><bt /><?=$booking_row['emp_name']?></td>
|
|
<td><?=$booking_row['name']?></td>
|
|
<td><?= round($booking_row['price'],2)?></td>
|
|
<td><?= round($booking_row['price'],2)?></td>
|
|
<td><?= $booking_row['price']?></td>
|
|
<td><?= round($booking_row['price'],2)?></td>
|
|
<td><?= round(($booking_row['price'] - $booking_row['price']) + $booking_row['price'],2)?></td>
|
|
<td><?=$booking_row['notes']?></td>
|
|
<td style="background-image:
|
|
<?php
|
|
switch ($booking_row['state']) {
|
|
case '2':
|
|
echo "linear-gradient(120deg, #f6d365 0, #ff7850 100%);";
|
|
break;
|
|
case '4':
|
|
echo "linear-gradient(120deg, #f6d365 0, #ff7850 100%);";
|
|
break;
|
|
case '6':
|
|
echo "linear-gradient(120deg, #a9a2a2 0, #b5a6ab 100%);";
|
|
break;
|
|
case '7':
|
|
echo "linear-gradient(120deg, #00e795 0, #0095e2 100%);";
|
|
break;
|
|
case '8':
|
|
if (round($booking_row['discount'],2) > 100) {
|
|
echo "linear-gradient(120deg, #f93b7a 0, #0095e2 100%);";
|
|
} else {
|
|
echo "linear-gradient(120deg, #f93b7a 0, #e0004a 100%);";
|
|
}
|
|
break;
|
|
case '9':
|
|
if (round($booking_row['discount'],2) > 100) {
|
|
echo "linear-gradient(120deg, #f93b7a 0, #0095e2 100%);";
|
|
} else {
|
|
echo "linear-gradient(120deg, #f93b7a 0, #e0004a 100%);";
|
|
}
|
|
break;
|
|
|
|
default:
|
|
echo "none;";
|
|
break;
|
|
}
|
|
?>
|
|
"><?=$booking_row['state_string']?></td>
|
|
<td>
|
|
<div class="dropdown d-inline-block">
|
|
<a class="nav-link dropdown-toggle arrow-none" id="dLabel4" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
|
|
<i class="fas fa-ellipsis-v font-20 text-muted"></i>
|
|
</a>
|
|
<div class="dropdown-menu dropdown-menu-left" aria-labelledby="dLabel4">
|
|
<a class="dropdown-item" href="edit_booking.php?booking_id=<?=$booking_row['id']?>">تعديل</a>
|
|
<?php
|
|
if ($booking_row['state'] == 4 || $booking_row['state'] == 2) {
|
|
?>
|
|
<a class="dropdown-item" href="active.php?booking_id=<?=$booking_row['id']?>">تفعيل</a>
|
|
<a class="dropdown-item" href="#">ارسال رسالة</a>
|
|
<?php
|
|
}
|
|
?>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
|
|
</tr><!--end tr-->
|
|
<?php
|
|
$count++;
|
|
}
|
|
?>
|
|
</tbody><!--end tbody-->
|
|
</table><!--end table-->
|
|
<script>
|
|
click = 0;
|
|
</script>
|
|
|
|
<?php
|
|
|
|
} else {
|
|
echo"
|
|
<script>
|
|
swalfun('تنبية','لا يوجد اي بيانات لهذا الرقم','info');
|
|
click = 0;
|
|
</script>
|
|
";
|
|
}
|
|
} else {
|
|
echo"
|
|
<script>
|
|
swalfun('حدث خطأ', 'رقم الجوال يجب أن يتكون من 9 أرقام وبدون 0 في البداية', 'error');
|
|
click = 0;
|
|
</script>
|
|
";
|
|
}
|
|
|
|
|
|
|
|
?>
|