' . $branch_id; } // $data = array(); // $get_invoices_sql = mysqli_query($db, // "SELECT // `invoices`.`id`, // `invoices`.`number_style`, // `invoices`.`price`, // `invoices`.`date_time` // FROM `invoices` // LEFT JOIN `invoices_details` AS `dd` ON `dd`.`invoices_id` = `invoices`.`id` // LEFT JOIN `branch` ON `dd`.`branch_id` = `branch`.`id` // WHERE `branch`.`id` $branch_sql // AND `invoices`.`date_time` LIKE '$today%' // AND `dd`.`id` IN (SELECT MIN(`id`) FROM `invoices_details` WHERE `invoices_id` = `dd`.`invoices_id`) // ORDER BY `invoices`.`date_time` ASC // "); $error = 0; $data = array(); $get_invoices_sql = mysqli_query( $db, "SELECT `invoices`.`number_style` AS `number_style`, `invoices_details_has_how_pay`.`pay` AS `pay`, `invoices_details`.`invoices_status_id` AS `invoices_status`, `invoices_details`.`id` AS `invoices_details_id`, `invoices_details`.`date_time` AS `date_time`, `user`.`name` AS `user_name_active`, `invoices_details_has_how_pay`.`how_pay_id` AS `how_pay_id`, `services`.`name` AS `services_name`, `book_user`.`name` AS `user_name_book`, `emplyee`.`name` AS `emplyee_name`, `branch`.`branch_name` AS `branch_name`, `book`.`id` AS `book_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` INNER JOIN `user` ON `invoices_details_has_how_pay`.`user_id` = `user`.`id` INNER JOIN `branch` ON `invoices_details`.`branch_id` = `branch`.`id` INNER JOIN `invoices_has_book` ON `invoices_has_book`.`invoices_id` = `invoices`.`id` INNER JOIN `book` ON `book`.`id` = `invoices_has_book`.`book_id` INNER JOIN `book_details` ON `book_details`.`book_id` = `invoices_has_book`.`book_id` AND `book_details`.`id` = (SELECT MAX(`id`) FROM `book_details` WHERE `book_id` = `invoices_has_book`.`book_id`) INNER JOIN `services` ON `book_details`.`services_id` = `services`.`id` INNER JOIN `emplyee` ON `book_details`.`emplyee_id` = `emplyee`.`id` INNER JOIN `user` AS `book_user` ON `book`.`user_id` = `book_user`.`id` WHERE ((`invoices_details_has_how_pay`.`date_time` >= '$frist_day 03:00:00') AND (`invoices_details_has_how_pay`.`date_time` < '$Next_day 03:00:00')) AND `invoices_details`.`branch_id` $branch_sql ORDER BY `invoices`.`date_time` ASC "); // 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[$get_invoices['number_style']][$get_invoices['id']]['cash'] = $get_invoices['pay']; // break; // case '2': // $data[$get_invoices['number_style']][$get_invoices['id']]['card'] = $get_invoices['pay']; // break; // case '3': // $data[$get_invoices['number_style']][$get_invoices['id']]['stuck'] = $get_invoices['pay']; // break; // default: // $error++; // break; // } // break; // case '2': // switch ($get_invoices['how_pay_id']) { // case '1': // $data[$get_invoices['number_style']][$get_invoices['id']]['cash'] = $get_invoices['pay']; // break; // case '2': // $data[$get_invoices['number_style']][$get_invoices['id']]['card'] = $get_invoices['pay']; // break; // case '3': // $data[$get_invoices['number_style']][$get_invoices['id']]['stuck'] = $get_invoices['pay']; // break; // default: // $error++; // break; // } // break; // case '3': // switch ($get_invoices['how_pay_id']) { // case '1': // $data[$get_invoices['number_style']][$get_invoices['id']]['cash'] = $get_invoices['pay']; // break; // case '2': // $data[$get_invoices['number_style']][$get_invoices['id']]['card'] = $get_invoices['pay']; // break; // case '3': // $data[$get_invoices['number_style']][$get_invoices['id']]['stuck'] = $get_invoices['pay']; // break; // default: // $error++; // break; // } // break; // default: // $error++; // break; // } // } // } ?>
| # | رقم الفاتورة | التاريخ والوقت | موظف الحجز | رقم الحجز | موظف التفعيل | الفني | الفرع | الخدمة | العدد | السعر | الاجمالي |
|---|---|---|---|---|---|---|---|---|---|---|---|
| = $count ?> | = $get_invoices['number_style']?> | = $get_invoices['date_time']?> | = $get_invoices['user_name_book']?> | = $get_invoices['book_id']?> | = $get_invoices['user_name_active']?> | = $get_invoices['emplyee_name']?> | = $get_invoices['branch_name']?> | = $get_invoices['services_name']?> | = 1?> | = $get_invoices['pay']?> | = $get_invoices['pay']?> |