Ejemplo n.º 1
0
 public function init()
 {
     $accounts = new Accounts();
     $accounts->userID = $_SESSION['userID'];
     $_SESSION['accounts'] = $accounts->getAccounts();
     if (!isset($_SESSION['detAccountID'])) {
         $firstAccount = $accounts->getFirstAccount();
         $_SESSION['detAccountID'] = $firstAccount['accountID'];
     }
     $this->setAccountSelected($_SESSION['detAccountID']);
     $account = new Account();
     $account->accountID = $_SESSION['detAccountID'];
     $account->getAccount();
     $_SESSION['detAccountNickname'] = $account->accountNickname;
     $_SESSION['detAccountNumber'] = $account->accountNumber;
     $_SESSION['detProductName'] = $account->productName;
     $_SESSION['detRecordedLimit'] = $account->recordedLimit;
     if (strlen($account->accruedDebitInterest()) == 0) {
         $_SESSION['detAccruedDebitInterest'] = '$0.00';
     } else {
         $_SESSION['detAccruedDebitInterest'] = '$' . number_format($account->accruedDebitInterest(), 2);
     }
     if (strlen($account->accruedCreditInterest()) == 0) {
         $_SESSION['detAccruedCreditInterest'] = '$0.00';
     } else {
         $_SESSION['detAccruedCreditInterest'] = '$' . number_format($account->accruedCreditInterest(), 2);
     }
     if (strlen($account->creditInterestLFY()) == 0) {
         $_SESSION['detInterestEarned'] = '$0.00';
     } else {
         $_SESSION['detInterestEarned'] = '$' . number_format($account->creditInterestLFY(), 2);
     }
 }
Ejemplo n.º 2
0
 public function init()
 {
     $payment = new Payment();
     $payment->cancelSessions();
     $accounts = new Accounts();
     $accounts->userID = $_SESSION['userID'];
     $_SESSION['accounts'] = $accounts->getAccounts();
     $firstAccount = $accounts->getFirstAccount();
     $_SESSION['accountID'] = $firstAccount['accountID'];
     $this->setAccountSelected($_SESSION['accountID']);
     $billerPayees = new BillerPayees();
     $billerPayees->userID = $_SESSION['userID'];
     if (isset($_SESSION['billPayment'])) {
         unset($_SESSION['allPaymentList']);
         $_SESSION['billPaymentList'] = 'selected="selected"';
         $_SESSION['payees'] = $billerPayees->getBillers();
         unset($_SESSION['fundsTransferPaymentList']);
         unset($_SESSION['fundsTransferPayment']);
     } elseif (isset($_SESSION['fundsTransferPayment'])) {
         unset($_SESSION['allPaymentList']);
         unset($_SESSION['billPaymentList']);
         unset($_SESSION['billPayment']);
         $_SESSION['fundsTransferPaymentList'] = 'selected="selected"';
         $_SESSION['payees'] = $billerPayees->getPayees();
     }
     $this->getPayments();
 }
Ejemplo n.º 3
0
 public function init()
 {
     // Retrieves the initial values to be displayed in the Account History Page.
     $accounts = new Accounts();
     $accounts->userID = $_SESSION['userID'];
     if (!isset($_SESSION['accounts'])) {
         $_SESSION['accounts'] = $accounts->getAccounts();
     }
     if (!isset($_SESSION['accountID'])) {
         $account = $accounts->getFirstAccount();
         $_SESSION['accountID'] = $firstAccount['accountID'];
     } else {
         $acct = new Account();
         $acct->accountID = $_SESSION['accountID'];
         $acct->getAccount();
         $openBalance = $acct->openBalance;
         $account = array('openBalance' => $openBalance);
     }
     $this->setAccountSelected($_SESSION['accountID']);
     $_SESSION['toDate'] = date('Y-m-d');
     $_SESSION['fromDate'] = date("Y-m-d", strtotime("-1 months"));
     $transactions = new Transactions();
     $transactions->accountID = $_SESSION['accountID'];
     $arr = array('openBalance' => $account['openBalance']);
     $_SESSION['history'] = $transactions->getTransactions($arr);
     $_SESSION['found'] = $transactions->countTransactions($arr);
     $_SESSION['historyDebit'] = $transactions->getDebits($arr);
     $_SESSION['historyCredit'] = $transactions->getCredits($arr);
     $_SESSION['historyFee'] = $transactions->getFees($arr);
     $_SESSION['historyNet'] = $transactions->getNet($arr);
     $_SESSION['period'] = date('d/m/Y', strtotime($_SESSION['fromDate'])) . ' to ' . date('d/m/Y', strtotime($_SESSION['toDate']));
 }