       <link href="<?php echo base_url(); ?>assets/vendors/select2/dist/css/select2.min.css" rel="stylesheet">
       <link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrapValidator.css"/>
       <style>
           #shw_blnc_dv{
               display:none;
           }
       </style>
         <style>
           #lv5bl{
               display:none;
           }
       </style>
        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3><?php //echo $form['type']; ?></h3>
                </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Bank Payment</h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a></li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                  
                    <form id="add_defn" class="form-horizontal form-label-left" enctype="multipart/form-data" action="<?php echo base_url(); ?>account/SaveTransactions_bank_payment"  method="post">
                     
                    <div class="row">
                        
                         <div class="item form-group col-md-4">
                        <label class="control-label col-md-3 col-sm-4 col-xs-12" for="name"><?php  echo "Paid To" ?><span class="required">*</span>
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                 <input type="text"  name="paidto" class="form-control">
                      </div>
                      </div>
                      
                        <div class="item form-group col-md-4"  >
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name">Date<span class="required">*</span>
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                        <input name="datee"  id="date" value="<?php echo date('d-m-Y') ?>" class="form-control date" maxlength="20" required>                    
                        </div>
                      </div>
                      
                       <div class="item form-group col-md-4">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name"><?php  echo "Cash/Chq#" ?><span class="required">*</span>
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                                <input name="chq" id="chq" class="form-control" required> </div></div>
                     </div> <!--row-->
                     <div class="row">
                      <div class="item form-group col-md-4">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Program<span class="required">*</span>
                        </label>
                        <div class="col-md-8 col-sm-6 col-xs-12">
                             <select name="prog"   class="form-control programme programme1 " required>
                              <option value="">Select Program</option>
                              <?php
                              foreach ($pro as $value) {
                                ?>
                                <option value="<?php echo $value['id'];?>"><?php echo $value['name'];?></option>  
                                <?php }?></select>            
                        </div>
                      </div>
                      <div class="item form-group col-md-4">
                        <label class="control-label col-md-4 col-sm-3 col-xs-12" for="name">Project<span class="required">*</span>
                        </label>
                        <div class="col-md-8 col-sm-6 col-xs-12">
                              <select  name="proj"   class="form-control project project1" required></select></div></div>
                      <div class="item form-group col-md-4">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name"><?php  echo "Bank" ?><span class="required">*</span>
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                         <select  name="bank_cr" id="cstm_bnk"  data-id="1"  class="form-control bank level5 level51" required>
                              <option value="">Select bank</option>
                         <?php
                          foreach ($banks as $value){
                               $branch=$this->user_model->getbranch(); 
                               $filter=$this->db->select('*')
                                                ->from('heads_permission')
                                                ->where('branch',$branch)
                                                ->where('head',$value['id'])
                                                ->get()->result_array();
                                  if(!empty($filter)) 
                                  {?>
                                <option value="<?php echo $value['id'];?>"><?php echo $value['name'];?></option>
                                <?php }}?></select>                 
                      </div>
                      </div> 
                      </div><!--row-->
               
               <div class="row">
                    
                    <div class="item form-group col-md-4">
                        <label class="control-label col-md-3 col-sm-4 col-xs-12" for="name">Voucher#<span class="required"></span>
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                          <input type="text" class="form-control" name="voucher_no" id="voucher_no" readonly value="<?php echo $voucher_no;?>">      
                      </div>
                      </div> 
                      
                      <div class="item form-group col-md-4">
                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="name"><span class="required"></span>
                        </label>
                        <div class="col-md-8 col-sm-8 col-xs-12">
                               
                      </div>
                      </div> 
                      
                      <div class="item form-group col-md-4" id="shw_blnc_dv">
                        <label class="control-label col-md-8 col-sm-4 col-xs-12" for="name"><span id="bnk_blnc" style="color:red" class="required">Balance : <b></b></span>
                        </label>
                       
                      </div> 
               </div>
                      <div class="table-responsive" style="scroll-x:overflow">
                        <table class="table table-striped" style="width:100%">
                        <thead>
                        <tr>
                     <td>Head Of Account</td><td>Narration</td><td>Amount</td>
                        </tr>
                        </thead>
                        <tbody id="upper_tbody">
                        <tr class="row_table row1">
                        
                       <td>
                      <select  name="rec[1][level5]" id="hl51" data-id="1"  class="form-control select2_single" style="width:500px" required="true" onchange="dr_up(<?php echo 1;?>,event)">
                              <option value="">Select Head Level 5</option>
                               <?php
                              foreach ($level5 as $value) {
                                      $branch=$this->user_model->getbranch(); 
                                  $filter=$this->db->select('*')
                                                   ->from('heads_permission')
                                                   ->where('branch',$branch)
                                                   ->where('head',$value['id'])
                                                   ->get()->result_array();
                                  if(!empty($filter)) 
                                  {
                                      //   $prnt_names[];
                                    $prnt1=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$value['id'])
                                                    ->get()->row()->parent;
                                      if($prnt1!=0)
                                      {
                                          $prnt2=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt1)
                                                    ->get()->row();
                                            $prnt_names[]=$prnt2->name;  
                                          $prnt3=$prnt2->parent;
                                          if($prnt3 !=0) 
                                          {
                                              $prnt4=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt3)
                                                    ->get()->row();
                                                $prnt_names[]=$prnt4->name; 
                                                $prnt5=$prnt4->parent;
                                            
                                            if($prnt5!=0)    
                                            {
                                             $prnt6=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt5)
                                                    ->get()->row();
                                                $prnt_names[]=$prnt6->name; 
                                                $prnt7=$prnt6->parent;
                                             if($prnt7 !=0)
                                             {
                                            $prnt8=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt7)
                                                    ->get()->row();
                                                $prnt_names[]=$prnt8->name; 
                                                $prnt9=$prnt8->parent;
                                             if($prnt9 !=0)
                                             {
                                              $prnt10=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt9)
                                                    ->get()->row();
                                                $prnt_names[]=$prnt9->name; 
                                                $prnt11=$prnt9->parent;
                                             }
                                             }
                                         
                                            }
                                          }
                                      }
                                ?>
                                <option value="<?php echo $value['id'];?>"><?php $prnt_names= array_reverse($prnt_names);
                                $p=1;
                                if(!empty($prnt_names))
                                {
                                   $cod=$this->db->select('code')
                                                   ->from('account_heads')
                                                   ->where('id',$value['id'])
                                                   ->get()->row_array()['code'];
                                     echo "<b>".$cod."</b>"."    "; 
                                $i=1;
                                foreach($prnt_names as $key=>$valtm)
                                {
                                    
                                   
                                echo " "."<b>".$valtm."</b>";
                               
                                $i++;
                                $p=$i;
                                }
                                unset($prnt_names);
                                } ?>
                                 <?php 
                                 echo " ";
                              
                                echo " ".$value['name'];
                                ?>
                                </option>  
                                <?php
                              }  
                              }
                              ?>
                            </select>
                            <span id="ammount1" style="color:red"></span>
                      </td>
                      <td class="col-md-3">
                     
                       
                       <textarea  name="rec[1][naration]" data-id="1" class="form-control" required placeholder="Enter Narration.........."></textarea>
                           
                        
                      </td>
                    
                                <td>
                                    <input name="rec[1][cr_amount]" autocomplete="false" class="cr-item num cr-item1 form-control" required="true" style="text-align:right;"  type="number" min="0"  data-id="1">
                                </td>
                                 
                      <td>
                      <button class="btn btn-primary" data-remove-id="1" type="button" >
                        <i class="fa fa-remove"></i>
                      </button>
                      </td>
                      </tr>
                     
                        </tbody>
                      <tbody>
                            
                      </tbody>
                      </table>
                      </div>
                      <div class="ln_solid"></div>
                      
                      <div class="form-group">
                     
                        <div class="col-md-6 col-md-offset-3">
                        <button type="button" class="btn btn-primary addRow pull-right">
                    <i class="fa fa-plus" ></i>
                          <button id="EntrySubmit" type="submit" class="btn btn-success pull-right">Add</button>
                        

                        </div>
                        
                          </div>
                          </div>
                    </form>
                      </div>
                        </div>
                     </div>
                </div>
             
              </div>
               
             
              </div>
            
            </div>
          </div>
                  <!-- /page content -->
        <script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.min.js"></script>
        <script src="<?php echo base_url(); ?>assets/vendors/select2/dist/js/select2.full.min.js"></script>
        <script src="<?php echo base_url(); ?>assets/js/bootstrapValidator.js"></script>
        <script type="text/javascript">
         var jq = jQuery.noConflict();
           jq('form').submit(function(){
            jq('button[type=submit], input[type=submit]').prop('disabled',true);
        });
jq(document).ready(function() {
 jq('#add_defn').bootstrapValidator({
       feedbackIcons: {
              valid: 'glyphicon glyphicon-ok',
              invalid: 'glyphicon glyphicon-remove',
              validating: 'glyphicon glyphicon-refresh'
                   },
        fields: {
                    paidto: {
                        trigger:'change keyup',
                        validators: {
                            notEmpty: {
                                message: 'Paid required'
                            }
                        }
                    },
                    
                     datee: {
                        trigger:'change keyup',
                        validators: {
                            notEmpty: {
                                message: 'Date required'
                            }
                        }
                    },
                    
                    prog: {
                        trigger:'change keyup',
                        validators: {
                            notEmpty: {
                                message: 'Program required'
                            }
                        }
                    },
                     proj: {
                        trigger:'change keyup',
                        validators: {
                            notEmpty: {
                                message: 'Project required'
                            }
                        }
                    },
                  chq: {
                        trigger:'change keyup',
                        validators: {
                            notEmpty: {
                                message: 'Chq# required'
                            }
                        }
                    },
                  bank_cr: {
                        trigger:'change keyup',
                        validators: {
                            notEmpty: {
                                message: 'Bank required'
                            }
                        }
                    },
      
         }
    });
    
});
</script>

      <script>
      var jq = jQuery.noConflict();
      jq(document).ready(function(){
        jq('#slip').hide();
      });
       jq(".select2_single").select2({
            placeholder: "Select Head Of Account",
            allowClear: true
         });
          jq(".select2_naration").select2({
            placeholder: "Select Type",
            allowClear: true
         });
        jq(document).on('change','.programme',function(){
          var val=jq(this).val();
          
           
          jq.ajax({
                    url: "<?php echo base_url(); ?>Load_account/proagainstproject/"+val,
                    data: {},
                      success: function( d ) {
                         var pre='<option value="">Select Project</option>';
                         
                          jq( ".project1" ).html(pre+d);
  }
});

        });
       
  var rows =1;
      
      var row = '<tr class="row_table row{id}">'+
                
                '<td>'+
                  '<select name="rec[{id}][level5]" id="hl5{id}" required="required" onchange="dr_up({id},event)" class="form-control select2_single" data-id="{id}" style="width:500px">'+
                 '<option value="">Select level5</option>'+
                  '<?php  foreach ($level5 as $value) { 
                          $branch=$this->user_model->getbranch(); 
                                  $filter=$this->db->select('*')
                                                   ->from('heads_permission')
                                                   ->where('branch',$branch)
                                                   ->where('head',$value['id'])
                                                   ->get()->result_array();
                                  if(!empty($filter)) 
                                  {
                                      $prnt1=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$value['id'])
                                                    ->get()->row()->parent;
                                      if($prnt1!=0)
                                      {
                                          $prnt2=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt1)
                                                    ->get()->row();
                                            $prnt_names[]=$prnt2->name;  
                                          $prnt3=$prnt2->parent;
                                          if($prnt3 !=0) 
                                          {
                                              $prnt4=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt3)
                                                    ->get()->row();
                                                $prnt_names[]=$prnt4->name; 
                                                $prnt5=$prnt4->parent;
                                            
                                            if($prnt5!=0)    
                                            {
                                             $prnt6=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt5)
                                                    ->get()->row();
                                                $prnt_names[]=$prnt6->name; 
                                                $prnt7=$prnt6->parent;
                                             if($prnt7 !=0)
                                             {
                                            $prnt8=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt7)
                                                    ->get()->row();
                                                $prnt_names[]=$prnt8->name; 
                                                $prnt9=$prnt8->parent;
                                                
                                              if($prnt9 !=0)
                                             {
                                              $prnt10=$this->db->select('*')
                                                    ->from('account_heads')
                                                    ->where('id',$prnt9)
                                                    ->get()->row();
                                                $prnt_names[]=$prnt9->name; 
                                                $prnt11=$prnt9->parent;
                                             }
                                             }
                                         
                                            }
                                          }
                                      } 
                      ?>'+
                   ' <option value="<?php echo $value['id'];?>"><?php 
                   $prnt_names= array_reverse($prnt_names);
                   $p=1;
                   if(!empty($prnt_names)){
                   $i=1;
                    $cod=$this->db->select('code')
                                                   ->from('account_heads')
                                                   ->where('id',$value['id'])
                                                   ->get()->row_array()['code'];
                                     echo '<b>'.$cod.'</b>'.'    ';
                   foreach($prnt_names as $key=>$valtm)
                                {
                                    
                                    echo ' ';
                                
                                echo ' '.$valtm;
                                echo ' ';
                                $i++;
                                $p=$i;
                                }
                                unset($prnt_names);
                                } ?>
                                <?php echo " ";
                                
                                echo " ".$value['name'];?>
                                </option>  '+
                    '<?php  }} ?>'+
                  '</select>'+
                  '<span id="ammount{id}" style="color:red"></span>'+
                '</td>'+
                '<td>'+
               ' <textarea name="rec[{id}][naration]" data-id="{id}" maxlength="200"  class="form-control" required placeholder="Enter Narration.........."></textarea>'+
                           '</td>'+
             '<td>'+
        '<input name="rec[{id}][cr_amount]" class="cr-item cr-item{id} form-control num " style="text-align:right;" autocomplete="false" required="true" type="number" min="0" data-id="{id}">'+
    '</td>'+
    
                '<td>'+
                  '<button class="btn btn-primary removeRow" data-id="{id}">'+
                    '<i class="fa fa-remove" type="button"></i>'+
                  '</button>'+
                '</td>'+
              '</tr>';
      String.prototype.replaceAll = function (find, replace) {
          var str = this;
          return str.replace(new RegExp(find.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'), 'g'), replace);
      };
              jq(document).on("click",".addRow",function(e){
               var jq = jQuery.noConflict();   
             //var wrapper_psl=jq("#upper_tbody > tr").length-1;
             var wrapper=jq("#upper_tbody > tr").length;
             //var wrapper=1;
           
             jq('.row'+wrapper).after(row.replaceAll("{id}",++rows));
             
          jq(".select2_single").select2({
            placeholder: "Select Head Of Account",
            allowClear: true
         });
          jq(".select2_naration").select2({
            placeholder: "Select Type",
            allowClear: true
         });
         e.preventDefault();
        });
        jq(document).on("click",".removeRow",function(e){
          var length = jq("#upper_tbody").children().length;
          var id = jq(this).attr("data-id");
          if(length!=1){
            
            jq(".row"+id).remove();
           
            }
          e.preventDefault();
        });

jq(document).on('change','.level5',function(){
          var id = jq('option:selected', this).attr('data-pid');
           var val = jq(this).attr("data-id");

        });
         jq(document).on('change','#bank',function(){
           var id = jq('option:selected', this).attr('data-balance');
           if(id!=""){
           jq('#balance').val(id);}else{
             jq('#balance').val(0);
           }
        });



// Helper Functions



function RedColor()
{
    jq("#EntryDrValue").addClass("bg-danger");
    jq("#EntryCrValue").addClass("bg-danger");
}

function GreenColor()
{
    jq("#EntryDrValue").addClass("bg-success");
    jq("#EntryCrValue").addClass("bg-success");
}

function NoColor()
{
    jq("#EntryDrValue").removeClass("bg-success").removeClass("bg-danger");
    jq("#EntryCrValue").removeClass("bg-success").removeClass("bg-danger");
}
        
        </script>
        
         <script>
    var jq = jQuery.noConflict(); 
    jq(function(){
        jq(document).on("keyup","#searchv",function(){
            var val = jq(this).val();
            jq(".searchArea").addClass("show");
            jq.get("<?php echo base_url(); ?>account/data_std/"+val,{},function(ret){
            var d=jQuery.parseJSON(ret);
             var retu = "";
              jq.each(d, function(i,v){
               retu += "<li id='"+v.id+"'>"+v.name+"</li>";
             });
                jq(".searchArea").html(retu);
            
            });
            setTimeout(hideSearch,400000);
        });
        jq(document).on("click",".searchArea > li",function(){
            var val = $(this).html();
            var id=$(this).attr("id");
            
            $("#searchv").val(val);
            $('#searchid').val(id);
            hideSearch();

        });
    });
    function hideSearch(){
        $(".searchArea").removeClass("show");
          }

  </script>
  <script>
  var jq = jQuery.noConflict(); 
        jq(document).ready(function(){
              jq(document).on("change","#cstm_bnk",function(){
                  var value = jq(this).val();
                var value = jq(this).val();
                 jq("#shw_blnc_dv").show();
                jq.get("<?php echo base_url(); ?>account/ftch_bnk_blnc/"+value,{},function(d){
                    if(d ==-1)
                   { 
                       alert("Please Enter Opening Balance Of This Head...");
                       jq("#EntrySubmit").prop("disabled",true);
                      
                   }else
                   {
                         jq("#EntrySubmit").prop("disabled",false);
                       jq("#bnk_blnc").html("Balance:<b>"+ d+"</b>");
                   }
                });
            });
        });
        </script>
 <script>
 var jq = jQuery.noConflict(); 
      jq(document).on('change','#hl5',function(){
           var val = jq(this).val();
             jq("#lv5bl").show();
                jq.get("<?php echo base_url(); ?>account/ftch_bnk_blnc/"+val,{},function(d){
                   if(d!="")
                   {
                        jq("#EntrySubmit").prop("disabled",false);
                       jq("#lv5bl").html("Balance/=<b>"+ d+"</b>");
                   }else
                   {
                         jq("#lv5bl").html("Balance/=<b>"+ 0+"</b>");
                       alert("Please Enter Opening Balance Of This Head...");
                       jq("#EntrySubmit").prop("disabled",true);
                   }
                }); 

        });
  </script>
     <script>
function dr_up(cid,event){
 var jq = jQuery.noConflict(); 
var dr='#hl5'+cid;
var amt='#ammount'+cid;
var val = jq(dr).val();

 jq.get("<?php echo base_url(); ?>account/ftch_mst_parent/"+val,{},function(res){
                   if(res ==0)
                   { 
                jq.get("<?php echo base_url(); ?>account/ftch_bnk_blnc/"+val,{},function(d){
                   if(d ==-1)
                   { 
                       alert("Please Enter Opening Balance Of This Head...");
                       jq("#EntrySubmit").prop("disabled",true);
                      
                   }else
                   {
                         jq("#EntrySubmit").prop("disabled",false);
                     //  $(amt).html("Balance:<b>"+ d+"</b>");
                   }
                });
                       
                   }else
                   {
              //  $.get("<?php //echo base_url(); ?>account/ftch_bnk_blnc2/"+val,{},function(dt){
               //        $(amt).html("Balance:<b>"+ dt+"</b>");
                        
               // });
                 }
 });
}
 </script>
 <footer>
          <div class="pull-right">
            Prudmac
          </div>
          <div class="clearfix"></div>
        </footer>
        <div id='ajaxload' style='position:fixed;top:0;left:0;bottom:0; width:100%;height:100%;z-index:1000;background:rgba(2,132,130,0.5);display:none;'>
            <i class='fa fa-spinner fa-spin fa-4x' style='position: relative;top: 50%;left: 50%;margin-top: -50px;margin-left: -50px;'></i>
        </div>
        <!-- /footer content -->
      </div>
    </div>

    <!-- jQuery -->
    
    <!-- Custom JS -->
    <script src="<?php echo base_url(); ?>assets/js/main2.js"></script>
    <!-- Bootstrap -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap/dist/js/bootstrap.min.js"></script>
    <!-- FastClick -->
    <script src="<?php echo base_url(); ?>assets/vendors/fastclick/lib/fastclick.js"></script>
    <!-- NProgress -->
    <script src="<?php echo base_url(); ?>assets/vendors/nprogress/nprogress.js"></script>
    <!-- Chart.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/Chart.js/dist/Chart.min.js"></script>
    <!-- gauge.js -->
    <script src="<?php echo base_url(); ?>assets/vendors/gauge.js/dist/gauge.min.js"></script>
    <!-- bootstrap-progressbar -->
    <script src="<?php echo base_url(); ?>assets/vendors/bootstrap-progressbar/bootstrap-progressbar.min.js"></script>
    <!-- iCheck -->
    <script src="<?php echo base_url(); ?>assets/vendors/iCheck/icheck.min.js"></script>
    <!-- Skycons -->
    <script src="<?php echo base_url(); ?>assets/vendors/skycons/skycons.js"></script>
    <!-- Flot -->
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.pie.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.time.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.stack.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/Flot/jquery.flot.resize.js"></script>
    <!-- Flot plugins -->
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.orderBars.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/date.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/jquery.flot.spline.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/flot/curvedLines.js"></script>
    <!-- jVectorMap -->
    <script src="<?php echo base_url(); ?>assets/js/maps/jquery-jvectormap-2.0.3.min.js"></script>
    <!-- bootstrap-daterangepicker -->
    <script src="<?php echo base_url(); ?>assets/js/moment/moment.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/js/datepicker/daterangepicker.js"></script>

    <!-- Custom Theme Scripts -->
    <script src="<?php echo base_url(); ?>assets/build/js/custom.min2.js"></script>
          <script src="<?php echo base_url(); ?>assets/js/bootstrap-datepicker.js"></script>
          
        <!-- Datatables -->
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net/js/jquery.dataTables.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/dataTables.buttons.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons-bs/js/buttons.bootstrap.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/buttons.flash.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/buttons.html5.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons/js/buttons.print.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-fixedheader/js/dataTables.fixedHeader.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-keytable/js/dataTables.keyTable.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-responsive/js/dataTables.responsive.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-responsive-bs/js/responsive.bootstrap.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/datatables.net-scroller/js/datatables.scroller.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/jszip/dist/jszip.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/pdfmake/build/pdfmake.min.js"></script>
    <script src="<?php echo base_url(); ?>assets/vendors/pdfmake/build/vfs_fonts.js"></script>


    <!-- Datatables -->
    
<script>
var jq = jQuery.noConflict();
 jq(document).ready(function() {
    jq('#datatable').DataTable();
} );
jq(document).ajaxStart(function() {
          jq('#ajaxload').show();
      });
      jq(document).ajaxStop(function() {
           jq('#ajaxload').hide();
      });
 jq(function () {
      var d = new Date();
     var st_dt=d.setDate(d.getDate() - 2);
    jq(".date").datepicker({
    format: 'dd/mm/yyyy',
    startDate :new Date(st_dt),
    endDate : new Date()
        
    });
    date(".now");
    jq(".date").focusout(function () {
        if (jq (this).val().trim() == "") {
            date(".date");
        }
    });

    function date(selector) {
        var dNow = new Date();
        var localdate = dNow.getFullYear()+'/' +(dNow.getMonth() + 1)+'/' + dNow.getDate();
       
    }

});
</script>
    <script>
    var jq = jQuery.noConflict();
    jq (".abc").on("keypress", function (event) {

            var englishAlphabetAndWhiteSpace = /[A-Za-z ]/g;


            var key = String.fromCharCode(event.which);


            if (event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39 || englishAlphabetAndWhiteSpace.test(key)) {
                return true;
            }
            return false;
        });

         
        jq (".abc1").on("keypress", function (event) {

            var englishAlphabetAndWhiteSpace = /[A-Za-z0-9|-]/g;


            var key = String.fromCharCode(event.which);


            if (event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 32 || event.keyCode == 37 || event.keyCode == 39 || englishAlphabetAndWhiteSpace.test(key)) {
                return true;
            }


            return false;
        });
        
        jq (document).bind("contextmenu", function (e) {
            e.preventDefault();
        });
         //form only numbers
        jq (".num").on("keypress", function (e) {
          
            var evt = (e) ? e : window.event;
            var charCode = (evt.keyCode) ? evt.keyCode : evt.which;
            if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                return false;
            }
            return true;
        });
    </script>
<script>
var jq = jQuery.noConflict();
jq(function() {
    jq( "#date" ).datepicker({ minDate: 0});
  });
</script>
  </body>
</html> 
        