  </section>
    <!-- /.content -->
  </div>
  <!-- /.content-wrapper -->

<footer class="main-footer">
    <strong><?= !empty(lang('copyright'))?lang('copyright'):"Copyright" ;?> &copy; <?php echo date('Y'); ?>
    <strong class="pull-right"><?= !empty(lang('version'))?lang('version'):"Version" ;?> <?= get_setting()['version'];?></strong>
  </footer>

  <!-- /.control-sidebar -->
  <!-- Add the sidebar's background. This div must be placed
       immediately after the control sidebar -->
  <div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->
<a href="<?php echo base_url() ?>" id="base_url"></a>
<a href="<?= !empty(lang('yes'))?lang('yes'):"Yes";?>" id="yes"></a>
<a href="<?= !empty(lang('no'))?lang('no'):"No";?>" id="no"></a>
<a href="<?= !empty(lang('cancel'))?lang('cancel'):"cancel";?>" id="cancel"></a>
<a href="<?= !empty(lang('are_you_sure'))?lang('are_you_sure'):"are you sure";?>" id="are_you_sure"></a>
<a href="<?= !empty(lang('success'))?lang('success'):"Success";?>" id="success"></a>
<a href="<?= !empty(lang('error'))?lang('error'):"error";?>" id="error"></a>
<a href="<?= !empty(lang('success_text'))?lang('success_text'):'Save Change Successful';?>" id="success_msg"></a>
<a href="<?= !empty(lang('error_text'))?lang('error_text'):'Somethings Were Wrong!';?>" id="error_msg"></a>
<a href="<?= lang('label_title'); ?>" id="label"></a>
<a href="<?= lang('value_url'); ?>" id="value"></a>

<?php if(isset($page) && $page=='Login'):?>
    <a href="<?= $this->security->csrf_token(0);?>" id="csrf_data"></a>
  <?php else: ?>
    <a href="<?= $this->security->csrf_token();?>" id="csrf_data"></a>
<?php endif ?>

<a href="<?php echo $this->security->get_csrf_hash(); ?>" id="csrf_value"></a>

<!-- jQuery 3 -->
<script src="<?php echo base_url()?>assets/admin/bower_components/jquery/dist/jquery.min.js"></script>
<!-- jQuery UI 1.11.4 -->
<script src="<?php echo base_url()?>assets/admin/bower_components/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
  $.widget.bridge('uibutton', $.ui.button);
</script>
<!-- Bootstrap 3.3.7 -->

<script src="<?php echo base_url()?>assets/admin/bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
<!-- Morris.js charts -->

<!-- select2 -->
<script src="<?php echo base_url()?>assets/admin/bower_components/select2/dist/js/select2.full.min.js"></script>

<!-- jQuery Knob Chart -->
<script src="<?php echo base_url()?>assets/admin/bower_components/jquery-knob/dist/jquery.knob.min.js"></script>

<!-- jQuery Knob Chart -->
<script src="<?php echo base_url()?>assets/admin/plugins/chart/jquery.flot.min.js"></script>
<script src="<?php echo base_url()?>assets/admin/plugins/chart/jquery.flot.categories.min.js"></script>


<!-- daterangepicker -->
<script src="<?php echo base_url()?>assets/admin/bower_components/moment/min/moment.min.js"></script>

<script src="<?php echo base_url()?>assets/admin/bower_components/bootstrap-daterangepicker/daterangepicker.js"></script>

<!-- bootstrap color picker -->
<script src="<?php echo base_url()?>assets/admin/bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>

<!-- bootstrap color picker -->
<script src="<?php echo base_url()?>assets/admin/bower_components/bootstrap-colorpicker/dist/js/bootstrap-colorpicker.min.js"></script>

<!-- datetime picker.js -->
<script src="<?php echo base_url()?>assets/admin/datetime/datetimepicker.js"></script>


<!-- time picker.js -->
<script src="<?php echo base_url()?>assets/admin/bower_components/bootstrap-timepicker/js/bootstrap-timepicker.js"></script>

<!-- datepicker -->
<script src="<?php echo base_url()?>assets/admin/bower_components/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js" charset="UTF-8"></script>
<!-- DataTables -->
<script src="<?php echo base_url()?>assets/admin/bower_components/datatables.net/js/jquery.dataTables.min.js"></script>

<script src="<?php echo base_url()?>assets/admin/bower_components/datatables.net-bs/js/dataTables.bootstrap.min.js"></script>


<!-- Slimscroll -->
<script src="<?php echo base_url()?>assets/admin/bower_components/jquery-slimscroll/jquery.slimscroll.min.js"></script>

<!-- iCheck -->
<script src="<?php echo base_url()?>assets/admin/plugins/iCheck/icheck.min.js"></script>
<script src="<?php echo base_url()?>assets/admin/plugins/sweetalert/sweet-alert.js"></script>

<!-- FastClick -->
<script src="<?php echo base_url()?>assets/admin/bower_components/fastclick/lib/fastclick.js"></script>

<!-- Image Uploader -->
<script src="<?php echo base_url()?>assets/admin/uploader/uploadify.js"></script>

<!-- chosen -->
<script src="<?= base_url();?>assets/plugins/jstars.js" ></script>
<script src="<?php echo base_url()?>assets/admin/plugins/chosen/chosen.jquery.js"></script>



<!-- tinymce -->
    <script src="<?php echo base_url()?>assets/admin/plugins/summernote/summernote-bs4.js"></script>
    <script type="text/javascript" src="<?php echo base_url()?>assets/admin/plugins/formValidation.js"></script>
<!-- tinymce -->


<!-- notify -->
<script src="<?php echo base_url()?>assets/admin/plugins/iconpicker/bootstrap-iconpicker.bundle.min.js"></script>

<script src="<?php echo base_url()?>assets/admin/plugins/notify/notify.js"></script>
<!-- notify --> 

<script src="<?php echo base_url()?>assets/admin/dist/js/adminlte.min.js"></script>
<!-- AdminLTE dashboard demo (This is only for demo purposes) -->
<script src="<?php echo base_url()?>assets/admin/dist/js/pages/dashboard.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="<?php echo base_url()?>assets/admin/bootstrapToggle.js"></script>
<script src="<?php echo base_url()?>assets/admin/dist/js/demo.js"></script>
<script src="<?php echo base_url()?>assets/admin/main.js?v=<?= get_setting()['version'];?>&time=<?= time();?>"></script>



<script type="text/javascript">
    $(function () {
        $('.datetimepicker').datetimepicker({
           format:'YYYY-MM-DD HH:mm:ss',
        });
    });

  $(function(){
      function load_image(input) {
        if (input.files && input.files[0]) {
          var reader = new FileReader();
          reader.onload = function(e) {
              $('#preview_load_image').attr('src', e.target.result);
              $('.preview_load_image').show();
          }
          reader.readAsDataURL(input.files[0]);
        }
      }

      $(document).on('change','#load_image',function($){
        load_image(this);
      });
  });
</script>

<?php if(isset($page_title) && $page_title=="Dashboard"): ?>
<script>
    /*
     * BAR CHART
     * ---------
     */

    var bar_data = {
      data: [["Jan", <?= income('01',1);?>], ["Feb", <?= income('02',1);?>], ["Mar", <?= income('03',1);?>], ["April", <?= income('04',1);?>], ["May", <?= income('05',1);?>], ["June", <?= income('06',1);?>],["July", <?= income('07',1);?>],["Aug",<?= income('08',1);?>]
      ,["Sep",<?= income('09',1);?>],["Oct",<?= income('10',1);?>],["Nov", <?= income('11',1);?>],["Dec",<?= income('12',1);?>]],
      color: "#3c8dbc"
    };
    $.plot("#bar-chart_1", [bar_data], {
      grid: {
        borderWidth: 1,
        borderColor: "#f3f3f3",
        tickColor: "#f3f3f3"
      },
      series: {
        bars: {
          show: true,
          barWidth: 0.5,
          align: "center"
        }
      },
      xaxis: {
        mode: "categories",
        tickLength: 0
      }
    });
</script>

<script>
    /*
     * BAR CHART
     * ---------
     */

    var bar_data = {
      data: [["Jan", <?= income('01',0);?>], ["Feb", <?= income('02',0);?>], ["Mar", <?= income('03',0);?>], ["April", <?= income('04',0);?>], ["May", <?= income('05',0);?>], ["June", <?= income('06',0);?>],["July", <?= income('07',0);?>],["Aug",<?= income('08',0);?>]
      ,["Sep",<?= income('09',0);?>],["Oct",<?= income('10',0);?>],["Nov", <?= income('11',0);?>],["Dec",<?= income('12',0);?>]],
      color: "#3c8dbc"
    };
    $.plot("#bar-chart", [bar_data], {
      grid: {
        borderWidth: 1,
        borderColor: "#f3f3f3",
        tickColor: "#f3f3f3"
      },
      series: {
        bars: {
          show: true,
          barWidth: 0.5,
          align: "center"
        }
      },
      xaxis: {
        mode: "categories",
        tickLength: 0
      }
    });
</script>
<?php endif; ?>

<?php $check = check_update(); ?> 
<?php if($check["check"]==1): ?>
  <?php if(isset($page_title) && $page_title=="Dashboard"): ?>
      <script>
         $(document).ready(function(){
          $("#updateModal").modal('show');
        });
      </script>
  <?php endif; ?>
<?php endif; ?>

<a href="javascript;" class="sure-msg" data-msg="<?=  !empty(lang('are_you_sure'))?lang('are_you_sure'):'Are you sure?';?>"></a>

  <?php if ($this->session->flashdata('success')) { ?>
      <span id="alert_title" data-msg="<?= !empty(lang('success'))?lang('success'):"Success";?>!"></span>
      <span id="alert" data-msg="<?php echo $this->session->flashdata('success'); ?>"></span>
      <script>
        $.notify({
            icon: 'fa fa-check',
            title: $('#alert_title').data('msg'),
            message:$('#alert').data('msg')
          },{
            type: 'success'
          },{
              animate: {
                enter: 'animated fadeInRight',
                exit: 'animated fadeOutRight'
              }
          });
      </script>
    <?php } ?>
     <?php if ($this->session->flashdata('error')) { ?>
      <span id="alert_title" data-msg="<?= !empty(lang('error'))?lang('error'):"Error";?>!!"></span>
       <span id="alert" data-msg="<?php echo $this->session->flashdata('error'); ?>"></span>
          <script>
              $.notify({
                icon: 'fa fa-close',
                  title: $('#alert_title').data('msg'),
                  message:$('#alert').data('msg')
                },{
                  type: 'danger'
              },{
                animate: {
                  enter: 'animated fadeInRight',
                  exit: 'animated fadeOutRight'
                }
              });
      </script>
    <?php } ?>


</body>
</html>
