-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.php
More file actions
42 lines (32 loc) · 993 Bytes
/
App.php
File metadata and controls
42 lines (32 loc) · 993 Bytes
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
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
spl_autoload_register(function ($class) {
include $class . '.php';
});
$params = $_GET;
$dbparams = array ( "host" => 'localhost',
"user" => 'admin',
"password" => '',
"database" => 'base');
$df = new db($dbparams);
$db= $df->getDB();
$logger = new Logger();
$salt='1235';
$url = substr($_SERVER['REQUEST_URI'],1);
$page = preg_replace('/^([^?]+)(\?.*?)?(#.*)?$/', '$1$3', $url);
switch ($page) {
case 'bank1':
$bank = new ProviderController(new Provider1Processor($logger, $salt), $db, $logger);
echo $bank->process($params);
break;
case 'bank2':
$bank = new ProviderController(new Provider2Processor($logger, $salt), $db, $logger);
echo $bank->process($params);
break;
case 'list':
$list = new TransactonPaginator($params['name'], $db);
$list->printer();
break;
}
?>