| Server IP : 127.0.0.1 / Your IP : 216.73.216.48 Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64 User : win 10 ( 0) PHP Version : 8.2.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/active_xampp_upgrade/cranepayk/ |
Upload File : |
<html>
<?php
include('db.php');
session_start();
if(isset($_SESSION['id']))
{
$my_id = $_SESSION['id'];
}
////////////////////////////////////////////////////////////////////////////////////
?>
<head>
<title>CrinePay</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="main_css/exchange.css" />
<meta name="google-adsense-account" content="ca-pub-4728417548940171"><!--gog ads -->
</head>
<body >
<input id="my_id" style="display:none;" value="<?php echo"$my_id";?>" />
<?php if(!isset($_SESSION['id'])){ echo"<script>window.open('login', '_self')</script>"; ?>
<?php }else{?>
<div class="main_content_div" >
<div class="home_div" >
<img onclick="history.back()" src="main_icon/bk.png" class="back_btn_img" />
<span class="send_m_title">Exchange rate</span>
<!--img src="main_icon/sm2.png" class="back_btn_img" /-->
</div>
<div class="exchange_div" >
<div class="exc_single_div" >
<img src="main_icon/bhd_f.png" class="flag_img" />
<span class="flag_lebal">BHD</span>
<input type="number" id="base_currency" onkeyup="calculate_rate();" class="exchange_input" value="1" />
</div>
<div class="exc_lebal2" >To</div>
<div class="exc_single_div" >
<img src="main_icon/ug_f.png" class="flag_img" />
<span class="flag_lebal">UGX</span>
<!--input class="exchange_input" /-->
<div id="second_currency" class="exchange_input" ></div>
</div>
<button id="exc_next_btn" onclick="show_more_info();" class="exc_next_btn">Next</button>
</div>
<div id="exchange_div2" class="exchange_div2" >
<div class="exc2_lebal" >Send to BenefitPay no.</div>
<div id="benefit_from_acc" class="exc_benefit_no" >34371631</div>
<div class="exc2_lebal" >Amount in Bahrain dinar</div>
<div id="base_curr_amt" class="exc_benefit_no" >1</div>
<div class="exc2_lebal" >Take Ref# from benefitPay message</div>
<input id="benfit_ref_no" onkeyup="check_ref_no();" class="exc_benefit_no" value="" placeholder="Enter Ref#..." />
<button id="finish_exc_btn" onclick="exchange_crrency();" class="exc_finish_btn">Finish</button>
</div>
<div id="error_ouput" ></div>
<?php
$get_exc_rate ="select * from exchange_ratetb ";
$run_get_exc_rate = mysqli_query($con,$get_exc_rate);
while($row_get_exc_rate = mysqli_fetch_array($run_get_exc_rate))
{
$second_currency_rate = $row_get_exc_rate['second_currency'];
?>
<input id="second_currency_rate" style="display:none;" value="<?php echo"$second_currency_rate";?>" />
<?php
}
?>
<script>
calculate_rate();
function calculate_rate()
{
base_currency = document.getElementById('base_currency').value;
cur_exc_rate = document.getElementById('second_currency_rate').value;
//cur_exc_rate = 9652.11;
vol_amount = cur_exc_rate * base_currency;
let final_amt = Math.trunc( vol_amount );
document.getElementById('second_currency').innerHTML=final_amt;
document.getElementById('base_curr_amt').innerHTML=base_currency;
//alert(base_currency);
}
function show_more_info()
{
base_currency = document.getElementById('base_currency').value;
if(base_currency >0 ){
document.getElementById('exc_next_btn').style.display="none";
document.getElementById('exchange_div2').style.display="block";
}
}
function check_ref_no()
{
base_currency = document.getElementById('base_currency').value;
benfit_ref_no = document.getElementById('benfit_ref_no').value;
if(base_currency >0 && benfit_ref_no !=="" ){
document.getElementById('finish_exc_btn').style.display="block";
document.getElementById("base_currency").disabled = true;
}else{document.getElementById('finish_exc_btn').style.display="none"; }
}
function exchange_crrency()
{
my_id = document.getElementById('my_id').value;
cur_exc_rate = document.getElementById('second_currency_rate').value;
benfit_ref_no = document.getElementById('benfit_ref_no').value;
base_curr_amt_output = document.getElementById('base_curr_amt').innerHTML;
sec_curr_amt = document.getElementById('second_currency').innerHTML;
// from_acc = getElementById('benefit_from_acc').innerHTML;
from_acc = document.getElementById('benefit_from_acc').innerHTML;
xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET","autopage.php?my_id="+my_id+"&&benfit_ref_no="+benfit_ref_no+"&&base_curr_amt_output="+base_curr_amt_output+"&&sec_curr_amt="+sec_curr_amt+"&&from_acc="+from_acc+"&&cur_exc_rate="+cur_exc_rate+"&&status=save_exchange",false);
xmlhttp.send(null);
document.getElementById('error_ouput').innerHTML =xmlhttp.responseText;
window.open('transaction','_self');
}
</script>
<?php } ?>
</body>
</html>