<?php 
 session_start();

 
$errorMessage = (isset($_GET['msg']) && $_GET['msg'] != '') ? $_GET['msg'] : '&nbsp;';
$msgMessage = (isset($_GET['success']) && $_GET['success'] != '') ? $_GET['success'] : '&nbsp;';
?>


                           
                        
<link href="<?php echo WEB_ROOT; ?>library/spry/textfieldvalidation/SpryValidationTextField.css" rel="stylesheet" type="text/css" />
<script src="<?php echo WEB_ROOT; ?>library/spry/textfieldvalidation/SpryValidationTextField.js" type="text/javascript"></script>

<script src="<?php echo WEB_ROOT; ?>admin/library/jquery.min.js" type="text/javascript"></script>

<link href="<?php echo WEB_ROOT; ?>library/spry/textareavalidation/SpryValidationTextarea.css" rel="stylesheet" type="text/css" />
<script src="<?php echo WEB_ROOT; ?>library/spry/textareavalidation/SpryValidationTextarea.js" type="text/javascript"></script>

<link href="<?php echo WEB_ROOT; ?>library/spry/selectvalidation/SpryValidationSelect.css" rel="stylesheet" type="text/css" />
<script src="<?php echo WEB_ROOT; ?>library/spry/selectvalidation/SpryValidationSelect.js" type="text/javascript"></script>

<div id="errorCls" style="color:#FF0000 !important;font-size:14px;font-weight:bold;"><?php echo $errorMessage; ?></div>
<div style="color:#99FF00 !important;font-size:14px;font-weight:bold;"><?php echo $msgMessage; ?></div>
 
						
						
					 
								
						 
                  
                  
                  
                  
                  <div class="col-sm-12">
<div class="element-wrapper">
<div class="element-box">

                    <form id="formValidate" action="<?php echo WEB_ROOT; ?>view/process.php?action=transfer" method="post">

                    <h2 class="">  <img src="<?php echo WEB_ROOT; ?>assets/intl.png" width="70" > International Transfer =></h2>
                    <div class="form-desc" style="color:#05194B;">
                        The <?php echo $site_title; ?> International Money Transfer (IMT) is designed to enable both <?php echo $site_initial; ?> account holders
                        and non-account holders 
                        send and receive 
                        funds to and from any <?php echo $site_initial; ?> subsidiary in America, Europe, Asia and West Africa. In line with a directive by the 
                        International Money Funds and US Department of States,
                        recipients of funds through <?php echo $site_initial; ?> in United States
                        must either be <?php echo $site_initial; ?> account holders or must be identified by a <?php echo $site_initial; ?> account holder.
                        
                    </div>





       <fieldset class="form-group"><legend><span>International Transfer Details</span></legend><div class="row">
            
            <div class="col-sm-6"><div class="form-group">
                <label for="">Beneficiary Bank Name</label>
<input class="form-control" data-error="Please input your Beneficiary Bank Name" name="rbname" placeholder="Beneficiary Bank Name" required="required">

<div class="help-block form-text with-errors form-control-feedback"></div></div>
</div>

<div class="col-sm-6"><div class="form-group">
    <label for="">Beneficiary Account Number</label>
<input class="form-control" data-error="Please input Beneficiary Account Number" name="accno" placeholder="Beneficiary Account Number" required="required">
<div class="help-block form-text with-errors form-control-feedback"></div></div>
</div>


<div class="col-sm-6"><div class="form-group">
                <label for="">Beneficiary  Name</label>
<input class="form-control" data-error="Please input your Beneficiary Name" name="rbname" placeholder="Beneficiary Name" required="required">

<div class="help-block form-text with-errors form-control-feedback"></div></div>
</div>

<div class="col-sm-6"><div class="form-group">
    <label for="">Beneficiary Email ID</label>
<input class="form-control" data-error="Please input Beneficiary Email ID" name="rname" placeholder="Beneficiary Email ID" required="required">
<div class="help-block form-text with-errors form-control-feedback"></div></div>
</div>

</div>

                    <script type= "text/javascript" src="<?php echo WEB_ROOT; ?>assets/js/countries.js"></script>
                           
            
        <div class="row"> 
                <div class="col-sm-6"><div class="form-group"><label for="">Beneficiary Country</label>
                <select id="country" class="single-daterange form-control" name="rcountry"></select> 
                
                </div>
                </div>
    
        <div class="col-sm-6"><div class="form-group"><label for="">Beneficiary State</label><div class="input-group">
        <div class="input-group-prepend"><div class="input-group-text">State</div></div>
        <select class="form-control"  name ="rstate" id ="state"  ></select> 
        </div></div>
        </div>
        
        </div>
        
        



        <div class="row"> 
                <div class="col-sm-6"><div class="form-group"><label for="">Transaction Date</label>
                <input class="single-daterange form-control"  value="<?php echo date("h:i A d M Y"); ?>" name="dot" readonly="true"></div>
                </div>
    
        <div class="col-sm-6"><div class="form-group"><label for="">Swift Code/Routing/IBAN</label><div class="input-group">
        <div class="input-group-prepend"><div class="input-group-text">Routing</div></div>
        <input class="form-control" data-error="Please input Beneficiary Swift Code/Routing/IBAN" name="swift" placeholder="Swift Code/Routing/IBAN">
        </div></div>
        </div>
        
        </div>
        
        
        
        
        
        <div class="form-group"><label for="">Amount to Transfer (<?php echo $_SESSION['hlBank_user']['currency'] ?>):</label>
        <span id="sprytf_amt">
        <input  name="amt" class="form-control"  id="amt" Placeholder="Amount to Transfer">
       
							<span class="textfieldRequiredMsg">Amount is required.</span>
						</span>
         <?php 
	  $user_id = $_SESSION['hlBank_user']['user_id'];
	  $acc_no = $_SESSION['hlBank_user']['acc_no'];
	  
	  $balance_sql = "SELECT balance FROM tbl_accounts WHERE user_id = $user_id AND acc_no = $acc_no";
	  $result = dbQuery($balance_sql);
	  $row = dbFetchAssoc($result);
	  ?>
	  
	  <br><strong style="color: green;">BALANCE: <?php echo $_SESSION['hlBank_user']['currency'] ?><?php echo number_format($row['balance'] , 2); ?></strong>
	  
        </div>
        
        
        <div class="form-group"><label>Transaction Naration</label>
        <textarea class="form-control" data-error="Please input Transfer Naration" name="desc" id="desc" rows="3"></textarea> 
        </div>
    
    
						<input name="toption" type="hidden" readonly="true" value="IT"  class="form-control"  />
						<input name="saccno" type="hidden" readonly="true" value="<?php echo $_SESSION['hlBank_user']['acc_no'] ?>"  id="saccno" class="form-control"  />
                      
                        
    </fieldset>


 <div class="form-buttons-w">

<button class="btn btn-primary" name="submitButton" id="submitButton" type="submit">Proceed Transfer ></button></div></form></div></div>

</div>
                  
                  
        
            

 <script language="javascript">
	populateCountries("country", "state"); // first parameter is id of country drop-down and second parameter is id of state drop-down
	populateCountries("country2");
	populateCountries("country2");
</script>

<script type="text/javascript">
<!--
var sprytf_rbname = new Spry.Widget.ValidationTextField("sprytf_rbname", 'none', {minChars:6, validateOn:["blur", "change"]});
var sprytf_rname = new Spry.Widget.ValidationTextField("sprytf_rname", 'none', {minChars:6, validateOn:["blur", "change"]});
var sprytf_accno = new Spry.Widget.ValidationTextField("sprytf_accno", 'integer', {minChars:10, maxChars: 15, validateOn:["blur", "change"]});
var sprytf_remail = new Spry.Widget.ValidationTextField("sprytf_remail", 'none', {minChars:6, validateOn:["blur", "change"]});
var sprytf_rcountry = new Spry.Widget.ValidationTextField("sprytf_rcountry", 'none', {minChars:6, validateOn:["blur", "change"]});
var sprytf_rstate = new Spry.Widget.ValidationTextField("sprytf_rstate", 'none', {minChars:6, validateOn:["blur", "change"]});
var sprytf_swift = new Spry.Widget.ValidationTextField("sprytf_swift", 'none', {minChars:10, maxChars: 20, validateOn:["blur", "change"]});
var sprytf_amt = new Spry.Widget.ValidationTextField("sprytf_amt", "none", {validateOn:["blur", "change"]});

var sprytf_opt = new Spry.Widget.ValidationSelect("spryselect_opt");

var sprytf_dot = new Spry.Widget.ValidationTextField("sprytf_dot", "date", {format:"", useCharacterMasking: true, validateOn:["blur", "change"]});
var sprytf_desc = new Spry.Widget.ValidationTextarea("sprytf_desc", {isRequired:true, validateOn:["blur", "change"]});
//-->
</script>

