New Admin BC fatures. Minor improvements in display
This commit is contained in:
parent
353923dc01
commit
7b93c44e40
@ -10,7 +10,13 @@ if (isset($_POST['task']) && trim($_POST['task'])=='run_OrderMatchingAlgorithm')
|
||||
|
||||
if ($slc1 == "" || $slc2 == "") {return;}
|
||||
|
||||
$refresh_orders = $OrderClass->OrderMatchingService($_POST['sel1'], $_POST['sel2']);
|
||||
$is_sel1_valid= $OrderClass->is_bc_valid($slc1, 1, null);
|
||||
$is_sel2_valid= $OrderClass->is_bc_valid($slc2, null, 1);
|
||||
if (!$is_sel1_valid || !$is_sel2_valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
$refresh_orders = $OrderClass->OrderMatchingService($slc1, $slc2);
|
||||
|
||||
/*If user is logged in user send him messages, if any*/
|
||||
if (checkLoginStatus()) {
|
||||
|
||||
@ -5,15 +5,55 @@ if (isset($_POST['task']) && trim($_POST['task']=='current_prices')) {
|
||||
$bc2 = isset($_POST['bc2']) ? $_POST['bc2'] : null;
|
||||
|
||||
$std = new stdClass();
|
||||
$std->bc = array();
|
||||
$std->cp = array();
|
||||
$std->error = true;
|
||||
if (isset($OrderClass)) {
|
||||
|
||||
$wallet = $OrderClass->tx_data(null,$bc2,null);
|
||||
$is_bc_valid= $OrderClass->is_bc_valid($bc2, null, 1);
|
||||
if ($is_bc_valid) {
|
||||
/*$wallet = $OrderClass->tx_data(null,$bc2,null);
|
||||
$rmteq = $OrderClass->tx_data(null,RMT,null);
|
||||
|
||||
$std->bc = $wallet;
|
||||
$std->error = false;
|
||||
$usd_eq = array();
|
||||
if (is_array($wallet)&&!empty($wallet)) {
|
||||
foreach ($wallet as $w) {
|
||||
if (isset($w->a_amount, $w->b_amount)) {
|
||||
$b = $w->b_amount;
|
||||
if ($w->b_amount == RMT && isset($_SESSION['RMT_TODAYS_PRICE'])) {
|
||||
$b = $_SESSION['RMT_TODAYS_PRICE'];
|
||||
}
|
||||
$usd_eq[] = bc_to_usd($w->a_amount, $b); // bc eq in rmt * rmt eq in usd
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
$bcs = $OrderClass->get_bc_list(null, 1, 1);
|
||||
$bccode = array();
|
||||
$bc2_eq = array();
|
||||
$rmt_eq = array();
|
||||
$usd_eq = array();
|
||||
|
||||
$res = array(
|
||||
'BC'=>'',
|
||||
'BC2VAL'=>'',
|
||||
'RMTVAL'=>'',
|
||||
'USDVAL'=>''
|
||||
);
|
||||
if (is_array($bcs)&&!empty($bcs)) {
|
||||
foreach ($bcs as $i=>$b) {
|
||||
$bccode[] = $b->bc_code;
|
||||
$bc2_eq[] = isset($OrderClass->get_bc1_to_bc2_eq($b->bc_code, $bc2)->a_amount) ? $OrderClass->get_bc1_to_bc2_eq($b->bc_code, $bc2)->a_amount : 0;
|
||||
$rmt_eq[] = isset($OrderClass->get_bc1_to_bc2_eq($b->bc_code, RMT)->a_amount) ? $OrderClass->get_bc1_to_bc2_eq($b->bc_code, RMT)->a_amount : 0;
|
||||
if (isset($_SESSION['RMT_TODAYS_PRICE'])) {
|
||||
$usd_eq[] = bc_to_usd($rmt_eq[$i], $_SESSION['RMT_TODAYS_PRICE']);
|
||||
}
|
||||
$res=['BC'=>$bccode, 'BC2VAL'=>$bc2_eq, 'RMTVAL'=>$rmt_eq, 'USDVAL'=>$usd_eq];
|
||||
}
|
||||
}
|
||||
|
||||
$std->cp = $res;
|
||||
$std->error = false;
|
||||
}
|
||||
}
|
||||
echo json_encode($std);
|
||||
}
|
||||
|
||||
@ -6,13 +6,17 @@ if (!checkLoginStatus()) {
|
||||
}
|
||||
|
||||
if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
|
||||
if (isset($UserClass, $OrderClass)) {
|
||||
$std = new stdClass();
|
||||
$std->user = null;
|
||||
$std->order = null;
|
||||
$std->error = false;
|
||||
$std->msg = null;
|
||||
|
||||
$place_order = "";
|
||||
$validate_user = "";
|
||||
$msss = "Order could not be placed.";
|
||||
|
||||
if (isset($_POST['sel1'], $_POST['qty'], $_POST['price'], $_POST['sel2'], $_POST['bs_rad'], $_POST['is_mkt'])) {
|
||||
$WantAssetTypeId = trim($_POST['sel1']);
|
||||
$OfferAssetTypeId = trim($_POST['sel2']);
|
||||
@ -31,19 +35,29 @@ if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
|
||||
$orderStatusId = 2; // 0 -> cancelled; 1 -> complete; 2 -> pending
|
||||
|
||||
if($WantAssetTypeId == '') {
|
||||
$is_sel1_valid= $OrderClass->is_bc_valid($WantAssetTypeId, 1, null);
|
||||
$is_sel2_valid= $OrderClass->is_bc_valid($OfferAssetTypeId, null, 1);
|
||||
|
||||
if($WantAssetTypeId == '' || !$is_sel1_valid) {
|
||||
$std->error = true;
|
||||
$std->msg = "Please select first Blockchain contract.";
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
if($OfferAssetTypeId == '') {
|
||||
if($OfferAssetTypeId == '' || !$is_sel2_valid) {
|
||||
$std->error = true;
|
||||
$std->msg = "Please select second Blockchain contract.";
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
if($qty == '' || $qty < 0) {
|
||||
|
||||
if ($WantAssetTypeId==$OfferAssetTypeId) {
|
||||
$std->error = true;
|
||||
$std->msg = "Both contracts cannot be same. Please select different contracts to trade.";
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
if($qty == '' || $qty < 0.0000000001) {
|
||||
$std->error = true;
|
||||
$std->msg = "Please provide a valid quantity to be traded.";
|
||||
echo json_encode($std);
|
||||
@ -59,6 +73,16 @@ if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
}
|
||||
}
|
||||
|
||||
$isValidQty = validate_decimal_place($qty, 10);
|
||||
$isValidPrice = validate_decimal_place($price, 10);
|
||||
|
||||
if (!$isValidQty || !$isValidPrice) {
|
||||
$std->error = true;
|
||||
$std->msg = 'Please insert valid quantity and price. Maximum 10 decimal places allowed.';
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($buy_sell=='ex-buy') {
|
||||
$orderTypeId = 0; // It is a buy
|
||||
$order_type = 'm-buy'; // for market req
|
||||
@ -74,10 +98,6 @@ if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$place_order = "";
|
||||
$validate_user = "";
|
||||
if (isset($UserClass, $OrderClass)) {
|
||||
|
||||
$validate_user = $UserClass->check_user($user_id);
|
||||
|
||||
if($validate_user == "" || empty($validate_user)) {
|
||||
@ -87,21 +107,76 @@ if (isset($_POST['subject']) && trim($_POST['subject'])=='placeOrder') {
|
||||
return false;
|
||||
}
|
||||
|
||||
$top_tbl = null;
|
||||
if ($orderTypeId == 0) {
|
||||
$user_current_bal = (float) $OrderClass->check_customer_balance($OfferAssetTypeId, $user_id)->balance;
|
||||
$top_tbl = TOP_BUYS_TABLE;
|
||||
$user_active_orders = $OrderClass->get_active_buy_order_of_user($user_id, $OfferAssetTypeId, $top_tbl);
|
||||
|
||||
$frozen_bal = 0;
|
||||
if (is_array($user_active_orders) && !empty($user_active_orders)) {
|
||||
foreach ($user_active_orders as $uao) {
|
||||
$frozen_bal += (float) $uao->price * $uao->quantity;
|
||||
}
|
||||
}
|
||||
$allowed_bid_amount = 0;
|
||||
if ($user_current_bal > $frozen_bal) {
|
||||
$allowed_bid_amount = $user_current_bal - $frozen_bal;
|
||||
}
|
||||
$ext_st = "You can put bid up to $OfferAssetTypeId $allowed_bid_amount only.";
|
||||
$ext_st2 = "";
|
||||
if ($allowed_bid_amount == 0) {
|
||||
$ext_st = "You don't have any $OfferAssetTypeId balance to spend.";
|
||||
}
|
||||
if ((float)$frozen_bal != 0) {
|
||||
$ext_st2 = "You have already placed an order worth $OfferAssetTypeId $frozen_bal.";
|
||||
}
|
||||
$msss = "Insufficient Balance: $ext_st2 $ext_st";
|
||||
|
||||
} elseif ($orderTypeId == 1) {
|
||||
$user_current_bal = (float) $OrderClass->check_customer_balance($WantAssetTypeId, $user_id)->balance;
|
||||
$top_tbl = TOP_SELLS_TABLE;
|
||||
$user_active_orders = $OrderClass->get_active_sell_order_of_user($user_id, $WantAssetTypeId, $top_tbl);
|
||||
$frozen_bal = 0;
|
||||
if (is_array($user_active_orders) && !empty($user_active_orders)) {
|
||||
foreach ($user_active_orders as $uao) {
|
||||
$frozen_bal += (float) $uao->quantity;
|
||||
}
|
||||
}
|
||||
$allowed_bid_amount = 0;
|
||||
if ($user_current_bal > $frozen_bal) {
|
||||
$allowed_bid_amount = $user_current_bal - $frozen_bal;
|
||||
}
|
||||
$ext_st = "You can sell maximum $WantAssetTypeId $allowed_bid_amount units.";
|
||||
if ($allowed_bid_amount == 0) {
|
||||
$ext_st = "You don't have any $WantAssetTypeId to sell.";
|
||||
}
|
||||
$msss = "Insufficient Balance: You have already placed an order of $WantAssetTypeId $frozen_bal. $ext_st";
|
||||
}
|
||||
|
||||
if ($frozen_bal + $total_trade_val > $user_current_bal) {
|
||||
$std->error = true;
|
||||
$std->msg = $msss;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($is_mkt) {
|
||||
$place_order = $OrderClass->market_order($order_type, $qty, $OfferAssetTypeId, $WantAssetTypeId);
|
||||
} else {
|
||||
$place_order = $OrderClass->insert_pending_order($orderTypeId, $qty, $price, $orderStatusId, $OfferAssetTypeId, $WantAssetTypeId);
|
||||
}
|
||||
$msss = "";
|
||||
|
||||
$std->user = $validate_user;
|
||||
$std->order = $place_order;
|
||||
$std->error = false;
|
||||
$std->msg = $msss;
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$std->user = $validate_user;
|
||||
$std->order = $place_order;
|
||||
$std->error = false;
|
||||
$std->msg = "Order placed successfully.";
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$std->error = true;
|
||||
$std->msg = "Please fill all the fields.";
|
||||
echo json_encode($std);
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
//echo $_POST['bc2'];
|
||||
if (isset($_POST['task'], $_POST['bc1'], $_POST['bc2']) && trim($_POST['task'])=='refresh') {
|
||||
|
||||
$bc1 = $_POST['bc1'];
|
||||
$bc2 = $_POST['bc2'];
|
||||
if (isset($_POST['task']) && trim($_POST['task'])=='refresh') {
|
||||
|
||||
$bc1 = trim($_POST['bc1']);
|
||||
$bc2 = trim($_POST['bc2']);
|
||||
|
||||
$std = new stdClass();
|
||||
$std->buys = null;
|
||||
@ -14,6 +14,19 @@ if (isset($_POST['task'], $_POST['bc1'], $_POST['bc2']) && trim($_POST['task'])=
|
||||
$std->error = true;
|
||||
|
||||
if (isset($OrderClass, $UserClass)) {
|
||||
if (isset($bc1) && trim($bc1)!=="") {
|
||||
$is_sel1_valid= $OrderClass->is_bc_valid($bc1, 1, null);
|
||||
if (!$is_sel1_valid) {
|
||||
return;
|
||||
}
|
||||
} else {$bc1=null;}
|
||||
|
||||
if (isset($bc2) && trim($bc2)!=="") {
|
||||
$is_sel2_valid= $OrderClass->is_bc_valid($bc2, null, 1);
|
||||
if (!$is_sel2_valid) {
|
||||
return;
|
||||
}
|
||||
} else {$bc2=null;}
|
||||
|
||||
$buy_list = $OrderClass->get_top_buy_sell_list(TOP_BUYS_TABLE, $bc1, $bc2, $asc_desc='DESC'); // buy
|
||||
$sell_list = $OrderClass->get_top_buy_sell_list(TOP_SELLS_TABLE, $bc1, $bc2, $asc_desc='ASC'); // sell
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
if (!checkLoginStatus() || !isset($UserClass, $OrderClass)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -43,4 +43,70 @@ if (isset($_SESSION['fb_id'], $_SESSION['user_id'], $_SESSION['user_name'])) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['job']) && trim($_POST['job']=="inset_bc")) {
|
||||
if (isset($_POST['ct_name'], $_POST['bccode'], $_POST['bcadmin'], $_POST['incpdt'])) {
|
||||
$contractName = trim($_POST['ct_name']);
|
||||
$bcCode = strtoupper(trim($_POST['bccode']));
|
||||
$bcAdmin = trim($_POST['bcadmin']);
|
||||
$eliSel1 = (trim($_POST['ch1'])=='true'?1:0);
|
||||
$eliSel2 = (trim($_POST['ch2'])=='true'?1:0);
|
||||
$incp = trim($_POST['incpdt']);
|
||||
|
||||
$std = new stdClass();
|
||||
$std->ctr = null;
|
||||
$std->msg = null;
|
||||
$std->error = true;
|
||||
|
||||
if (strlen($bcCode)>8) {
|
||||
$std->msg = "Blockchain Code cannot be greater than 8 characters.";
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
$insertBC = $OrderClass->insert_new_bc($contractName, $bcCode, $bcAdmin, $eliSel1, $eliSel2, $incp);
|
||||
|
||||
if ($insertBC) {
|
||||
$std->ctr = $insertBC;
|
||||
$std->msg = "New BC inserted successfully";
|
||||
$std->error = false;
|
||||
} else {
|
||||
$std->msg = "Failed to insert new BC.";
|
||||
}
|
||||
} else {
|
||||
$std->msg = "Please fill all the fields";
|
||||
}
|
||||
|
||||
echo json_encode($std);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isset($_POST['updt_job']) && trim($_POST['updt_job']=="update_sel_bc")) {
|
||||
if (isset($_POST['_id'])) {
|
||||
$id = trim($_POST['_id']);
|
||||
$exp = explode("_",$id);
|
||||
$bc = $exp[1];
|
||||
$sel = $exp[0];
|
||||
$val = (int) $exp[2];
|
||||
$val = ($val=='')?1:0;
|
||||
|
||||
$std = new stdClass();
|
||||
$std->res = null;
|
||||
$std->val = null;
|
||||
|
||||
if ($bc==''||$sel==''||$val==='') {
|
||||
echo json_encode($std);
|
||||
return;
|
||||
}
|
||||
|
||||
$res = $OrderClass->update_bc_eligibility($bc, $sel, $val);
|
||||
|
||||
$std = new stdClass();
|
||||
$std->res = $res;
|
||||
$std->val = $val;
|
||||
$std->new_id = $sel.'_'.$bc.'_'.$val;
|
||||
echo json_encode($std);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -11,6 +11,11 @@ if (isset($_POST['task'], $_POST['bc1'], $_POST['bc2']) && trim($_POST['task'])=
|
||||
$std->error = true;
|
||||
|
||||
if (isset($OrderClass)) {
|
||||
$is_sel1_valid= $OrderClass->is_bc_valid($bc1, 1, null);
|
||||
$is_sel2_valid= $OrderClass->is_bc_valid($bc2, null, 1);
|
||||
if (!$is_sel1_valid || !$is_sel2_valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = $OrderClass->tx_data($bc1, $bc2, 1);
|
||||
if (!empty($data)) {
|
||||
|
||||
@ -10,13 +10,21 @@ require_once '../includes/imp_files.php';
|
||||
|
||||
if (isset($_POST['task'],$_POST['bc1'],$_POST['bc2']) && trim($_POST['task'])=='loadTradeList') {
|
||||
|
||||
$bc1 = trim($_POST['bc1']);
|
||||
$bc2 = trim($_POST['bc2']);
|
||||
|
||||
$std = new stdClass();
|
||||
$std->trade_list = array();
|
||||
$std->error = true;
|
||||
|
||||
if (isset($OrderClass, $UserClass)) {
|
||||
$is_sel1_valid= $OrderClass->is_bc_valid($bc1, 1, null);
|
||||
$is_sel2_valid= $OrderClass->is_bc_valid($bc2, null, 1);
|
||||
if (!$is_sel1_valid || !$is_sel2_valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
$tradeList = $OrderClass->last_transaction_list(0,10,trim($_POST['bc1']),trim($_POST['bc2']));
|
||||
$tradeList = $OrderClass->last_transaction_list(0,10,$bc1,$bc2);
|
||||
|
||||
$std->trade_list = $tradeList;
|
||||
$std->error = false;
|
||||
|
||||
@ -18,6 +18,11 @@ if (isset($_POST['task'], $_POST['bc2']) && trim($_POST['task'])=='loadTradersLi
|
||||
|
||||
if (isset($OrderClass)) {
|
||||
|
||||
$is_sel2_valid= $OrderClass->is_bc_valid($bc2, null, 1);
|
||||
if (!$is_sel2_valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
$tradersList = $OrderClass->UserBalanceList($bc2, 1);
|
||||
if (is_array($tradersList) && !empty($tradersList)) {
|
||||
$std->traders_list = $tradersList;
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<?php
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
if (!checkLoginStatus() || !isset($OrderClass)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -24,7 +24,9 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_tokens") {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($bc2==""||$bc2==null) {
|
||||
$is_sel2_valid= $OrderClass->is_bc_valid($bc2, null, 1);
|
||||
|
||||
if ($bc2==""||$bc2==null || !$is_sel2_valid) {
|
||||
$mess = "Please choose a Blockchain contract from second dropdown.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
@ -65,7 +67,7 @@ if (isset($_POST['job']) && trim($_POST['job']) == "transfer_tokens") {
|
||||
}
|
||||
|
||||
// Check order in sell table
|
||||
$user_active_orders = $OrderClass->get_active_order_of_user($from, $bc2, TOP_SELLS_TABLE);
|
||||
$user_active_orders = $OrderClass->get_active_buy_order_of_user($from, $bc2, TOP_SELLS_TABLE);
|
||||
$frozen_bal_sells = 0;
|
||||
$allowed_bid_amount = $customer_bal_fr;
|
||||
if (is_array($user_active_orders) && !empty($user_active_orders)) {
|
||||
|
||||
@ -1,10 +1,5 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Abhishek Kumar Sinha
|
||||
* Date: 5/16/2018
|
||||
* Time: 5:56 PM
|
||||
*/
|
||||
|
||||
require_once '../includes/imp_files.php';
|
||||
|
||||
if (!checkLoginStatus()) {
|
||||
@ -22,7 +17,9 @@ if (isset($_POST['job']) && trim($_POST['job']) == "update-user-bc-balance") {
|
||||
$std->mesg = array();
|
||||
$std->error = true;
|
||||
|
||||
if ($bc2==""||$bc2==null) {
|
||||
$is_sel2_valid= $OrderClass->is_bc_valid($bc2, null, 1);
|
||||
|
||||
if ($bc2==""||$bc2==null || !$is_sel2_valid) {
|
||||
$mess = "Please choose a Blockchain contract from second dropdown.";
|
||||
$std->error = true;
|
||||
$std->mesg[] = $mess;
|
||||
|
||||
@ -158,20 +158,29 @@ class Orders extends Users {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get_top_buy_sell_list($top_table, $WantAssetTypeId, $OfferAssetTypeId, $asc_desc) {
|
||||
public function get_top_buy_sell_list($top_table, $WantAssetTypeId=null, $OfferAssetTypeId=null, $asc_desc) {
|
||||
|
||||
if ($this->databaseConnection()) {
|
||||
|
||||
$top_list = array();
|
||||
$st1 = "";
|
||||
if (trim($WantAssetTypeId) != null) {
|
||||
$st1 = " AND $top_table.bc1 = '".$WantAssetTypeId."' ";
|
||||
}
|
||||
$st2 = "";
|
||||
if (trim($OfferAssetTypeId) != null) {
|
||||
$st2 = " AND $top_table.bc2 = '".$OfferAssetTypeId."' ";
|
||||
}
|
||||
|
||||
$query = $this->db_connection->query("SELECT $top_table.order_id, $top_table.uid, $top_table.quantity, $top_table.price, ".USERS_TABLE.".name
|
||||
FROM $top_table, ".USERS_TABLE."
|
||||
WHERE $top_table.uid = ".USERS_TABLE.".id
|
||||
AND $top_table.bc1 = '".$WantAssetTypeId."'
|
||||
AND $top_table.bc2 = '".$OfferAssetTypeId."'
|
||||
ORDER BY price $asc_desc
|
||||
LIMIT $this->max_top_bids
|
||||
");
|
||||
$query = $this->db_connection->query("
|
||||
SELECT $top_table.order_id, $top_table.uid, $top_table.quantity, $top_table.price, ".USERS_TABLE.".name, $top_table.bc1, $top_table.bc2
|
||||
FROM $top_table, ".USERS_TABLE."
|
||||
WHERE $top_table.uid = ".USERS_TABLE.".id
|
||||
$st1
|
||||
$st2
|
||||
ORDER BY price $asc_desc
|
||||
LIMIT $this->max_top_bids
|
||||
");
|
||||
|
||||
if ($query) {
|
||||
|
||||
@ -208,12 +217,22 @@ class Orders extends Users {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get_active_order_of_user($user_id, $bc, $top_table) {
|
||||
public function get_active_buy_order_of_user($user_id, $bc=null, $top_table) {
|
||||
if ($this->databaseConnection()) {
|
||||
|
||||
$st = "";
|
||||
if (trim($bc)!=null) {
|
||||
$st = " AND bc2 = :bc ";
|
||||
}
|
||||
$query = $this->db_connection->prepare("
|
||||
SELECT * FROM $top_table WHERE `uid`= :uid ORDER BY `insert_dt` DESC
|
||||
SELECT * FROM $top_table WHERE `uid`= :uid
|
||||
".$st."
|
||||
ORDER BY `insert_dt` DESC
|
||||
");
|
||||
$query->bindParam('uid', $user_id);
|
||||
if (trim($bc)!=null) {
|
||||
$query->bindParam('bc', $bc);
|
||||
}
|
||||
$query->execute();
|
||||
|
||||
$arr = array();
|
||||
@ -225,6 +244,33 @@ class Orders extends Users {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get_active_sell_order_of_user($user_id, $bc=null, $top_table) {
|
||||
if ($this->databaseConnection()) {
|
||||
$st = "";
|
||||
if (trim($bc)!=null) {
|
||||
$st = " AND bc1 = :bc ";
|
||||
}
|
||||
$query = $this->db_connection->prepare("
|
||||
SELECT * FROM $top_table WHERE `uid`= :uid
|
||||
".$st."
|
||||
ORDER BY `insert_dt` DESC
|
||||
");
|
||||
$query->bindParam('uid', $user_id);
|
||||
if (trim($bc)!=null) {
|
||||
$query->bindParam('bc', $bc);
|
||||
}
|
||||
$query->execute();
|
||||
|
||||
$arr = array();
|
||||
while ($qr = $query->fetchObject()) {
|
||||
$arr[] = $qr;
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function OrderMatchingQuery($bc1, $bc2) {
|
||||
|
||||
if ($this->databaseConnection()) {
|
||||
@ -1423,6 +1469,14 @@ class Orders extends Users {
|
||||
return false;
|
||||
}
|
||||
|
||||
public function get_bc1_to_bc2_eq($bc1, $bc2) {
|
||||
$res = "";
|
||||
if (trim($bc1) !="" && trim($bc2) !="") {
|
||||
$res = $this->tx_data($bc1, $bc2, $limit=1);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function record_root_bal_update($uid, $bal_prev, $bal_now, $bal_type) {
|
||||
if ($this->databaseConnection()) {
|
||||
$now = $this->time_now();
|
||||
@ -1570,5 +1624,110 @@ class Orders extends Users {
|
||||
return false;
|
||||
}
|
||||
|
||||
/*Blockchain Contract Queries*/
|
||||
|
||||
public function get_bc_list($bc_name = null, $tradable_bc1=null, $tradable_bc2=null) {
|
||||
$bcl = [];
|
||||
if ($this->databaseConnection()) {
|
||||
$st = '';
|
||||
$st2 = '';
|
||||
if ($bc_name != null) {
|
||||
$st2 = " AND bc_code=:b ";
|
||||
}
|
||||
if ($tradable_bc1!=null && $tradable_bc2!=null) {
|
||||
$st = 'WHERE eligible_bc1 = 1 AND eligible_bc2 = 1 '.$st2;
|
||||
} else if ($tradable_bc1!=null && $tradable_bc2==null) {
|
||||
$st = 'WHERE eligible_bc1 = 1 '.$st2;
|
||||
} else if ($tradable_bc1==null && $tradable_bc2!=null) {
|
||||
$st = 'WHERE eligible_bc2 = 1 '.$st2;
|
||||
} else {
|
||||
if ($bc_name != null) {
|
||||
$st2 = " WHERE bc_code=:b ";
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->db_connection->prepare("SELECT * FROM ".BC_TABLE."
|
||||
$st $st2 ");
|
||||
|
||||
if ($bc_name != null) {
|
||||
$query->bindParam('b', $bc_name);
|
||||
}
|
||||
$query->execute();
|
||||
|
||||
if ($query->rowCount()) {
|
||||
while ($l = $query->fetchObject()) {
|
||||
$bcl[] = $l;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $bcl;
|
||||
}
|
||||
|
||||
public function is_bc_valid($bc=null, $val_bc1=null, $val_bc2=null) {
|
||||
if ($this->databaseConnection()) {
|
||||
$bc= trim($bc); $val_bc1=trim($val_bc1); $val_bc2=trim($val_bc2);
|
||||
if ($val_bc1 == null && $val_bc2==null && $bc==null) {
|
||||
return false;
|
||||
}
|
||||
if ($bc != null) {
|
||||
if ($bc=="RMT") {
|
||||
return true;
|
||||
}
|
||||
$bc_list = array();
|
||||
$bcs = $this->get_bc_list(null, $val_bc1, $val_bc2);
|
||||
if (!empty($bcs)) {
|
||||
foreach ($bcs as $bcl) {
|
||||
$bc_list[] = $bcl->bc_code;
|
||||
}
|
||||
}
|
||||
if (in_array($bc, $bc_list)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function insert_new_bc($contractName, $contractCode, $contractAdmin, $isEligibleSel1, $isEligibleSel2, $incpDate) {
|
||||
if ($this->databaseConnection()) {
|
||||
|
||||
$query = $this->db_connection->prepare("
|
||||
INSERT INTO ".BC_TABLE."(`id`, `contracts`, `bc_code`, `admin`, `eligible_bc1`, `eligible_bc2`, `incp`)
|
||||
VALUES('', :ctr, :bcc, :adm, $isEligibleSel1, $isEligibleSel2, :dt)
|
||||
");
|
||||
$query->bindParam('ctr', $contractName);
|
||||
$query->bindParam('bcc', $contractCode);
|
||||
$query->bindParam('adm', $contractAdmin);
|
||||
$query->bindParam('dt', $incpDate);
|
||||
if ($query->execute()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function update_bc_eligibility($bc=null, $sel=null, $val=null) {
|
||||
if ($this->databaseConnection()) {
|
||||
$st = '';
|
||||
if ($sel=="tdsel1") {
|
||||
$st = "SET `eligible_bc1`=".$val;
|
||||
} else if ($sel=='tdsel2') {
|
||||
$st = "SET `eligible_bc2`=".$val;
|
||||
}
|
||||
|
||||
$query = $this->db_connection->prepare("
|
||||
UPDATE ".BC_TABLE."
|
||||
$st
|
||||
WHERE `bc_code`= :bc
|
||||
");
|
||||
$query->bindParam('bc', $bc);
|
||||
if ($query->execute()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -260,7 +260,7 @@ class Users {
|
||||
|
||||
public function user_bc_bal($user_id) {
|
||||
if ($this->databaseConnection()) {
|
||||
$query = $this->db_connection->prepare("SELECT * FROM `wallet` WHERE `uid`=:usr_id");
|
||||
$query = $this->db_connection->prepare("SELECT * FROM ".CREDITS_TABLE." WHERE `uid`=:usr_id");
|
||||
$query->bindParam('usr_id', $user_id);
|
||||
$query->execute();
|
||||
$bc_bal = array();
|
||||
|
||||
@ -51,7 +51,7 @@ if (isset($accessToken)) {
|
||||
}
|
||||
// getting basic info about user
|
||||
try {
|
||||
$profile_request = $fb->get('/me?fields=name,first_name,last_name,email');
|
||||
$profile_request = $fb->get('/me?fields=name,first_name,last_name,email,picture');
|
||||
$profile = $profile_request->getGraphNode()->asArray();
|
||||
} catch(Facebook\Exceptions\FacebookResponseException $e) {
|
||||
// When Graph returns an error
|
||||
@ -72,13 +72,14 @@ if (isset($accessToken)) {
|
||||
$first_name = isset($profile['first_name']) ? $profile['first_name'] : null;
|
||||
$last_name = isset($profile['last_name']) ? $profile['last_name'] : null;
|
||||
$email = isset($profile['email']) ? $profile['email'] : null;
|
||||
//$gender = isset($profile['gender']) ? $profile['gender'] : null;
|
||||
$fb_id = isset($profile['id']) ? $profile['id'] : null;
|
||||
$profile_pic = isset($profile['picture']['url']) ? $profile['picture']['url'] : IMG_DIR.'/avavtardefault50px.png';
|
||||
|
||||
$_SESSION['first_name'] = $first_name;
|
||||
$_SESSION['full_name'] = $name;
|
||||
$_SESSION['email'] = $email;
|
||||
$_SESSION['fb_id'] = $fb_id;
|
||||
$_SESSION['profile_pic'] = $profile_pic;
|
||||
|
||||
// Now you can redirect to another page and use the access token from $_SESSION['facebook_access_token']
|
||||
|
||||
|
||||
BIN
images/avavtardefault50px.png
Normal file
BIN
images/avavtardefault50px.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@ -61,4 +61,8 @@ define("APP_SECRET", 'YOUR FB APP PASSWORD');
|
||||
/*ADMIN DETAILS*/
|
||||
define("ADMIN_FB_ID", "ADMIN FB APP ID");
|
||||
define("ADMIN_ID", "ADMIN ID NUMBER IN USER TABLE");
|
||||
define("ADMIN_UNAME", "ADMIN USERNAME IN USER TABLE IN DB");
|
||||
define("ADMIN_UNAME", "ADMIN USERNAME IN USER TABLE IN DB");
|
||||
|
||||
if (isset($_SESSION['RMT_TODAYS_PRICE']) && is_float($_SESSION['RMT_TODAYS_PRICE']) && $_SESSION['RMT_TODAYS_PRICE'] > 0) {
|
||||
define("RMT_CURRENT", $_SESSION['RMT_TODAYS_PRICE']);
|
||||
}
|
||||
@ -25,6 +25,9 @@ defined("VIEWS_DIR") || define("VIEWS_DIR", "views");
|
||||
//CONFIG DIR
|
||||
defined("CONFIG_DIR") || define("CONFIG_DIR", "config");
|
||||
|
||||
//CONFIG DIR
|
||||
defined("IMG_DIR") || define("IMG_DIR", "images");
|
||||
|
||||
if(isset($_SESSION['user_name'])) {
|
||||
//USER DIR
|
||||
defined("USER_DIR") || define("USER_DIR", "user". DS .$_SESSION['user_name']. DS ."uploads". DS);
|
||||
|
||||
@ -1,3 +1,23 @@
|
||||
<?php if(isset($loginUrl)) { ?>
|
||||
<!-- Modal -->
|
||||
<div id="LoginModel" class="modal animated fadeInDown" role="dialog">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
|
||||
<!-- Modal content-->
|
||||
<div class="modal-content">
|
||||
<div class="modal-header" style="padding-left: 18%;/">
|
||||
<h4 class="modal-title text-warning"><span class="text-center">⚠ You are not logged in!</span></h4>
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
</div>
|
||||
<p class="">
|
||||
<a href="<?=$loginUrl?>"><div class="btn btn--facebook-2">Continue with Facebook</div></a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php } ?>
|
||||
<div id="MsgModel" class="modal fade bs-MsgModel-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" style="top:33%; text-align: center;">
|
||||
<div class="vertical-alignment-helper">
|
||||
<div class="modal-dialog modal-lg vertical-align-center">
|
||||
|
||||
@ -102,4 +102,27 @@ function validate_decimal_place($num=0, $decimal_allowed=2) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function rmt_price_today() {
|
||||
$rmt_price = null;
|
||||
|
||||
try {
|
||||
$url = "https://www.ranchimall.net/exchange/api/market_price";
|
||||
|
||||
$json = file_get_contents($url);
|
||||
$data = json_decode($json);
|
||||
|
||||
return $data;
|
||||
/*$rate = $data[1]["rate"];
|
||||
$usd_price = 1;
|
||||
$bit_price = round($rate/$usd_price , 8);*/
|
||||
} catch(Exception $e) {
|
||||
$rmt_price = null;
|
||||
}
|
||||
return (float) $rmt_price;
|
||||
}
|
||||
|
||||
function bc_to_usd($bc_rmt_price, $current_rmt_price_in_usd) {
|
||||
return round(($bc_rmt_price * $current_rmt_price_in_usd), 2);
|
||||
}
|
||||
@ -4,6 +4,8 @@
|
||||
//error_reporting(0);
|
||||
//@ini_set('display_errors', 0);
|
||||
|
||||
$bc_list1 = array();
|
||||
$bc_list2= array();
|
||||
$tradersList = array();
|
||||
$buy_list = array();
|
||||
$sell_list = array();
|
||||
@ -20,18 +22,15 @@ if (isset($UserClass)) {
|
||||
}
|
||||
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
|
||||
$bc_list1 = $OrderClass->get_bc_list(null, 1, null);
|
||||
$bc_list2 = $OrderClass->get_bc_list(null, null, 1);
|
||||
}
|
||||
|
||||
$fullName = isset($_SESSION['full_name']) ? $_SESSION['full_name'] : "";
|
||||
$user_logged_in = false;
|
||||
$action_class_market = 'fb_log_in';
|
||||
$action_class_buy_sell = 'fb_log_in';
|
||||
if(checkLoginStatus()) {
|
||||
$user_logged_in = true;
|
||||
$action_class_market = 'market_submit_btn';
|
||||
$action_class_buy_sell = 'process';
|
||||
}
|
||||
|
||||
@ -41,6 +40,7 @@ if(checkLoginStatus()) {
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Ranchi Mall Blockchain Contracts</title>
|
||||
<!-- Latest compiled and minified CSS -->
|
||||
<link rel="stylesheet" href="<?=STYLE_DIR?>/bootstrap.min.css">
|
||||
@ -56,17 +56,21 @@ if(checkLoginStatus()) {
|
||||
<div class="sel-div float-right">
|
||||
<select class="custom-select selbc" name="sel-bc-1" id="sel-bc-1">
|
||||
<option value=""> Select BC1</option>
|
||||
<option value="REBC">Real Estate</option>
|
||||
<option value="IBC">Incorporation</option>
|
||||
<option value="FLOBC">Flo</option>
|
||||
<?php if(is_array($bc_list1) && !empty($bc_list1)): ?>
|
||||
<?php foreach($bc_list1 as $bcl):?>
|
||||
<option value="<?=$bcl->bc_code?>"><?=$bcl->contracts?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
|
||||
<select class="custom-select selbc" name="sel-bc-2" id="sel-bc-2">
|
||||
<option value="">Select BC2</option>
|
||||
<option value="RMT">RMT</option>
|
||||
<option value="REBC">Real Estate</option>
|
||||
<option value="IBC">Incorporation</option>
|
||||
<option value="FLOBC">Flo</option>
|
||||
<option value="RMT" selected>RMT</option>
|
||||
<?php if(is_array($bc_list2) && !empty($bc_list2)): ?>
|
||||
<?php foreach($bc_list2 as $bcl):?>
|
||||
<option value="<?=$bcl->bc_code?>"><?=$bcl->contracts?></option>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@ -77,11 +81,13 @@ if(checkLoginStatus()) {
|
||||
|
||||
<div class="nav-scroller bg-white box-shadow">
|
||||
<nav class="nav nav-underline">
|
||||
<a class="nav-link active" href="#">Dashboard</a>
|
||||
<a class="nav-link" href="#">
|
||||
<?php if($user_logged_in) { ?>
|
||||
<a class="nav-link active" href="#"><?php echo "Welcome ". (isset($_SESSION['full_name']) ? $_SESSION['full_name']:"")?></a>
|
||||
<?php } ?>
|
||||
<!--<a class="nav-link" href="#">
|
||||
Investors
|
||||
<span class="badge badge-pill bg-light align-text-bottom">127</span>
|
||||
</a>
|
||||
</a>-->
|
||||
<a class="nav-link" href="https://www.ranchimall.net/exchange">Buy RMT</a>
|
||||
|
||||
<?php if($user_logged_in) { ?>
|
||||
|
||||
@ -45,3 +45,10 @@ if (class_exists('Users') && class_exists('Orders') && class_exists('SendMail'))
|
||||
//$ApiClass = new Api();
|
||||
$MailClass = new SendMail();
|
||||
}
|
||||
/*Fetch current RMT price*/
|
||||
if (!isset($_SESSION['RMT_TODAYS_PRICE'])) {
|
||||
$rmt = rmt_price_today();
|
||||
if (is_object($rmt) && isset($rmt->B_Amount) && $rmt->B_Amount>0 ) {
|
||||
$_SESSION['RMT_TODAYS_PRICE'] = (float)$rmt->B_Amount;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
<?php
|
||||
ob_start();
|
||||
date_default_timezone_set('Asia/Kolkata');
|
||||
?>
|
||||
<?php ob_start(); ?>
|
||||
|
||||
<?php require_once "includes/imp_files.php";?>
|
||||
|
||||
<?php include_once 'includes/header.php'; ?>
|
||||
|
||||
65
js/main.js
65
js/main.js
@ -4,7 +4,7 @@
|
||||
$(document).ready(function() {
|
||||
var sel1 = $('#sel-bc-1').val();
|
||||
var sel2 = $('#sel-bc-2').val();
|
||||
//load_fresh_table_data(sel1, sel2);
|
||||
load_fresh_table_data(sel1, sel2);
|
||||
run_OrderMatchingAlgorithm();
|
||||
tradeList();
|
||||
MyOrders();
|
||||
@ -13,6 +13,7 @@ $(document).ready(function() {
|
||||
user_wallet();
|
||||
current_prices();
|
||||
load_messages();
|
||||
checkLoginStatusJS();
|
||||
});
|
||||
|
||||
$(document).on('click', '#is_mkt', function() {
|
||||
@ -27,7 +28,7 @@ var my_date_format = function(input){
|
||||
return (date + " " + time);
|
||||
};
|
||||
|
||||
$(document).on('click', '#ex-sub', function() {
|
||||
$(document).on('click', '.process', function() {
|
||||
|
||||
var btn = $(this);
|
||||
var sel1 = $('#sel-bc-1').val();
|
||||
@ -43,6 +44,14 @@ $(document).on('click', '#ex-sub', function() {
|
||||
current_prices(sel2);
|
||||
});
|
||||
|
||||
function checkLoginStatusJS() {
|
||||
|
||||
$(document).on('click drop', '.fb_log_in', function (e) {
|
||||
e.preventDefault();
|
||||
$('#LoginModel').modal('toggle');
|
||||
});
|
||||
}
|
||||
|
||||
function displayNotice(msg, _type) {
|
||||
var v = '<li>'+msg+'</li>';
|
||||
|
||||
@ -73,6 +82,7 @@ function place_order(sel1, sel2, pr, qty, bs_rad, is_mkt, btn) {
|
||||
console.log(xhr.responseText);
|
||||
},
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
btn.prop( "disabled", false);
|
||||
var IS_JSON = true;
|
||||
try {
|
||||
@ -88,8 +98,8 @@ function place_order(sel1, sel2, pr, qty, bs_rad, is_mkt, btn) {
|
||||
displayNotice($msg, "failure");
|
||||
} else if(d.order != null && d.order.error == true && d.order.message != null) {
|
||||
displayNotice(d.order.message, "failure");
|
||||
} else if(d.user == '') {
|
||||
displayNotice('There was a problem in identifying the user.', "failure");
|
||||
} else if(d.msg != '' && d.msg != 'undefined') {
|
||||
displayNotice(d.msg, "failure");
|
||||
} else {
|
||||
$('#empty_msg').hide();
|
||||
var trade = "";
|
||||
@ -123,6 +133,7 @@ function run_all() {
|
||||
MyOrders();
|
||||
MyTransactions();
|
||||
load_messages();
|
||||
user_wallet();
|
||||
}
|
||||
|
||||
function check_new_orders() {
|
||||
@ -158,7 +169,6 @@ function isArray(what) {
|
||||
}
|
||||
|
||||
function load_fresh_table_data(bc1, bc2) {
|
||||
|
||||
$.ajax({
|
||||
method:'post',
|
||||
url:'ajax/refresh_table.php',
|
||||
@ -167,11 +177,8 @@ function load_fresh_table_data(bc1, bc2) {
|
||||
console.log(xhr.responseText);
|
||||
},
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
if(data !== '') {
|
||||
var d = jQuery.parseJSON(data);
|
||||
console.log(d);
|
||||
//get_my_balance();
|
||||
|
||||
var t = '';
|
||||
if(isArray(d.buys) && d.buys.length !== 0) {
|
||||
@ -179,11 +186,13 @@ function load_fresh_table_data(bc1, bc2) {
|
||||
t += '';
|
||||
t += '<tr id="'+d.buys[j].order_id+'">';
|
||||
t += '<td> '+d.buys[j].name+'</td>';
|
||||
t += '<td> '+d.buys[j].price+'</td>';
|
||||
t += '<td>'+d.buys[j].bc1+'</td>';
|
||||
t += '<td>'+d.buys[j].quantity+'</td>';
|
||||
t += '<td> '+d.buys[j].bc2+'</td>';
|
||||
t += '<td> '+d.buys[j].price+'</td>';
|
||||
t += '</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
$('#bd-buy').html(t);
|
||||
|
||||
var v = '';
|
||||
@ -192,8 +201,10 @@ function load_fresh_table_data(bc1, bc2) {
|
||||
v += '';
|
||||
v += '<tr id="'+d.sells[k].order_id+'">';
|
||||
v += '<td>'+d.sells[k].name+'</td>';
|
||||
v += '<td> '+d.sells[k].price+'</td>';
|
||||
v += '<td>'+d.sells[k].bc1+'</td>';
|
||||
v += '<td>'+d.sells[k].quantity+'</td>';
|
||||
v += '<td>'+d.sells[k].bc2+'</td>';
|
||||
v += '<td> '+d.sells[k].price+'</td>';
|
||||
v += '</tr>';
|
||||
}
|
||||
}
|
||||
@ -389,7 +400,12 @@ function MyTransactions() {
|
||||
function sel_bc_stats(bc1, bc2) {
|
||||
var bc_one = $('#bc-one');
|
||||
var bc_two = $('#bc-two');
|
||||
bc_one.text(bc1);
|
||||
if(bc_one.text()=="") {
|
||||
bc_one.html('Select BC1'+ " ⇔ ");
|
||||
}else {
|
||||
bc_one.html(bc1+ " ⇔ ");
|
||||
}
|
||||
|
||||
bc_two.text(bc2);
|
||||
$.ajax({
|
||||
method:'post',
|
||||
@ -409,8 +425,8 @@ function sel_bc_stats(bc1, bc2) {
|
||||
}
|
||||
|
||||
if(IS_JSON) {
|
||||
if((d.data.length != 0) && (bc_one.val()!='') && (bc_two.val()!='')) {
|
||||
bc_one.text(d.data.a_bc);
|
||||
if((typeof(d.data) != "undefined" && d.data !== null && d.error!=true) && (bc_one.text()!='') && (bc_two.text()!='')) {
|
||||
bc_one.html(d.data.a_bc + " ⇔ ");
|
||||
bc_two.text(d.data.b_bc);
|
||||
$('#bc-two-pr').text(d.data.b_amount);
|
||||
}
|
||||
@ -429,7 +445,6 @@ function user_wallet() {
|
||||
console.log(xhr.responseText);
|
||||
},
|
||||
success: function (data) {
|
||||
|
||||
var IS_JSON = true;
|
||||
try {
|
||||
var d = jQuery.parseJSON(data);
|
||||
@ -483,19 +498,19 @@ function current_prices(bc2) {
|
||||
|
||||
if (IS_JSON) {
|
||||
if (d.error == false) {
|
||||
if (isArray(d.bc) && d.bc.length != 0) {
|
||||
if (typeof(d.cp) != "undefined" && d.cp !== null) {
|
||||
var t = '';
|
||||
var w = '';
|
||||
for (var k = 0; k <= d.bc.length - 1; k++) {
|
||||
w = d.bc[k].b_bc;
|
||||
for (var k = 0; k <= d.cp.BC.length - 1; k++) {
|
||||
t += '<tr>';
|
||||
t += '<td>'+ d.bc[k].a_bc+'</td>';
|
||||
t += '<td>'+ d.bc[k].a_amount+'</td>';
|
||||
t += '<td><span class="text-success">22%</span></td>';
|
||||
t += '<td>'+ d.cp.BC[k]+'</td>';
|
||||
t += '<td>'+ d.cp.BC2VAL[k]+'</td>';
|
||||
t += '<td>'+ d.cp.RMTVAL[k]+'</td>';
|
||||
t += '<td>'+ d.cp.USDVAL[k]+'</td>';
|
||||
t += '</tr>';
|
||||
}
|
||||
ltpbc2.html('('+w+')');
|
||||
|
||||
bccp.html(t);
|
||||
ltpbc2.text('('+bc2+')');
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -574,3 +589,7 @@ $(document).on('click', '.del_order', function (e) {
|
||||
});
|
||||
});
|
||||
|
||||
/*Get length of Object in Jquery*/
|
||||
function getLengthOfObject(obj) {
|
||||
return Object.getOwnPropertyNames(obj).length;
|
||||
}
|
||||
394
rm_root.php
394
rm_root.php
@ -19,134 +19,211 @@
|
||||
}
|
||||
|
||||
$traders = $OrderClass->UserBalanceList('', 1);
|
||||
$BClist = $OrderClass->get_bc_list();
|
||||
|
||||
?>
|
||||
|
||||
<div class="container mt--2">
|
||||
<h2>Actions table</h2>
|
||||
<div class="mt--2 mb--2 p--1">
|
||||
<div class="container" style="margin-top:30px; margin-bottom:30px;">
|
||||
<div class="row">
|
||||
<!--Transfer tokens-->
|
||||
<div class="col-xs-12 col-md-12 col-lg-12 mb-50">
|
||||
<h2>Transfer tokens</h2>
|
||||
<div class="mt--2 mb--2 p--1">
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="cus_id">User Id</label>
|
||||
<input type="number" class="form-control" name="cus_id" id="cus_id" placeholder="User Id">
|
||||
<label class="sr-only" for="cust_id-fr">From (User Id)</label>
|
||||
<input type="number" class="form-control" name="cust_id-fr" id="cust_id-fr" placeholder="From (User Id)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="bal">Input Balance</label>
|
||||
<input type="text" class="form-control" name="bal" id="bc-bal-updt" placeholder="Input Balance">
|
||||
<label class="sr-only" for="cust_id_to">To (User Id)</label>
|
||||
<input type="number" class="form-control" name="cust_id_to" id="cust_id_to" placeholder="To (User Id)">
|
||||
</div>
|
||||
<input type="submit" class="btn-sm mt--1" id="bc_tr_btn" value="Update balance">
|
||||
</div>
|
||||
|
||||
<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>Id</th>
|
||||
<th>User</th>
|
||||
<th>RMT</th>
|
||||
<th>Cash</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$action_class = null;
|
||||
$btn_name = null;
|
||||
$i=1;
|
||||
if (is_array($traders) && !empty($traders)) {
|
||||
foreach ($traders as $index=>$trader) {
|
||||
if ($trader->is_active) {
|
||||
$action_class = 'off';
|
||||
$btn_name = "Deactivate Account";
|
||||
} else {
|
||||
$action_class = 'on';
|
||||
$btn_name = "Activate Account";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?=$trader->UID?></td>
|
||||
<td><a href="http://facebook.com/<?=$trader->FACEBOOK_ID?>" target="_blank"><?=$trader->name?></a></td>
|
||||
<td><?=$trader->bc?></td>
|
||||
<td><?=$trader->balance?></td>
|
||||
<?php if($i!=$trader->UID) {continue;} ?>
|
||||
<td><input type="button" class="btn-ra" id="<?=$action_class.'_'.$trader->UID?>" value="<?=$btn_name?>"></td>
|
||||
</tr>
|
||||
<?php $i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--Transfer tokens-->
|
||||
<div class="container mt--2">
|
||||
<h2>Transfer tokens</h2>
|
||||
<div class="mt--2 mb--2 p--1">
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="cust_id-fr">From (User Id)</label>
|
||||
<input type="number" class="form-control" name="cust_id-fr" id="cust_id-fr" placeholder="From (User Id)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="cust_id_to">To (User Id)</label>
|
||||
<input type="number" class="form-control" name="cust_id_to" id="cust_id_to" placeholder="To (User Id)">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="toke_amt">Amount of BC units to transfer </label>
|
||||
<input type="text" class="form-control" name="toke_amt" id="toke_amt" placeholder="Amount of BC units to transfer">
|
||||
</div>
|
||||
<input type="submit" class="btn-sm mt--1" id="btn-tr" value="Transfer tokens">
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="toke_amt">Amount of BC units to transfer </label>
|
||||
<input type="text" class="form-control" name="toke_amt" id="toke_amt" placeholder="Amount of BC units to transfer">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--History-->
|
||||
|
||||
<div class="container mt--2">
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive">
|
||||
<?php $list_bal_changes = $OrderClass->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">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<th>Investor's Id</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Previous Balance</th>
|
||||
<th>Updated Balance</th>
|
||||
<th>Type</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($list_bal_changes as $ch): ?>
|
||||
<tr>
|
||||
<td><?=$ch->BalStatusHistoryId?></td>
|
||||
<td><?=$ch->user_id?></td>
|
||||
<td><?=$ch->name?></td>
|
||||
<td><?=$ch->email?></td>
|
||||
<td><?=$ch->bal_prev?></td>
|
||||
<td><?=$ch->bal_now?></td>
|
||||
<td><?=$ch->type?></td>
|
||||
<td><?=$ch->UpdateDate?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="submit" class="btn-sm mt--1" id="btn-tr" value="Transfer tokens">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!--Insert New Blockchain Contract-->
|
||||
<div class="col-xs-12 col-md-12 col-lg-12 mb-50">
|
||||
<div>
|
||||
<h2>Blockchain Contracts Actions</h2>
|
||||
<div class="form-group">
|
||||
<label for="ctrn">Contract Name:</label>
|
||||
<input type="text" class="form-control" id="ctrn">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bcc">BC Code (Not more than 8 characters):</label>
|
||||
<input type="text" class="form-control" id="bcc">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bcadm">Admin:</label>
|
||||
<input type="text" class="form-control" id="bcadm">
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" id="eli_sel1"> Is Eligible for Select 1
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group form-check">
|
||||
<label class="form-check-label">
|
||||
<input class="form-check-input" type="checkbox" id="eli_sel2"> Is Eligible for Select 2
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="bcicpdt">Date of Incorporation:</label>
|
||||
<input type="date" class="form-control" id="bcicpdt">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary" id="btn_bcinst">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!--Update BC-->
|
||||
<div class="col-xs-12 col-md-12 col-lg-12 mb-50">
|
||||
<div>
|
||||
<h2>Blockchain Contracts List</h2>
|
||||
<div class="table-responsive">
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Contracts</th>
|
||||
<th>BC Code</th>
|
||||
<th>BC Admin</th>
|
||||
<th>Select BC 1</th>
|
||||
<th>Select BC 2</th>
|
||||
<th>Incorporated on</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if(is_array($BClist) && !empty($BClist)):
|
||||
foreach ($BClist as $bcl):
|
||||
?>
|
||||
<tr>
|
||||
<td><?=$bcl->contracts?></td>
|
||||
<td><?=$bcl->bc_code?></td>
|
||||
<td><?=$bcl->admin?></td>
|
||||
<td>
|
||||
<button id="tdsel1_<?=$bcl->bc_code?>_<?=$bcl->eligible_bc1?>" class="btn btn-light btn_updt_bc"><?php echo $tt = ($bcl->eligible_bc1==1)?'On':'Off'?></button>
|
||||
</td>
|
||||
<td>
|
||||
<button id="tdsel2_<?=$bcl->bc_code?>_<?=$bcl->eligible_bc2?>" class="btn btn-light btn_updt_bc"><?php echo $tt = ($bcl->eligible_bc2==1)?'On':'Off'?></button>
|
||||
</td>
|
||||
<td><?=$bcl->incp?></td>
|
||||
</tr>
|
||||
<?php endforeach; endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!--User Actions-->
|
||||
<div class="col-xs-12 col-md-12 col-lg-12 mb-50">
|
||||
<h2>Actions table</h2>
|
||||
<div class="mt--2 mb--2 p--1">
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="cus_id">User Id</label>
|
||||
<input type="number" class="form-control" name="cus_id" id="cus_id" placeholder="User Id">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="sr-only" for="bal">Input Balance</label>
|
||||
<input type="text" class="form-control" name="bal" id="bc-bal-updt" placeholder="Input Balance">
|
||||
</div>
|
||||
<input type="submit" class="btn-sm mt--1" id="bc_tr_btn" value="Update balance">
|
||||
</div>
|
||||
|
||||
<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>Id</th>
|
||||
<th>User</th>
|
||||
<th>RMT</th>
|
||||
<th>Cash</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$action_class = null;
|
||||
$btn_name = null;
|
||||
$i=1;
|
||||
if (is_array($traders) && !empty($traders)) {
|
||||
foreach ($traders as $index=>$trader) {
|
||||
if ($trader->is_active) {
|
||||
$action_class = 'off';
|
||||
$btn_name = "Deactivate Account";
|
||||
} else {
|
||||
$action_class = 'on';
|
||||
$btn_name = "Activate Account";
|
||||
}
|
||||
?>
|
||||
<tr>
|
||||
<td><?=$trader->UID?></td>
|
||||
<td><a href="http://facebook.com/<?=$trader->FACEBOOK_ID?>" target="_blank"><?=$trader->name?></a></td>
|
||||
<td><?=$trader->bc?></td>
|
||||
<td><?=$trader->balance?></td>
|
||||
<?php if($i!=$trader->UID) {continue;} ?>
|
||||
<td><input type="button" class="btn-ra" id="<?=$action_class.'_'.$trader->UID?>" value="<?=$btn_name?>"></td>
|
||||
</tr>
|
||||
<?php $i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<!--Update History-->
|
||||
<div class="col-xs-12 col-md-12 col-lg-12 mb-50">
|
||||
<div class="table-responsive">
|
||||
<div class="table-responsive">
|
||||
<?php $list_bal_changes = $OrderClass->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">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>S.No</th>
|
||||
<th>Investor's Id</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
<th>Previous Balance</th>
|
||||
<th>Updated Balance</th>
|
||||
<th>Type</th>
|
||||
<th>Date</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($list_bal_changes as $ch): ?>
|
||||
<tr>
|
||||
<td><?=$ch->BalStatusHistoryId?></td>
|
||||
<td><?=$ch->user_id?></td>
|
||||
<td><?=$ch->name?></td>
|
||||
<td><?=$ch->email?></td>
|
||||
<td><?=$ch->bal_prev?></td>
|
||||
<td><?=$ch->bal_now?></td>
|
||||
<td><?=$ch->type?></td>
|
||||
<td><?=$ch->UpdateDate?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<!--footer-->
|
||||
<?php include_once 'includes/footer.php'; ?>
|
||||
@ -375,8 +452,89 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/*Insert New BC*/
|
||||
$(document).on('click', '#btn_bcinst', function() {
|
||||
var btn = this;
|
||||
var ct_name = $('#ctrn').val();
|
||||
var bccode = $('#bcc').val();
|
||||
var bcadmin = $('#bcadm').val();
|
||||
var ch1 = $('#eli_sel1').is(":checked");
|
||||
var ch2 = $('#eli_sel2').is(":checked");
|
||||
var incpdt = $('#bcicpdt').val();
|
||||
var job = 'inset_bc';
|
||||
|
||||
$(btn).val('Please wait...').prop( "disabled", true );
|
||||
|
||||
$.ajax({
|
||||
method: 'post',
|
||||
url: 'ajax/rm_root.php',
|
||||
data: {job:job, ct_name:ct_name, bccode:bccode, bcadmin:bcadmin, ch1:ch1, ch2:ch2, incpdt:incpdt},
|
||||
error: function(xhr, status, error) {
|
||||
console.log(xhr, status, error);
|
||||
},
|
||||
success: function(data) {
|
||||
console.log(data);
|
||||
$(btn).val('Submit').prop( "disabled", false );
|
||||
if ($.trim(data) != '' && $.trim(data) != undefined && $.trim(data) != null) {
|
||||
var IS_JSON = true;
|
||||
try {
|
||||
var d = jQuery.parseJSON(data);
|
||||
}
|
||||
catch(err) {
|
||||
IS_JSON = false;
|
||||
}
|
||||
|
||||
if(IS_JSON) {
|
||||
console.log(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
/*Update BC*/
|
||||
$(document).on('click', '.btn_updt_bc', function() {
|
||||
|
||||
var btn = this;
|
||||
var _id = $(btn).attr('id');
|
||||
var updt_job = 'update_sel_bc';
|
||||
$(btn).prop( "disabled", true);
|
||||
$.ajax({
|
||||
method: 'post',
|
||||
url: 'ajax/rm_root.php',
|
||||
data: {updt_job:updt_job, _id:_id},
|
||||
error: function(xhr, status, error) {
|
||||
console.log(xhr, status, error);
|
||||
},
|
||||
success: function(data) {
|
||||
var IS_JSON = true;
|
||||
try {
|
||||
var d = jQuery.parseJSON(data);
|
||||
}
|
||||
catch(err) {
|
||||
IS_JSON = false;
|
||||
}
|
||||
|
||||
if(IS_JSON) {
|
||||
if (d.res==true) {
|
||||
var vv = (d.val==1)?'On':'Off';
|
||||
$(btn).attr('id', d.new_id).text(vv).prop( "disabled", false );
|
||||
}
|
||||
} else {
|
||||
$.notify({
|
||||
title: "<strong>Update failed!:</strong> ",
|
||||
message: "Failed to update the state."
|
||||
},{
|
||||
type: 'danger'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow-x: hidden; /* Prevent scroll on narrow devices */
|
||||
color: #ffffff;
|
||||
background-color: #343a40;
|
||||
@ -9,12 +11,10 @@ a {
|
||||
color: #f7f7f7;
|
||||
}
|
||||
input[type=text] {
|
||||
//background: #FAFAFA;
|
||||
border: 1px solid #F4F4F4;
|
||||
border-radius: 3px;
|
||||
display: block;
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
@ -25,7 +25,7 @@ input[type=text] {
|
||||
}
|
||||
.sel-div {
|
||||
display: flex;
|
||||
width: auto;
|
||||
width: 100%;
|
||||
}
|
||||
.selbc {
|
||||
margin-right: 5px;
|
||||
@ -33,6 +33,9 @@ input[type=text] {
|
||||
.mg-2 {
|
||||
margin: 2px 2px;
|
||||
}
|
||||
.mb-50 {
|
||||
margin-bottom: 50px;
|
||||
}
|
||||
h5 > span {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
@ -111,13 +114,13 @@ h5 > span {
|
||||
/*Extra small devices (portrait phones, less than 576px)*/
|
||||
@media (max-width: 576px) {
|
||||
body {
|
||||
//display: block;
|
||||
//display: block;
|
||||
padding-top: 56px;
|
||||
//font-size: 24px;
|
||||
//font-size: 24px;
|
||||
width: 100%;
|
||||
}
|
||||
.lays {
|
||||
background-color: #c8cbcf;
|
||||
background-color: rgba(0, 0, 0, 0.24);
|
||||
margin: 0 0 5px 0;
|
||||
line-height: 19px;
|
||||
padding: 5px;
|
||||
@ -129,10 +132,10 @@ h5 > span {
|
||||
@media (min-width: 576px) {
|
||||
body {
|
||||
padding-top: 56px;
|
||||
//font-size: 18px; !important;
|
||||
//font-size: 18px; !important;
|
||||
}
|
||||
.lays {
|
||||
background-color: #c8cbcf;
|
||||
background-color: rgba(0, 0, 0, 0.24);
|
||||
margin: 0 0 5px 0;
|
||||
line-height: 19px;
|
||||
padding: 5px;
|
||||
@ -144,7 +147,7 @@ h5 > span {
|
||||
@media (min-width: 768px) {
|
||||
body {
|
||||
padding-top: 56px;
|
||||
//font-size: 16px;
|
||||
//font-size: 16px;
|
||||
}
|
||||
.lays {
|
||||
/*#c8cbcf, rgba(255, 193, 7, 0.32), #ffc293*/
|
||||
@ -175,7 +178,7 @@ h5 > span {
|
||||
background-color: #162029;
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
//font-size: large;
|
||||
//font-size: large;
|
||||
}
|
||||
|
||||
.btn-link {
|
||||
@ -189,4 +192,43 @@ h5 > span {
|
||||
color: #fff;
|
||||
background-color: #162029; !important;
|
||||
border-color: #282c31; !important;
|
||||
}
|
||||
}
|
||||
.btn.btn--facebook {
|
||||
background: #FFFFFF;
|
||||
box-shadow: 5px 5px 0 0 #3b5998;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #3b5998;
|
||||
letter-spacing: -0.3px;
|
||||
border-radius: 0px;
|
||||
width: 360px;
|
||||
display: inline-block;
|
||||
padding-top: 9px;
|
||||
}
|
||||
.btn.btn--facebook-2 {
|
||||
display: block;
|
||||
background: #3b5998;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
letter-spacing: -0.3px;
|
||||
border-radius: 0px;
|
||||
width: 320px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.btn.btn--facebook-2 a {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.modal-content {
|
||||
border-radius: 2px !important;
|
||||
}
|
||||
.modal-header {
|
||||
padding: 15px;
|
||||
border-bottom: 0px solid #e5e5e5;
|
||||
}
|
||||
.modal-footer {
|
||||
padding: 15px;
|
||||
text-align: right;
|
||||
border-top: 0px solid #e5e5e5;
|
||||
}
|
||||
|
||||
@ -5,8 +5,10 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Buyer</th>
|
||||
<th>Price</th>
|
||||
<th>BC1</th>
|
||||
<th>Quantity</th>
|
||||
<th>BC2</th>
|
||||
<th>Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="bd-buy"></tbody>
|
||||
@ -21,8 +23,10 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Buyer</th>
|
||||
<th>Price</th>
|
||||
<th>BC1</th>
|
||||
<th>Quantity</th>
|
||||
<th>BC2</th>
|
||||
<th>Price</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="bd-sell"></tbody>
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-lg-3">
|
||||
<div class="row lays">
|
||||
<div class="col-6"><h5 class="text-justify"><span id="bc-one"></span>/<span id="bc-two"></span></h5></div>
|
||||
<div class="col-3">
|
||||
<div class="col-8"><h5 class="text-justify"><span id="bc-one"></span> <span id="bc-two"></span></h5></div>
|
||||
<div class="col-4">
|
||||
<h5 class="text-justify" id="bc-two-pr"></h5>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<h5 class="text-justify text-success">22.3%</h5>
|
||||
</div>
|
||||
<!--<div class="col-3">
|
||||
<!--<h5 class="text-justify text-success">22.3%</h5>
|
||||
</div>-->
|
||||
</div>
|
||||
<div class="row lays">
|
||||
<div class="col">
|
||||
@ -43,7 +43,7 @@
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary" id="ex-sub" name="ex-sub">Submit</button>
|
||||
<button type="submit" class="btn btn-primary <?=$action_class_buy_sell?>" id="ex-sub" name="ex-sub">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -106,7 +106,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="card lays">
|
||||
<div class="card-header" id="headingTwo">
|
||||
<h5 class="mb-0">
|
||||
@ -122,15 +122,16 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-12 col-md-8 ">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="lays">
|
||||
<?php include_once 'traders_list.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-4">
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="lays">
|
||||
<?php include_once "ltp.php";?>
|
||||
</div>
|
||||
|
||||
@ -6,7 +6,8 @@
|
||||
<tr>
|
||||
<th>BC</th>
|
||||
<th>Price <span id="ltpbc2"></span></th>
|
||||
<th>24h % shift</th>
|
||||
<th>Price (RMT)</th>
|
||||
<th>Price (USD)</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="bccp"></tbody>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user