-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbooking_transfer.php
executable file
·65 lines (55 loc) · 2.29 KB
/
booking_transfer.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
require_once 'conf/smarty-conf.php';
include 'functions/chat_functions.php';
include 'functions/booking_functions.php';
include 'functions/user_functions.php';
include 'functions/invoice_functions.php';
include 'functions/ledger_functions.php';
$module_no = 35;
if ($_SESSION ['login'] == 1) {
if (check_access ( $module_no, $_SESSION ['user_id'] ) == 1) {
if ($_REQUEST ['job'] == 'transfer') {
unset ( $_SESSION ['search_booking_no'] );
unset ( $_SESSION ['search_customer'] );
unset ( $_SESSION ['from_date'] );
unset ( $_SESSION ['to_date'] );
$smarty->assign ( 'page', "Transfer Bookings" );
$smarty->display ( 'booking/transfer.tpl' );
} elseif ($_REQUEST ['job'] == 'search') {
$_SESSION ['search_booking_no'] = $_POST ['booking_no'];
$_SESSION ['search_customer'] = $_POST ['customer'];
$_SESSION ['from_date'] = $_POST ['from_date'];
$_SESSION ['to_date'] = $_POST ['to_date'];
$smarty->assign ( 'page', "Transfer Bookings" );
$smarty->display ( 'booking/transfer.tpl' );
} elseif ($_REQUEST ['job'] == 'transfer_booking') {
$booking_no = $_REQUEST ['booking_no'];
$to_user = $_POST ['to_user'];
$user_info = get_user_info ( $to_user );
$branch = $user_info ['branch'];
$invoice_info = get_invoice_info_by_booking_no ( $booking_no );
$invoice_no = $invoice_info ['invoice_no'];
transfer_booking_to ( $to_user, $booking_no, $branch );
transfer_invoice_to ( $to_user, $invoice_no, $branch );
transfer_ledger_to ( $to_user, $invoice_no, $branch );
unset ( $_SESSION ['search_booking_no'] );
unset ( $_SESSION ['search_customer'] );
unset ( $_SESSION ['from_date'] );
unset ( $_SESSION ['to_date'] );
$smarty->assign ( 'page', "Transfer Bookings" );
$smarty->display ( 'booking/transfer.tpl' );
} else {
$smarty->assign ( 'page', "Transfer Bookings" );
$smarty->display ( 'booking/transfer.tpl' );
}
} else {
$user_name = $_SESSION ['user_name'];
$smarty->assign ( 'error_report', "on" );
$smarty->assign ( 'error_message', "Dear $user_name, you don't have permission to access Transfer Booking." );
$smarty->assign ( 'page', "Access Error" );
$smarty->display ( 'user_home/access_error.tpl' );
}
} else {
$smarty->assign ( 'page', "Login" );
$smarty->display ( 'login/login.tpl' );
}