-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbranch_target.php
executable file
·50 lines (36 loc) · 1.27 KB
/
branch_target.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
<?php
require_once 'conf/smarty-conf.php';
include 'functions/user_functions.php';
include 'functions/chat_functions.php';
include 'functions/target_functions.php';
$module_no = 61;
if ($_SESSION ['login'] == 1) {
if (check_access ( $module_no, $_SESSION ['user_id'] ) == 1) {
if ($_REQUEST ['job'] == "branch_target") {
$smarty->assign ( 'page', "branch_target" );
$smarty->display ( 'branch_target/branch_target.tpl' );
}
elseif ($_REQUEST['job'] == 'add') {
$branch = $_POST ['branch'];
$amount = $_POST ['amount'];
$date= $_POST ['date'];
$user_name = $_SESSION ['saved_by'];
save_branch_target($branch, $amount, $date);
$smarty->assign ( 'page', "branch_target" );
$smarty->display ( 'branch_target/branch_target.tpl' );
}
else {
$smarty->assign ( 'page', "branch_target" );
$smarty->display ( 'branch_target/branch_target.tpl' );
}
} else {
$smarty->assign ( 'error_report', "on" );
$smarty->assign ( 'error_message', "Dear $_SESSION[user_name], you don't have permission to branch target" );
$smarty->assign ( 'page', "Access Error" );
$smarty->display ( 'user_home/access_error.tpl' );
}
}
else {
$smarty->assign ( 'error', "Incorrect Login Details!" );
$smarty->display ( 'login/login.tpl' );
}