-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcash.php
executable file
·77 lines (63 loc) · 2.36 KB
/
cash.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
66
67
68
69
70
71
72
73
74
75
76
77
<?php
require_once 'conf/smarty-conf.php';
include 'functions/cash_functions.php';
include 'functions/user_functions.php';
include 'functions/chat_functions.php';
$module_no = 37;
if ($_SESSION ['login'] == 1) {
if (check_access ( $module_no, $_SESSION ['user_id'] ) == 1) {
if ($_REQUEST ['job'] == "view_form") {
unset ( $_SESSION ['search_branch'] );
unset ( $_SESSION ['from_date'] );
unset ( $_SESSION ['to_date'] );
$smarty->assign ( 'branches', branches () );
$smarty->assign ( 'page', "Cash" );
$smarty->display ( 'cash/cash.tpl' );
}
elseif ($_REQUEST ['job'] == 'list') {
$_SESSION ['search_branch'] = $branch = $_POST ['branch'];
unset ( $_SESSION ['from_date'] );
unset ( $_SESSION ['to_date'] );
$smarty->assign ( 'branches', branches () );
$smarty->assign ( 'branch', $branch );
$smarty->assign ( 'search', "on" );
$smarty->assign ( 'page', "Cash" );
$smarty->display ( 'cash/cash.tpl' );
} elseif ($_REQUEST ['job'] == 'list_full') {
$branch = $_SESSION ['search_branch'];
$_SESSION ['from_date'] = $from_date = $_POST ['from_date'];
$_SESSION ['to_date'] = $to_date = $_POST ['to_date'];
$smarty->assign ( 'branches', branches () );
$smarty->assign ( 'branch', $branch );
$smarty->assign ( 'from_date', $from_date );
$smarty->assign ( 'to_date', $to_date );
$smarty->assign ( 'search', "on" );
$smarty->assign ( 'page', "Cash" );
$smarty->display ( 'cash/cash.tpl' );
} elseif ($_REQUEST ['job'] == 'search') {
$_SESSION ['search'] = $_POST ['search'];
$smarty->assign ( 'search', "$_SESSION[search]" );
$smarty->assign ( 'search_mode', "on" );
$smarty->assign ( 'page', "Bank" );
$smarty->display ( 'bank/add_bank.tpl' );
}
elseif ($_REQUEST ['job'] == 'delete') {
cancel_bank ( $_REQUEST ['id'] );
$smarty->assign ( 'page', "Bank" );
$smarty->display ( 'bank/add_bank.tpl' );
}
else {
$smarty->assign ( 'page', "Bank" );
$smarty->display ( 'bank/add_bank.tpl' );
}
} else {
$smarty->assign ( 'error_report', "on" );
$smarty->assign ( 'error_message', "Dear $_SESSION[user_name], you don't have permission to Bank" );
$smarty->assign ( 'page', "Access Error" );
$smarty->display ( 'user_home/access_error.tpl' );
}
}
else {
$smarty->assign ( 'error', "Incorrect Login Details!" );
$smarty->display ( 'login/login.tpl' );
}