loginAdmin(); if(!loggedAdmin()) header('location: index.php'); $transaction = new TransactionCollection(); $clients = ClientCollection::getClients(); $isins = IsinCollection::getIsins(); $collection = new SecurityCollection(); $isinCollection = new IsinCollection; $accounts = CustodyCollection::getAccountsForClientByTransactionId(mysql_real_escape_string($_GET['id'])); if(exist($_POST['button'])) { $result = TransactionCollection::updateTransaction(); } else { TransactionCollection::loadTransaction(); $result = array(); } include("$templates/menu.php"); $clients = ClientCollection::getClients(); $isins = IsinCollection::getIsins(); include("$templates/transaction_edit.php"); include("$templates/footer.php"); ?>
<?php include('../config.php'); include('../functions.php'); include('../classes/transactioncollection.class.php'); include('../classes/clientcollection.class.php'); include('../classes/custodycollection.class.php'); loginAdmin(); if(!loggedAdmin()) header('location: index.php'); include("$templates/menu.php"); $transactions = TransactionCollection::getTransactions(); $clients = ClientCollection::getClients(); include("$templates/trade.php"); include("$templates/footer.php"); ?>
include('classes/securitycollection.class.php'); include('classes/isin.class.php'); include('classes/isincollection.class.php'); include('classes/transactioncollection.class.php'); //check, if client is already logged in. $username=""; $login=""; login(); if(!logged()) { include('login_header.php'); } elseif(isset($_POST['button'])) { //process data $transaction = new TransactionCollection(); $collection = new SecurityCollection(); $isinCollection = new IsinCollection; $client = new Client; $isins = $isinCollection->getIsins(); $accounts = getAccounts(); $result = $transaction->saveTransaction(); if(empty($result)) { header('location: create_success.php'); } else { include($templates.'menu.html');
static public function updateTransaction() { $result = TransactionCollection::verifyFields(); if(count($result)) return ($result); $fields = explode(',','security1,Amount,account,status'); $fieldsDb = explode(',','id_isin1,amount1,id_account,status'); $partOfQuery = array(); foreach($fields as $key=>$value): $partOfQuery[]="`".$fieldsDb[$key]."` = '".$_POST[$fields[$key]]."'"; endforeach; $query = "UPDATE `transactions` SET ".implode(" , ",$partOfQuery)." WHERE id = '".$_POST['id']."';"; //echo$query; mysql_query($query); header('location: transaction_updated.php'); }
public function getTransactions($type) { self::$transactions= TransactionCollection::retrieveByClient($type,$this->getId()); return self::$transactions; }