<?php require_once 'core/init.php'; $user = new User(); if (Input::exists()) { if (Token::check(Input::get('token'))) { $validate = new Validate(); $validation = $validate->check($_POST, array('ddlMyAccounts' => array('name' => "Saját számla", 'required' => true), 'ddlAccountTypes' => array('name' => "Tipus", 'required' => true), 'amount' => array('name' => 'Összeg', 'required' => true, 'min' => 1), 'description' => array('name' => 'Leírás', 'required' => true, 'min' => 7))); if ($validation->passed()) { if (Input::get('amount') <= $user->getAccAmount(Input::get('ddlMyAccounts'))) { $transactionid = $user->getTranByAccID(Input::get('ddlMyAccounts')); if (Input::get('ddlAccountTypes') == "accountid") { $toaccid = $user->getAccByCode(Input::get('accountid')); $totranid = $user->getTranByAccID($toaccid->ID); } else { if (Input::get('ddlAccountTypes') == "contact") { $toaccid = $user->getAccByCode(Input::get('ddlContacts')); $totranid = $user->getTranByAccID($toaccid->ID); } } $senderaccid = Input::get('ddlMyAccounts'); if ($toaccid != 0) { $user->send(array('Transaction_ID' => $transactionid->ID, 'Account_ID' => $toaccid->ID, 'When' => date(DATE_ATOM), 'Amount' => Input::get('amount'), 'IsIncome' => 0, 'Description' => Input::get('description'))); $user->send(array('Transaction_ID' => $totranid->ID, 'Account_ID' => Input::get('ddlMyAccounts'), 'When' => date(DATE_ATOM), 'Amount' => Input::get('amount'), 'IsIncome' => 1, 'Description' => Input::get('description'))); Session::flash('home', 'Tranzakció sikeresen végrehajtva !'); Redirect::to('index.php'); } else { echo 'Tranzakció sikertelen! Ellenőrizze a megadott információkat!'; } } else { echo 'Nincs elég pénz a számláján!!!';
Redirect::to('index.php'); } else { $user = new User($username); if (!$user->exists()) { Redirect::to(404); } else { $data = $user->data(); } ?> <div class="profilform"> <h2><?php echo escape($data->FirstName) . ' ' . escape($data->LastName); ?> </h3> <h4>Egyenleg: <?php echo escape($user->getAccAmount($user->getAccByUserID($data->ID)->ID)->Amount) . ' RON'; ?> </h5> <table class="table"> <thead class="table-invers"> <tr> <th>#</th> <th>Irány</th> <th>Ügyfél</th> <th>Összeg</th> <th>Leírás</th> </tr> </thead> <tbody> <?php $accid = $user->getAccByUserID($user->data()->ID);