<?php

$status_login = $this->session->userdata("session_status");

if(empty($status_login)){

    header("location:".base_url("login.aspx"));

}

if ($this->session->userdata("sebagai") == "1" || $this->session->userdata("sebagai") == "4") {

  $page = "dashboard_user";

}else{

  $page = "dashboard_admin";

}

?>

<!DOCTYPE html>

<html lang="en">



<head> 

<link rel='icon' type='img/png' href='gpib1.png'>

  <meta charset="utf-8">

  <meta http-equiv="X-UA-Compatible" content="IE=edge">

  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

  <meta name="description" content="">

  <meta name="author" content="">



  <title>Cloud PKA GPIB CINERE</title>



  <!-- Custom fonts for this template-->

  <script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>

  <link href="<?=base_url('assets/')?>vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">

  <!-- <link href="<?=base_url('assets/')?>vendor/.min.css" rel="stylesheet" type="text/css"> -->

  <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

  <link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/css/select2.min.css" rel="stylesheet" />


  <link href="https://cdn.datatables.net/1.10.23/css/dataTables.bootstrap4.min.css" rel="stylesheet" type="text/css">

  <script src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.min.js"></script>

  <script src="https://cdn.datatables.net/1.10.23/js/dataTables.bootstrap4.min.js"></script> 



  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/css/bootstrap-datepicker.min.css" integrity="sha512-mSYUmp1HYZDFaVKK//63EcZq4iFWFjxSL+Z3T/aCt4IO9Cejm03q3NKKYN6pFQzY0SBOr8h+eCIAZHPXcpZaNw==" crossorigin="anonymous" />



  <!-- include summernote css/js -->

  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote-bs4.min.css" integrity="sha512-pDpLmYKym2pnF0DNYDKxRnOk1wkM9fISpSOjt8kWFKQeDmBTjSnBZhTd41tXwh8+bRMoSaFsRnznZUiH9i3pxA==" crossorigin="anonymous" />

  <script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.8.18/summernote.min.js" integrity="sha512-kZv5Zq4Cj/9aTpjyYFrt7CmyTUlvBday8NGjD9MxJyOY/f2UfRYluKsFzek26XWQaiAp7SZ0ekE7ooL9IYMM2A==" crossorigin="anonymous"></script>



  <!-- <script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js" referrerpolicy="origin"></script> -->

<!-- and it's easy to individually load additional languages -->

<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/languages/go.min.js"></script> -->



  <!-- Custom styles for this template-->

  <link href="<?=base_url('assets/')?>css/sb-admin-2.min.css" rel="stylesheet">

</head>



<body id="page-top">

  <!-- Page Wrapper -->

  <div id="wrapper">

    <?php

    $this->load->view('main/main_sidebar');

    ?>

    <!-- Content Wrapper -->

    <div id="content-wrapper" class="d-flex flex-column">



      <!-- Main Content -->

      <div id="content">



        <?php

        $this->load->view('main/main_header');

        ?>



        <!-- Begin Page Content -->

        <div class="container-fluid" id="content-contens"></div>

        <div id="content-popup"></div>

        <!-- /.container-fluid -->



        <!-- loading-->

        <div id="loading" class="modal" tabindex="-1" role="dialog">

          <div class="modal-dialog" role="document">

            <div class="modal-content">

              <div class="modal-body">

                <img src="<?=base_url('assets/img/gpib1.png')?>" class="img-fluid" alt="Responsive image">

                <center><h2><i class="fa fa-spin fa-spinner"></i> Loading...</h2></center>

              </div>

            </div>

          </div>

        </div>

        <!--End loading-->

      </div>

      <!-- End of Main Content -->



      <!-- Footer -->

        <footer class="sticky-footer bg-white">

          <div class="container my-auto">

            <div class="copyright text-center my-auto">

              <hr color='black'>

              <span><h7><b>Copyright<a target = '_blank' href="https://www.gpibcinere.org/"> ©GPIB CINERE</a> 2021-2022<br><br>Developer <a target = '_blank' href="https://www.instagram.com/maschris25/">@natal</a></b></h7></span>
              <br></br>
              <?php

function getClientIP() {



    if (isset($_SERVER)) {



        if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))

            return $_SERVER["HTTP_X_FORWARDED_FOR"];



        if (isset($_SERVER["HTTP_CLIENT_IP"]))

            return $_SERVER["HTTP_CLIENT_IP"];



        return $_SERVER["REMOTE_ADDR"];

    }



    if (getenv('HTTP_X_FORWARDED_FOR'))

        return getenv('HTTP_X_FORWARDED_FOR');



    if (getenv('HTTP_CLIENT_IP'))

        return getenv('HTTP_CLIENT_IP');



    return getenv('REMOTE_ADDR');

}

function get_client_browser() {

    $browser = '';

    if(strpos($_SERVER['HTTP_USER_AGENT'], 'Netscape'))

        $browser = 'Netscape';

    else if (strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox'))

        $browser = 'Firefox';

    else if (strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome'))

        $browser = 'Chrome';

    else if (strpos($_SERVER['HTTP_USER_AGENT'], 'Opera'))

        $browser = 'Opera';

    else if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))

        $browser = 'Internet Explorer';

    else

        $browser = 'Other';

    return $browser;

}



echo "<h7 align=\"center\"><b>Your IP Address : ".getClientIP()."
&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;&emsp;

Detect Your Browser : ".get_client_browser()."";

?>

              
             </span>

            </div>

          </div>

        </footer>

      <!-- End of Footer -->



    </div>

    <!-- End of Content Wrapper -->



  </div>

  <!-- End of Page Wrapper -->



  <!-- Scroll to Top Button-->

  <a class="scroll-to-top rounded" href="#page-top">

    <i class="fas fa-angle-up"></i>

  </a>



  <!-- Logout Modal-->

  <div class="modal fade" id="logoutModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">

    <div class="modal-dialog" role="document">

      <div class="modal-content">

        <div class="modal-header">

          <h5 class="modal-title" id="exampleModalLabel">Anda Yakin Mau Keluar ?</h5>

          <button class="close" type="button" data-dismiss="modal" aria-label="Close">

            <span aria-hidden="true">×</span>

          </button>

        </div>

        <div class="modal-body">Pilih "Logout" di bawah ini jika anda yakin untuk mengakhiri sesi.</div>

        <div class="modal-footer">

          <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>

          <a class="btn btn-primary" href="<?=base_url("log/logout")?>">Logout</a>

        </div>

      </div>

    </div>

  </div>



  

  <script src="<?=base_url('assets/')?>vendor/bootstrap/js/bootstrap.bundle.min.js"></script>



  <script src="<?=base_url('assets/')?>vendor/datatable/jquery.dataTable.min.js"></script>

  <script src="<?=base_url('assets/')?>vendor/datatable/dataTable.bootstrap4.min.js"></script>

  <!-- Core plugin JavaScript-->

  <script src="<?=base_url('assets/')?>vendor/jquery-easing/jquery.easing.min.js"></script>

  <!-- JavaScript -->

  <script src=" //cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/js/toastr.min.js"></script>

  <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/css/toastr.min.css"/>



  <script src="<?=base_url('assets/')?>vendor/wickedpicker/dist/wickedpicker.min.js"></script>

  <link rel="stylesheet" href="<?=base_url('assets/')?>vendor/wickedpicker/dist/wickedpicker.min.css"/>



  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/js/bootstrap-datepicker.min.js" integrity="sha512-T/tUfKSV1bihCnd+MxKD0Hm1uBBroVYBOYSk1knyvQ9VyZJpc/ALb4P0r6ubwVPSGB2GvjeoMAJJImBG12TiaQ==" crossorigin="anonymous"></script>

  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.9.0/locales/bootstrap-datepicker.id.min.js" integrity="sha512-zHDWtKP91CHnvBDpPpfLo9UsuMa02/WgXDYcnFp5DFs8lQvhCe2tx56h2l7SqKs/+yQCx4W++hZ/ABg8t3KH/Q==" crossorigin="anonymous"></script>



  <script src="https://unpkg.com/sweetalert/dist/sweetalert.min.js"></script>

  <!-- JavaScript -->

  <script src="https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/5.5.2/bootbox.min.js"></script>

    <script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.6-rc.0/js/select2.min.js"></script>







  <!-- Custom scripts for all pages-->

  <script src="<?=base_url('assets/')?>js/sb-admin-2.min.js"></script>



  <!-- Page level plugins -->

  <script src="<?=base_url('assets/')?>vendor/chart.js/Chart.min.js"></script>



  <!-- Page level custom scripts -->

  <script src="<?=base_url('assets/')?>js/demo/chart-area-demo.js"></script>

  <script src="<?=base_url('assets/')?>js/demo/chart-pie-demo.js"></script>
  <script type="text/javascript">
  $(document).ready(function(){
    $( document ).ajaxStart(function() {
        $('#loading').modal('show');  
    });
    $( document ).ajaxStop(function() {
      $('#loading').modal('hide');
    });
  });
</script>
  <script type="text/javascript">

  	function getcontens(controller,id_row,id_row2){

          var base_url = '<?php echo base_url();?>';

                

                var http    = new XMLHttpRequest();

                var url     = base_url + controller;

                var params  = 'id_row='+id_row+'&id_row2='+id_row2+'';

                http.open('POST', url, true);

                http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');

                http.onreadystatechange = function() {//Call a function when the state changes.

                    if(http.readyState == 4 && http.status == 200) {

                        //$('#content-popup').html("");

                        document.getElementById('content-contens').innerHTML = "";

                        $('#content-contens').html(http.responseText);

                    }else{

                        //loadErrorPage();

                    }

                }

                http.send(params);

    	}

    getcontens('page/<?=$page?>');

    function getpopup(controller,id_modal,id_row,id_row2){

          var base_url = '<?php echo base_url();?>';

//                document.getElementById('content-popup').innerHTML = "";

//                $("#content-popup").load(base_url + controller, {

//                    '<?php echo $this->security->get_csrf_token_name(); ?>': "<?php echo $this->security->get_csrf_hash();?>", 

//                    tokens:tokens,

//                    id_modal:id_modal,

//                    id_row:id_row,

//                    id_row2:id_row2

//                });

                

                var http    = new XMLHttpRequest();

                var url     = base_url + controller;

                var params  = 'id_modal='+id_modal+'&id_row='+id_row+'&id_row2='+id_row2+'';

                http.open('POST', url, true);

                http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');

                http.onreadystatechange = function() {//Call a function when the state changes.

                    if(http.readyState == 4 && http.status == 200) {

                        //$('#content-popup').html("");

                        document.getElementById('content-popup').innerHTML = "";

                        $('#content-popup').html(http.responseText);

                        $('#'+id_modal).modal({backdrop:'static',keyboard:true,show:true,refresh: true});

                    }else{

                        //loadErrorPage();

                    }

                }

                http.send(params);

    }

    function randomColor(){

      return Math.floor(Math.random()*16777215).toString(16);

    }

    toastr.options = {

          "closeButton": false,

          "debug": false,

          "newestOnTop": false,

          "progressBar": true,

          "positionClass": "toast-top-right",

          "preventDuplicates": false,

          "onclick": null,

          "showDuration": "300",

          "hideDuration": "1000",

          "timeOut": "5000",

          "extendedTimeOut": "1000",

          "showEasing": "swing",

          "hideEasing": "swing",

          "showMethod": "slideDown",

          "hideMethod": "slideUp"

    }

    alertify.defaults = {

        // dialogs defaults

        autoReset:true,

        basic:false,

        closable:true,

        closableByDimmer:true,

        invokeOnCloseOff:false,

        frameless:false,

        defaultFocusOff:false,

        maintainFocus:true, // <== global default not per instance, applies to all dialogs

        maximizable:true,

        modal:true,

        movable:true,

        moveBounded:false,

        overflow:false,

        padding: true,

        pinnable:true,

        pinned:true,

        preventBodyShift:false, // <== global default not per instance, applies to all dialogs

        resizable:true,

        startMaximized:false,

        transition:'pulse',

        transitionOff:false,

        tabbable:'button:not(:disabled):not(.ajs-reset),[href]:not(:disabled):not(.ajs-reset),input:not(:disabled):not(.ajs-reset),select:not(:disabled):not(.ajs-reset),textarea:not(:disabled):not(.ajs-reset),[tabindex]:not([tabindex^="-"]):not(:disabled):not(.ajs-reset)',  // <== global default not per instance, applies to all dialogs



        // notifier defaults

        notifier:{

        // auto-dismiss wait time (in seconds)  

            delay:5,

        // default position

            position:'bottom-right',

        // adds a close button to notifier messages

            closeButton: false,

        // provides the ability to rename notifier classes

            classes : {

                base: 'alertify-notifier',

                prefix:'ajs-',

                message: 'ajs-message',

                top: 'ajs-top',

                right: 'ajs-right',

                bottom: 'ajs-bottom',

                left: 'ajs-left',

                center: 'ajs-center',

                visible: 'ajs-visible',

                hidden: 'ajs-hidden',

                close: 'ajs-close'

            }

        },



        // language resources 

        glossary:{

            // dialogs default title

            title:'AlertifyJS',

            // ok button text

            ok: 'OK',

            // cancel button text

            cancel: 'Cancel'            

        },



        // theme settings

        theme:{

            // class name attached to prompt dialog input textbox.

            input:'ajs-input',

            // class name attached to ok button

            ok:'ajs-ok',

            // class name attached to cancel button 

            cancel:'ajs-cancel'

        },

        // global hooks

        hooks:{

            // invoked before initializing any dialog

            preinit:function(instance){},

            // invoked after initializing any dialog

            postinit:function(instance){},

        },

    };

    function formatRupiah(angka, prefix){

      var number_string = angka.toString(),

      split       = number_string.split(','),

      sisa        = split[0].length % 3,

      rupiah        = split[0].substr(0, sisa),

      ribuan        = split[0].substr(sisa).match(/\d{3}/gi);

 

      // tambahkan titik jika yang di input sudah menjadi angka ribuan

      if(ribuan){

        separator = sisa ? '.' : '';

        rupiah += separator + ribuan.join('.');

      }

 

      rupiah = split[1] != undefined ? rupiah + ',' + split[1] : rupiah;

      return prefix == undefined ? rupiah : (rupiah ? 'Rp. ' + rupiah : '');

      // return angka;

    }

  </script>

    
</body>



</html>

