Compare commits
75 Commits
flo_id_aut
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d1abf710bb | |||
| 02680ef541 | |||
| 1812de3efe | |||
| effe1565ee | |||
| d6b949cb1d | |||
| ae39d8dc31 | |||
| ff09d4f35b | |||
| 40dfd00804 | |||
| 57a54c2ce4 | |||
| c7463192bb | |||
| dcd47dea68 | |||
| b9dbe462ac | |||
| bfe2b1e36c | |||
| 52e2383c4a | |||
| ab15e23669 | |||
| 1a30bc92ac | |||
| d9229875de | |||
| 375de4aece | |||
| 7ba56ab27f | |||
| 59fc5c9e38 | |||
| 64671dce58 | |||
| 95d5cebde6 | |||
| 66dc614d76 | |||
| 39939da134 | |||
| 8b4251bd1f | |||
| 124de84f80 | |||
| e38797b484 | |||
| 34bb0cf5bd | |||
| 5d9752700d | |||
| bf25ea18df | |||
| ebae79f7c7 | |||
| ff7282c0ec | |||
| 5d030c04d2 | |||
| b91ced6418 | |||
| c94dd23905 | |||
| 95983e695b | |||
| fc4dd0baf6 | |||
| 811f27f237 | |||
| 2b00129857 | |||
| d19f674da0 | |||
| 0ce31abf3d | |||
| 072cfb046b | |||
| 3287d084c3 | |||
| 21ac9826c8 | |||
| 3a0d5dd7f8 | |||
| fd61e27e2e | |||
| ca2df1f142 | |||
| 1f0ef88b62 | |||
| bd2609b6d9 | |||
| 7852716e3d | |||
| c537e6e410 | |||
| 12dc47a848 | |||
| 71bfb900d0 | |||
| 313389e8b7 | |||
| b13cbd58e5 | |||
| 370e66bf38 | |||
| 30f4136041 | |||
| 97520d0ac0 | |||
| 696b963265 | |||
| ae6add301a | |||
| fe9d9b069f | |||
| 827df705bb | |||
| 4a39567ee8 | |||
| 5abd3f713c | |||
| 0467e08470 | |||
| 1f80437960 | |||
| c08efff431 | |||
| d615aa756d | |||
| ffb8c97c48 | |||
| 49c7994dbc | |||
| 157658bf2a | |||
| a7bd4cc744 | |||
| 533f86239a | |||
| bac728c449 | |||
| bfa5345d4a |
@ -2,7 +2,7 @@
|
||||
<?php
|
||||
if (isset($_SESSION['user_id']) && $_SESSION['user_id'] != null) {
|
||||
|
||||
$is_activated = $UserClass->check_user($_SESSION['user_id']);
|
||||
$is_activated = check_user($_SESSION['user_id']);
|
||||
if(!$is_activated) { ?>
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 9/27/2017
|
||||
* Time: 5:21 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -14,13 +7,13 @@ if (!checkLoginStatus()) {
|
||||
|
||||
if(isset($_POST['job']) && $_POST['job'] == 'total_my_messages') {
|
||||
|
||||
if (isset($UserClass, $OrderClass, $user_id)) {
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
if (isset($user_id)) {
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
return false;
|
||||
}
|
||||
echo $total_my_orders = (int) $OrderClass->total_my_messages();
|
||||
echo $total_my_orders = (int) total_my_messages();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 9/27/2017
|
||||
* Time: 5:21 PM
|
||||
*/
|
||||
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
@ -15,13 +8,13 @@ if (!checkLoginStatus()) {
|
||||
|
||||
if(isset($_POST['job']) && $_POST['job'] == 'total_my_orders') {
|
||||
|
||||
if (isset($UserClass, $OrderClass, $user_id)) {
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
if (isset($user_id)) {
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
return false;
|
||||
}
|
||||
echo $total_my_orders = (int) $OrderClass->total_my_orders();
|
||||
echo $total_my_orders = (int) total_my_orders();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 9/27/2017
|
||||
* Time: 5:21 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
@ -14,9 +8,6 @@ if (!checkLoginStatus()) {
|
||||
|
||||
if(isset($_POST['job']) && $_POST['job'] == 'total_my_transactions') {
|
||||
|
||||
if (isset($UserClass, $OrderClass)) {
|
||||
|
||||
echo $total_my_orders = (int) $OrderClass->total_my_transactions();
|
||||
}
|
||||
|
||||
echo $total_my_orders = (int) total_my_transactions();
|
||||
|
||||
}
|
||||
|
||||
@ -1,18 +1,9 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Sinha
|
||||
* Date: 11/15/2016
|
||||
* Time: 11:13 AM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (isset($_POST['task']) && trim($_POST['task'])=='run_OrderMatcingAlgorithm') {
|
||||
|
||||
if (isset($OrderClass, $UserClass)) {
|
||||
|
||||
$refresh_orders = $OrderClass->OrderMatchingService();
|
||||
$refresh_orders = OrderMatchingService();
|
||||
|
||||
/*If user is logged in user send him messages, if any*/
|
||||
if (checkLoginStatus()) {
|
||||
@ -25,7 +16,7 @@ if (isset($_POST['task']) && trim($_POST['task'])=='run_OrderMatcingAlgorithm')
|
||||
|
||||
if (isset($user_id)) {
|
||||
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
$std->error = true;
|
||||
@ -45,7 +36,7 @@ if (isset($_POST['task']) && trim($_POST['task'])=='run_OrderMatcingAlgorithm')
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
55
ajax/acceptNewUser.php
Normal file
55
ajax/acceptNewUser.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
session_start();
|
||||
|
||||
|
||||
//CRITICAL: THIS FILE NEEDS AUTHENTICATION -- ADD IT --ADDED
|
||||
if (!checkLoginStatus()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//AUTHORIZATION CHECK
|
||||
if (isset($_SESSION['flo_id'], $_SESSION['user_id'])) {
|
||||
$root_flo = $_SESSION['flo_id'];
|
||||
$root_user_id = $_SESSION['user_id'];
|
||||
|
||||
if ($root_flo != ADMIN_FLO_ID && $root_user_id != ADMIN_ID) {
|
||||
redirect_to("index.php");
|
||||
}
|
||||
|
||||
|
||||
if ((isset($_POST['flo_id']) && ($_POST['task'] == 'approve_user'))){
|
||||
|
||||
ob_start();
|
||||
|
||||
|
||||
$floID = $_POST['flo_id'];
|
||||
$newUserDetails = findNewUserDetails($floID);
|
||||
|
||||
$fullName = $newUserDetails->full_name;
|
||||
$emailID = $newUserDetails->email;
|
||||
|
||||
acceptUser($floID,$fullName,$emailID);
|
||||
$result = "approved";
|
||||
deleteNewUser($floID);
|
||||
echo $result;
|
||||
exit();
|
||||
}
|
||||
|
||||
if ((isset($_POST['flo_id']) && ($_POST['task'] == 'reject_user'))){
|
||||
|
||||
ob_start();
|
||||
|
||||
|
||||
$floID = $_POST['flo_id'];
|
||||
deleteNewUser($floID);
|
||||
|
||||
$result = "deleted";
|
||||
echo $result;
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/21/2017
|
||||
* Time: 5:57 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -28,7 +21,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "add_bank_account") {
|
||||
|
||||
if (empty($account_holder_name) || empty($account_number) || empty($bank_name) || empty($branch_name) || empty($bank_addr) || empty($bk_ctry)) {
|
||||
$mess = "Bank Account Addition Failure: Please fill all fields with valid data!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -36,7 +29,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "add_bank_account") {
|
||||
|
||||
if(!preg_match("/^[a-zA-Z ]+$/", $account_holder_name) == 1) {
|
||||
$mess = "Bank Account Addition Failure: Account Holder name must be only in alphabetical characters!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -44,7 +37,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "add_bank_account") {
|
||||
|
||||
if(!preg_match("/^[a-zA-Z0-9]+$/", $account_number) == 1) {
|
||||
$mess = "Bank Account Addition Failure: Account number must be only in alphanumeric characters!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -52,17 +45,17 @@ if (isset($_POST['job']) && trim($_POST['job']) == "add_bank_account") {
|
||||
|
||||
if((!preg_match("/^[a-zA-Z ]+$/", $bank_name) == 1) || (!preg_match("/^[a-zA-Z-,: ]+$/", $branch_name) == 1) || (!preg_match("/^[a-zA-Z ]+$/", $bk_ctry) == 1)) {
|
||||
$mess = "Bank Account Addition Failure: Bank name, Bank country and branch name must be only in alphabetical characters!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$add_bank_account = $OrderClass->add_bank_account($user_id, $account_holder_name, $bank_name, $account_number, $branch_name, $bank_addr, $bk_ctry);
|
||||
$add_bank_account = add_bank_account($user_id, $account_holder_name, $bank_name, $account_number, $branch_name, $bank_addr, $bk_ctry);
|
||||
|
||||
if ($add_bank_account) {
|
||||
$mess = "Bank Account Addition: Bank account <strong>$account_number</strong> was added successfully.!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = false;
|
||||
}
|
||||
@ -71,4 +64,4 @@ if (isset($_POST['job']) && trim($_POST['job']) == "add_bank_account") {
|
||||
exit;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,10 +53,11 @@ $std->error = true;
|
||||
$floID = $_POST['floID'];
|
||||
$pubKey = $_POST['floPubKey'];
|
||||
$s_id = $_SESSION['session_id'];
|
||||
$s_id_time_rand = $_SESSION['session_id'] . round(time()/1000)*1000 . $_SESSION['rand'];
|
||||
$signDataWithFlo = $_POST['signDataWithFlo'];
|
||||
|
||||
|
||||
$data_array = array( "floID" => $floID, "pubKey" => $pubKey, "message" => $s_id, "sign" => $signDataWithFlo );
|
||||
$data_array = array( "floID" => $floID, "pubKey" => $pubKey, "message" => $s_id_time_rand, "sign" => $signDataWithFlo );
|
||||
$make_call = callAPI('POST', 'https://flo-sign-validator.duckdns.org', json_encode($data_array));
|
||||
$response = json_decode($make_call, true);
|
||||
|
||||
@ -75,12 +76,12 @@ $std->error = true;
|
||||
|
||||
//Now I need to enter public key and session ID in database .. but first I need to know the username
|
||||
// This check can be suspended here. If the user has correct FLO signature, but does not exist in database, he will fail the gate at acc_deact.php
|
||||
if (isset($UserClass)) {
|
||||
$permitted_status = $UserClass->checkIfFloIDPermitted($floID);
|
||||
|
||||
$permitted_status = checkIfFloIDPermitted($floID);
|
||||
if ($permitted_status == true){
|
||||
$UserClass->update_flo_details($floID, $s_id, $pubKey);
|
||||
update_flo_details($floID, $s_id, $pubKey);
|
||||
|
||||
$userDetails = $UserClass->getUserDetails($floID);
|
||||
$userDetails = getUserDetails($floID);
|
||||
$_SESSION['user_id'] = $userDetails->CustomerId;
|
||||
$_SESSION['user_name'] = $userDetails->Name;
|
||||
$_SESSION['email'] = $userDetails->Email;
|
||||
@ -92,18 +93,18 @@ $std->error = true;
|
||||
echo json_encode($std);
|
||||
return true;
|
||||
} else {
|
||||
if (($UserClass->check_flo_id_registration_status($floID) == true) && ($UserClass->check_flo_id_active_status($floID) != true)) {
|
||||
if ((check_flo_id_registration_status($floID) == true) && (check_flo_id_active_status($floID) != true)) {
|
||||
$std->message[] = "FLO ID is not active. Please contact RanchiMall Team. ";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
return false; }
|
||||
if ($UserClass->check_flo_id_registration_status($floID) != true ) {
|
||||
if (check_flo_id_registration_status($floID) != true ) {
|
||||
$std->message[] = "Your FLO ID is not registered. Please contact RanchiMall Team and get yourself registered.";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
return false; }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -120,3 +121,6 @@ $std->error = true;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 12/1/2017
|
||||
* Time: 3:31 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -13,9 +8,9 @@ if (!checkLoginStatus()) {
|
||||
|
||||
$last_trade_date = $_SESSION['last_trade_date'];
|
||||
|
||||
$lod = $OrderClass->get_last_order_date($last_trade_date);
|
||||
$lod = get_last_order_date($last_trade_date);
|
||||
|
||||
if ($lod) {
|
||||
$_SESSION['last_trade_date'] = $UserClass->time_now();
|
||||
$_SESSION['last_trade_date'] = time_now();
|
||||
}
|
||||
echo $lod;
|
||||
echo $lod;
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/7/2017
|
||||
* Time: 11:07 AM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
@ -16,19 +10,19 @@ if (isset($_POST['task'], $_POST['id']) && trim($_POST['task'])=="delOrder") {
|
||||
|
||||
$del_id = extract_int($_POST['id']);
|
||||
|
||||
if (isset($OrderClass, $UserClass, $user_id)) {
|
||||
if (isset($user_id)) {
|
||||
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$del_order = $OrderClass->del_order($del_id);
|
||||
$del_order = del_order($del_id);
|
||||
|
||||
if ($del_order) {
|
||||
echo true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +1,11 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Sinha
|
||||
* Date: 11/16/2016
|
||||
* Time: 8:36 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['task']) && trim($_POST['task'])=='get_my_balance') {
|
||||
|
||||
$std = new stdClass();
|
||||
@ -20,14 +15,14 @@ if (isset($_POST['task']) && trim($_POST['task'])=='get_my_balance') {
|
||||
$std->message = array();
|
||||
$std->error = true;
|
||||
|
||||
if (isset($OrderClass, $UserClass, $user_id)) {
|
||||
if (isset($user_id)) {
|
||||
|
||||
$UserClass = new Users();
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
|
||||
$OrderClass = new Orders();
|
||||
$cash_balance = $OrderClass->check_customer_balance($assetType = 'traditional', $user_id)->Balance;
|
||||
$bit_balance = $OrderClass->check_customer_balance($assetType = 'btc', $user_id)->Balance;
|
||||
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
|
||||
$cash_balance = check_customer_balance($assetType = 'traditional', $user_id)->Balance;
|
||||
$bit_balance = check_customer_balance($assetType = 'btc', $user_id)->Balance;
|
||||
|
||||
$std->users = $validate_user;
|
||||
$std->cash = round_it($cash_balance, 2);
|
||||
@ -43,4 +38,4 @@ if (isset($_POST['task']) && trim($_POST['task'])=='get_my_balance') {
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/6/2017
|
||||
* Time: 7:09 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -14,8 +7,8 @@ if (!checkLoginStatus()) {
|
||||
|
||||
if(isset($_POST['req']) && $_POST['req'] == 'loadMoreMyMessages') {
|
||||
|
||||
if (isset($UserClass, $OrderClass, $user_id)) {
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
if (isset($user_id)) {
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
return false;
|
||||
@ -30,7 +23,7 @@ if(isset($_POST['req']) && $_POST['req'] == 'loadMoreMyMessages') {
|
||||
$start = (int) $_POST['start'];
|
||||
$records = (int) $_POST['records_per_page'];
|
||||
|
||||
$megs = $UserClass->list_messages_by_userId($user_id, $start, $records);
|
||||
$megs = list_messages_by_userId($user_id, $start, $records);
|
||||
|
||||
if (is_array($megs) && !empty($megs)) {
|
||||
$std->msg = $megs;
|
||||
@ -39,4 +32,4 @@ if(isset($_POST['req']) && $_POST['req'] == 'loadMoreMyMessages') {
|
||||
}
|
||||
echo json_encode($std);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/6/2017
|
||||
* Time: 7:09 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
@ -14,8 +8,8 @@ if (!checkLoginStatus()) {
|
||||
|
||||
if(isset($_POST['req']) && $_POST['req'] == 'loadMoreMyOrders') {
|
||||
|
||||
if (isset($UserClass, $OrderClass, $user_id)) {
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
if (isset($user_id)) {
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
return false;
|
||||
@ -27,9 +21,9 @@ if(isset($_POST['req']) && $_POST['req'] == 'loadMoreMyOrders') {
|
||||
$records = (int) $_POST['records_per_page'];
|
||||
|
||||
$iter = "";
|
||||
if (isset($OrderClass, $user_id)) {
|
||||
if (isset($user_id)) {
|
||||
|
||||
$myOrders = $OrderClass->UserOrdersList($user_id, $start, $records);
|
||||
$myOrders = UserOrdersList($user_id, $start, $records);
|
||||
|
||||
if (is_array($myOrders) && !empty($myOrders)) {
|
||||
|
||||
@ -85,4 +79,4 @@ if(isset($_POST['req']) && $_POST['req'] == 'loadMoreMyOrders') {
|
||||
echo $iter;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/6/2017
|
||||
* Time: 7:09 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -14,8 +7,8 @@ if (!checkLoginStatus()) {
|
||||
|
||||
if(isset($_POST['req']) && $_POST['req'] == 'loadMoreMyTransactions') {
|
||||
|
||||
if (isset($UserClass, $OrderClass, $user_id)) {
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
if (isset($user_id)) {
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
return false;
|
||||
@ -30,7 +23,7 @@ if(isset($_POST['req']) && $_POST['req'] == 'loadMoreMyTransactions') {
|
||||
$start = (int) $_POST['start'];
|
||||
$records = (int) $_POST['records_per_page'];
|
||||
|
||||
$megs = $UserClass->displayUserTransaction($user_id, $start, $records);
|
||||
$megs = displayUserTransaction($user_id, $start, $records);
|
||||
|
||||
if (is_array($megs) && !empty($megs)) {
|
||||
$std->trade_list = $megs;
|
||||
@ -39,4 +32,4 @@ if(isset($_POST['req']) && $_POST['req'] == 'loadMoreMyTransactions') {
|
||||
}
|
||||
echo json_encode($std);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,17 +1,8 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/6/2017
|
||||
* Time: 7:09 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if(isset($_POST['req']) && $_POST['req'] == 'loadMoreRecentTransactions') {
|
||||
|
||||
if (isset($UserClass, $OrderClass)) {
|
||||
|
||||
$std = new stdClass();
|
||||
$std->msg = array();
|
||||
$std->error = true;
|
||||
@ -21,7 +12,7 @@ if(isset($_POST['req']) && $_POST['req'] == 'loadMoreRecentTransactions') {
|
||||
$start = (int) $_POST['start'];
|
||||
$records = (int) $_POST['records_per_page'];
|
||||
|
||||
$megs = $OrderClass->last_transaction_list($start, $records);
|
||||
$megs = last_transaction_list($start, $records);
|
||||
|
||||
if (is_array($megs) && !empty($megs)) {
|
||||
$std->trade_list = $megs;
|
||||
@ -29,5 +20,4 @@ if(isset($_POST['req']) && $_POST['req'] == 'loadMoreRecentTransactions') {
|
||||
}
|
||||
}
|
||||
echo json_encode($std);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ if (isset($_POST['job'])) {
|
||||
|
||||
if (empty($btc_today)) {
|
||||
$mess[] = "BTC2CASH Error: Something went wrong. Please refresh the page and try again.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess." Failed to fetch price of 1 bitcoin today.");
|
||||
storeMessagesPublic(null, $user_id, $mess." Failed to fetch price of 1 bitcoin today.");
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -33,7 +33,7 @@ if (isset($_POST['job'])) {
|
||||
|
||||
if (empty($amount_to_load) || empty($equivalent_btc)) {
|
||||
$mess[] = "BTC2CASH Error: Please fill all the required fields.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -43,7 +43,7 @@ if (isset($_POST['job'])) {
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
$mess = "BTC2CASH error: No such user exist. Please login again.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
@ -54,7 +54,7 @@ if (isset($_POST['job'])) {
|
||||
|
||||
if (!is_email($email_id)) {
|
||||
$mess = "BTC2CASH error: Please provide a valid email id!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
@ -64,7 +64,7 @@ if (isset($_POST['job'])) {
|
||||
if (strlen($remarks) > 250) {
|
||||
$mess = "BTC2CASH error: Remarks up to 250 characters allowed only!";
|
||||
$std->mesg[] = $mess;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -73,7 +73,7 @@ if (isset($_POST['job'])) {
|
||||
if (!preg_match("/^[a-zA-Z0-9 \r\n]*$/", $remarks)) {
|
||||
$mess = "BTC2CASH error: Only alphanumeric characters are allowed in remarks!";
|
||||
$std->mesg[] = $mess;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
@ -103,12 +103,12 @@ if (isset($_POST['job'])) {
|
||||
</footer>
|
||||
</div>";
|
||||
|
||||
$send_mail = $OrderClass->send_notice_mail($reciever_email, $email_from, $email_sender, $email_subject, $email_body);
|
||||
$send_mail = send_notice_mail($reciever_email, $email_from, $email_sender, $email_subject, $email_body);
|
||||
|
||||
if($send_mail) {
|
||||
//$mess = "BTC2CASH Request: You sent a request to deposit BTC $equivalent_btc to Ranchi Mall to receive $ $amount_to_load. You will receive an email from Ranchi Mall. Please follow the instructions provided in that email.";
|
||||
$mess = "BTC2CASH Request: You sent a request to deposit BTC $equivalent_btc to Ranchi Mall to receive $ $amount_to_load. Please send the Bitcoins to address provided in the 'Load Cash to my trading account' tab below.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = false;
|
||||
$std->mesg[] = $mess;
|
||||
}
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Sinha
|
||||
* Date: 11/26/2016
|
||||
* Time: 7:10 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -20,9 +13,9 @@ if(isset($_POST['job']) && $_POST['job'] == 'market_order') {
|
||||
$std->error = false;
|
||||
$std->msg = null;
|
||||
|
||||
if (isset($OrderClass, $UserClass, $user_id)) {
|
||||
if (isset($user_id)) {
|
||||
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
$std->error = true;
|
||||
@ -58,7 +51,7 @@ if(isset($_POST['job']) && $_POST['job'] == 'market_order') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$run_market_order = $OrderClass->market_order($order_type, $qty);
|
||||
$run_market_order = market_order($order_type, $qty);
|
||||
|
||||
$std->user = $validate_user;
|
||||
$std->order = $run_market_order;
|
||||
@ -74,4 +67,4 @@ if(isset($_POST['job']) && $_POST['job'] == 'market_order') {
|
||||
echo json_encode($std);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 10:44 AM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
@ -13,13 +7,13 @@ if (!checkLoginStatus()) {
|
||||
}
|
||||
|
||||
if (isset($_POST['task']) && $_POST['task']=='loadMyMessagesList') {
|
||||
if (isset($UserClass, $OrderClass, $user_id) && $UserClass!=null && $OrderClass!=null) {
|
||||
if (isset($user_id)) {
|
||||
|
||||
$std = new stdClass();
|
||||
$std->msg = null;
|
||||
$std->error = true;
|
||||
|
||||
$my_messages = $UserClass->list_messages_by_userId($user_id, 0, 10);
|
||||
$my_messages = list_messages_by_userId($user_id, 0, 10);
|
||||
|
||||
if (is_array($my_messages) && !empty($my_messages)) {
|
||||
$std->msg = $my_messages;
|
||||
@ -29,4 +23,4 @@ if (isset($_POST['task']) && $_POST['task']=='loadMyMessagesList') {
|
||||
echo json_encode($std);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 9/27/2017
|
||||
* Time: 3:22 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -15,9 +8,9 @@ if (!checkLoginStatus()) {
|
||||
if (isset($_POST['task']) && trim($_POST['task'])=='loadMyOrdersList') {
|
||||
|
||||
$iter = "";
|
||||
if (isset($OrderClass, $user_id)) {
|
||||
if (isset($user_id)) {
|
||||
|
||||
$myOrders = $OrderClass->UserOrdersList($user_id, 0, 10);
|
||||
$myOrders = UserOrdersList($user_id, 0, 10);
|
||||
|
||||
if (is_array($myOrders) && !empty($myOrders)) {
|
||||
|
||||
@ -75,4 +68,4 @@ if (isset($_POST['task']) && trim($_POST['task'])=='loadMyOrdersList') {
|
||||
echo $iter;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Sinha
|
||||
* Date: 6/24/2017
|
||||
* Time: 8:38 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -18,9 +11,9 @@ if (isset($_POST['task']) && trim($_POST['task'])=='myTransactions') {
|
||||
$std->trade_list = array();
|
||||
$std->error = true;
|
||||
|
||||
if (isset($UserClass, $user_id)) {
|
||||
if (isset($user_id)) {
|
||||
|
||||
$tradeList = $UserClass->displayUserTransaction($user_id, 0, 10);
|
||||
$tradeList = displayUserTransaction($user_id, 0, 10);
|
||||
|
||||
$std->trade_list = $tradeList;
|
||||
$std->error = false;
|
||||
@ -30,4 +23,4 @@ if (isset($_POST['task']) && trim($_POST['task'])=='myTransactions') {
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "pay_in_btc") {
|
||||
|
||||
if (empty($balance_to_transfer) || empty($btc_addr)) {
|
||||
$mess = "E2BTC error: Please fill all the required fields!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
@ -28,7 +28,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "pay_in_btc") {
|
||||
|
||||
if ((!preg_match("/^[a-zA-Z0-9]+$/", $btc_addr) == 1) || strlen(trim($btc_addr)) !== 34) {
|
||||
$mess = "E2BTC error: Invalid Bitcoin address!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
@ -37,7 +37,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "pay_in_btc") {
|
||||
|
||||
if (strlen($remarks) > 250) {
|
||||
$mess = "E2BTC error: Remarks up to 250 characters allowed only!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
@ -46,18 +46,18 @@ if (isset($_POST['job']) && trim($_POST['job']) == "pay_in_btc") {
|
||||
|
||||
if (!preg_match("/^[a-zA-Z0-9 \r\n]*$/",$remarks)) {
|
||||
$mess = "E2BTC error: Only alphanumeric characters allowed in Remarks!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
$mess = "E2BTC error: No such user exist. Please login again.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
@ -68,21 +68,21 @@ if (isset($_POST['job']) && trim($_POST['job']) == "pay_in_btc") {
|
||||
|
||||
if ($senders_email == null || !is_email($senders_email)) {
|
||||
$mess = "E2BTC error: Invalid email format!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$customer_bal = (float) $OrderClass->check_customer_balance($assetType="traditional", $user_id)->Balance;
|
||||
$customer_bal = (float) check_customer_balance($assetType="traditional", $user_id)->Balance;
|
||||
|
||||
if ($balance_to_transfer > $customer_bal) {
|
||||
$mess = "E2BTC transaction failed: You have insufficient balance to make this transfer. Your current Cash balance is $ $customer_bal.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "pay_in_btc") {
|
||||
$WantAssetTypeId = 'RMT';
|
||||
$assetType = 'traditional';
|
||||
$allowed_bid_amount = $customer_bal;
|
||||
$user_active_orders = $OrderClass->get_active_order_of_user($user_id, TOP_BUYS_TABLE);
|
||||
$user_active_orders = get_active_order_of_user($user_id, TOP_BUYS_TABLE);
|
||||
$frozen_bal_buys = 0;
|
||||
if (is_array($user_active_orders) && !empty($user_active_orders)) {
|
||||
foreach ($user_active_orders as $uao) {
|
||||
@ -108,7 +108,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "pay_in_btc") {
|
||||
}
|
||||
|
||||
if ($frozen_bal_buys + $balance_to_transfer > $customer_bal) {
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $msss);
|
||||
storeMessagesPublic(null, $user_id, $msss);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $msss;
|
||||
echo json_encode($std);
|
||||
@ -137,7 +137,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "pay_in_btc") {
|
||||
<p>AMOUNT TO TRANSFER: <strong>$ $balance_to_transfer</strong> (DO NOT SEND MORE THAN $ $allowed_bid_amount.)</p>
|
||||
<p>EMAIL: $senders_email</p>
|
||||
<p>REMARKS: <strong>".$remarks."</strong></p>
|
||||
<p>SENDER FLO ID: ".$flo_id."</p>
|
||||
<p>SENDER FB ID: ".$flo_id."</p>
|
||||
</div>
|
||||
<footer>
|
||||
<p>Thank You</p>
|
||||
@ -146,23 +146,23 @@ if (isset($_POST['job']) && trim($_POST['job']) == "pay_in_btc") {
|
||||
</footer>
|
||||
</div>";
|
||||
|
||||
$send_mail = $OrderClass->send_notice_mail($reciever_email, $email_from, $email_sender, $email_subject, $email_body);
|
||||
$send_mail = send_notice_mail($reciever_email, $email_from, $email_sender, $email_subject, $email_body);
|
||||
$transfer_funds = null;
|
||||
if($send_mail) {
|
||||
/*Transfer funds from site to bank account*/
|
||||
$transfer_funds = $OrderClass->fund_transfer($fund_type="E2BTC", $from="Exchange", $to=$btc_addr, $balance_to_transfer, $remarks, $assetType = 'traditional');
|
||||
$transfer_funds = fund_transfer($fund_type="E2BTC", $from="Exchange", $to=$btc_addr, $balance_to_transfer, $remarks, $assetType = 'traditional');
|
||||
}
|
||||
|
||||
if ($transfer_funds) {
|
||||
$mess = "E2BTC Transaction Success: Please check your mail to approve this request.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = false;
|
||||
$std->mesg[] = $mess;
|
||||
$std->user = $validate_user;
|
||||
|
||||
} else {
|
||||
$mess = "E2BTC error: Mail could not be sent. Try again.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
$std->user = $validate_user;
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Sinha
|
||||
* Date: 11/9/2016
|
||||
* Time: 1:55 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -66,9 +59,9 @@ if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
$validate_user = "";
|
||||
$place_order = "";
|
||||
|
||||
if (isset($OrderClass, $UserClass, $user_id)) {
|
||||
if (isset($user_id)) {
|
||||
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
$std->error = true;
|
||||
@ -77,12 +70,12 @@ if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$user_current_bal = (float) $OrderClass->check_customer_balance($assetType, $user_id)->Balance;
|
||||
$user_current_bal = (float) check_customer_balance($assetType, $user_id)->Balance;
|
||||
|
||||
$top_tbl = null;
|
||||
if ($orderTypeId == 0) {
|
||||
$top_tbl = TOP_BUYS_TABLE;
|
||||
$user_active_orders = $OrderClass->get_active_order_of_user($user_id, $top_tbl);
|
||||
$user_active_orders = get_active_order_of_user($user_id, $top_tbl);
|
||||
|
||||
$frozen_bal = 0;
|
||||
if (is_array($user_active_orders) && !empty($user_active_orders)) {
|
||||
@ -103,7 +96,7 @@ if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
|
||||
} elseif ($orderTypeId == 1) {
|
||||
$top_tbl = TOP_SELL_TABLE;
|
||||
$user_active_orders = $OrderClass->get_active_order_of_user($user_id, $top_tbl);
|
||||
$user_active_orders = get_active_order_of_user($user_id, $top_tbl);
|
||||
$frozen_bal = 0;
|
||||
if (is_array($user_active_orders) && !empty($user_active_orders)) {
|
||||
foreach ($user_active_orders as $uao) {
|
||||
@ -125,7 +118,7 @@ if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$place_order = $OrderClass->insert_pending_order($orderTypeId, $qty, $item_price, $orderStatusId, $OfferAssetTypeId, $WantAssetTypeId);
|
||||
$place_order = insert_pending_order($orderTypeId, $qty, $item_price, $orderStatusId, $OfferAssetTypeId, $WantAssetTypeId);
|
||||
|
||||
} else {
|
||||
$std->error = true;
|
||||
@ -139,4 +132,4 @@ if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,17 +1,6 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 9/27/2017
|
||||
* Time: 5:21 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if(isset($_POST['job']) && $_POST['job'] == 'total_recent_transactions') {
|
||||
|
||||
if (isset($UserClass, $OrderClass)) {
|
||||
echo $total_my_orders = (int) $OrderClass->total_recent_transactions();
|
||||
}
|
||||
|
||||
echo $total_my_orders = (int) total_recent_transactions();
|
||||
}
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Sinha
|
||||
* Date: 11/15/2016
|
||||
* Time: 6:22 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (isset($_POST['task']) && trim($_POST['task'])=='refresh') {
|
||||
@ -16,17 +9,17 @@ if (isset($_POST['task']) && trim($_POST['task'])=='refresh') {
|
||||
$std->message = array();
|
||||
$std->error = true;
|
||||
|
||||
if (isset($OrderClass, $UserClass)) {
|
||||
|
||||
|
||||
$buy_list = $OrderClass->get_top_buy_sell_list(TOP_BUYS_TABLE, $asc_desc='DESC'); // buy
|
||||
$sell_list = $OrderClass->get_top_buy_sell_list(TOP_SELL_TABLE, $asc_desc='ASC'); // sell
|
||||
$buy_list = get_top_buy_sell_list(TOP_BUYS_TABLE, $asc_desc='DESC'); // buy
|
||||
$sell_list = get_top_buy_sell_list(TOP_SELL_TABLE, $asc_desc='ASC'); // sell
|
||||
|
||||
$std->buys = $buy_list;
|
||||
$std->sells = $sell_list;
|
||||
$std->error = false;
|
||||
}
|
||||
|
||||
echo json_encode($std);
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
121
ajax/registerMe.php
Normal file
121
ajax/registerMe.php
Normal file
@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
session_start();
|
||||
|
||||
$std = new stdClass();
|
||||
$std->message = array();
|
||||
$std->error = true;
|
||||
|
||||
if (empty($_POST["floID"])) {
|
||||
$std->message[] = "FLO ID is missing.";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
exit();
|
||||
}
|
||||
|
||||
if (empty($_POST["fullName"])) {
|
||||
$std->message[] = "Full Name is missing.";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
exit();
|
||||
}
|
||||
|
||||
if (empty($_POST["emailID"])) {
|
||||
$std->message[] = "E-mail is missing.";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
exit();
|
||||
}
|
||||
|
||||
$floID = sanitise_input($_POST['floID']);
|
||||
$fullName = sanitise_input($_POST['fullName']);
|
||||
$emailID = sanitise_input($_POST['emailID']);
|
||||
|
||||
if (preg_match('/[^1-9A-HJ-NP-Za-km-z]/', $floID)) {
|
||||
$std->message[] = "FLO ID has unacceptable characters.";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
exit();;
|
||||
}
|
||||
|
||||
|
||||
if (strlen($floID) != 34) {
|
||||
$std->message[] = "Length of FLO ID should be 34.";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($floID[0] != "F"){
|
||||
$std->message[] = "FLO ID must begin with F";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if (!preg_match("/^[0-9a-zA-Z-' .]*$/",$fullName)) {
|
||||
$std->message[] = "Only letters, numbers, period and white space allowed in Full Name";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
exit();
|
||||
}
|
||||
|
||||
if (!filter_var($emailID, FILTER_VALIDATE_EMAIL)) {
|
||||
$std->message[] = "Invalid email format";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
exit();
|
||||
}
|
||||
|
||||
|
||||
if (isset($_POST['floID'], $_POST['fullName'], $_POST['emailID'] )){
|
||||
|
||||
ob_start();
|
||||
|
||||
$check_duplicate_status = true;
|
||||
$check_already_exists_status = true;
|
||||
$insert_status = false;
|
||||
|
||||
$check_duplicate_status = check_duplicate_newUser($floID);
|
||||
$check_already_exists_status = check_flo_id_registration_status($floID);
|
||||
|
||||
if (($check_duplicate_status == false) && ($check_already_exists_status == false)){
|
||||
$insert_status = insert_flo_newUser($floID);
|
||||
|
||||
|
||||
} else {
|
||||
$std->message[] = "New User could not be registered as FLO ID attempted to register earlier. ";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
exit();
|
||||
}
|
||||
|
||||
if ($insert_status == true){
|
||||
$update_status = update_newUser($floID, $fullName, $emailID);
|
||||
|
||||
//$std->message[] = "New User Request accepted ". $floID ." ". $fullName ." ". $emailID;
|
||||
|
||||
//$std->error = false;
|
||||
//echo json_encode($std);
|
||||
// exit();
|
||||
|
||||
$std->message[] = "New User Request accepted for ". $floID . " You can login after System Admin enables your account, usually within 24 hours.";
|
||||
|
||||
$std->error = false;
|
||||
echo json_encode($std);
|
||||
exit();
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
$std->message[] = "New User could not be registered as either data fields are missing, FLO ID is wrong, or already attempted to register earlier. ";
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -27,17 +27,17 @@ if (isset($_SESSION['flo_id'], $_SESSION['user_id'])) {
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
if (isset($OrderClass, $UserClass)) {
|
||||
|
||||
|
||||
if ($u_id_str == "off") {
|
||||
$del_ord = $OrderClass->delete_orders_of_user($u_id_int);
|
||||
$del_ord = delete_orders_of_user($u_id_int);
|
||||
}
|
||||
$act_user = $UserClass->actions_user($u_id_int, $act);
|
||||
$act_user = actions_user($u_id_int, $act);
|
||||
|
||||
if ($act_user) {
|
||||
echo $u_id_str;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 6/2/2018
|
||||
* Time: 3:18 PM
|
||||
*/
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -20,7 +14,7 @@ if (isset($_POST['job'])) {
|
||||
/*Check if user has account in BCX*/
|
||||
if (!isset($_SESSION['email'])||trim($_SESSION['email'])=='') {
|
||||
$mess[] = "RMT2BCX Error: No email found. Please provide your email id in My Account link.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -28,7 +22,7 @@ if (isset($_POST['job'])) {
|
||||
$user_email = $_SESSION['email'];
|
||||
$bcx_user = get_bcx_user_by_email($user_email);
|
||||
|
||||
$usr_rmt_bal = (float)$OrderClass->check_customer_balance($assetType='btc', $_SESSION['user_id'])->Balance;
|
||||
$usr_rmt_bal = (float)check_customer_balance($assetType='btc', $_SESSION['user_id'])->Balance;
|
||||
|
||||
$std = new stdClass();
|
||||
$std->mesg = array();
|
||||
@ -36,7 +30,7 @@ if (isset($_POST['job'])) {
|
||||
|
||||
if (empty($amount_to_load) || $amount_to_load<0) {
|
||||
$mess[] = "RMT2BCX Error: Please fill valid amount.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -44,7 +38,7 @@ if (isset($_POST['job'])) {
|
||||
|
||||
if ($usr_rmt_bal<0.0000000001 || !is_float($usr_rmt_bal) || $usr_rmt_bal==null || ($amount_to_load > $usr_rmt_bal)) {
|
||||
$mess[] = "RMT2BCX Error: Insufficient RMT balance. ";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess." Balance: $usr_rmt_bal.");
|
||||
storeMessagesPublic(null, $user_id, $mess." Balance: $usr_rmt_bal.");
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -54,7 +48,7 @@ if (isset($_POST['job'])) {
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
$mess = "RMT2BCX error: No such user exist. Please login again.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
@ -65,7 +59,7 @@ if (isset($_POST['job'])) {
|
||||
|
||||
if (!is_email($email_id)) {
|
||||
$mess = "BTC2CASH error: Please provide a valid email id!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
@ -74,7 +68,7 @@ if (isset($_POST['job'])) {
|
||||
|
||||
|
||||
// Check order in sell table
|
||||
$user_active_orders = $OrderClass->get_active_order_of_user($user_id, TOP_SELL_TABLE);
|
||||
$user_active_orders = get_active_order_of_user($user_id, TOP_SELL_TABLE);
|
||||
$frozen_bal_sells = 0;
|
||||
$allowed_bid_amount = $usr_rmt_bal;
|
||||
if (is_array($user_active_orders) && !empty($user_active_orders)) {
|
||||
@ -90,7 +84,7 @@ if (isset($_POST['job'])) {
|
||||
}
|
||||
|
||||
if ($frozen_bal_sells + $amount_to_load > $usr_rmt_bal) {
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $msss);
|
||||
storeMessagesPublic(null, $user_id, $msss);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $msss;
|
||||
echo json_encode($std);
|
||||
@ -102,15 +96,15 @@ if (isset($_POST['job'])) {
|
||||
$new_rmt_bal = $usr_rmt_bal - $amount_to_load;
|
||||
|
||||
// Decrease tokens of 'from'
|
||||
$update_bal_fr = $OrderClass->update_user_balance($assetType="btc", $new_rmt_bal, $user_id);
|
||||
$update_bal_fr = update_user_balance($assetType="btc", $new_rmt_bal, $user_id);
|
||||
|
||||
// Record the balance transfers or errors
|
||||
if (!$update_bal_fr) {
|
||||
$msss = "RMT2BCX Warning: Failed to update user balance. User id: ".$user_id;
|
||||
$std->error = true;
|
||||
$std->mesg[] = $msss;
|
||||
$OrderClass->storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $msss);
|
||||
storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
storeMessagesPublic(null, $user_id, $msss);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
} else {
|
||||
@ -137,8 +131,8 @@ if (isset($_POST['job'])) {
|
||||
$msss = "RMT2BCX FATAL ERROR: Failed to transfer RMT to BC Exchange. User id: ".$user_id. ". Report admin as soon as possible.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $msss;
|
||||
$OrderClass->storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $msss);
|
||||
storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
storeMessagesPublic(null, $user_id, $msss);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
@ -151,20 +145,20 @@ if (isset($_POST['job'])) {
|
||||
//
|
||||
}
|
||||
if ($transfer_successful==trim("success")) {
|
||||
$OrderClass->record_root_bal_update($user_id, $usr_rmt_bal, $new_rmt_bal, $assetType='btc');
|
||||
record_root_bal_update($user_id, $usr_rmt_bal, $new_rmt_bal, $assetType='btc');
|
||||
|
||||
$msss = "$amount_to_load RMTs transfer from RMT Exchange to BC Exchange was processed successfully. Your new balance is RMT ".$new_rmt_bal;
|
||||
$std->error = false;
|
||||
$std->mesg[] = $msss;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $msss);
|
||||
storeMessagesPublic(null, $user_id, $msss);
|
||||
echo json_encode($std);
|
||||
return true;
|
||||
}
|
||||
$msss = "RMT2BCX Warning: Failed to transfer RMT to BC Exchange. User id: ".$user_id;
|
||||
$std->error = true;
|
||||
$std->mesg[] = $msss;
|
||||
$OrderClass->storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $msss);
|
||||
storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
storeMessagesPublic(null, $user_id, $msss);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
@ -172,4 +166,4 @@ if (isset($_POST['job'])) {
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Sinha
|
||||
* Date: 6/24/2017
|
||||
* Time: 8:38 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (isset($_POST['task']) && trim($_POST['task'])=='loadTradeList') {
|
||||
@ -14,16 +7,16 @@ if (isset($_POST['task']) && trim($_POST['task'])=='loadTradeList') {
|
||||
$std->trade_list = array();
|
||||
$std->error = true;
|
||||
|
||||
if (isset($OrderClass, $UserClass)) {
|
||||
|
||||
|
||||
$tradeList = $OrderClass->last_transaction_list(0,10);
|
||||
$tradeList = last_transaction_list(0,10);
|
||||
|
||||
$std->trade_list = $tradeList;
|
||||
$std->error = false;
|
||||
|
||||
}
|
||||
|
||||
echo json_encode($std);
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 9/27/2017
|
||||
* Time: 2:41 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
@ -14,16 +8,14 @@ if (isset($_POST['task']) && trim($_POST['task'])=='loadTradersList') {
|
||||
$std->traders_list = array();
|
||||
$std->error = true;
|
||||
|
||||
if (isset($OrderClass)) {
|
||||
|
||||
$tradersList = $OrderClass->UserBalanceList();
|
||||
$tradersList = UserBalanceList();
|
||||
if (is_array($tradersList) && !empty($tradersList)) {
|
||||
$std->traders_list = $tradersList;
|
||||
$std->error = false;
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode($std);
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,7 +19,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_to_bank") {
|
||||
|
||||
if (empty($account_number) || empty($balance_to_transfer)) {
|
||||
$mess = "E2B error: Please fill all the required fields!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
@ -28,7 +28,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_to_bank") {
|
||||
|
||||
if (!preg_match("/^[a-zA-Z0-9 \r\n]*$/",$remarks)) {
|
||||
$mess = "E2B error: Only alphanumeric characters allowed in Remarks!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
@ -37,18 +37,18 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_to_bank") {
|
||||
|
||||
if (strlen($remarks) > 250) {
|
||||
$mess = "E2B error: Remarks up to 250 characters allowed only!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
$mess = "E2B error: No such user exist. Please login again.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
@ -59,32 +59,32 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_to_bank") {
|
||||
|
||||
if (!is_email($senders_email)) {
|
||||
$mess = "E2B error: Please provide a valid email id!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$user_bank_details = $OrderClass->get_bank_details($user_id, $account_number);
|
||||
$user_bank_details = get_bank_details($user_id, $account_number);
|
||||
|
||||
if($user_bank_details == "" || empty($user_bank_details)) {
|
||||
$mess = "E2B error: No such bank account exist. Please check bank details again.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$customer_bal = (float) $OrderClass->check_customer_balance($assetType="traditional", $user_id)->Balance;
|
||||
$customer_bal = (float) check_customer_balance($assetType="traditional", $user_id)->Balance;
|
||||
|
||||
if ($balance_to_transfer > $customer_bal) {
|
||||
$mess = "E2B transaction failed: You have insufficient balance to make this transfer. Your current Cash balance is $ $customer_bal.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -94,7 +94,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_to_bank") {
|
||||
$OfferAssetTypeId= 'USD';
|
||||
$WantAssetTypeId = 'RMT';
|
||||
$assetType = 'traditional';
|
||||
$user_active_orders = $OrderClass->get_active_order_of_user($user_id, TOP_BUYS_TABLE);
|
||||
$user_active_orders = get_active_order_of_user($user_id, TOP_BUYS_TABLE);
|
||||
$frozen_bal_buys = 0;
|
||||
$allowed_bid_amount = $customer_bal;
|
||||
if (is_array($user_active_orders) && !empty($user_active_orders)) {
|
||||
@ -110,7 +110,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_to_bank") {
|
||||
}
|
||||
|
||||
if ($frozen_bal_buys + $balance_to_transfer > $customer_bal) {
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $msss);
|
||||
storeMessagesPublic(null, $user_id, $msss);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $msss;
|
||||
echo json_encode($std);
|
||||
@ -145,23 +145,23 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_to_bank") {
|
||||
</footer>
|
||||
</div>";
|
||||
|
||||
$send_mail = $OrderClass->send_notice_mail($reciever_email, $email_from, $email_sender, $email_subject, $email_body);
|
||||
$send_mail = send_notice_mail($reciever_email, $email_from, $email_sender, $email_subject, $email_body);
|
||||
$transfer_funds = null;
|
||||
if($send_mail) {
|
||||
/*Transfer funds fro site to bank account*/
|
||||
$transfer_funds = $OrderClass->fund_transfer($fund_type="E2B", $from="Exchange", $to=$user_bank_details[0]->acc_num, $balance_to_transfer, $remarks, $assetType = 'traditional');
|
||||
$transfer_funds = fund_transfer($fund_type="E2B", $from="Exchange", $to=$user_bank_details[0]->acc_num, $balance_to_transfer, $remarks, $assetType = 'traditional');
|
||||
}
|
||||
|
||||
if ($transfer_funds) {
|
||||
$mess = "E2B Transaction Success: Your request has been recorded and will be processed very soon by our team.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = false;
|
||||
$std->mesg[] = $mess;
|
||||
$std->user = $validate_user;
|
||||
|
||||
} else {
|
||||
$mess = "E2B error: Mail could not be sent. Try again.";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
$std->user = $validate_user;
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* This section is incomplete
|
||||
1. Check token sell order
|
||||
@ -26,7 +25,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
|
||||
if (empty($wallet_address) || empty($balance_to_transfer)) {
|
||||
$mess = "E2W error: Please fill all the required fields!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -35,7 +34,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
if (!preg_match('/^[A-Za-z0-9]*$/', $wallet_address)) {
|
||||
$mess = "E2W error (Invalid Wallet Address): Only alphanumeric characters are allowed in wallet address!";
|
||||
$std->mesg[] = $mess;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
@ -43,7 +42,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
if (!preg_match("/^[a-zA-Z0-9 \r\n]*$/",$remarks)) {
|
||||
$mess = "E2W error: Only alphanumeric characters are allowed in remarks!";
|
||||
$std->mesg[] = $mess;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
@ -55,13 +54,13 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($balance_to_transfer < 0.0000000001) {
|
||||
$mess = "E2W error: Please provide minimum amount of 0.0000000001 RMTs!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -70,19 +69,19 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
if (strlen($remarks) > 250) {
|
||||
$mess = "E2W error: Remarks up to 250 characters allowed only!";
|
||||
$std->mesg[] = $mess;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
$validate_user = check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
$mess = "No such user exist. Please login again.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
@ -91,7 +90,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
|
||||
if (!is_email($email_id)) {
|
||||
$mess = "E2W error: Invalid email format!";
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
$std->error = true;
|
||||
echo json_encode($std);
|
||||
@ -113,7 +112,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
<p>AMOUNT TO TRANSFER: <strong>RMT $balance_to_transfer</strong></p>
|
||||
<p>EMAIL: $email_id</p>
|
||||
<p>REMARKS: <strong>".$remarks."</strong></p>
|
||||
<p>SENDER FLO ID: ".$flo_id."</p>
|
||||
<p>SENDER FB ID: ".$flo_id."</p>
|
||||
</div>
|
||||
<footer>
|
||||
<p>Thank You</p>
|
||||
@ -122,10 +121,10 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
</footer>
|
||||
</div>";
|
||||
|
||||
$send_mail = $OrderClass->send_notice_mail($reciever_email, $email_from, $email_sender, $email_subject, $email_body);
|
||||
$send_mail = send_notice_mail($reciever_email, $email_from, $email_sender, $email_subject, $email_body);
|
||||
$transfer_funds = null;
|
||||
if($send_mail) {
|
||||
$transfer_funds = $OrderClass->fund_transfer($fund_type="E2W", $from="Exchange", $to=$wallet_address, $balance_to_transfer, $remarks, $asset_type='btc');
|
||||
$transfer_funds = fund_transfer($fund_type="E2W", $from="Exchange", $to=$wallet_address, $balance_to_transfer, $remarks, $asset_type='btc');
|
||||
}
|
||||
|
||||
if ($transfer_funds) {
|
||||
@ -137,13 +136,13 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
$std->error = false;
|
||||
$std->mesg[] = $mess;
|
||||
$std->user = $validate_user;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
} else {
|
||||
$mess = "E2W error: API request could not be sent. ";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
$std->user = $validate_user;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -152,7 +151,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "rtm_to_bchain") {
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
$std->user = $validate_user;
|
||||
$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
storeMessagesPublic(null, $user_id, $mess);
|
||||
}
|
||||
echo json_encode($std);
|
||||
return true;
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 2/9/2018
|
||||
* Time: 11:00 AM (in Bali :) )
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -16,7 +9,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_tokens") {
|
||||
if (isset($_POST['_from'], $_POST['_to'], $_POST['_tokens'])) {
|
||||
$from = (int) $_POST['_from'];
|
||||
$to = (int) $_POST['_to'];
|
||||
$tokens = number_format($_POST['_tokens'], 10);
|
||||
$tokens = (float) $_POST['_tokens'];
|
||||
|
||||
$std = new stdClass();
|
||||
$std->mesg = array();
|
||||
@ -30,33 +23,33 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_tokens") {
|
||||
return false;
|
||||
}
|
||||
|
||||
$validate_user_from = $UserClass->check_user($from);
|
||||
$validate_user_to = $UserClass->check_user($to);
|
||||
$validate_user_from = check_user($from);
|
||||
$validate_user_to = check_user($to);
|
||||
|
||||
if($validate_user_from == "" || empty($validate_user_from) || $validate_user_to == "" || empty($validate_user_to)) {
|
||||
$mess = "No such user exist. Please re-check user ids.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
//$OrderClass->storeMessagesPublic(null, $user_id, $mess);
|
||||
//storeMessagesPublic(null, $user_id, $mess);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$customer_bal_fr = (float) $OrderClass->check_customer_balance($assetType="btc", $from)->Balance;
|
||||
$customer_bal_to = (float) $OrderClass->check_customer_balance($assetType="btc", $to)->Balance;
|
||||
$customer_bal_fr = (float) check_customer_balance($assetType="btc", $from)->Balance;
|
||||
$customer_bal_to = (float) check_customer_balance($assetType="btc", $to)->Balance;
|
||||
|
||||
if ($tokens > $customer_bal_fr) {
|
||||
$mess = "Admin Token Transfer: The user has insufficient balance to make this RMT token transfer. His current Token balance is $customer_bal_fr RMTs.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
$OrderClass->storeMessagesPublic(null, $from, $mess);
|
||||
storeMessagesPublic(null, $from, $mess);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($tokens < 0.0000000001) {
|
||||
$mess = "Admin Token Transfer: Please provide minimum amount of 0.0000000001 RMTs!";
|
||||
$OrderClass->storeMessagesPublic(null, $from, $mess);
|
||||
storeMessagesPublic(null, $from, $mess);
|
||||
$std->mesg[] = $mess;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
@ -79,7 +72,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_tokens") {
|
||||
}
|
||||
|
||||
if ($frozen_bal_sells + $tokens > $customer_bal_fr) {
|
||||
$OrderClass->storeMessagesPublic(null, $from, $msss);
|
||||
storeMessagesPublic(null, $from, $msss);
|
||||
$std->error = true;
|
||||
$std->mesg[] = $msss;
|
||||
echo json_encode($std);
|
||||
@ -92,40 +85,40 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_tokens") {
|
||||
$new_to_bal = $customer_bal_to + $tokens;
|
||||
|
||||
// Decrease tokens of 'from'
|
||||
$update_bal_fr = $OrderClass->update_user_balance($assetType="btc", $new_from_bal, $from);
|
||||
$update_bal_fr = update_user_balance($assetType="btc", $new_from_bal, $from);
|
||||
|
||||
// Increase tokens of 'to'
|
||||
$update_bal_to = $OrderClass->update_user_balance($assetType="btc", $new_to_bal, $to);
|
||||
$update_bal_to = update_user_balance($assetType="btc", $new_to_bal, $to);
|
||||
|
||||
// Record the balance transfers or errors
|
||||
if (!$update_bal_fr) {
|
||||
$msss = "Failed to update Sender's balance.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $msss;
|
||||
$OrderClass->storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
} else if(!$update_bal_to) {
|
||||
$msss = "Failed to update Receiver's balance.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $msss;
|
||||
$OrderClass->storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
} else {
|
||||
$OrderClass->record_root_bal_update($from, $customer_bal_fr, $new_from_bal, $assetType='btc');
|
||||
$OrderClass->record_root_bal_update($to, $customer_bal_to, $new_to_bal, $assetType='btc');
|
||||
record_root_bal_update($from, $customer_bal_fr, $new_from_bal, $assetType='btc');
|
||||
record_root_bal_update($to, $customer_bal_to, $new_to_bal, $assetType='btc');
|
||||
|
||||
$msss = "RMT transfer for user id ".$from." and ".$to." was processed successfully.";
|
||||
$mess1 = "Your ".$tokens." RMTs were transferred by Admin to user ".$to.".";
|
||||
$mess2 = "You received ".$tokens." RMTs from user ".$from." transferred by Admin.";
|
||||
$std->error = false;
|
||||
$std->mesg[] = $msss;
|
||||
$OrderClass->storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
$OrderClass->storeMessagesPublic(null, $from, $mess1);
|
||||
$OrderClass->storeMessagesPublic(null, $to, $mess2);
|
||||
storeMessagesPublic(null, ADMIN_ID, $msss);
|
||||
storeMessagesPublic(null, $from, $mess1);
|
||||
storeMessagesPublic(null, $to, $mess2);
|
||||
echo json_encode($std);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
204
approve_newusers.php
Normal file
204
approve_newusers.php
Normal file
@ -0,0 +1,204 @@
|
||||
<?php ob_start(); date_default_timezone_set('Asia/Kolkata'); ?>
|
||||
<?php $user_id = 0; ?>
|
||||
<!--Bootstrap-->
|
||||
<?php
|
||||
require_once 'includes/imp_files.php';
|
||||
require_once 'views/header.php';?>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
redirect_to("index.php");
|
||||
}
|
||||
|
||||
if (isset($_SESSION['flo_id'], $_SESSION['user_id'])) {
|
||||
$root_flo = (string) $_SESSION['flo_id'];
|
||||
$root_user_id = (int) $_SESSION['user_id'];
|
||||
|
||||
|
||||
/*This should match ajax/rm_root.php too*/
|
||||
if ($root_flo != ADMIN_FLO_ID && $root_user_id != ADMIN_ID) {
|
||||
redirect_to("index.php");
|
||||
}
|
||||
|
||||
|
||||
$traders = newUserList();
|
||||
|
||||
?>
|
||||
|
||||
<div class="container mt--2">
|
||||
<h2>Actions table</h2>
|
||||
|
||||
<input type="text" id="search_traders" onkeyup="search_traders()" placeholder="Search for names..">
|
||||
|
||||
<div class="table-responsive" id="traders_table">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>FLO ID</th>
|
||||
<th>Full Name</th>
|
||||
<th>Email</th>
|
||||
<th>InsertDate</th>
|
||||
<th>Approve</th>
|
||||
<th>Reject</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
|
||||
$btn_name = null;$btn_name2 = null;
|
||||
if (is_array($traders) && !empty($traders)) {
|
||||
foreach ($traders as $index=>$trader) {
|
||||
if (isset($trader->flo_id)) {
|
||||
|
||||
$btn_name = "Approve Account";
|
||||
$btn_name2 = "Reject Account";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?=$trader->flo_id?></td>
|
||||
<td><a href="http://facebook.com/flo_id" target="_blank"><?=$trader->full_name?></a></td>
|
||||
<td><?=$trader->email?></td>
|
||||
<td><?=$trader->insertDate?></td>
|
||||
<td><input type="button" class="btn-ra" id="<?='a_'.$trader->flo_id?>" value="<?=$btn_name?>"></td>
|
||||
<td><input type="button" class="btn-da" id="<?='d_'.$trader->flo_id?>" value="<?=$btn_name2?>"></td>
|
||||
</tr>
|
||||
<?php }
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<!--footer-->
|
||||
<?php include_once 'footer.php'; ?>
|
||||
|
||||
<script>
|
||||
$(document).on('click', '.btn-ra', function (e) {
|
||||
e.preventDefault();
|
||||
var btn = $(this);
|
||||
var btn_id = $(this).attr('id').slice(2);
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url:'ajax/acceptNewUser.php',
|
||||
data: { task : 'approve_user', flo_id:btn_id}
|
||||
}).error(function(xhr, status, error) {
|
||||
console.log(error);
|
||||
}).success(function(data) {
|
||||
data = $.trim(data);
|
||||
if ($.trim(data) != '' && $.trim(data) != undefined && $.trim(data) != null) {
|
||||
if (data == 'approved') {
|
||||
btn.prop("value", "Account Accepted");
|
||||
$.notify({
|
||||
title: "<strong>Success!:</strong> ",
|
||||
message: "User activated successfully."
|
||||
},{
|
||||
type: 'info'
|
||||
});
|
||||
} else if (data == 'off') {
|
||||
btn.prop("value", "Activate Account");
|
||||
$.notify({
|
||||
title: "<strong>Success!:</strong> ",
|
||||
message: "User de-activated successfully."
|
||||
},{
|
||||
type: 'info'
|
||||
});
|
||||
} else {
|
||||
$.notify({
|
||||
title: "<strong>Process Failed!:</strong> ",
|
||||
message: "Process could not be completed."
|
||||
},{
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
displayNotice("Process could not be completed. Try again later.", "failure");
|
||||
}
|
||||
run_all();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$(document).on('click', '.btn-da', function (e) {
|
||||
e.preventDefault();
|
||||
var btn = $(this);
|
||||
var btn_id = $(this).attr('id').slice(2);
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url:'ajax/acceptNewUser.php',
|
||||
data: { task : 'reject_user', flo_id:btn_id}
|
||||
}).error(function(xhr, status, error) {
|
||||
console.log(error);
|
||||
}).success(function(data) {
|
||||
data = $.trim(data);
|
||||
if ($.trim(data) != '' && $.trim(data) != undefined && $.trim(data) != null) {
|
||||
if (data == 'deleted') {
|
||||
btn.prop("value", "Account Deleted");
|
||||
$.notify({
|
||||
title: "<strong>Success!:</strong> ",
|
||||
message: "User deleted."
|
||||
},{
|
||||
type: 'info'
|
||||
});
|
||||
} else if (data == 'off') {
|
||||
btn.prop("value", "Activate Account");
|
||||
$.notify({
|
||||
title: "<strong>Success!:</strong> ",
|
||||
message: "User de-activated successfully."
|
||||
},{
|
||||
type: 'info'
|
||||
});
|
||||
} else {
|
||||
$.notify({
|
||||
title: "<strong>Process Failed!:</strong> ",
|
||||
message: "Process could not be completed."
|
||||
},{
|
||||
type: 'warning'
|
||||
});
|
||||
}
|
||||
|
||||
} else {
|
||||
displayNotice("Process could not be completed. Try again later.", "failure");
|
||||
}
|
||||
run_all();
|
||||
});
|
||||
});
|
||||
|
||||
function search_traders() {
|
||||
// Declare variables
|
||||
var input, filter, table, tr, td, i;
|
||||
input = document.getElementById("search_traders");
|
||||
filter = input.value.toUpperCase();
|
||||
table = document.getElementById("traders_table");
|
||||
tr = table.getElementsByTagName("tr");
|
||||
|
||||
// Loop through all table rows, and hide those who don't match the search query
|
||||
for (i = 0; i < tr.length; i++) {
|
||||
td = tr[i].getElementsByTagName("td")[1];
|
||||
|
||||
if (td) {
|
||||
if (td.innerHTML.toUpperCase().indexOf(filter) > -1) {
|
||||
tr[i].style.display = "";
|
||||
} else {
|
||||
tr[i].style.display = "none";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
@ -1,10 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: user
|
||||
* Date: 17-Oct-16
|
||||
* Time: 9:22 AM
|
||||
*/
|
||||
|
||||
require_once "Users.php";
|
||||
|
||||
class Orders extends Users {
|
||||
@ -36,19 +31,17 @@ class Orders extends Users {
|
||||
|
||||
$n = new DateTime("now", new DateTimeZone("Asia/Kolkata"));
|
||||
$now = $n->format('Y-m-d H:i:s');
|
||||
$user_id = $_SESSION['user_id'];
|
||||
|
||||
$query = $this->db_connection->prepare("INSERT INTO $top_table(`price`, `orderId`, `quantity`, `customerId`, `insertDate`)
|
||||
VALUES (:price, :orderId, :quantity, :user_id, '$now')");
|
||||
$query->bindParam("price", $price);
|
||||
$query->bindParam("orderId", $orderId);
|
||||
$query->bindParam("quantity", $quantity);
|
||||
$query->bindParam("user_id", $_SESSION['user_id']);
|
||||
$query = $this->db_connection->query("INSERT INTO $top_table(`price`, `orderId`, `quantity`, `customerId`, `insertDate`)
|
||||
VALUES ('$price', '$orderId', '$quantity','$user_id' , '$now')");
|
||||
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
$this->updateOrderStatus($orderId, 3);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -58,15 +51,15 @@ class Orders extends Users {
|
||||
if ($this->databaseConnection()) {
|
||||
|
||||
$customer_balance = null;
|
||||
$query = $this->db_connection->prepare("SELECT `Balance`, FrozenBalance
|
||||
$query = $this->db_connection->query("SELECT `Balance`, FrozenBalance
|
||||
FROM $this->customer_balance_table
|
||||
WHERE `CustomerId`= :user_id AND `AssetTypeId`='$assetType'");
|
||||
$query->bindParam(":user_id", $user_id);
|
||||
if ($query->execute()) {
|
||||
WHERE `CustomerId`= '$user_id' AND `AssetTypeId`='$assetType'");
|
||||
|
||||
|
||||
if ($query->rowCount()) {
|
||||
$customer_balance = $query->fetchObject();
|
||||
}
|
||||
}
|
||||
|
||||
return $customer_balance;
|
||||
}
|
||||
return false;
|
||||
@ -77,15 +70,12 @@ class Orders extends Users {
|
||||
|
||||
$now = $this->time_now();
|
||||
|
||||
$query = $this->db_connection->prepare("INSERT INTO $this->bal_history (`id`, `user_id`, `balance`, `AssetType`, `datetime`)
|
||||
VALUES ('', :uid, :bal, :asset_type, '$now')");
|
||||
$query->bindParam('uid', $user_id);
|
||||
$query->bindParam('bal', $balance);
|
||||
$query->bindParam('asset_type', $type);
|
||||
|
||||
if ($query->execute()) {
|
||||
$query = $this->db_connection->query("INSERT INTO $this->bal_history (`id`, `user_id`, `balance`, `AssetType`, `datetime`)
|
||||
VALUES ('', '$user_id', '$balance', '$type', '$now')");
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -97,26 +87,18 @@ class Orders extends Users {
|
||||
$sql = "";
|
||||
if ($balance >= 0) {
|
||||
$sql .= "UPDATE $this->customer_balance_table ";
|
||||
$sql .= " SET `Balance`= :balance, ";
|
||||
$sql .= " SET `Balance`= '$balance', ";
|
||||
$sql .= " `UpdateDate`= '$now' ";
|
||||
$sql .= " WHERE `CustomerId`= :user_id ";
|
||||
$sql .= " AND `AssetTypeId`= :asset_type ";
|
||||
$sql .= " WHERE `CustomerId`= '$user_id' ";
|
||||
$sql .= " AND `AssetTypeId`= '$assetType' ";
|
||||
$sql .= "LIMIT 1";
|
||||
|
||||
$query = $this->db_connection->prepare($sql);
|
||||
|
||||
if ($balance >= 0) {
|
||||
$query->bindParam("balance", $balance);
|
||||
}
|
||||
$query->bindParam("user_id", $user_id);
|
||||
$query->bindParam("asset_type", $assetType);
|
||||
if ($query->execute()) {
|
||||
$this->record_bal_history($user_id, $balance, $assetType);
|
||||
return true;
|
||||
}
|
||||
$query = $this->db_connection->query($sql);
|
||||
$this->record_bal_history($user_id, $balance, $assetType);
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -158,7 +140,7 @@ class Orders extends Users {
|
||||
$this->customer_balance = $customer_bal;
|
||||
|
||||
if ($this->customer_balance == '' || $this->customer_balance == null || !is_float($this->customer_balance)) {
|
||||
$messages = "0 balance: Your account balance is nill.";
|
||||
$messages = "0 balance: Your account balance is nil.";
|
||||
$std->message = $messages;
|
||||
$this->storeMessages($order_id=null, $this->customerId, $messages);
|
||||
return $std;
|
||||
@ -171,17 +153,11 @@ class Orders extends Users {
|
||||
return $std;
|
||||
}
|
||||
|
||||
$query = $this->db_connection->prepare("INSERT INTO $this->orders_table (`OrderId`, `CustomerId`, `OrderTypeId`, `OfferAssetTypeId`, `WantAssetTypeId`, `Quantity`, `Price`, `OrderStatusId`, `UpdateDate`, `InsertDate`, `SaveDate`)
|
||||
VALUES ('', " . $this->customerId . ", :a, :e, :f, :b, :c, :d, NULL, '$now', NULL)");
|
||||
$query = $this->db_connection->query("INSERT INTO $this->orders_table (`OrderId`, `CustomerId`, `OrderTypeId`, `OfferAssetTypeId`, `WantAssetTypeId`, `Quantity`, `Price`, `OrderStatusId`, `UpdateDate`, `InsertDate`, `SaveDate`)
|
||||
VALUES ('', " . $this->customerId . ", " . $this->orderTypeId . ", '$OfferAssetTypeId', '$WantAssetTypeId', " . $this->quantity . "," . $this->price . ", " . $this->orderStatusId . ", NULL, '$now', NULL)");
|
||||
|
||||
$query->bindParam(':a', $this->orderTypeId, PDO::PARAM_STR);
|
||||
$query->bindParam(':e', $OfferAssetTypeId, PDO::PARAM_STR);
|
||||
$query->bindParam(':f', $WantAssetTypeId, PDO::PARAM_STR);
|
||||
$query->bindParam(':b', $this->quantity, PDO::PARAM_STR);
|
||||
$query->bindParam(':c', $this->price, PDO::PARAM_STR);
|
||||
$query->bindParam(':d', $this->orderStatusId);
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
|
||||
$insertedrowid = $this->db_connection->lastInsertId();
|
||||
|
||||
@ -219,8 +195,7 @@ class Orders extends Users {
|
||||
$std->message = "Order moved to active table.";
|
||||
|
||||
return $std;
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -265,29 +240,17 @@ class Orders extends Users {
|
||||
|
||||
$buy_or_sell_list = array();
|
||||
|
||||
$query = $this->db_connection->prepare("SELECT $this->orders_table.OrderId, $this->customers_table.CustomerId, $this->customers_table.Name, $this->orders_table.Quantity, $this->orders_table.Price, ($this->orders_table.Quantity * $this->orders_table.Price) AS TOTAL_COST, $this->orders_table.OrderStatusid, $this->orders_table.InsertDate
|
||||
$query = $this->db_connection->query("SELECT $this->orders_table.OrderId, $this->customers_table.CustomerId, $this->customers_table.Name, $this->orders_table.Quantity, $this->orders_table.Price, ($this->orders_table.Quantity * $this->orders_table.Price) AS TOTAL_COST, $this->orders_table.OrderStatusid, $this->orders_table.InsertDate
|
||||
FROM $this->orders_table, $this->customers_table
|
||||
WHERE $this->orders_table.OrderTypeId = :id
|
||||
WHERE $this->orders_table.OrderTypeId = '$buy_or_sell_id'
|
||||
GROUP BY $this->orders_table.Price $AscDesc");
|
||||
|
||||
$query->bindParam("id", $buy_or_sell_id);
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
$rowCount = $query->rowCount();
|
||||
|
||||
if ($rowCount > 0) {
|
||||
|
||||
while ($orders = $query->fetchObject()) {
|
||||
|
||||
$buy_or_sell_list[] = $orders;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return $buy_or_sell_list;
|
||||
}
|
||||
return false;
|
||||
@ -295,11 +258,10 @@ class Orders extends Users {
|
||||
|
||||
public function get_active_order_of_user($user_id, $top_table) {
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->prepare("
|
||||
SELECT * FROM $top_table WHERE `customerId`= :uid ORDER BY `insertDate` DESC
|
||||
$query = $this->db_connection->query("
|
||||
SELECT * FROM $top_table WHERE `customerId`= '$user_id' ORDER BY `insertDate` DESC
|
||||
");
|
||||
$query->bindParam('uid', $user_id);
|
||||
$query->execute();
|
||||
|
||||
|
||||
$arr = array();
|
||||
while ($qr = $query->fetchObject()) {
|
||||
@ -352,12 +314,9 @@ class Orders extends Users {
|
||||
|
||||
private function updateOrderStatus($orderId=null, $status=null) {
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->prepare("UPDATE ".ORDERS_TABLE." SET `OrderStatusId`= '$status' WHERE `OrderId` = :id LIMIT 1");
|
||||
$query->bindParam("id", $orderId);
|
||||
if ($query->execute()) {
|
||||
$query = $this->db_connection->query("UPDATE ".ORDERS_TABLE." SET `OrderStatusId`= '$status' WHERE `OrderId` = '$orderId' LIMIT 1");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -641,34 +600,20 @@ class Orders extends Users {
|
||||
private function record_transaction($buyer, $buy_order_id, $buy_amount, $buy_commission, $seller, $sell_order_id, $sell_amount, $sell_commission, $trade_qty) {
|
||||
if ($this->databaseConnection()) {
|
||||
$now = $this->time_now();
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
INSERT INTO $this->transaction_table(`TransactionId`, `a_buyer`, `A_OrderId`, `A_Amount`, `A_Commission`, `b_seller`, `B_OrderId`, `B_Amount`, `B_Commission`, `qty_traded`, `UpdateDate`, `InsertDate`, `SaveDate`)
|
||||
VALUES ('', :buyer,:buy_order_id, :buy_amount, :buy_commission, :seller, :sell_order_id, :sell_amount, :sell_commission, :trade_qty, NULL, '$now', '$now')
|
||||
VALUES ('', '$buyer','$buy_order_id', '$buy_amount', '$buy_commission', '$seller', '$sell_order_id', '$sell_amount', 'sell_commission', '$trade_qty', NULL, '$now', '$now')
|
||||
");
|
||||
$query->bindParam("buyer", $buyer);
|
||||
$query->bindParam("buy_order_id", $buy_order_id);
|
||||
$query->bindParam("buy_amount", $buy_amount);
|
||||
$query->bindParam("buy_commission", $buy_commission);
|
||||
$query->bindParam("seller", $seller);
|
||||
$query->bindParam("sell_order_id", $sell_order_id);
|
||||
$query->bindParam("sell_amount", $sell_amount);
|
||||
$query->bindParam("sell_commission", $sell_commission);
|
||||
$query->bindParam("trade_qty", $trade_qty);
|
||||
if($query->execute()) {
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function delete_order($top_table, $orderId) {
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->prepare("DELETE FROM `$top_table` WHERE `orderId`=:id LIMIT 1");
|
||||
$query->bindParam('id', $orderId);
|
||||
if($query->execute()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
$query = $this->db_connection->query("DELETE FROM `$top_table` WHERE `orderId`='$orderId' LIMIT 1");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -677,36 +622,26 @@ class Orders extends Users {
|
||||
|
||||
if ($this->databaseConnection()) {
|
||||
$now = $this->time_now();
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
UPDATE $top_table
|
||||
SET `quantity`= :qty, `insertDate`='$now'
|
||||
WHERE orderId = :orderId
|
||||
SET `quantity`= '$qty', `insertDate`='$now'
|
||||
WHERE orderId = '$$orderId'
|
||||
LIMIT 1
|
||||
");
|
||||
$query->bindParam('qty', $qty);
|
||||
$query->bindParam('orderId', $orderId);
|
||||
if($query->execute()) {
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private function insert_market_order($customerId, $orderTypeId, $OfferAssetTypeId=null, $WantAssetTypeId=null, $qty, $price) {
|
||||
if ($this->databaseConnection()) {
|
||||
$now = $this->time_now();
|
||||
$query = $this->db_connection->prepare("INSERT INTO $this->orders_table (`OrderId`, `CustomerId`, `OrderTypeId`, `OfferAssetTypeId`, `WantAssetTypeId`, `Quantity`, `Price`, `OrderStatusId`, `MarketOrder`, `UpdateDate`, `InsertDate`, `SaveDate`)
|
||||
VALUES ('', :u, :a, :d, :e, :b, :c, 1, 1, NULL, '$now', NULL)
|
||||
$query = $this->db_connection->query("INSERT INTO $this->orders_table (`OrderId`, `CustomerId`, `OrderTypeId`, `OfferAssetTypeId`, `WantAssetTypeId`, `Quantity`, `Price`, `OrderStatusId`, `MarketOrder`, `UpdateDate`, `InsertDate`, `SaveDate`)
|
||||
VALUES ('', '$customerId', '$orderTypeId', '$OfferAssetTypeId', '$WantAssetTypeId', '$qty', '$price', 1, 1, NULL, '$now', NULL)
|
||||
");
|
||||
$query->bindParam(':u', $customerId, PDO::PARAM_INT);
|
||||
$query->bindParam(':a', $orderTypeId, PDO::PARAM_INT);
|
||||
$query->bindParam(':d', $OfferAssetTypeId, PDO::PARAM_STR);
|
||||
$query->bindParam(':e', $WantAssetTypeId, PDO::PARAM_STR);
|
||||
$query->bindParam(':b', $qty, PDO::PARAM_STR);
|
||||
$query->bindParam(':c', $price, PDO::PARAM_STR);
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
$insertedrowid = $this->db_connection->lastInsertId();
|
||||
|
||||
$trade_type = ($orderTypeId=='1') ? "sell" : "buy";
|
||||
@ -715,8 +650,6 @@ class Orders extends Users {
|
||||
|
||||
return (int) $insertedrowid;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1260,12 +1193,12 @@ class Orders extends Users {
|
||||
|
||||
$list = array();
|
||||
|
||||
$extraQuerry = "";
|
||||
$extraQuery = "";
|
||||
|
||||
if ($is_active != null) {
|
||||
$extraQuerry = "WHERE ".USERS_TABLE.".is_active = 0 OR ".USERS_TABLE.".is_active = 1";
|
||||
$extraQuery = "WHERE ".USERS_TABLE.".is_active = 0 OR ".USERS_TABLE.".is_active = 1";
|
||||
} else {
|
||||
$extraQuerry = "WHERE ".USERS_TABLE.".is_active = 1";
|
||||
$extraQuery = "WHERE ".USERS_TABLE.".is_active = 1";
|
||||
}
|
||||
|
||||
$query = $this->db_connection->query("
|
||||
@ -1273,7 +1206,7 @@ class Orders extends Users {
|
||||
(SELECT ".CREDITS_TABLE.".Balance FROM ".CREDITS_TABLE." WHERE ".CREDITS_TABLE.".AssetTypeId='btc' AND ".CREDITS_TABLE.".CustomerId=UID) AS BTC,
|
||||
(SELECT ".CREDITS_TABLE.".Balance FROM ".CREDITS_TABLE." WHERE ".CREDITS_TABLE.".AssetTypeId='traditional' AND ".CREDITS_TABLE.".CustomerId=UID) AS CASH
|
||||
FROM ".USERS_TABLE.", ".CREDITS_TABLE."
|
||||
$extraQuerry
|
||||
$extraQuery
|
||||
GROUP BY UID ORDER BY MAX(BTC) DESC
|
||||
");
|
||||
|
||||
@ -1308,58 +1241,49 @@ class Orders extends Users {
|
||||
if ($this->databaseConnection()) {
|
||||
|
||||
$list = array();
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
SELECT `OrderId`, `CustomerId`, `OrderTypeId`, `OfferAssetTypeId`, `WantAssetTypeId`, `Quantity`, `Price`, `OrderStatusId`, `MarketOrder`, `InsertDate`
|
||||
FROM ".ORDERS_TABLE."
|
||||
WHERE `CustomerId`=:u_id
|
||||
WHERE `CustomerId`='$user_id'
|
||||
ORDER BY InsertDate DESC
|
||||
LIMIT $start, $limit
|
||||
");
|
||||
$query->bindParam('u_id', $user_id);
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
if ($query->rowCount() > 0) {
|
||||
while ($ls = $query->fetchObject()) {
|
||||
$list[] = $ls;
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
protected function cancel_order($order_id=null, $user_id=null) {
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->prepare("
|
||||
DELETE FROM ".TOP_BUYS_TABLE." WHERE `orderId`=:id AND customerId = :cus_id;
|
||||
DELETE FROM ".TOP_SELL_TABLE." WHERE `orderId`=:id AND customerId = :cus_id
|
||||
$query = $this->db_connection->query("
|
||||
DELETE FROM ".TOP_BUYS_TABLE." WHERE `orderId`=:'$order_id' AND customerId = '$user_id';
|
||||
DELETE FROM ".TOP_SELL_TABLE." WHERE `orderId`=:'$order_id' AND customerId = '$user_id'
|
||||
");
|
||||
|
||||
$query->bindParam('id', $order_id);
|
||||
$query->bindParam('cus_id', $user_id);
|
||||
|
||||
$query->execute();
|
||||
unset($query); // Unset the query
|
||||
|
||||
$q = $this->db_connection->prepare("
|
||||
$q = $this->db_connection->query("
|
||||
UPDATE ".ORDERS_TABLE." SET `OrderStatusId`= 0
|
||||
WHERE `OrderId` = :ord
|
||||
AND CustomerId = :cust_id
|
||||
WHERE `OrderId` = '$order_id'
|
||||
AND CustomerId = '$user_id'
|
||||
");
|
||||
$q->bindParam('ord', $order_id);
|
||||
$q->bindParam('cust_id', $user_id);
|
||||
|
||||
$q->execute();
|
||||
unset($q);
|
||||
|
||||
$query2 = $this->db_connection->prepare("
|
||||
SELECT * FROM ".TOP_BUYS_TABLE." WHERE `orderId`=:o_id;
|
||||
SELECT * FROM ".TOP_SELL_TABLE." WHERE `orderId`=:o_id
|
||||
$query2 = $this->db_connection->query("
|
||||
SELECT * FROM ".TOP_BUYS_TABLE." WHERE `orderId`='$order_id';
|
||||
SELECT * FROM ".TOP_SELL_TABLE." WHERE `orderId`='$order_id'
|
||||
");
|
||||
$query2->bindParam('o_id', $order_id);
|
||||
|
||||
|
||||
if ($query2->execute()) {
|
||||
|
||||
if ($query2->rowCount() == 0) {
|
||||
if ($_SESSION['user_id']==ADMIN_ID) {
|
||||
$this->storeMessages($order_id, ADMIN_ID, $msg="Order number $order_id was deleted by user id ".ADMIN_ID);
|
||||
@ -1369,7 +1293,7 @@ class Orders extends Users {
|
||||
}
|
||||
return true; // This means row was actually deleted
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1409,18 +1333,12 @@ class Orders extends Users {
|
||||
}
|
||||
$username = $this->get_username($user_id);
|
||||
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
INSERT INTO ".MSG_TABLE."(`id`, `order_id`, `username_key`, `username`, `messages`, `datetime`)
|
||||
VALUES ('', :order_id, :user_id, :username, :msg, '$now')
|
||||
VALUES ('', '$order_id', '$user_id', '$username', '$msg', '$now')
|
||||
");
|
||||
$query->bindParam("order_id", $order_id);
|
||||
$query->bindParam("user_id", $user_id);
|
||||
$query->bindParam("username", $username);
|
||||
$query->bindParam("msg", $msg);
|
||||
|
||||
if ($query->execute()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1438,16 +1356,16 @@ class Orders extends Users {
|
||||
} else {
|
||||
return $my_total_messages;
|
||||
}
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
SELECT COUNT(*) AS MY_TOTAL_MESSAGES
|
||||
FROM ".MSG_TABLE."
|
||||
WHERE `username_key`=:u_id
|
||||
WHERE `username_key`=:'$user_id'
|
||||
");
|
||||
$query->bindParam('u_id', $user_id);
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
$fetch = $query->fetchObject();
|
||||
$my_total_messages = (int) $fetch->MY_TOTAL_MESSAGES;
|
||||
}
|
||||
|
||||
return $my_total_messages;
|
||||
}
|
||||
return false;
|
||||
@ -1462,16 +1380,16 @@ class Orders extends Users {
|
||||
} else {
|
||||
return $my_total_orders;
|
||||
}
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
SELECT COUNT(*) AS MY_TOTAL_ORDERS
|
||||
FROM ".ORDERS_TABLE."
|
||||
WHERE `CustomerId`=:u_id
|
||||
WHERE `CustomerId`='$user_id'
|
||||
");
|
||||
$query->bindParam('u_id', $user_id);
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
$fetch = $query->fetchObject();
|
||||
$my_total_orders = (int)$fetch->MY_TOTAL_ORDERS;
|
||||
}
|
||||
|
||||
return $my_total_orders;
|
||||
}
|
||||
return false;
|
||||
@ -1486,16 +1404,16 @@ class Orders extends Users {
|
||||
} else {
|
||||
return $my_total_orders;
|
||||
}
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
SELECT COUNT(*) AS MY_TOTAL_ORDERS
|
||||
FROM ".TRANSACTIONS_TABLE."
|
||||
WHERE `a_buyer`= :u_id OR `b_seller`= :u_id
|
||||
WHERE `a_buyer`= '$user_id' OR `b_seller`= '$user_id'
|
||||
");
|
||||
$query->bindParam('u_id', $user_id);
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
$fetch = $query->fetchObject();
|
||||
$my_total_orders = (int)$fetch->MY_TOTAL_ORDERS;
|
||||
}
|
||||
|
||||
return $my_total_orders;
|
||||
}
|
||||
return false;
|
||||
@ -1506,14 +1424,14 @@ class Orders extends Users {
|
||||
if ($this->databaseConnection()) {
|
||||
$total_orders = 0;
|
||||
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
SELECT COUNT(*) AS TOTAL_ORDERS
|
||||
FROM ".TRANSACTIONS_TABLE."
|
||||
");
|
||||
if ($query->execute()) {
|
||||
|
||||
$fetch = $query->fetchObject();
|
||||
$total_orders = (int)$fetch->TOTAL_ORDERS;
|
||||
}
|
||||
|
||||
return $total_orders;
|
||||
}
|
||||
return false;
|
||||
@ -1521,19 +1439,17 @@ class Orders extends Users {
|
||||
|
||||
private function isUserOrderOwner($order_id=0, $user_id=0) {
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
SELECT `OrderId` FROM ".ORDERS_TABLE."
|
||||
WHERE `OrderId`=:o_id
|
||||
AND `CustomerId`=:c_id
|
||||
WHERE `OrderId`='$order_id'
|
||||
AND `CustomerId`='$user_id'
|
||||
LIMIT 1
|
||||
");
|
||||
$query->bindParam('o_id', $order_id);
|
||||
$query->bindParam('c_id', $user_id);
|
||||
if ($query->execute()) {
|
||||
|
||||
if ($query->rowCount()==1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1548,22 +1464,15 @@ class Orders extends Users {
|
||||
public function add_bank_account($user_id, $holder, $bank_name, $account_num, $branch_name, $bank_addr, $bk_ctry) {
|
||||
if ($this->databaseConnection()) {
|
||||
$now = $this->time_now();
|
||||
$query = $this->db_connection->prepare(
|
||||
$query = $this->db_connection->query(
|
||||
"INSERT INTO $this->bank_acc(`id`, `user_id`, `acc_holder`, `bank_name`, `acc_num`, `branch_name`, `bank_addr`, `bank_ctry`, `date_added`)
|
||||
VALUES ('', :uid, :holder, :bk_name, :acc_num, :br_name, :addr, :ctry, '$now')"
|
||||
VALUES ('', '$user_id', '$holder', '$bank_name', '$account_num', '$branch_name', '$bank_addr', '$bk_ctry', '$now')"
|
||||
);
|
||||
$query->bindParam("uid", $user_id);
|
||||
$query->bindParam("holder", $holder);
|
||||
$query->bindParam("bk_name", $bank_name);
|
||||
$query->bindParam("acc_num", $account_num);
|
||||
$query->bindParam("br_name", $branch_name);
|
||||
$query->bindParam("addr", $bank_addr);
|
||||
$query->bindParam("ctry", $bk_ctry);
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
$this->storeMessages(null, $user_id, $msg="You added a new bank account number $account_num.");
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1583,18 +1492,13 @@ class Orders extends Users {
|
||||
|
||||
$ex = "";
|
||||
if ($acc != null) {
|
||||
$ex = "AND `acc_num`=:acc";
|
||||
$ex = "AND `acc_num`='$acc'";
|
||||
}
|
||||
|
||||
$query = $this->db_connection->prepare(
|
||||
"SELECT * FROM $this->bank_acc WHERE `user_id`=:uid $ex"
|
||||
$query = $this->db_connection->query(
|
||||
"SELECT * FROM $this->bank_acc WHERE `user_id`='$user_id' $ex"
|
||||
);
|
||||
$query->bindParam("uid", $user_id);
|
||||
if ($acc != null) {
|
||||
$query->bindParam("acc", $acc);
|
||||
}
|
||||
$query->execute();
|
||||
|
||||
|
||||
if ($query->rowCount() > 0) {
|
||||
while ($acc_info = $query->fetchObject()) {
|
||||
$acc_details[] = $acc_info;
|
||||
@ -1622,21 +1526,14 @@ class Orders extends Users {
|
||||
|
||||
$sign = ($assetType == 'btc') ? 'RTM':'$';
|
||||
|
||||
$query = $this->db_connection->prepare(
|
||||
$query = $this->db_connection->query(
|
||||
"INSERT INTO ".TRANSFER_INFO_TABLE."(`id`, `user_id`, `fund_type`, `tr_from`, `tr_to`, `fund_amount`, `remarks`, `datetime`)
|
||||
VALUES('', :uid, :fund_type, :tr_from, :tr_to, :tr_amount, :remarks, '$now')"
|
||||
VALUES('', '$user_id', '$fund_type', '$from', '$to', '$amount', '$remarks', '$now')"
|
||||
);
|
||||
$query->bindParam('uid', $user_id);
|
||||
$query->bindParam('fund_type', $fund_type);
|
||||
$query->bindParam('tr_from', $from);
|
||||
$query->bindParam('tr_to', $to);
|
||||
$query->bindParam('tr_amount', $amount);
|
||||
$query->bindParam('remarks', $remarks);
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
$this->storeMessages(null, $user_id, $msg="You have requested to transfer $sign $amount to bank account number $to.");
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1645,19 +1542,14 @@ class Orders extends Users {
|
||||
if ($this->databaseConnection()) {
|
||||
$now = $this->time_now();
|
||||
$root = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : 0;
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
INSERT INTO ".ADMIN_BAL_RECORDS."(`BalStatusHistoryId`, `user_id`, `bal_prev`, `bal_now`, `type`, `root_id`, `UpdateDate`)
|
||||
VALUES ('', :uid, :prev, :now, :btype, :root, '$now')
|
||||
VALUES ('', '$uid', '$bal_prev', '$bal_now', '$bal_type', '$root', '$now')
|
||||
");
|
||||
$query->bindParam("uid", $uid);
|
||||
$query->bindParam("prev", $bal_prev);
|
||||
$query->bindParam("now", $bal_now);
|
||||
$query->bindParam("btype", $bal_type);
|
||||
$query->bindParam("root", $root);
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -1665,14 +1557,14 @@ class Orders extends Users {
|
||||
public function list_root_bal_changes() {
|
||||
if ($this->databaseConnection()) {
|
||||
$list_details = array();
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
SELECT ".ADMIN_BAL_RECORDS.".*, ".USERS_TABLE.".Name, ".USERS_TABLE.".Email
|
||||
FROM ".ADMIN_BAL_RECORDS.", ".USERS_TABLE."
|
||||
WHERE ".ADMIN_BAL_RECORDS.".user_id=".USERS_TABLE.".CustomerId
|
||||
ORDER BY UpdateDate DESC
|
||||
LIMIT 200
|
||||
");
|
||||
$query->execute();
|
||||
|
||||
|
||||
if ($query->rowCount() > 0) {
|
||||
while ($list = $query->fetchObject()) {
|
||||
@ -1697,13 +1589,13 @@ class Orders extends Users {
|
||||
public function delete_orders_of_user($user_id=null) {
|
||||
if ($this->databaseConnection()) {
|
||||
$order_ids = array();
|
||||
$query = $this->db_connection->prepare("
|
||||
SELECT orderId FROM ".TOP_BUYS_TABLE." WHERE `customerId`=:uid
|
||||
$query = $this->db_connection->query("
|
||||
SELECT orderId FROM ".TOP_BUYS_TABLE." WHERE `customerId`='$user_id'
|
||||
UNION
|
||||
SELECT orderId FROM ".TOP_SELL_TABLE." WHERE `customerId`=:uid
|
||||
SELECT orderId FROM ".TOP_SELL_TABLE." WHERE `customerId`='$user_id'
|
||||
");
|
||||
$query->bindParam('uid', $user_id);
|
||||
$query->execute();
|
||||
|
||||
|
||||
if ($query->rowCount() > 0) {
|
||||
while ($rr = $query->fetchObject()) {
|
||||
$order_ids[] = $rr;
|
||||
|
||||
@ -37,15 +37,10 @@ class Users {
|
||||
private function insert_balance($CustomerId, $AssetTypeId, $Balance, $FrozenBalance) {
|
||||
$now = $this->time_now();
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->prepare("INSERT INTO `$this->customer_balance_table`(`sr_no`, `CustomerId`, `AssetTypeId`, `Balance`, `FrozenBalance`, `UpdateDate`, `InsertDate`, `SaveDate`) VALUES ('', :CustomerId,:AssetTypeId,:Balance,:FrozenBalance,NULL,'$now','$now')");
|
||||
$query->bindValue(':CustomerId', $CustomerId, PDO::PARAM_STR);
|
||||
$query->bindValue(':AssetTypeId', $AssetTypeId, PDO::PARAM_STR);
|
||||
$query->bindValue(':Balance', $Balance, PDO::PARAM_STR);
|
||||
$query->bindValue(':FrozenBalance', $FrozenBalance, PDO::PARAM_STR);
|
||||
|
||||
if($query->execute()) {
|
||||
$query = $this->db_connection->query("INSERT INTO `$this->customer_balance_table`(`sr_no`, `CustomerId`, `AssetTypeId`, `Balance`, `FrozenBalance`, `UpdateDate`, `InsertDate`, `SaveDate`) VALUES ('', '$CustomerId',$AssetTypeId','$Balance','$FrozenBalance',NULL,'$now','$now')");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -133,18 +128,15 @@ public function check_flo_id_active_status($flo_id) {
|
||||
|
||||
if ($this->databaseConnection()) {
|
||||
|
||||
$query = $this->db_connection->prepare("SELECT * FROM $this->customers_table WHERE flo_id = :flo_id AND is_active = 1 LIMIT 1");
|
||||
$query->bindParam('flo_id', $flo_id);
|
||||
|
||||
if ($query->execute()) {
|
||||
$query = $this->db_connection->query("SELECT * FROM $this->customers_table WHERE flo_id = '$flo_id' AND is_active = 1 LIMIT 1");
|
||||
|
||||
|
||||
$row_count = $query->rowCount();
|
||||
if ($row_count == 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -153,18 +145,14 @@ public function check_flo_id_registration_status($flo_id) {
|
||||
|
||||
if ($this->databaseConnection()) {
|
||||
|
||||
$query = $this->db_connection->prepare("SELECT * FROM $this->customers_table WHERE flo_id = :flo_id LIMIT 1");
|
||||
$query->bindParam('flo_id', $flo_id);
|
||||
|
||||
if ($query->execute()) {
|
||||
$query = $this->db_connection->query("SELECT * FROM $this->customers_table WHERE flo_id = '$flo_id' LIMIT 1");
|
||||
|
||||
$row_count = $query->rowCount();
|
||||
if ($row_count == 1) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -182,37 +170,71 @@ public function update_flo_details($floID, $auth_random, $floPublicKey) {
|
||||
|
||||
$now = $this->time_now();
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->prepare("UPDATE `$this->customers_table` SET `auth_random` = :authRandom, `floPublicKey` = :floPublicKey, `updateDate` = '$now' WHERE `flo_id` = :floID LIMIT 1");
|
||||
$query->bindValue(':authRandom', $auth_random, PDO::PARAM_STR);
|
||||
$query->bindValue(':floPublicKey', $floPublicKey, PDO::PARAM_STR);
|
||||
$query->bindValue(':floID', $floID, PDO::PARAM_STR);
|
||||
|
||||
|
||||
if($query->execute()) {
|
||||
$query = $this->db_connection->query("UPDATE `$this->customers_table` SET `auth_random` = '$authRandom', `floPublicKey` = '$floPublicKey', `updateDate` = '$now' WHERE `flo_id` = '$floID' LIMIT 1");
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function update_newUser($flo_id, $name, $email) {
|
||||
|
||||
$now = $this->time_now();
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->query("UPDATE `new_user` SET `name` = '$name', `email` = '$email', `insertDate` = '$now' WHERE `flo_id` = '$flo_id' LIMIT 1");
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function insert_flo_newUser($flo_id) {
|
||||
|
||||
$now = $this->time_now();
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->query("INSERT INTO new_user (`flo_id`,`insertDate`) VALUES ('$flo_id', '$now')");
|
||||
return true;
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function check_duplicate_newUser($flo_id) {
|
||||
|
||||
if ($this->databaseConnection()) {
|
||||
|
||||
$query = $this->db_connection->query("SELECT `flo_id` FROM new_user WHERE flo_id = '$flo_id'");
|
||||
|
||||
|
||||
|
||||
$row_count = $query->rowCount();
|
||||
if ($row_count >= 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function check_user($customerId) {
|
||||
|
||||
if ($this->databaseConnection()) {
|
||||
|
||||
$query = $this->db_connection->prepare("SELECT * FROM $this->customers_table WHERE customerId = :customerId AND is_active = 1 LIMIT 1");
|
||||
$query->bindParam('customerId', $customerId);
|
||||
$query = $this->db_connection->query("SELECT * FROM $this->customers_table WHERE customerId = '$customerId' AND is_active = 1 LIMIT 1");
|
||||
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
$row_count = $query->rowCount();
|
||||
if ($row_count == 1) {
|
||||
return $user_details = $query->fetchObject();
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -220,23 +242,23 @@ public function update_flo_details($floID, $auth_random, $floPublicKey) {
|
||||
if ($this->databaseConnection()) {
|
||||
$transactions = array();
|
||||
|
||||
$query = $this->db_connection->prepare("
|
||||
$query = $this->db_connection->query("
|
||||
SELECT TransactionId AS T_ID, a_buyer AS BUYER_ID, b_seller AS SELLER_ID, (SELECT ".USERS_TABLE.".Name FROM ".USERS_TABLE." WHERE ".USERS_TABLE.".CustomerId=BUYER_ID) AS BUYER, (SELECT ".USERS_TABLE.".Name FROM ".USERS_TABLE." WHERE ".USERS_TABLE.".CustomerId=SELLER_ID) AS SELLER, B_AMOUNT AS TRADE_PRICE, ".TRANSACTIONS_TABLE.".InsertDate, ".TRANSACTIONS_TABLE.".qty_traded AS TRADED_QTY
|
||||
FROM ".TRANSACTIONS_TABLE.", ".USERS_TABLE."
|
||||
WHERE `a_buyer`= :u_id OR `b_seller`= :u_id
|
||||
WHERE `a_buyer`= '$user_id' OR `b_seller`= '$user_id'
|
||||
GROUP BY T_ID
|
||||
ORDER BY T_ID DESC
|
||||
LIMIT $start, $limit
|
||||
");
|
||||
$query->bindParam('u_id', $user_id);
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
$rowCount = $query->rowCount();
|
||||
if ($rowCount > 0) {
|
||||
while ($tr = $query->fetchObject()) {
|
||||
$transactions[] = $tr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $transactions;
|
||||
}
|
||||
return false;
|
||||
@ -246,20 +268,20 @@ public function update_flo_details($floID, $auth_random, $floPublicKey) {
|
||||
if ($this->databaseConnection()) {
|
||||
$messages = array();
|
||||
|
||||
$query = $this->db_connection->prepare("
|
||||
SELECT * FROM ".MSG_TABLE." WHERE `username_key`= :uk
|
||||
$query = $this->db_connection->query("
|
||||
SELECT * FROM ".MSG_TABLE." WHERE `username_key`= '$user_id'
|
||||
ORDER BY datetime DESC
|
||||
LIMIT $start, $limit
|
||||
");
|
||||
$query->bindParam("uk", $user_id);
|
||||
if ($query->execute()) {
|
||||
|
||||
|
||||
$rowCount = $query->rowCount();
|
||||
if ($rowCount > 0) {
|
||||
while ($tr = $query->fetchObject()) {
|
||||
$messages[] = $tr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $messages;
|
||||
}
|
||||
return false;
|
||||
@ -272,16 +294,16 @@ public function update_flo_details($floID, $auth_random, $floPublicKey) {
|
||||
$act = (int) $act;
|
||||
$u_id = (int) $u_id;
|
||||
|
||||
$query = $this->db_connection->prepare("
|
||||
UPDATE ".USERS_TABLE." SET `is_active`= $act
|
||||
WHERE CustomerId = :u_id
|
||||
$query = $this->db_connection->query("
|
||||
UPDATE ".USERS_TABLE." SET `is_active`= '$act'
|
||||
WHERE CustomerId = '$u_id'
|
||||
LIMIT 1
|
||||
");
|
||||
$query->bindParam('u_id', $u_id);
|
||||
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
@ -309,10 +331,8 @@ public function update_flo_details($floID, $auth_random, $floPublicKey) {
|
||||
|
||||
if ($this->databaseConnection()) {
|
||||
$customerId = (int) $customerId;
|
||||
$query = $this->db_connection->prepare("SELECT Username FROM ".USERS_TABLE." WHERE customerId = :id LIMIT 1");
|
||||
$query->bindParam('id', $customerId);
|
||||
|
||||
$query->execute();
|
||||
$query = $this->db_connection->query("SELECT Username FROM ".USERS_TABLE." WHERE customerId = '$customerId' LIMIT 1");
|
||||
|
||||
$row_count = $query->rowCount();
|
||||
if ($row_count == 1) {
|
||||
return $query->fetchObject()->Username;
|
||||
@ -325,10 +345,8 @@ public function update_flo_details($floID, $auth_random, $floPublicKey) {
|
||||
|
||||
if ($this->databaseConnection()) {
|
||||
$customerId = (int) $customerId;
|
||||
$query = $this->db_connection->prepare("SELECT CustomerId,Name,Email FROM ".USERS_TABLE." WHERE flo_id = :id LIMIT 1");
|
||||
$query->bindParam('id', $flo_id);
|
||||
|
||||
$query->execute();
|
||||
$query = $this->db_connection->query("SELECT CustomerId,Name,Email FROM ".USERS_TABLE." WHERE flo_id = '$flo_id' LIMIT 1");
|
||||
|
||||
$row_count = $query->rowCount();
|
||||
if ($row_count == 1) {
|
||||
return $query->fetchObject();
|
||||
@ -339,15 +357,14 @@ public function update_flo_details($floID, $auth_random, $floPublicKey) {
|
||||
|
||||
public function input_user_email($email=null, $user_id=null) {
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->prepare("
|
||||
UPDATE ".USERS_TABLE." SET `Email`= :em WHERE CustomerId = :cid
|
||||
$query = $this->db_connection->query("
|
||||
UPDATE ".USERS_TABLE." SET `Email`= '$email' WHERE CustomerId = '$user_id'
|
||||
");
|
||||
$query->bindParam('em', $email);
|
||||
$query->bindParam('cid', $user_id);
|
||||
|
||||
|
||||
if ($query->execute()) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<?php if(isset($loginUrl)) { ?>
|
||||
<?php if(isset($_SESSION['authenticated']) && ($_SESSION['authenticated']== true) ) { ?>
|
||||
<!-- Modal -->
|
||||
<div id="LoginModel" class="modal animated fadeInDown" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
@ -10,7 +10,7 @@
|
||||
<h4 class="modal-title">Login to continue...</h4>
|
||||
</div>
|
||||
<p class="">
|
||||
<a href="<?=$loginUrl?>"><div class="btn btn--facebook-2">Continue with Facebook</div></a>
|
||||
<a href="<?=$loginUrl?>"><div class="btn btn--facebook-2">Continue with FFLO Address</div></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
2123
includes/UsersFunc.php
Normal file
2123
includes/UsersFunc.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -5,46 +5,49 @@
|
||||
/*Change these values according to your configurations*/
|
||||
|
||||
define("DB_HOST", "localhost");
|
||||
define("DB_NAME", "YOUR DB NAME");
|
||||
define("DB_USER", "DB USER NAME");
|
||||
define("DB_PASS", "DB PASSWORD");
|
||||
define("DB_NAME", "test");
|
||||
define("DB_USER", "User");
|
||||
define("DB_PASS", "password");
|
||||
define("MESSAGE_DATABASE_ERROR", "Failed to connect to database.");
|
||||
|
||||
define("EMAIL_USE_SMTP", true);
|
||||
define("EMAIL_SMTP_HOST", "");
|
||||
define("EMAIL_SMTP_HOST", "secure207.inmotionhosting.com");
|
||||
define("EMAIL_SMTP_AUTH", true);
|
||||
define("EMAIL_SMTP_USERNAME", "");
|
||||
define("EMAIL_SMTP_PASSWORD", "");
|
||||
define("EMAIL_SMTP_USERNAME", "abc@abc.net");
|
||||
define("EMAIL_SMTP_PASSWORD", "smtp_pass");
|
||||
define("EMAIL_SMTP_PORT", 587); //587
|
||||
define("EMAIL_SMTP_ENCRYPTION", "ssl");
|
||||
|
||||
define("RT", "");
|
||||
define("RM", "");
|
||||
define("PI", "");
|
||||
define("AB", "");
|
||||
define("RMGM", "");
|
||||
define("FINANCE", "");
|
||||
define("RT", "rt@gmail.com");
|
||||
define("RM", "dv@xyz.net");
|
||||
define("PI", "am@xyz.com");
|
||||
define("AB", "av@xyz.com");
|
||||
define("RMGM", "rm@xyz.com");
|
||||
define("FINANCE", "finance@xyz.com");
|
||||
|
||||
define("EMAIL_SENDER_NAME", "Ranchi Mall");
|
||||
define("EMAIL_SUBJECT", "Ranchi Mall Fund Transfer Request.");
|
||||
define("EMAIL_SUBJECT_RTM_TRANSFER", "Ranchi Mall RMT Transfer Request.");
|
||||
define("EMAIL_SUBJECT_BTC_TO_CASH", "Ranchi Mall BTC To CASH exchange Request.");
|
||||
|
||||
define("TOP_BUYS_TABLE", "");
|
||||
define("TOP_SELL_TABLE", "");
|
||||
define("CREDITS_TABLE", "");
|
||||
define("CREDITS_HISTORY_TABLE", "");
|
||||
define("ACCOUNTS_TABLE", "");
|
||||
define("USERS_TABLE", "");
|
||||
define("TRANSFER_INFO_TABLE", "");
|
||||
define("MSG_TABLE", "");
|
||||
define("ORDERS_TABLE", "");
|
||||
define("TRANSACTIONS_TABLE", "");
|
||||
define("ADMIN_BAL_RECORDS", "");
|
||||
define("TOP_BUYS_TABLE", "active_buy_list");
|
||||
define("TOP_SELL_TABLE", "active_selling_list");
|
||||
define("CREDITS_TABLE", "assetbalance");
|
||||
define("CREDITS_HISTORY_TABLE", "bal_history");
|
||||
define("ACCOUNTS_TABLE", "bank_accounts");
|
||||
define("USERS_TABLE", "customer");
|
||||
define("TRANSFER_INFO_TABLE", "fund_transfer");
|
||||
define("MSG_TABLE", "messages");
|
||||
define("ORDERS_TABLE", "orderbook");
|
||||
define("TRANSACTIONS_TABLE", "transaction");
|
||||
define("ADMIN_BAL_RECORDS", "root_bal_updates");
|
||||
|
||||
define("APP_ID", 'XXXXXXXXXX');
|
||||
define("APP_SECRET", 'XXXXXXXXXXXXX');
|
||||
define("APP_ID", '371829233156037');
|
||||
define("APP_SECRET", '439475897850541dcd7d4b11f9ef654c');
|
||||
|
||||
define("ADMIN_FB_ID", "XXXXXXXXX");
|
||||
define("ADMIN_ID", "XXXXXXXXXXXXX");
|
||||
define("ADMIN_UNAME", "XXXXXXXXXXXXX");
|
||||
define("ADMIN_FB_ID", "10155672288552348");
|
||||
define("ADMIN_FLO_ID", "F9hTGdRTpkvWDgsrrgj7wCJ3pJrigwmauX");
|
||||
define("ADMIN_ID", "4");
|
||||
define("ADMIN_UNAME", "Rohit1528658369");
|
||||
|
||||
define("COOKIE_LIFE_DAYS", 60);
|
||||
|
||||
@ -9,6 +9,9 @@ require_once 'defines.php';
|
||||
require_once 'config.php';
|
||||
include_once 'autoload.php';
|
||||
include_once 'functions.php';
|
||||
include_once 'UsersFunc.php';
|
||||
|
||||
$db_connection = databaseConnection();
|
||||
|
||||
//if logged in store user DB details
|
||||
$flo_id = null;
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
ob_start();
|
||||
if(!isset($_SESSION['session_id'])) {
|
||||
session_start();
|
||||
@ -11,7 +12,7 @@ date_default_timezone_set('Asia/Kolkata'); ?>
|
||||
<?php require_once "includes/imp_files.php";?>
|
||||
|
||||
<?php require_once 'views/header.php';?>
|
||||
<?php //echo $OrderClass->get_username(3);die; ?>
|
||||
|
||||
<?php include_once 'acc_deact.php';?>
|
||||
|
||||
<!--Buy Sell div-->
|
||||
|
||||
@ -1,7 +1,3 @@
|
||||
/**
|
||||
* Created by Abhishek Kumar Sinha on 9/27/2017.
|
||||
*/
|
||||
|
||||
$(document).ready(function(){
|
||||
var loading = false;
|
||||
|
||||
@ -94,4 +90,4 @@ function loadMoreMyMessages($start,$records_per_page) {
|
||||
}
|
||||
});
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,3 @@
|
||||
/**
|
||||
* Created by Abhishek Kumar Sinha on 9/27/2017.
|
||||
*/
|
||||
|
||||
$(document).ready(function(){
|
||||
var loading = false;
|
||||
|
||||
@ -71,4 +67,4 @@ function loadMoreMyOrders($start,$records_per_page) {
|
||||
}
|
||||
});
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,3 @@
|
||||
/**
|
||||
* Created by Abhishek Kumar Sinha on 9/27/2017.
|
||||
*/
|
||||
|
||||
$(document).ready(function(){
|
||||
var loading = false;
|
||||
|
||||
@ -93,4 +89,4 @@ function loadMoreMyTransactions($start,$records_per_page) {
|
||||
}
|
||||
});
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,3 @@
|
||||
/**
|
||||
* Created by Abhishek Kumar Sinha on 9/27/2017.
|
||||
*/
|
||||
|
||||
$(document).ready(function(){
|
||||
var loading = false;
|
||||
|
||||
@ -95,4 +91,4 @@ function loadMoreRecentTransactions($start,$records_per_page) {
|
||||
}
|
||||
});
|
||||
loading = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ $(document).ready(function() {
|
||||
MyTransactions();
|
||||
load_messages();
|
||||
run_OrderMatcingAlgorithm();
|
||||
load_fresh_table_data();
|
||||
|
||||
$('[data-toggle="popover"]').popover();
|
||||
});
|
||||
@ -218,6 +219,9 @@ function get_my_balance() {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// function to check if JSON data is array or not
|
||||
function isArray(what) {
|
||||
return Object.prototype.toString.call(what) === '[object Array]';
|
||||
|
||||
File diff suppressed because one or more lines are too long
12
logout.php
12
logout.php
@ -1,6 +1,18 @@
|
||||
<?php
|
||||
session_start();
|
||||
$_SESSION['authenticated'] = false;
|
||||
ob_end_clean();
|
||||
ob_start();
|
||||
if (isset($_COOKIE['exchange'])) {
|
||||
unset($_COOKIE['exchange[flo_id]']);
|
||||
setcookie('exchange[flo_id]', null, -1);
|
||||
unset($_COOKIE['exchange[session_id]']);
|
||||
setcookie('exchange[session_id]', null, -1);
|
||||
unset($_COOKIE['exchange[flo_pub_key]']);
|
||||
setcookie('exchange[flo_pub_key]', null, -1);
|
||||
unset($_COOKIE['exchange']);
|
||||
setcookie('exchange', null, -1);
|
||||
}
|
||||
session_destroy();
|
||||
header("Location: index.php"); // you can enter home page here ( Eg : header("Location: " ."http://www.krizna.com");
|
||||
?>
|
||||
|
||||
130
registerUser.php
Normal file
130
registerUser.php
Normal file
@ -0,0 +1,130 @@
|
||||
<?
|
||||
ob_start();
|
||||
session_start();
|
||||
$_SESSION['id'] = session_id();
|
||||
|
||||
|
||||
echo <<<END
|
||||
<head>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
|
||||
<link rel="stylesheet" href="css/bootstrap.css">
|
||||
<link rel="stylesheet" href="css/custom.css">
|
||||
<link rel="stylesheet" href="css/mate.css">
|
||||
|
||||
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300" rel="stylesheet">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script src="https://ranchimall.github.io/Standard_Operations/lib.js"></script>
|
||||
<script src="https://ranchimall.github.io/Standard_Operations/floCrypto.js"></script>
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="text--default">
|
||||
<div class="container-fluid background--primary p--3">
|
||||
<div class="container">
|
||||
<div class="col-sm-6">
|
||||
<a href="http://ranchimall.net/exchange"><div class="logo mt--1"></div></a>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-4 ">
|
||||
<div class="box p--2 mt--4">
|
||||
<div class="row">
|
||||
<h2 class="text-center" id="loginMessage" style="font-size:14px">All fields are mandatory.<br> Name and Email must be correct. <br>Make sure you have the private key for FLO ID.</h2>
|
||||
|
||||
|
||||
<h2 class="text-center">Register Me Please </h2>
|
||||
<hr>
|
||||
<div class="col-lg-12 lazy-form">
|
||||
<label for="id_flo">My FLO ID. I confirm I have the private key</label>
|
||||
<input type="text" name="id_flo" id="id_flo" style="color:black;">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="col-lg-12 lazy-form">
|
||||
<label for="full_name">My Full Name. I promise it is correct</label>
|
||||
<input type="text" name="full_name" id="full_name" style="color:black;">
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="col-lg-12 lazy-form">
|
||||
<label for="email_id">My Email ID. I am sure I get emails on it</label>
|
||||
<input type="text" name="email_id" id="email_id" style="color:black;">
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12">
|
||||
<input type="submit" id="data_submit" class="btn btn--primary-1 btn-white fb_log_in" value="Register Me">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
END;
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<script>
|
||||
|
||||
function ajax_authentication(floID,fullName,emailID) {
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url:'ajax/registerMe.php',
|
||||
data: { floID: floID,fullName:fullName,emailID:emailID},
|
||||
success: function(data) {
|
||||
// console.log(data);
|
||||
}
|
||||
}).error(function(xhr, status, error) {
|
||||
console.log(xhr.responseText);
|
||||
document.getElementById("loginMessage").innerHTML = xhr.responseText;
|
||||
document.getElementById("loginMessage").style.color = "red";
|
||||
}).success(function(data) {
|
||||
|
||||
var IS_JSON = true;
|
||||
try {
|
||||
var d = jQuery.parseJSON(data);
|
||||
console.log(d.message);
|
||||
}
|
||||
catch(err) {
|
||||
IS_JSON = false;
|
||||
}
|
||||
|
||||
if(IS_JSON) {
|
||||
if(d.error == false) {
|
||||
document.getElementById("loginMessage").style.color = "blue";
|
||||
document.getElementById("loginMessage").innerHTML = d.message;
|
||||
|
||||
} else {
|
||||
document.getElementById("loginMessage").innerHTML = d.message;
|
||||
document.getElementById("loginMessage").style.color = "red";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
document.getElementById("data_submit").onclick = function(evt) {
|
||||
|
||||
document.getElementById("loginMessage").style.color = "#CCCCCC";
|
||||
document.getElementById("loginMessage").innerHTML = "Information provided. Waiting for response.";
|
||||
var floID,fullName, emailID;
|
||||
floID = document.getElementById("id_flo").value;
|
||||
fullName = document.getElementById("full_name").value;
|
||||
emailID = document.getElementById("email_id").value;
|
||||
console.log(floID);console.log(fullName);console.log(emailID);
|
||||
ajax_authentication(floID,fullName,emailID);
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
24
rm_root.php
24
rm_root.php
@ -1,9 +1,9 @@
|
||||
<?php ob_start(); date_default_timezone_set('Asia/Kolkata'); ?>
|
||||
<?php $user_id = 0; ?>
|
||||
<!--Bootstrap-->
|
||||
<?php require_once 'includes/imp_files.php';
|
||||
require_once 'views/header.php';
|
||||
?>
|
||||
<?php
|
||||
require_once 'includes/imp_files.php';
|
||||
require_once 'views/header.php';?>
|
||||
|
||||
<?php
|
||||
|
||||
@ -13,10 +13,10 @@
|
||||
redirect_to("index.php");
|
||||
}
|
||||
|
||||
if (isset($_SESSION['flo_id'], $_SESSION['user_id'])) {
|
||||
$root_flo = $_SESSION['flo_id'];
|
||||
$root_user_id = $_SESSION['user_id'];
|
||||
|
||||
if (isset($_SESSION['flo_id'], $_SESSION['user_id'], $_SESSION['user_name'])) {
|
||||
$root_flo = (string) $_SESSION['flo_id'];
|
||||
$root_user_id = (int) $_SESSION['user_id'];
|
||||
|
||||
|
||||
/*This should match ajax/rm_root.php too*/
|
||||
if ($root_flo != ADMIN_FLO_ID && $root_user_id != ADMIN_ID) {
|
||||
@ -44,7 +44,7 @@
|
||||
return false;
|
||||
}
|
||||
|
||||
$validate_user = $UserClass->check_user($investor_id);
|
||||
$validate_user = check_user($investor_id);
|
||||
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
@ -81,9 +81,9 @@
|
||||
}
|
||||
|
||||
//Prev balance of user
|
||||
$bal_prev = (float) $OrderClass->check_customer_balance($assetType, $investor_id)->Balance;
|
||||
$bal_prev = (float) check_customer_balance($assetType, $investor_id)->Balance;
|
||||
|
||||
$update_bal = $OrderClass->update_user_balance($assetType, $balance, $investor_id);
|
||||
$update_bal = update_user_balance($assetType, $balance, $investor_id);
|
||||
|
||||
if (!$update_bal) {
|
||||
redirect_to("rm_root.php?msg=Failed to update balance!");
|
||||
@ -103,7 +103,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
$traders = $OrderClass->UserBalanceList(1);
|
||||
$traders = UserBalanceList(1);
|
||||
|
||||
?>
|
||||
|
||||
@ -205,7 +205,7 @@
|
||||
<div class="container mt--2">
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive">
|
||||
<?php $list_bal_changes = $OrderClass->list_root_bal_changes(); ?>
|
||||
<?php $list_bal_changes = list_root_bal_changes(); ?>
|
||||
<h2>Update History</h2>
|
||||
<input type="text" id="audit_input" onkeyup="search_audit_table()" placeholder="Search for names or id..">
|
||||
<table class="table" id="audit_table">
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 11:46 AM
|
||||
*/
|
||||
ob_start();
|
||||
require_once 'includes/imp_files.php';
|
||||
require_once VIEWS_DIR.'/header.php';
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 4:57 PM
|
||||
*/
|
||||
ob_start();
|
||||
require_once 'includes/imp_files.php';
|
||||
require_once VIEWS_DIR.'/header.php';
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 4:57 PM
|
||||
*/
|
||||
ob_start();
|
||||
require_once 'includes/imp_files.php';
|
||||
require_once VIEWS_DIR.'/header.php';
|
||||
|
||||
@ -1,10 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 11:46 AM
|
||||
*/
|
||||
ob_start();
|
||||
require_once 'includes/imp_files.php';
|
||||
require_once VIEWS_DIR.'/header.php';
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 5:20 PM
|
||||
*/
|
||||
|
||||
ob_start();
|
||||
require_once 'includes/imp_files.php';
|
||||
require_once VIEWS_DIR.'/header.php';
|
||||
@ -15,4 +8,4 @@ require_once VIEWS_DIR.'/header.php';
|
||||
include_once VIEWS_DIR.'/view_all_traders_list.php';
|
||||
|
||||
include_once 'footer.php';
|
||||
?>
|
||||
?>
|
||||
|
||||
@ -12,16 +12,16 @@ $validate_user = null;
|
||||
if (isset($UserClass)) {
|
||||
if (isset($_SESSION['flo_id'])):
|
||||
// check if user already registered
|
||||
$validate_user = $UserClass->doInitialUserHandling($flo_id);
|
||||
// $validate_user = $UserClass->doInitialUserHandling($flo_id);
|
||||
|
||||
if($validate_user == "" || $validate_user == false) {
|
||||
redirect_to('index.php');
|
||||
}
|
||||
// if($validate_user == "" || $validate_user == false) {
|
||||
// redirect_to('index.php');
|
||||
// }
|
||||
endif;
|
||||
|
||||
$tradersList = $OrderClass->UserBalanceList();
|
||||
$buy_list[] = $OrderClass->get_top_buy_sell_list(TOP_BUYS_TABLE, $asc_desc='DESC'); // buy
|
||||
$sell_list[] = $OrderClass->get_top_buy_sell_list(TOP_SELL_TABLE, $asc_desc='ASC'); // sell
|
||||
$tradersList = UserBalanceList();
|
||||
$buy_list[] = get_top_buy_sell_list(TOP_BUYS_TABLE, $asc_desc='DESC'); // buy
|
||||
$sell_list[] = get_top_buy_sell_list(TOP_SELL_TABLE, $asc_desc='ASC'); // sell
|
||||
}
|
||||
|
||||
$fullName = isset($_SESSION['user_name']) ? $_SESSION['user_name'] : "";
|
||||
@ -54,7 +54,8 @@ $_SESSION['rand'] = rand();
|
||||
|
||||
<!-- Latest compiled JavaScript -->
|
||||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
|
||||
<script src="https://sairajzero.github.io/Standard_Operations/cdn/floCrypto.js"></script>
|
||||
<script src="https://ranchimall.github.io/standard-operations/lib.js"></script>
|
||||
<script src="https://ranchimall.github.io/standard-operations/floCrypto.js"></script>
|
||||
|
||||
<script src="<?=JS_DIR?>/notify.js"></script>
|
||||
|
||||
@ -118,7 +119,8 @@ $type = isset($_GET['type']) ? trim($_GET['type']) : 'danger';
|
||||
|
||||
// Refresh needed every 12 minutes to fetch new time challenge to be digitally signed
|
||||
var delayInMilliseconds = 700000;
|
||||
setInterval(function() {window.location.reload();}, delayInMilliseconds);
|
||||
//Need to make sure user is not interrupted
|
||||
// setInterval(function() {window.location.reload();}, delayInMilliseconds);
|
||||
|
||||
function ajax_authentication(floID,floPubKey,message,signDataWithFlo) {
|
||||
$.ajax({
|
||||
@ -200,11 +202,11 @@ function ajax_authentication(floID,floPubKey,message,signDataWithFlo) {
|
||||
<div class="container-fluid background--primary-1 p--1">
|
||||
<div class="container">
|
||||
<div class="col-sm-6">
|
||||
<?php if (isset($OrderClass)) {
|
||||
$LastTradedPrice = $OrderClass->LastTradedPrice();
|
||||
<?php
|
||||
$LastTradedPrice = LastTradedPrice();
|
||||
$LastTradedPrice = ($LastTradedPrice !=Null) ? '$ '. $LastTradedPrice->B_Amount : 'No Data';?>
|
||||
<h5 class="font-20 mt--2 text--uppercase text--bold text--center--mobile">Last Traded Price: <span id="_ltp"><?=$LastTradedPrice;?></span></h5>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
|
||||
<?php if($user_logged_in) { ?>
|
||||
|
||||
@ -42,7 +42,7 @@ if ($user_logged_in) { ?>
|
||||
</thead>
|
||||
<tbody id="my-transactions-list"></tbody>
|
||||
<?php if(isset($user_id) && $user_id !=null) {
|
||||
$MyTransactions = $OrderClass->displayUserTransaction($user_id, 0, 10);?>
|
||||
$MyTransactions = displayUserTransaction($user_id, 0, 10);?>
|
||||
<?php if ($MyTransactions == null || !is_array($MyTransactions) || empty($MyTransactions)) { ?>
|
||||
<p class="text-info">No transactions!</p>
|
||||
<?php }} ?>
|
||||
@ -53,4 +53,4 @@ if ($user_logged_in) { ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
@ -3,16 +3,16 @@ if (!isset($user_id)) {
|
||||
$user_id = $_SESSION['user_id'];
|
||||
}
|
||||
if (!isset($user_email)) {
|
||||
$user_email = $_SESSION['flo_id'];
|
||||
$user_email = $_SESSION['email'];
|
||||
}
|
||||
if (!isset($log_fullName)) {
|
||||
$log_fullName = $_SESSION['flo_id'];
|
||||
}
|
||||
if (($user_email == null) && ($user_logged_in == true)) {
|
||||
|
||||
if (isset($_POST['user_em_id'], $UserClass) && is_email($_POST['user_em_id'])) {
|
||||
if (isset($_POST['user_em_id']) && is_email($_POST['user_em_id'])) {
|
||||
$email = trim($_POST['user_em_id']);
|
||||
$updateEmail = $UserClass->input_user_email($email, $user_id);
|
||||
$updateEmail = input_user_email($email, $user_id);
|
||||
if ($updateEmail) {
|
||||
redirect_to("index.php?msg=Email updated as $email successfully.&type=success");
|
||||
}
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
<?php if (isset($OrderClass)) { ?>
|
||||
|
||||
<h4>Trader's list</h4>
|
||||
<h5><a href="traders" target="_blank">View All</a></h5>
|
||||
<?php if ( isset($tradersList) && is_array($tradersList) && !empty($tradersList)) { ?>
|
||||
@ -24,4 +22,4 @@
|
||||
<?php } else {
|
||||
|
||||
echo '<h4>No traders found!</h4>';
|
||||
}} ?>
|
||||
} ?>
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/3/2017
|
||||
* Time: 5:07 PM
|
||||
*/
|
||||
|
||||
if (isset($tradersList) && is_array($tradersList) && !empty($tradersList)) { ?>
|
||||
|
||||
<div class="container-fluid p--2 background-white-1 mt--4">
|
||||
@ -37,4 +30,4 @@ if (isset($tradersList) && is_array($tradersList) && !empty($tradersList)) { ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php }
|
||||
<?php }
|
||||
|
||||
@ -1,13 +1,7 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* Date: 10/21/2017
|
||||
* Time: 3:36 PM
|
||||
*/
|
||||
|
||||
if($user_logged_in):
|
||||
$user_id = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : null;
|
||||
$accounts = $OrderClass->get_bank_details($user_id);
|
||||
$accounts = get_bank_details($user_id);
|
||||
?>
|
||||
<div class="container-fluid background-white-1 mt--4 p--2">
|
||||
<div class="container">
|
||||
|
||||
@ -1,12 +1,3 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 9/28/2017
|
||||
* Time: 4:58 PM
|
||||
*/
|
||||
|
||||
?>
|
||||
<?php
|
||||
if($user_logged_in) {?>
|
||||
<div class="container-fluid background-white-1 mt--4 p--2">
|
||||
@ -31,4 +22,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
|
||||
@ -1,12 +1,3 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 11:19 AM
|
||||
*/
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<div class="col-lg-12">
|
||||
<h2 class="mt--2">My Messages</h2>
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 11:19 AM
|
||||
*/
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="col-lg-12">
|
||||
<h2 class="mt--2">My Orders</h2>
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 11:19 AM
|
||||
*/
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="col-lg-12">
|
||||
<h2 class="mt--2">My Transactions</h2>
|
||||
|
||||
@ -1,11 +1,3 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 11:19 AM
|
||||
*/
|
||||
?>
|
||||
<div class="container">
|
||||
<div class="col-lg-12">
|
||||
<h2 class="mt--2">Recent Transactions</h2>
|
||||
|
||||
@ -1,16 +1,10 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 10/5/2017
|
||||
* Time: 11:19 AM
|
||||
*/
|
||||
|
||||
$tradersList = array();
|
||||
|
||||
if(isset($OrderClass)) {
|
||||
$tradersList = $OrderClass->UserBalanceList();
|
||||
}
|
||||
|
||||
$tradersList = UserBalanceList();
|
||||
|
||||
|
||||
if(!empty($tradersList)) { ?>
|
||||
<div class="container">
|
||||
|
||||
Loading…
Reference in New Issue
Block a user