<div class="row">
                <div class="col-md-12" id = "formulir">

<script type="text/javascript">
$(document).ready(function(){
  $("#inquiry").click(function(e){
       e.preventDefault();
       var rekening = $('#rekeningselector').val();
       var namarekening = $('#namarekeningselector').val();
       var userid = $('#uidselector').val();
       var pinlayar = $('#pinlayarselector').val();
       var pintoken = $('#pintokenselector').val();
       var balance = $('#balanceselector').val();
       
       var useable = $('#useableselector option:selected').val();
       var ewalletonly = $('#ewalletonlyselector option:selected').val(); 
       var bank = $('#bankselector option:selected').val();
       
       
         $.ajax({
           type: "POST",
           url: "<?php echo base_url();?>c_modules/inquirerekening", 
           data: {
            rekening:rekening,
            namarekening:namarekening,
            userid:userid,
            pinlayar:pinlayar,
            pintoken:pintoken,
            balance:balance,
            ewalletonly:ewalletonly,
            useable:useable,
            bank:bank
           },
           dataType: "text",  
           success: function(data){
                $("#datagrid").html(data);
                
                }
            });

         // $("#errmsg").html(data);
      })

  $("#deletion").click(function(e){
       e.preventDefault();
       var rekening = $('#rekeningselector').val();
         $.ajax({
           type: "POST",
           url: "<?php echo base_url();?>c_modules/deleterekening", 
           data: {
            rekening:rekening
           },
           dataType: "text",  
           success: function(data){
                $("#datagrid").html(data);
              
                }
            });

         // $("#errmsg").html(data);
      })

  $("#submission").click(function(e){
       e.preventDefault();
       var rekening = $('#rekeningselector').val();
       var namarekening = $('#namarekeningselector').val();
       var userid = $('#uidselector').val();
       var pinlayar = $('#pinlayarselector').val();
       var pintoken = $('#pintokenselector').val();
       var balance = $('#balanceselector').val();
       
       var useable = $('#useableselector option:selected').val();
       var ewalletonly = $('#ewalletonlyselector option:selected').val(); 
       var bank = $('#bankselector option:selected').val();
       
       var brandgroup = $('#brandgroupselector option:selected').val();
       
         $.ajax({
           type: "POST",
           url: "<?php echo base_url();?>c_modules/submitrekening", 
           data: {
            rekening:rekening,
            namarekening:namarekening,
            userid:userid,
            pinlayar:pinlayar,
            pintoken:pintoken,
            balance:balance,
            ewalletonly:ewalletonly,
            useable:useable,
            bank:bank,
            
            brandgroup:brandgroup
           },
           dataType: "text",  
           success: function(data){
                $("#datagrid").html(data);
              
                }
            });
      })
})
</script>

<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<!-- <script>
  $( function() {
    $( "#mindateselector" ).datepicker();
  } );

</script> -->

<h1>Insert / Delete Rekening</h1>


<form  class="form-horizontal" enctype="multipart/form-data"  method="post">
<div class="row">
  <div class="col-md-3">
    <div class="form-group">
      <label for="inputUsername">Nomor Rekening (delete nomor rekening hanya menggunakan field ini)</label>
      <input type="number" class="form-control mainform" id="rekeningselector" name="rekeningselector">
    </div>
  </div>
  
  <div class="col-md-3">
    <div class="form-group">
      <label for="inputUsername">Nama Rekening</label>
      <input type="text" class="form-control mainform" id="namarekeningselector" name="namarekeningselector">
    </div>
  </div>
  
  
  <div class="col-md-3">
    <div class="form-group">
      <label for="inputUsername">User ID</label>
      <input type="text" class="form-control mainform" id="uidselector" name="uidselector">
    </div>
  </div>
  
  <div class="col-md-3">
    <div class="form-group">
      <label>Useable</label>
      <select id = "useableselector" name="useableselector" class="form-control mainform" style="width: 100%;">
        <option selected = "selected" value = "">All</option>  
        <option value = "1">1</option>
        <option value = "0">0</option>
      </select>
    </div>
  </div>
  
  
  <div class="col-md-3">
    <div class="form-group">
      <label>E-Wallet Only</label>
      <select id = "ewalletonlyselector" name="ewalletonlyselector" class="form-control mainform" style="width: 100%;">
        <option selected = "selected" value = "">All</option>  
        <option value = "1">1</option>
        <option value = "0">0</option>
      </select>
    </div>
  </div>
  
  
</div>
 
  
  
<div class = "row">
    
  <div class="col-md-3">
    <div class="form-group">
      <label for="inputUsername">PIN Layar</label>
      <input type="text" class="form-control mainform" id="pinlayarselector" name="pinlayarselector">
    </div>
  </div>
  
  <div class="col-md-3">
    <div class="form-group">
      <label for="inputUsername">PIN Token</label>
      <input type="text" class="form-control mainform" id="pintokenselector" name="pintokenselector">
    </div>
  </div>
  
  
  <div class="col-md-3">
    <div class="form-group">
      <label>Bank</label>
      <select id = "bankselector" name="bankselector" class="form-control mainform" style="width: 100%;">
          <option selected="selected" value="">All</option>
        <?php 
            foreach($banklist as $row)
            { 
         ?>
            <option  value="<?php echo $row->bank;?>"><?php echo $row->bank;?></option>
        <?php }?>
      </select>
    </div>
  </div>
  
  <div class="col-md-3">
    <div class="form-group">
      <label for="inputUsername">Balance</label>
      <input type="number" class="form-control mainform" id="balanceselector" name="balanceselector">
    </div>
  </div>
</div>

<?php if($this->session->userdata('privilege') == 'SuperAdmin') {?>
<div class = "row">
    <div class="form-group">
      <label>(for Inserting Only) Brand Group</label>
      <select id = "brandgroupselector" name="brandgroupselector" class="form-control mainform" style="width: 100%;">
        <?php 
            foreach($brandgrouplist as $row)
            { 
         ?>
            <option  value="<?php echo $row->brandgroup;?>"><?php echo $row->brandgroup;?></option>
        <?php }?>
      </select>
    </div>
</div>
<?php }?>

<div id = "errmsg" class = "mt-4">
                
</div>

<div class="card-footer">
  <button id = "inquiry" type="submit" class="btn btn-primary">Inquire</button>
  <button id = "submission" type="submit" class="btn btn-primary">Submit</button>
  <button id = "deletion" type="submit" class="btn btn-primary">Delete</button>
</div>
</form>
</div>
</div>

<div class="row">
    <div class="col-md-12" id = "datagrid">
    </div>
</div>