        <!-- page content -->
        <div class="right_col" role="main">
          <div class="">
            <div class="clearfix"></div>
            <div class="row">

              <div class="col-md-12 col-sm-12 col-xs-12" id="def">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>Add News</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">
                      
<?php if ($this->session->flashdata('succes_msg')): ?>
<div class="alert alert-success">
<?php echo $this->session->flashdata('succes_msg'); ?>
</div>
<?php endif ?>

<?php if ($this->session->flashdata('error_msg')): ?>
<div class="alert alert-danger">
<?php echo $this->session->flashdata('error_msg'); ?>
</div>
<?php endif ?>

                    <form class="form-horizontal form-label-left" action="<?php echo $base_url; ?>web/save_news" method="post" enctype="multipart/form-data">

                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">Title<span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="text" class="form-control" name="title" required>
                        </div>
                      </div>
                      
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">Description<span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <textarea class="form-control" name="description" required></textarea>
                        </div>
                      </div>
                      
                      <div class="item form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="title">Date<span class="text-danger">*</span>
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input type="date" class="form-control" name="date" required>
                        </div>
                      </div>
              
                      <div class="form-group">
                        <div class="col-md-6 col-md-offset-3">
                          <button id="send" type="submit" value="send" class="btn btn-success pull-right">Save</button>
                        </div>
                      </div>
                    </form>
                  </div>
                </div>
              </div>

            </div>


            <div class="row">
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>News</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 class="table table-bordered table-hover"  id="datatable">
                        <thead>
                            <tr>
                              <th>#</th>
                              <th>Title</th>
                              <th>description</th>
                              <th>Date</th>
                              <th>Actions</th>
                            </tr>
                          </thead>

                          <tbody class="center">
                          <?php $i=1; 
                          if(!empty($news))
                          {
                          foreach ($news as $key => $value){ ?>
                            <tr>
                              <td><?php echo $i++; ?></td>
                             
                              <td><?php echo $value['title'];?></td>
                              <td><?php echo $value['description'];?></td>
                              <td><?php echo date('d-m-Y',strtotime($value['date']));?></td>
                             
                              <td>
                                  <?php
                                  if($edit_delete['edit']) {?>
                                    <a href="<?php echo base_url();?>web/edit_news/<?php echo $value['id'];?>" ><i class="fa fa-edit"></i></a>  
                               <?php }  ?>
                               <?php
                                  if($edit_delete['delete']) {?>
                                    <a href="<?php echo base_url();?>web/delete_news/<?php echo $value['id'];?>" ><i class="fa fa-trash"></i></a>  
                               <?php }  ?>
                              </td>
                            </tr>
                            <?php }} ?>
                          </tbody>
                    </table>                    
                  </div>
                </div>
              </div>

            </div>
          </div>
        </div>
        <!-- /page content -->

        <!-- footer content -->
        <footer>
          <div class="pull-right">
            Edusolution
          </div>
          <div class="clearfix"></div>
        </footer>
        <!-- /footer content -->
      </div>
    </div>

    <!-- jQuery -->
    <script src="<?php echo base_url(); ?>assets/vendors/jquery/dist/jquery.min.js"></script>
    <!-- Custom JS -->
    <script src="<?php echo base_url(); ?>assets/js/main.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.min.js"></script>
    
    <!-- jQuery Tags Input -->
    <script src="<?php echo base_url(); ?>assets/vendors/jquery.tagsinput/src/jquery.tagsinput.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/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/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>
    <!-- Select2 -->
    <script src="<?php echo base_url(); ?>assets/vendors/select2/dist/js/select2.min.js"></script>
<script  src="<?php echo base_url(); ?>assets/js/notify.js"></script>


    <script>
    <?php if($this->user_model->is_super()){ ?>
                      
    // $("#branch").select2();
   
       <?php } ?>
       
       
        $(document).ready(function() {
             
        var handleDataTableButtons = function() {
          if ($("#datatable").length) {
            $("#datatable").DataTable({
                dom: "lBfrtip",
              "bPaginate": true,
              "pageLength":35,
              "lengthMenu": [[35, 70, 100, -1], [35, 70, 100, "All"]],
               
             buttons: [
                {
                  extend: "copy",
                  className: "btn-sm",
                   exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3],
                       <?php }else{?>
                       columns: [0,1,2,],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                },
                {
                  extend: "csv",
                  className: "btn-sm",
                  exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3],
                       <?php }else{?>
                       columns: [0,1,2,],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                },
                {
                  extend: "excel",
                  className: "btn-sm",
                  exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3],
                       <?php }else{?>
                       columns: [0,1,2,],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                },
                {
                extend: 'pdf',
                className: "btn-sm",
                title: '',
                exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3],
                       <?php }else{?>
                       columns: [0,1,2,],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                
                },
                {
                    extend: "print",
                    className: "btn-sm",
                   exportOptions: {
                       <?php  if($this->user_model->is_super()){ ?>
                        columns: [0,1,2,3],
                       <?php }else{?>
                       columns: [0,1,2,],
                       <?php }?>
                        modifier: {
                            selected: true
                        }
                    }
                  
                },
              ],
              responsive: true
            });
          }
        };

        TableManageButtons = function() {
          "use strict";
          return {
            init: function() {
              handleDataTableButtons();
            }
          };
        }();

        TableManageButtons.init();
      });
      
       
       
           
</script>    
  <script>
window.setTimeout(function() {
$(".alert").fadeTo(500, 0).slideUp(500, function(){
    $(this).remove(); 
});
}, 3000);
        </script>


  </body>
</html>