    <link href="<?php echo base_url(); ?>assets/vendors/datatables.net-bs/css/dataTables.bootstrap.min.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/vendors/datatables.net-buttons-bs/css/buttons.bootstrap.min.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/vendors/datatables.net-fixedheader-bs/css/fixedHeader.bootstrap.min.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/vendors/datatables.net-responsive-bs/css/responsive.bootstrap.min.css" rel="stylesheet">
    <link href="<?php echo base_url(); ?>assets/vendors/datatables.net-scroller-bs/css/scroller.bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="<?php echo base_url()?>assets/css/bootstrapValidator.css"/>
    

        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="page-title">
                <div class="title_left">
                    <h3></h3>
                </div>
            </div>
            <div class="clearfix"></div>

            <div class="row">
              <div class="col-md-6 col-sm-6 col-xs-6">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Add Program</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 class="form-horizontal form-label-left" id="add_defn" action="<?php echo base_url(); ?>account/save_program" method="post">
<input type="hidden" name="id" <?php if($edit!=null){echo "value='".$edit['id']."'";}else{echo "value='0'";} ?>>
                    


                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Name <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                        <input name="name" id="name" class="form-control" <?php if($edit!=null){echo "value='".$edit['name']."'";} ?> maxlength="20"  title="Only alphabatic character" required>                    
                        </div>
                      </div>    
                      
                      
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                          <button id="send" type="submit" class="btn btn-success pull-right">Save</button>
                        </div>
                      </div>
                    </form>
                  </div>
                </div>
             
              </div>
                <div class="col-md-6 col-sm-6 col-xs-6">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>View Program</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">
                    <table id="datatable1" class="table table-striped table-bordered " style="width:100%">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th style="width:100px;">Name</th>
                          <th>Actions</th>
                        </tr>
                      </thead>


                      <tbody class="center">

                        <?php $i=1; foreach ($program as $key => $value) { ?>
                        <tr>
                          <td style="width:25%"><?php echo $i++; ?></td>
                          <td style="width:25%"><?php echo $value['name']; ?></td>
                          
                          <td style="width:25%">
                            <a href="<?php echo $base_url; ?>account/index/?abc=<?php echo urlencode($this->encrypt->encode($value['id']));?>"><i class="fa fa-edit"></i></a> 
                            <a href="<?php echo $base_url; ?>account/delete_program/?abc=<?php echo urlencode($this->encrypt->encode($value['id'])); ?>"><i class="fa fa-trash"></i></a>
                          </td>
                        </tr>
                        <?php } ?>
                      

                      </tbody>

                    </table>
                  
                  </div>
                </div>
              </div>
              </div>
            <div class='row'>
 <div class="col-md-6 col-sm-6 col-xs-6">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Assign Program</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 class="form-horizontal form-label-left" id="asi_pro" action="<?php echo base_url(); ?>account/save_assining" method="post">
                   <input type="hidden" name="id" <?php if($edit1!=null){echo "value='".$edit1['id']."'";}else{echo "value='0'";} ?>>
                   <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">Branch <span class="required">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select id="branch" class="form-control col-md-7 col-xs-12" name="branch" required="required">
                            

                            <option value=''>Select Branch</option>
                    <?php       
                              foreach ($branch as $value) {?>
                    <option value="<?php echo $value->id; ?>" <?php if($edit1['branch']==$value->id){echo "selected";} ?>><?php echo $value->name?></option>

                  <?php } ?>
                          </select>
                        </div>
                      </div>
                       <div class="item form-group">
                        <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-6 col-sm-6 col-xs-12">
                          <select id="prog" class="form-control col-md-7 col-xs-12" name="prog" required="required">
                            

                            <option value=''>Select Program</option>
                    <?php       
                              foreach ($program as $value) {?>
                    <option value="<?php echo $value['id']; ?>" <?php if($edit1['programe_id']==$value['id']){echo "selected";} ?>><?php echo $value['name']?></option>

                  <?php } ?>
                          </select>
                          
                        </div>
                        <span id="error" class="text-danger"></span>
                      </div>

                  
                   <input type="hidden" id="pro" name="pro"  value="0"> 
                   <input type="hidden" id="main" name="main_head"  value="0"> 
                   <input type="hidden" id="l2" name="level2"  value="0">
                   <input type="hidden" id="l3" name="level3"  value="0">  
                   <input type="hidden" id="l4" name="level4"  value="0">  
                   <input type="hidden" id="l5" name="level5"  value="0">  
                   <input type="hidden" id="bank" name="bank"  value="0">  
                   <input type="hidden" name="type"  value="programe">   
                   <input type="hidden" name="link"  value="account/index">  
                      
                      
                      <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                          <button id="send" type="submit" class="btn btn-success pull-right send">Assign</button>
                        </div>
                      </div>
                    </form> 
                  
                  </div>
                </div>
              </div>
               <div class="col-md-6 col-sm-6 col-xs-6">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>View Assigned Program</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">
                    <table id="datatable2" class="table table-striped table-bordered" style="width:100%">
                      <thead>
                        <tr>
                          <th>#</th>
                          <th style="width:100px;">Branch Name</th>
                          <th style="width:100px;">Name</th>
                          <th>Actions</th>
                        </tr>
                      </thead>
                        <tbody class="center" id="center">
                      <?php $i=1; foreach ($assignView as $key => $value) { ?>
                        <tr>
                        <td><?php echo $i++; ?></td>
                        <td><?php echo $value['branchname']; ?></td>
                        <td><?php echo $value['name']; ?></td>
                        <td>
                        <a href="<?php echo base_url(); ?>account/index/?abc=<?php echo urlencode($this->encrypt->encode($value['id']));?>"><i class='fa fa-edit'></i></a>
                        <a href="<?php echo base_url(); ?>account/delete_assign/programe/?abc=<?php echo urlencode($this->encrypt->encode($value['id']));?>"><i class='fa fa-trash'></i></a>
                        
                        </td>
                      
                        </tr>
                      <?php } ?>
                      </tbody>

                    </table>
                  
                  </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/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>
    <script src="<?php echo base_url(); ?>assets/js/bootstrapValidator.js"></script>
        <script>
        var jq=jQuery.noConflict();
        jq(document).ready(function() {
        
        jq('#datatable1').DataTable(
            {
            "bPaginate":true,
            "bFilter":true,
            "bInfo":false,
            "ordering":false,
            "scrollX":true,
            dom: 'Bfrtip',
            buttons: [
            'csv', 'pdf',{extend:'excel',text:'Excel',exportOptions:{columns:[0,1,2]}}            ]
            }
        );

        jq('#datatable2').DataTable(
            {
            "bPaginate":true,
            "bFilter":true,
            "bInfo":false,
            "ordering":false,
            "scrollX":true,
            dom: 'Bfrtip',
            buttons: [
            'csv', 'pdf',{extend:'excel',text:'Excel',exportOptions:{columns:[0,1,2]}}            ]
            }
        );
       
        });
        
        </script>
      <script>
      var jq=jQuery.noConflict();
      jq('#branch').change(function(){
        var id=jq(this).val();
         jq( "tbody#center" ).empty();
       jq.ajax({
                    url: "<?php echo base_url(); ?>Load_account/pro_again_branch/"+id,
                    data: {},
                      success: function( d ) {
                       
                          jq( "tbody#center" ).html(d);
  }
});
      });
      jq('#prog').change(function(){
        var bid=jq('#branch').val();
        var prog=jq('#prog').val();
        var proj=jq('#pro').val();
        var main=jq('#main').val();
        var l2=jq('#l2').val();
        var l3=jq('#l3').val();
        var l4=jq('#l4').val();
        var l5=jq('#l5').val();
        var bank=jq('#bank').val();
        var val={'branch':bid,'prog':prog,'proj':proj,'main':main,'l2':l2,'l3':l3,'l4':l4,'l5':l5,'bank':bank};
         
       jq.ajax({
                    url: "<?php echo base_url(); ?>Load_account/check_assigning/",
                    type:'post',
                    data:val,
                    success: function( d ) {
                     
                       if(d==1){
                         jq('#error').html('Already Assigned');
                         jq('.send').prop("disabled",true);
                       }else{
                         jq('#error').html(' ');
                         jq('.send').prop("disabled",false);
                       }
                          
  }
});
      });
      </script>
      <script type="text/javascript">
      var jq=jQuery.noConflict();
    jq(document).ready(function() {
        jq('#add_defn')
            .on('init.form.bv', function(e, data) {
                //console.log(data);
            })
            .bootstrapValidator({
                message: 'This value is not valid',
               feedbackIcons: {
              valid: 'glyphicon glyphicon-ok',
              invalid: 'glyphicon glyphicon-remove',
              validating: 'glyphicon glyphicon-refresh'
                   },
                fields: {
                    name: {
                        trigger:'blur',
                        validators: {
                            notEmpty: {
                                message: 'The name is required'
                            }
                        }
                    },
                    }
            });
    });
    

</script>
<script type="text/javascript">
      var jq=jQuery.noConflict();
    jq(document).ready(function() {
        jq('#asi_pro')
            .on('init.form.bv', function(e, data) {
                //console.log(data);
            })
            .bootstrapValidator({
                message: 'This value is not valid',
               feedbackIcons: {
              valid: 'glyphicon glyphicon-ok',
              invalid: 'glyphicon glyphicon-remove',
              validating: 'glyphicon glyphicon-refresh'
                   },
                fields: {
                    branch: {
                        trigger:'blur',
                        validators: {
                            notEmpty: {
                                message: 'The branch is required'
                            }
                        }
                    },
                    
                   prog: {
                        trigger:'blur',
                        validators: {
                            notEmpty: {
                                message: 'The Program is required'
                            }
                        }
                    },
                    }
            });
    });
    

</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>
             <!-- 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>
    <!-- Jquery UI-daterangepicker -->
    <script src="<?php echo base_url(); ?>assets/vendors/datepicker/jquery-ui.min.js"></script>
<script>
var jq=jQuery.noConflict();
 jq( function() {
    jq( ".datepicker" ).datepicker({ dateFormat: 'd-m-yy' }).val();
  } );
</script>
<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 () {
    jq(".date").datepicker();
    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('.abc').on("paste", function (e) {
            e.preventDefault();
        });
        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('.abc1').on("paste", function (e) {
            e.preventDefault();
        });
        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>
  </body>
</html>
      