<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
  <link rel="stylesheet" href="<?php echo base_url();?>styles/css/table.css">
    <?php
      $this->load->view('user/common_style');
      $this->load->view('user/header');
    ?> 
<style type="text/css">
.dataTables_filter > label
{
  display: block;
  color: rgb(239, 239, 239);
  background: rgb(239, 239, 239);
}

.dataTables_filter label > input[type=search]::after {
    font-family: 'FontAwesome';
    /*color:red;*/
    position: relative;
    left: -5px;
    content: "\f007";
}


</style>      
</head>

  <body>


      <?php
        
        $this->load->view('user/login_header');
        $currency_info = defaultcurrency();

      ?>
          <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
          <h4 class="other-title theme-color"> <?php echo $coinname.' '.'('.$coinsymbol.')';?>  <?php echo $this->lang->line('menu_deposit');?></h4> 
          <div class="col-lg-12">
          <?php
          if($coin_det->coin_type=='1')
          {
            
            if($coin_det->pay_status=='1' || $coin_det->pay_status=='2')
            {
              if($coin_det->pay_mode=='1')
              {

            ?>
                 <p>Please  Only send <?php echo $coinsymbol;?> to this address </p>
             <?php 
              if($address!='')
              {
             ?>
             <div class="col-lg-8">
             <input type="text" class="form-control" name="addr" id="link01" value="<?php echo $address;?>" readonly>
             </div>
             <div class="col-lg-4 mt-5">
             <button type="button" class="btn btn-default" id="cpy" data-copytarget="#link01">Copy</button>
             </div>
             <div style="clear:both;"><Br></div>
              <div class="col-lg-12 mb-30">
                <div align="center">
                    <h4 class="other-title theme-color">or scan QR code</h4>
                    <img src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=<?php echo $address;?>">
               </div>
              </div>
              <div style='clear:both;'><br></div>
            
          <?php
            }
            else
            {
              ?>
                <p class="frgtpwd frgtpwd" style='background:red;'><i class="fa fa-thumbs-down"></i> NO Address Generations Found.. Pls try again Later</p>

              <?php

            }
          ?>
          <br>
          <span class="black mt-50">Crypto-currencies are credited within 1 minute after accessing this page or "My funds" page. and only after <?php echo $coinconfirm;?> confirmations of the transaction in the network. The minimum deposit amount is 0.0001. </span>

          <?php
                }
                else
                {
              ?>
                  
                   <div class="table-list clearfix">
                  <p style='text-align:center;font-weight:bold;'>(Please Pay only <?php echo $coinsymbol;?> For Coin Payment)</p>
                  <div style='clear:both;'><br></div>
                <div class="img-bg4 clearfix pt-20 mb-20">
              <div class="form_content">
                <form class="steps-validation" action="<?php echo base_url();?>user/dashboard/payment" id="pay_form" method="post">
                 <div class="col-sm-12">
                    <div class="form_block_inner">
                    <div class="col-sm-4">
                         <label style="margin-top:5px;" ><?php echo $this->lang->line('lbl_amount'); ?> * </label>
                    </div>
                    
                    <div class="col-sm-4">
                         <input name="amount"  class="" type="text" id="amount" value="<?php echo (isset($fullname[1])) ? $fullname[1] : '';?>"/></span>
                        <input type='hidden' id="coinid" name="coinid" value="<?php echo $coin_det->coid;?>">
                        <div style='color:red;' id="amount_err"></div>
                    </div>
                </div>
                <div style='clear:both;'><Br><br></div>

                <div class="col-sm-12">
                      <div class="contact_page_btn" align="center">
                        <button type="button" class="yellow-btn" onclick="javascript:check_payment();">Submit Now</button>
                      </div>
                      <div style='clear:both;'><br></div>
                </div>
                </form>
                </div>
                </div>
                </div>
                </div>


            <?php 

                }
            }
            else
            {


              if($coin_det->pay_mode=='3' || $coin_det->pay_mode=='5' || $coin_det->pay_mode=='6')
              {
                if($coin_det->pay_mode=='3')
                    $payment_name='Credit/Debit Card';
                else if($coin_det->pay_mode=='5')
                  $payment_name='Coin';
                else
                  $payment_name='Perfect Money';
              ?>
              <div class="table-list clearfix">
                <p style='text-align:center;font-weight:bold;'>(Please Pay only <?php echo $coinsymbol;?> For <?php echo $payment_name?>  Payment)</p>
                <div style='clear:both;'><br></div>
                <div class="img-bg4 clearfix pt-20 mb-20">
              <div class="form_content">
                <form class="steps-validation" action="<?php echo base_url();?>user/dashboard/payment" id="pay_form" method="post">
                 <div class="col-sm-12">
                    <div class="form_block_inner">
                    <div class="col-sm-4">
                         <label style="margin-top:5px;" ><?php echo $this->lang->line('lbl_amount'); ?> * </label>
                    </div>
                    
                    <div class="col-sm-4">
                         <input name="amount"  class="" type="text" id="amount" value="<?php echo (isset($fullname[1])) ? $fullname[1] : '';?>"/></span>
                        <input type='hidden' id="coinid" name="coinid" value="<?php echo $coin_det->coid;?>">
                        <div style='color:red;' id="amount_err"></div>
                    </div>
                </div>
                <div style='clear:both;'><Br></div>

                <div class="col-sm-12">
                      <div class="contact_page_btn" align="center">
                        <button type="button" class="yellow-btn" onclick="javascript:check_payment();">Submit Now</button>
                      </div>

                      <div style='clear:both;'><br></div>
                </div>
                </form>
                </div>
                </div>
                </div>
                </div>
              <?php
               }
               else
               { 
                ?>

                 <div class="table-list clearfix">
                 <div class="img-bg4 clearfix pt-20 mb-20">
                 <p style='text-align:center;font-weight:bold;'>(Please Pay only <?php echo $coinsymbol;?> For Selected Wire Transfer )</p>
              <div class="form_content">
                <form class="steps-validation" action="<?php echo base_url();?>user/dashboard/bank" id="pay_form" method="post">
                 <div class="col-sm-12">

                    <div class="form_block_inner">
                    <div class="col-sm-4">
                         <label style="margin-top:5px;" ><?php echo $this->lang->line('menu_bank_name'); ?> * </label>
                    </div>
                    
                    <div class="col-sm-4">
                        <select name="bank" id="bank" >
                          <option value="select">Select Bank Deposit</option>
                          <?php
                          $rest=$this->db->query("select * from bankwire where payment_id='".$coin_det->coid."' and status='1'");
                          $bank_det=$rest->result();
                          if($bank_det)
                          {
                            foreach ($bank_det as $bank) 
                            {
                              ?>
                                <option value="<?php echo $bank->id;?>"><?php echo $bank->bank_name;?></option>
                              <?php
                            
                            }

                          }
                          ?>

                        </select>
                        
                        <div style='color:red;' id="bank_err"></div>
                    </div>

                    <div style='clear:both;'><br></div>

                    <div id="bank_det"></div>

                    <div style='clear:both;'><br></div>

                    <div class="form_block_inner">
                    <div class="col-sm-4">
                         <label style="margin-top:5px;" ><?php echo $this->lang->line('lbl_amount'); ?> * </label>
                    </div>
                    
                    <div class="col-sm-4">
                         <input name="amount"  class="" type="text" id="amount" value="<?php echo (isset($fullname[1])) ? $fullname[1] : '';?>"/></span>
                        <input type='hidden' id="coinid" name="coinid" value="<?php echo $coin_det->coid;?>">
                        <div style='color:red;' id="amount_err"></div>
                    </div>
                  </div>

                  <div style='clear:both;'><Br></div>
                  <div class="form_block_inner">
                    <div class="col-sm-4">
                         <label style="margin-top:5px;" >Transaction ID * </label>
                    </div>
                    
                    <div class="col-sm-4">
                         <input name="trans_id"  class="" type="text" id="trans_id" value=""/></span>
                        <div style='color:red;' id="trans_err"></div>
                    </div>
                  </div>

                <div style='clear:both;'><Br></div>

                <div class="col-sm-12">
                      <div class="contact_page_btn" align="center">
                        <button type="button" class="yellow-btn" onclick="javascript:check_payment1();">Submit Now</button>
                      </div>
                      <div style="clear:both;"><br></div>
                </div>
                </form>
                </div>
                </div>
               </div>
               </div>
               </div>



                <?php
                }
            }


          }
          else
          {

            
            ?>
            <div class="table-list clearfix">
                 <div class="img-bg4 clearfix pt-20 mb-20">
                 <p style='text-align:center;font-weight:bold;'>(Please Pay Amount For Given Wallet Address )</p>

                 <p style="text-align:center;font-weight:bold;color:orange;">1 USD = <?php echo $coin_det->coins_per;?> <?php echo strtoupper($coin_det->coin_symbol);?></p>
              <div class="form_content">
                <form class="steps-validation" action="<?php echo base_url();?>user/dashboard/nonlive" id="pay_form" method="post">
                 <div class="col-sm-12">

                    <div class="form_block_inner">
                    
                    <div class="col-sm-12">
                    <?php 
                    if($coin_det->wallet_address!='')
                    {
                      $address=$coin_det->wallet_address;
                      ?>
                        <div class="col-sm-6">
                           <input type="text" class="form-control" name="addr" id="link01" value="<?php echo $address;?>" readonly  style="height:45px;">
                           </div>
                           <div class="col-sm-6">
                           <button type="button" class="btn btn-default" id="cpy" data-copytarget="#link01">Copy</button>
                           </div>
                           <div style="clear:both;"><Br></div>
                            <div class="col-lg-12 mb-30">
                              <div align="center">
                                  <h4 class="other-title theme-color">or scan QR code</h4>
                                  <img src="https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=<?php echo $address;?>">
                             </div>
                            </div>
                            <div style='clear:both;'><br></div>

                      <?php 

                    }
                    else
                    {
                      ?>
                        <p class="frgtpwd frgtpwd" style='background:red;'><i class="fa fa-thumbs-down"></i> NO Address Provided .. Pls try again Later</p>
                    <?php 
                    }
                    ?>

                
                    </div>

                    <div style='clear:both;'><br></div>

                    <div id="bank_det"></div>

                    <div style='clear:both;'><br></div>

                    <div class="form_block_inner">
                    <div class="col-sm-4">
                         <label style="margin-top:5px;" ><?php echo $this->lang->line('lbl_amount'); ?> * </label>
                    </div>
                    
                    <div class="col-sm-4">
                         <input name="amount"  class="" type="text" id="amount" value="<?php echo (isset($fullname[1])) ? $fullname[1] : '';?>"/></span>
                        <input type='hidden' id="coinid" name="coinid" value="<?php echo $coin_det->coid;?>">
                        <div style='color:red;' id="amount_err"></div>
                    </div>
                </div>

                 <div style='clear:both;'><Br></div>
                  <div class="form_block_inner">
                    <div class="col-sm-4">
                         <label style="margin-top:5px;" >Transaction ID * </label>
                    </div>
                    
                    <div class="col-sm-4">
                         <input name="trans_id"  class="" type="text" id="trans_id" value=""/></span>
                        <div style='color:red;' id="trans_err"></div>
                    </div>
                  </div>
                  
                <div style='clear:both;'><Br></div>
                <?php 
                if($coin_det->wallet_address!='')
                {
                ?>
                  <div class="col-sm-12">
                        <div class="contact_page_btn" align="center">
                          <button type="button" class="yellow-btn" onclick="javascript:check_payment2();">Submit Now</button>
                        </div>
                        <div style="clear:both;"><br></div>
                  </div>
                <?php 
                }
                ?>
                </form>
                </div>
                </div>
               </div>
               </div>
               </div>
             <?php 
            }
          ?>
          </div>
               
           

           <div style='clear:both;'><br></div>

          <div class="table-responsive main-table">
            <h4 class="other-title theme-color"><?php echo $this->lang->line('recent_depst_in_coin');?></h4> 
              <table class="main-table">
                <thead>
                  <tr>
                    <th><?php echo $this->lang->line('date_label');?></th>
                    <th><?php echo $this->lang->line('deposit_admount');?></th>
                    <th><?php echo $this->lang->line('deposit_status');?></th>
                  </tr>
                </thead>
                <tbody>
                <?php
                  foreach ($all_active as $coin)
                  {?>
                    <tr>
                      <td><span class="grey"><?php echo date('Y-m-d H:i:s',strtotime($coin->invest_date));?></span></td>
                      <td><span class="grey"><?php echo  $coin->amount;?> <?php echo $coinsymbol;?></span></td>
                      <?php


                      if($coin_det->coid=='1' || $coin_det->coid=='3' || $coin_det->coid=='4' || $coin_det->coid=='5')
                      {
                         if($coin->confirmation >=$coinconfirm)
                         {
                          ?>
                            <td><span class="green"><?php echo $this->lang->line('lbl_paid');?></span></td>
                         <?php
                         }
                         else
                         {
                          ?>   
                          <td><span class="purple"><?php echo $this->lang->line('lbl_pending');?></span></td>
                         <?php
                        }
                     }
                     else
                     {
                        if($coin->status=='pending')
                        {
                        ?>
                        <td><span class="purple"><?php echo $this->lang->line('lbl_pending');?></span></td>
                        <?php
                        }
                        else
                        {
                        ?>
                        <td><span class="green"><?php echo $this->lang->line('lbl_paid');?></span></td>
                        <?php

                        }
                     }


                       ?>
                    </tr>
                  <?php
                  }
                ?>
                </tbody>
              </table>
          </div>


    </div>
    
    </div>
    
  </div>
  </section>
<script src="<?php echo base_url();?>styles/js/jquery-1.12.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>styles/js/datatables.min.js"></script>
<script type="text/javascript">
 $(document).ready(function($) {   
    'use strict';

     
      document.body.addEventListener('click', copy, true);


      function copy(e) {

        var
          t = e.target,
          c = t.dataset.copytarget,
          inp = (c ? document.querySelector(c) : null);

        if (inp && inp.select) {

          $("#cpy").html('Copied');
          $("#cpy").css('background','green');
          $("#cpy").css('color','white');

          inp.select();

          try {
            document.execCommand('copy');
            inp.blur();
          }
          catch (err) {
             swal({
                title: "<?php echo $this->lang->line('referral_copy_lbl'); ?>",
                confirmButtonColor: "#f5ab35"
            });
          }

        }

      }


      $("#bank").on('change', function(){

        var valus1= $("#bank").val();
        jQuery.ajax({
                type: 'post',
                url:'<?php echo base_url();?>user/dashboard/bank_det',
                data: {'id':valus1},
                success : function(resp)
                {
                   $("#bank_det").html(resp);
                }
            });
   
 
    });


    $('.main-table table').dataTable({
          // "paginate": false,
          // "filter": false,
          "Info": false
    });
  });


 function check_payment()
 {

  var min_amt=document.getElementById('amount').value;
  if(min_amt=="")
  {
    document.getElementById('amount_err').innerHTML=" * Pls Enter Amount";
    
  }
  if(min_amt!='')
  {
    var mq =/^[0-9.]+$/;
    if(!mq.test(min_amt))
    {
      document.getElementById('amount_err').innerHTML=" * Invalid amount format";
    }
    else
    {
      document.getElementById('pay_form').submit();
    }

  }

}


function check_payment1()
 {

  var min_amt=document.getElementById('amount').value;
  var trans_id=document.getElementById('trans_id').value;
  var bank=document.getElementById('bank').value;
  var flag=0;
  var flag1=0;
  if(min_amt=="")
  {
    flag=1;
    document.getElementById('amount_err').innerHTML=" * Pls Enter Amount";
    
  }
  if(min_amt!='')
  {
    var mq =/^[0-9.]+$/;
    if(!mq.test(min_amt))
    {
      flag=1;
      document.getElementById('amount_err').innerHTML=" * Invalid amount format";
    }
  }

  if(trans_id=='')
  {
    flag1=1;
    document.getElementById('trans_err').innerHTML=" * Pls Enter Transaction ID";
  }

  if(bank=='select')
  {
    flag1=1;
    document.getElementById('bank_err').innerHTML=" * Pls Select Bank";

  }

  if(flag=='0' && flag1=='0')
  {
    document.getElementById('pay_form').submit(); 
  }

}



function check_payment2()
 {

  var min_amt=document.getElementById('amount').value;
  var trans_id=document.getElementById('trans_id').value;
  var flag=0;
  var flag1=0;
  if(min_amt=="")
  {
    flag=1;
    document.getElementById('amount_err').innerHTML=" * Pls Enter Amount";
    
  }

  if(trans_id=='')
  {
    flag1=1;
    document.getElementById('trans_err').innerHTML=" * Pls Enter Transaction ID";
  }

  if(min_amt!='')
  {
    var mq =/^[0-9.]+$/;
    if(!mq.test(min_amt))
    {
      flag=1;
      document.getElementById('amount_err').innerHTML=" * Invalid amount format";
    }
  }

  if(flag=='0' && flag1=='0')
  {
    document.getElementById('pay_form').submit(); 
  }

}

 </script>   

<?php
  $this->load->view('user/common_script');
// $this->load->view('user/result_check');
?>
</div>
<?php
$this->load->view('user/footer');
?>

  </body>
</html>
