<?php session_start();
include_once ('conn/session.php');
require_once ('conn/controller.php');
 if (!isset($_SESSION['uname'])) {
    header("Location: user_login.php");
    exit();
}
  
  
$reg_user = new USER(); 

$stmt = $reg_user->runQuery("SELECT * FROM account WHERE uname=:uname");
$stmt->execute(array(":uname"=>$_SESSION['uname']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);  
  
  
  
if(isset($_GET['id'])){
	
$id=$_GET['id'];
$stmt = $reg_user->runQuery("SELECT * FROM beneficiary WHERE id='$id'");
$stmt->execute();
$rowb = $stmt->fetch(PDO::FETCH_ASSOC);
}
 
?>

<?php 

if (isset($_POST['rname'])) { 
    $_SESSION['rname'] = $_POST['rname'];
}
if (isset($_POST['rbank'])) { 
    $_SESSION['rbank'] = $_POST['rbank'];
}
if (isset($_POST['racc'])) { 
    $_SESSION['racc'] = $_POST['racc'];
}
if (isset($_POST['remail'])) { 
    $_SESSION['remail'] = $_POST['remail'];
}
if (isset($_POST['rswift'])) { 
    $_SESSION['rswift'] = $_POST['rswift'];
}
if (isset($_POST['baddress'])) { 
    $_SESSION['baddress'] = $_POST['baddress'];
}
if (isset($_POST['iban'])) { 
    $_SESSION['iban'] = $_POST['iban'];
}
if (isset($_POST['rcurrency'])) { 
    $_SESSION['rcurrency'] = $_POST['rcurrency'];
}
if (isset($_POST['rtype'])) { 
    $_SESSION['rtype'] = $_POST['rtype'];
}
if (isset($_POST['rcountry'])) { 
    $_SESSION['rcountry'] = $_POST['rcountry'];
}
?>
 <?php include 'auth_header.php'; ?>
 <!-- partial -->
      <div class="main-panel">        
        <div class="content-wrapper">
          <div class="row">
           
 
            
            <div class="col-12 grid-margin stretch-card">
              <div class="card">
                <div class="card-body"> 
                  <h4 class="card-title"> <img src="icon/local.png"  height="40px"/> Account to Account Transfer</h4>
                  <p class="card-description">
                   Transfer money from your account to another account in the same bank
                  </p>
                  <form class="form-inline" method="POST" action="beneficiarysame.php">
                      
                       <input type="hidden" name="rname" value="<?php echo $rowb['rname']; ?>" />
   <input type="hidden" name="iban" value="<?php echo $rowb['iban']; ?>" />
   <input type="hidden" name="remail" value="<?php echo $rowb['remail']; ?>" />
   <input type="hidden" name="racc" value="<?php echo $rowb['racc']; ?>" />
   <input type="hidden" name="baddress" value="<?php echo $rowb['baddress']; ?>" />
   <input type="hidden" name="rbank" value="<?php echo $rowb['rbank']; ?>" />
   <input type="hidden" name="rcurrency" value="<?php echo $rowb['rcurrency']; ?>" />
   <input type="hidden" name="rswift" value="<?php echo $rowb['rswift']; ?>" />
   <input type="hidden" name="rtype" value="<?php echo $rowb['rtype']; ?>" />
   <input type="hidden" name="rcountry" value="<?php echo $rowb['rcountry']; ?>" />
   
 
                    <label class="sr-only" for="inlineFormInputName2">Acc Name</label>
                    <input type="text" value="<?php echo $rowb['rname']; ?>" class="form-control mb-2 mr-sm-2" id="inlineFormInputName2" readonly >
                  
                    <label class="sr-only" for="inlineFormInputGroupUsername2">Account Number</label>
                    <div class="input-group mb-2 mr-sm-2">
                      <div class="input-group-prepend">
                        <div class="input-group-text">A/C</div>
                      </div>
                      <input type="text" value="<?php echo $rowb['racc']; ?>" class="form-control" id="inlineFormInputGroupUsername2" readonly>
                    </div>
                  
                    <button type="submit" class="btn btn-danger mb-2">SEND MONEY</button>
                  </form>
                </div>
              </div>
            </div>
            
            
            
            
            
             <div class="col-12 grid-margin stretch-card">
              <div class="card">
                <div class="card-body"> 
                  <h4 class="card-title"><img src="icon/ibft.png"  height="40px"/> InterBank Transfer</h4>
                  <p class="card-description">
                   Transfer money from your account to another bank in the same country
                  </p>
                  <form class="form-inline" method="POST" action="beneficiaryinter.php">
                      
                       <input type="hidden" name="rname" value="<?php echo $rowb['rname']; ?>" />
   <input type="hidden" name="iban" value="<?php echo $rowb['iban']; ?>" />
   <input type="hidden" name="remail" value="<?php echo $rowb['remail']; ?>" />
   <input type="hidden" name="racc" value="<?php echo $rowb['racc']; ?>" />
   <input type="hidden" name="baddress" value="<?php echo $rowb['baddress']; ?>" />
   <input type="hidden" name="rbank" value="<?php echo $rowb['rbank']; ?>" />
   <input type="hidden" name="rcurrency" value="<?php echo $rowb['rcurrency']; ?>" />
   <input type="hidden" name="rswift" value="<?php echo $rowb['rswift']; ?>" />
   <input type="hidden" name="rtype" value="<?php echo $rowb['rtype']; ?>" />
   <input type="hidden" name="rcountry" value="<?php echo $rowb['rcountry']; ?>" />
   
 
                    <label class="sr-only" for="inlineFormInputName2">Acc Name</label>
                    <input type="text" value="<?php echo $rowb['rname']; ?>" class="form-control mb-2 mr-sm-2" id="inlineFormInputName2" readonly >
                  
                    <label class="sr-only" for="inlineFormInputGroupUsername2">Account Number</label>
                    <div class="input-group mb-2 mr-sm-2">
                      <div class="input-group-prepend">
                        <div class="input-group-text">A/C</div>
                      </div>
                      <input type="text" value="<?php echo $rowb['racc']; ?>" class="form-control" id="inlineFormInputGroupUsername2" readonly>
                    </div>
                  
                    <button type="submit" class="btn btn-warning mb-2">SEND MONEY</button>
                  </form>
                </div>
              </div>
            </div>
            
            
            
            
            
            
            
             <div class="col-12 grid-margin stretch-card">
              <div class="card">
                <div class="card-body"> 
                  <h4 class="card-title"><img src="icon/wire.png"  height="40px"/> Wire/Intl Transfer</h4>
                  <p class="card-description">
                   Transfer money from one country to another 
                  </p>
                  <form class="form-inline" method="POST" action="beneficiarywire.php">
                      
                       <input type="hidden" name="rname" value="<?php echo $rowb['rname']; ?>" />
   <input type="hidden" name="iban" value="<?php echo $rowb['iban']; ?>" />
   <input type="hidden" name="remail" value="<?php echo $rowb['remail']; ?>" />
   <input type="hidden" name="racc" value="<?php echo $rowb['racc']; ?>" />
   <input type="hidden" name="baddress" value="<?php echo $rowb['baddress']; ?>" />
   <input type="hidden" name="rbank" value="<?php echo $rowb['rbank']; ?>" />
   <input type="hidden" name="rcurrency" value="<?php echo $rowb['rcurrency']; ?>" />
   <input type="hidden" name="rswift" value="<?php echo $rowb['rswift']; ?>" />
   <input type="hidden" name="rtype" value="<?php echo $rowb['rtype']; ?>" />
   <input type="hidden" name="rcountry" value="<?php echo $rowb['rcountry']; ?>" />
   
 
                    <label class="sr-only" for="inlineFormInputName2">Acc Name</label>
                    <input type="text" value="<?php echo $rowb['rname']; ?>" class="form-control mb-2 mr-sm-2" id="inlineFormInputName2" readonly >
                  
                    <label class="sr-only" for="inlineFormInputGroupUsername2">Account Number</label>
                    <div class="input-group mb-2 mr-sm-2">
                      <div class="input-group-prepend">
                        <div class="input-group-text">A/C</div>
                      </div>
                      <input type="text" value="<?php echo $rowb['racc']; ?>" class="form-control" id="inlineFormInputGroupUsername2" readonly>
                    </div>
                  
                    <button type="submit" class="btn btn-primary mb-2">SEND MONEY</button>
                  </form>
                </div>
              </div>
            </div>
            
            
            
            
            
            
            
            
            
            
            
            
            
            
          </div>
        </div>
        <!-- content-wrapper ends -->
        
        
        
          <?php include 'auth_footer.php'; ?>