<?php require_once 'template.php'; page_header(5); if ($_SESSION['user']['is_logged'] == 1) { if (isset($_POST['submit'])) { global $username; $a = new DBConnection(); $Mailer = new App\Utility\Mailer($a); $to = getLang('site_notification'); //$to='@gmail.com'; $first = array_get($username, 'user_firstname'); $last = array_get($username, 'user_lastname'); $user_account_num = array($username, 'user_account_num'); $message = "{$first} {$last} requested funding information {$user_account_num}."; // Create the message $mailerMessage = Swift_Message::newInstance()->setSubject('Request Funding Details')->setFrom(array(getLang('site_notification') => getLang('site_notification')))->setTo(array($to))->setBody($message); try { $Mailer->send($mailerMessage); } catch (Exeption $ex) { } $status = true; } echo ' <div class="flat_area grid_16" style="opacity: 1;"> <h2>' . getLang('deposit_head') . '<small> - ' . getLang('deposit_subhead') . '</small> </h2> </div> ';
$PageTitle = getLang('ptitle_logged'); } else { $PageTitle = getLang('ptitle_notlogged'); } $db = new DBConnection(); $userModel = new App\Model\User($db); $user = $userModel->getUserByUid($_SESSION['user']['user_account_num']); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $db = new DBConnection(); $view = new App\View\View('mail/trade_request'); $view->form = $_POST; $view->user = $user; $to = getLang('site_notification'); $message = \Swift_Message::newInstance('Trade Request from ' . $user['user_account_name']); $message->setFrom($to)->setTo($to)->setBody($view->render(), 'text/html'); $mailer = new App\Utility\Mailer($db); $mailer->send($message); $_SESSION['history_msg'] = 'Request was send'; header('Location: history.php'); exit; } $query = 'SELECT user_firstname, trading_type,user_lastname,user_account_num FROM users WHERE user_account_num="' . $_SESSION['user']['user_account_num'] . '" LIMIT 1'; $res = $db->rq($query); $username = $db->fetch($res); $buyStatuses = array(1 => 'Open', 2 => 'Pending', 3 => 'Disabled', 4 => 'Closed'); $sellStatuses = array(1 => 'Closed', 2 => 'Pending', 3 => 'Disabled'); $tradesBuyOptions = array(1 => 'CALL', 2 => 'PUT'); $query = 'SELECT * FROM trades WHERE user_account_num="' . $_SESSION['user']['user_account_num'] . '" ORDER BY trade_date DESC, trade_action_date DESC, trades_id DESC'; $res = $db->rq($query); if ($user['trading_type'] == 1 || $user['trading_type'] == 3) { $hist_trade_head = array();