Пример #1
0
 public function getRoute()
 {
     // Retrieve the URI
     if (strlen($this->_basepath) > 1) {
         // Local Server
         $uri = str_replace($this->_basepath, "", $_SERVER['REQUEST_URI']);
     } else {
         // AWS Server
         $uri = substr($_SERVER['REQUEST_URI'], 1);
     }
     // If the user is not logged in, go back to Home.
     if ($uri != 'Login') {
         if (!isset($_SESSION['loggedin'])) {
             $uri = 'Home';
         }
     }
     if (strrpos($uri, '/') !== false) {
         $uri = explode('/', $uri);
         $id = $uri[1];
         $uri = $uri[0] . '-';
     }
     // Calls the appropriate controller based on the URI.
     switch ($uri) {
         case 'Home':
             $home = new HomeController();
             $home->display();
             break;
         case 'Account-Summary':
             $summary = new SummaryController();
             $summary->display();
             break;
         case 'Transaction-History-':
             $_SESSION['accountID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Transaction-History");
             break;
         case 'Transaction-History':
             $history = new HistoryController();
             $history->display();
             break;
         case 'Account-Details-':
             $_SESSION['detAccountID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Account-Details");
             break;
         case 'Account-Details':
             $details = new DetailsController();
             $details->display();
             break;
         case 'New-Bill-Payment-':
             $payment = new Paymentamt();
             $payment->setAccountSelected($id);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "New-Bill-Payment");
             break;
         case 'New-Bill-Payment':
             $payment = new PaymentController();
             $payment->display();
             break;
         case 'Bill-Payment-Amount':
             $paymentamt = new PaymentamtController();
             $paymentamt->display();
             break;
         case 'Bill-Payment-Confirmation':
             $paymentconf = new PaymentconfController();
             $paymentconf->display();
             break;
         case 'Bill-Payment-Acknowledgement':
             $paymentack = new PaymentackController();
             $paymentack->display();
             break;
         case 'Payment-List':
             $paymentlist = new PaymentlistController();
             $paymentlist->display();
             break;
         case 'Bill-Payment-List':
             $_SESSION['billPayment'] = true;
             unset($_SESSION['fundsTransferPayment']);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payment-List");
             break;
         case 'Funds-Transfer-Payment-List':
             $_SESSION['fundsTransferPayment'] = true;
             unset($_SESSION['billPayment']);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payment-List");
             break;
         case 'Payee-List':
             $payeelist = new PayeelistController();
             $payeelist->display();
             break;
         case 'Bill-Payee-List':
             $_SESSION['billPayee'] = true;
             unset($_SESSION['fundsTransferPayee']);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payee-List");
             break;
         case 'Funds-Transfer-Payee-List':
             $_SESSION['fundsTransferPayee'] = true;
             unset($_SESSION['billPayee']);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payee-List");
             break;
         case 'Biller-Add':
             $billeradd = new BilleraddController();
             $billeradd->display();
             break;
         case 'Biller-Modify-':
             $_SESSION['billerModifyID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Biller-Modify");
             break;
         case 'Biller-Modify':
             $billermodify = new BillermodifyController();
             $billermodify->display();
             break;
         case 'Biller-Delete-':
             $_SESSION['billerDeleteID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Biller-Delete");
             break;
         case 'Biller-Delete':
             $billerdelete = new BillerdeleteController();
             $billerdelete->display();
             break;
         case 'New-Funds-Transfer-':
             $transfer = new CheckTransfer();
             $transfer->setAccountSelected($id);
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "New-Funds-Transfer");
             break;
         case 'New-Funds-Transfer':
             $transfer = new TransferController();
             $transfer->display();
             break;
         case 'Check-Transfer':
             $checktransfer = new ChecktransferController();
             $checktransfer->display();
             break;
         case 'Funds-Transfer-Acknowledgement':
             $transferack = new TransferackController();
             $transferack->display();
             break;
         case 'Payee-Add':
             $payeeadd = new PayeeaddController();
             $payeeadd->display();
             break;
         case 'Payee-Modify-':
             $_SESSION['payeeModifyID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payee-Modify");
             break;
         case 'Payee-Modify':
             $payeemodify = new PayeemodifyController();
             $payeemodify->display();
             break;
         case 'Payee-Delete-':
             $_SESSION['payeeDeleteID'] = $id;
             $pos = strrpos($_SERVER['HTTP_REFERER'], '/');
             $pos = strlen($_SERVER['HTTP_REFERER']) - $pos;
             header("Location: " . substr($_SERVER['HTTP_REFERER'], 0, -$pos + 1) . "Payee-Delete");
             break;
         case 'Payee-Delete':
             $payeedelete = new PayeedeleteController();
             $payeedelete->display();
             break;
         case 'Login':
             $login = new LoginController();
             $login->login();
             break;
         case 'Logout':
             $logout = new LoginController();
             $logout->logout();
             break;
         default:
             $home = new HomeController();
             $home->display();
             break;
     }
 }
Пример #2
0
<?php

require dirname(__FILE__) . '/../../../config/config.inc.php';
require dirname(__FILE__) . '/controllers/DetailsController.php';
$controller = new DetailsController();
$controller->run();