<?php require_once('../auth/auth.php');?>
<section class="content">
 <div class="container-fluid">
  <div class="row">
  	<div class="col-md-4"></div>
    <div class="col-md-4">
      <div class="card card-primary card-outline direct-chat direct-chat-primary shadow-none" style="border-left:1px solid #969c9d;border-right:1px solid #969c9d;border-bottom:1px solid #969c9d;">
        <div class="card-header" style="padding: 3px 8px;">
          <h3 class="card-title"><?php echo language(232);?></h3>
          <div class="card-tools">
            <button type="button" class="btn btn-tool" data-card-widget="remove">
              <i class="fas fa-times"></i>
            </button>
          </div>
        </div>

        <form id="search_form" action="#" method="post" autocomplete="off">
        	<div class="card-body">
        		<div class="col-md-12">
        			<div class="row">
        				<div class="col-md-12">
                 <div class="form-group" >
                    <label> <?php echo language(232);?></label>
                    <select  name="bbrid" class="form-control" required="true">
                       <option value="0"><?php echo language(222); ?></option>
                       <?php 
                            $prr= mysqli_query($conn,"SELECT brid,branch_name FROM branch WHERE coid='$coid' AND bid='$bid'") or die(mysqli_error($conn));
                              while($prw= mysqli_fetch_assoc($prr)){
                              echo '<option value='.$prw["brid"].'>'.$prw["branch_name"].'</option>';
                            }?>
                    </select>
                 </div>
        				</div>
        			</div>
        		</div>
        	</div>

        	<center>
        		<div class="card-footer" style="padding: 8px 5px;">
        			<button type="submit" id="save" class="btn btn-primary btn-xs">View Report</button>
        		</div>
        	</center>
        </form>

       </div> 
     </div>
     <div class="col-md-4"></div>
   </div>
 </div>
</section>


<script>
$(document).ready(function() {
$('select').select2();
$('#search_form').on('submit', function(e){
$('#save').prop('disabled', true);
$('#save').html('<span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span> '+'Loading...');
e.preventDefault();  
     $('#mview').load("../voucher/cash_zero.php",$(this).serialize(),function() {
     $('#save').prop('disabled', false);
     $('#save').html('View Report');
   });
  });
});  
</script>