<?php
require_once("../app/config.php");
$title="Fund Account";
$status=$_GET['id'];
require_once('include/user_header.php');
require_once('include/user_navbar.php');
require_once('include/user_sidebar.php');
?>
<div class="content-wrapper">

      <!-- Page header -->
      <div class="page-header page-header-light">
        <div class="page-header-content header-elements-md-inline">
          <div class="page-title d-flex">
            <h4><i class="icon-credit-card mr-2"></i> <span class="font-weight-semibold">Select payment Method</span></h4>
          </div>
        </div>

        <div class="breadcrumb-line breadcrumb-line-light header-elements-md-inline">
          <div class="d-flex">
            <div class="breadcrumb">
              <a href="./" class="breadcrumb-item"><i class="icon-home2 mr-2"></i> Home</a>
              <a href="./fund/0" class="breadcrumb-item">fund Wallet</a>
            </div>
          </div>

          <div class="header-elements d-none">
            <div class="breadcrumb justify-content-center">
              <a href="./fund/0" class="breadcrumb-elements-item">
                <i class="icon-credit-card mr-2 text-success"></i>
                Fund account
              </a>
              <a href="./plans/0" class="breadcrumb-elements-item">
                <i class="icon-stats-bars3 mr-2 text-danger"></i>
                Investment plans
              </a>   
             <a href="ticket" class="breadcrumb-elements-item">
                <i class="icon-comment-discussion mr-2 text-info"></i>
                Support
              </a>
            </div>
          </div>
        </div>
      </div>
      <div class="content">
        <div class="row">
          <div class="col-lg-12">
            <div class="alert bg-secondary text-white alert-styled-left alert-dismissible">
              <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
                <h3>Current account balance is <?php echo $scan2['currency'].number_format($row['balance']);?></h3>
              </div>
            </div>
        </div>
<?php 
if(!empty($_SESSION['automax_userhome'])){?>
        <div class="row">
            <div class="col-lg-12">
              <div class="alert <?php if($_SESSION['automax_userhome']=='email_versent') {echo 'bg-success';}else{echo 'bg-danger';}?> text-white alert-styled-left alert-dismissible">
                <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
          <?php if($_SESSION['automax_userhome']=='email_verfailed') {
            echo'An error occured while sending verification email, try again later.';
          } else if($_SESSION['automax_userhome']=='email_versent') {
            echo'Verification email was successfully sent.';
          }?>                 
                </div>
              </div>
          </div>
<?php
}?>
<?php if($status==1){?>   
          <div class="row">
            <div class="col-lg-12">
              <div class="alert bg-success text-white alert-styled-left alert-dismissible">
                <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
                  Transaction was successful.
                </div>
              </div>
          </div>
<?php }else if($status==2){?>
            <div class="row">
            <div class="col-lg-12">
              <div class="alert bg-danger text-white alert-styled-left alert-dismissible">
                <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
                  An error occured, try again later.
                </div>
              </div>
          </div>
<?php }else if($status==3){?>
            <div class="row">
            <div class="col-lg-12">
              <div class="alert bg-danger text-white alert-styled-left alert-dismissible">
                <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
                  Please follow deposit limit.
                </div>
              </div>
          </div>
<?php }else if($status==4){?>
            <div class="row">
            <div class="col-lg-12">
              <div class="alert bg-danger text-white alert-styled-left alert-dismissible">
                <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
                 Invalid Deposit Request
                </div>
              </div>
          </div>
<?php }else if($status==5){?>
            <div class="row">
            <div class="col-lg-12">
              <div class="alert bg-danger text-white alert-styled-left alert-dismissible">
                <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
                 BLOCKCHAIN API HAVING ISSUE. PLEASE TRY LATER
                </div>
              </div>
          </div>
<?php }else if($status==6){?>
            <div class="row">
            <div class="col-lg-12">
              <div class="alert bg-danger text-white alert-styled-left alert-dismissible">
                <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
                 Failed to Process
                </div>
              </div>
          </div>
<?php }?>
<?php
if($row['active']==0){
  if($set['email_activation']==1){
    if($eset['status']==1){?>
        <div class="alert bg-info alert-styled-left alert-arrow-left alert-dismissible">
          <button type="button" class="close" data-dismiss="alert"><span>×</span></button>
          <h6 class="alert-heading font-weight-semibold mb-1">Email verification</h6>
          User account has not yet been verified, account funding is currently disabled until email is verified, you can't buy a trading plan without funding your account. <a class="text-white" href='<?php echo $url."/app/user?id=sendver&del=2&status=".$row['token'];?>'>Click here</a> to verify your account
          </div>
<?php

    }
  }
}else{?>
<div class="row"> 
<center><h2><b style="color:black"> CHOOSE DEPOSIT GATEWAY</b></h2></center>
<div class="col-md-4">
  <a href="./bank_transfer" class="text-default">
  <div class="card border-3 border-primary rounded-10">
    <div class="card-body">
      <div class="d-sm-flex align-item-sm-center flex-sm-nowrap">
        <div>
          <h6 class="font-weight-semibold">BITCOIN </h6>
         <!-- <img src="btc.jpeg" style="width:270px;"><br> -->
        <!--  <center><b>DEPOSITE WITH BITCOIN</b></center> -->
        </div>
      </div>
    </div>
  </div>
  </a>
</div> 
<div class="col-md-4">
  <a href="./ethereum.php" class="text-default">
   <div class="card border-3 border-primary rounded-10">
    <div class="card-body">
      <div class="d-sm-flex align-item-sm-center flex-sm-nowrap">
        <div>
          <h6 class="font-weight-semibold">ETHEREUM</h6>
         <!-- <img src="eth.jpeg" style="width:270px;"><br> -->
         <!-- <center><b>DEPOSITE WITH ETHEREUM</b></center> -->
        </div>
      </div>
    </div>
  </div>
  </a>
</div> 

<?php

$data=mysqli_query($dbc, "SELECT * FROM gateways WHERE status=1 order by gateways.id ASC");
while($gate=mysqli_fetch_array($data)){
?>    
 <div class="col-md-4">
  <a href="#" class="text-default" data-toggle="modal" data-target="#<?php echo $gate['id'];?>modal_mini">
  <div class="card border-left-3 border-left-danger rounded-left-0">
    <div class="card-body">
      <div class="d-sm-flex align-item-sm-center flex-sm-nowrap">
        <div>
          <h6 class="font-weight-semibold"><?php echo $gate['main_name'];?></h6>
        </div>
      </div>
    </div>
  </div>
  </a>
</div> 
    <div id="<?php echo $gate['id'];?>modal_mini" class="modal fade" tabindex="-1">
      <div class="modal-dialog">
        <div class="modal-content">
          <div class="modal-header">
            <h5 class="modal-title">Deposit via <?php echo $gate['main_name'];?></h5>
            <button type="button" class="close" data-dismiss="modal">×</button>
          </div>
          <form action="../app/user?id=depositinsert" method="post">
          <div class="modal-body">
            <p class="font-weight-semibold">Deposit amount <?php echo $scan2['currency'];?>(<?php echo $gate['minamo'].' - '.$gate['maxamo'];?>)</p>
            <p class="font-weight-semibold">Charged <?php echo $scan2['currency'].$gate['fixed_charge'];?> + <?php echo $gate['percent_charge'];?>%</p>
                <div class="form-group row">
                  <div class="col-lg-12">
                    <div class="input-group">
                      <span class="input-group-prepend">
                        <span class="input-group-text"><?php echo $scan2['currency'];?></span>
                      </span>
                      <input type="number" class="form-control" placeholder="" name="amount" required>
                    </div>
                  </div>
                </div>  
                <input type="hidden" name="gateway" value="<?php echo $gate['id'];?>">
                <input type="hidden" name="user_id" value="<?php echo $row['id'];?>">                   
          </div>

          <div class="modal-footer">
            <button type="submit" class="btn bg-primary">Preview</button>
          </div>
        </form>
        </div>
      </div>
    </div>
<?php } ?>
</div>
<?php } ?>
  </div>
<?php require_once('include/user_footer.php');?>