-
Notifications
You must be signed in to change notification settings - Fork 2
/
bank.php
71 lines (48 loc) · 1.68 KB
/
bank.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
<?php
#-------------------------------------------
include_once 'config.php';
include_once 'utils.php';
$config = new ConfigStruct();
#check for existing database
if ( !file_exists( $database ) ) {
echo "no database found! - run setup.php";
die;
}
$config->db = new PDO( 'sqlite:' . $database );
$config->orderid = getCurrentOrderId();
#check database version
updateDatabase();
$config->userid = -1;
if ( isset( $_SESSION[ 'userid' ] ) ) {
$config->userid = $_SESSION[ 'userid' ];
}
$config->login = getLogin( $config->userid );
$template_userpanelTxt = "/\[\%userpanel\%\]/";
$template_ordersTxt = "/\[\%orders\%\]/";
# define templates:
$template = "template/bank.html";
#-------------------------------------------
# load template:
$page = file_get_contents( $template );
#-------------------------------------------
$combobox = addUserIdLogin( extractSection( "<!-- customer section transfer -->", $page ),1 );
$page = replaceSection( "<!-- customer section transfer -->", $combobox, $page );
eventBankTransfer();
if ( isBankTransactor() == 0 ) {
$page = removeSection( "<!-- bank section -->", $page );
} else {
eventBankInput();
$combobox = addUserIdLogin( extractSection( "<!-- bank section customer bankInput-->", $page ),0 );
$page = replaceSection( "<!-- bank section customer bankInput-->", $combobox, $page );
}
if ( $config->userid > -1 ) {
input_logout();
$page = preg_replace( "/\[\%loginName\%\]/", $config->login, $page );
$page = preg_replace( "/\[\%money\%\]/", countMoney(), $page );
} else {
$page = removeSection( "<!-- login section -->", $page );
}
$page = showBankInfo( $page );
$page = preg_replace( "/\[\%version\%\]/", getVersion(), $page );
echo $page;
?>