<?php ob_start();session_start();//error_reporting(0);?>
<?php include "../config.php"; ?>
<?php include "../assets/var.php"; ?>
<?php include "../assets/function.php"; ?>
<?php 
if(!isset($_SESSION['id_user']))
{
	header("LOCATION:".BASE_URL."/dashboard/login.php");
	exit;
}
?>
<!DOCTYPE html>
<html lang="en">
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    
    <!-- URL Theme Color untuk Chrome, Firefox OS, Opera dan Vivaldi -->
    <meta name="theme-color" content="#ef4471">
    <!-- URL Theme Color untuk Windows Phone -->
    <meta name="msapplication-navbutton-color" content="#e6ae07">
    <!-- URL Theme Color untuk iOS Safari -->
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="#e6ae07">
    
    <meta name="robots" content="noindex" >
    
    <title>Admin Panel</title>

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

    <!-- Favicon -->
    <link rel="icon" type="image/x-icon" href="<?php echo BASE_URL; ?>/img/logo-admin.png">

    <!-- Fonts -->
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap" rel="stylesheet">
    
    <!--<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">-->
      
    <!-- Icons. Uncomment required icon fonts -->
    <link rel="stylesheet" href="assets/vendor/fonts/boxicons.css">

    <!-- Core CSS -->
    <link rel="stylesheet" href="assets/vendor/css/core.css" class="template-customizer-core-css">
    <link rel="stylesheet" href="assets/vendor/css/theme-default.css" class="template-customizer-theme-css">
    <link rel="stylesheet" href="assets/css/demo.css">

    <!-- Vendors CSS -->
    <link rel="stylesheet" href="assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.css">

    <link rel="stylesheet" href="assets/vendor/libs/apex-charts/apex-charts.css">

    <!-- Page CSS -->
	
	<link rel="stylesheet" href="https://cdn.datatables.net/1.11.5/css/dataTables.bootstrap4.min.css">
	
	<!-- date picker -->
	
    <!--<link href="css/date-picker.css" rel="stylesheet">-->
    <link href="https://unpkg.com/gijgo@1.9.14/css/gijgo.min.css" rel="stylesheet" type="text/css" />

    <!-- Helpers -->
    <script src="assets/vendor/js/helpers.js"></script>

    <!--! Template customizer & Theme config files MUST be included after core stylesheets and helpers.js in the <head> section -->
    <!--? Config:  Mandatory theme config file contain global vars & default theme options, Set your preferred theme option in this file.  -->
    <script src="assets/js/config.js"></script>
	<script src="assets/vendor/libs/jquery/jquery.js"></script>
	<script src="https://cdn.datatables.net/1.11.5/js/jquery.dataTables.min.js"></script>
	<script src="https://cdn.datatables.net/1.11.5/js/dataTables.bootstrap4.min.js"></script>
	
	<!-- Drop down list -->
    <script type="text/javascript">
    $(function() {
     $("#prov").change(function(){
          $("img#imgLoad").show();
          var idProvinsi = $(this).val();
          $.ajax({
             type: "POST",
             dataType: "html",
             url: "get-kabkota.php",
             data: "idProvinsi="+idProvinsi,
             success: function(msg){
                 if(msg == ''){
                         $("select#kabkota").html('<option value="">Pilih Kabupaten-Kota');
                 }else{
                           $("select#kabkota").html(msg);                                                      
                 }
                 $("img#imgLoad").hide();
             }
          });                   
     });
	 
    });
    </script>
    
    <!-- input only number -->
    <script>
    function isNumber(evt)
		{
        evt = (evt) ? evt : window.event;
        var charCode = (evt.which) ? evt.which : evt.keyCode;
        if (charCode > 31 && (charCode < 48 || charCode > 57)) {
            alert ('Hanya boleh diisi angka');
            return false;
        }
        return true; }
    </script>
	
  </head>

  <body>
    <!-- Layout wrapper -->
    <div class="layout-wrapper layout-content-navbar">
      <div class="layout-container">
        
		<!-- Menu -->
		
		<?php include "left-menu.php"; ?>
		
		<!-- / Menu -->

        <!-- Layout container -->
        <div class="layout-page">
		
          <!-- Navbar -->

          <?php include "navbar.php"; ?>
		  
		  <!-- / Navbar -->

          <!-- Content wrapper -->
          <div class="content-wrapper">
            <!-- Content -->

            <?php include "content.php"; ?>
			
            <!-- / Content -->

            <!-- Footer -->
            <footer class="content-footer footer bg-footer-theme">
              <div class="container-xxl d-flex flex-wrap justify-content-between py-2 flex-md-row flex-column">
                <div class="mb-2 mb-md-0">
                  Copyright © <?php echo WEBSITE_NAME; ?> - Operations
                  <script>
                    document.write(new Date().getFullYear());
                  </script>
                </div>
              </div>
            </footer>
            <!-- / Footer -->

            <div class="content-backdrop fade"></div>
          </div>
          <!-- Content wrapper -->
        </div>
        <!-- / Layout page -->
      </div>

      <!-- Overlay -->
      <div class="layout-overlay layout-menu-toggle"></div>
    </div>
    <!-- / Layout wrapper -->

    <!-- Core JS -->
    <!-- build:js assets/vendor/js/core.js -->
    
    <script src="assets/vendor/libs/popper/popper.js"></script>
    <script src="assets/vendor/js/bootstrap.js"></script>
    <script src="assets/vendor/libs/perfect-scrollbar/perfect-scrollbar.js"></script>

    <script src="assets/vendor/js/menu.js"></script>
    <!-- endbuild -->

    <!-- Vendors JS -->
    <script src="assets/vendor/libs/apex-charts/apexcharts.js"></script>

    <!-- Main JS -->
    <script src="assets/js/main.js"></script>

    <!-- Page JS -->
    <script src="assets/js/dashboards-analytics.js"></script>
	<script src="assets/js/pages-account-settings-account.js"></script>
	<script src="ckeditor/ckeditor.js"></script>
	
	<!-- panggil date picker.js -->
    <script src="../js/date-picker.js" type="text/javascript"></script>
    
    <!-- date picker -->
    <script>
    $( document ).ready(function() {
        $("#datepicker").datepicker({ 
           uiLibrary: 'bootstrap4',
           format: 'yyyy-mm-dd',
           minDate: new Date()
        });
        /*$("#datepicker").on("change", function () {
           var fromdate = $(this).val();
           alert(fromdate);
        });*/
    }); 
    </script>
	
	<script>
    $(document).ready(function() {
       $('#example1').DataTable();
    } );
    </script>
    
    <!-- data table checkbox all triger -->
    <script>
    $(document).ready(function () { 
        var oTable = $('#example').dataTable({
            stateSave: true
        });

        $("#selectAll").on("change", function(){
            
            var checked = $(this).is(':checked');
            if(checked){
                //oTable.$("input[type='checkbox']").attr('checked', $(this.checked));
               oTable.$("input[type='checkbox']").prop("checked",true);
        
            }else{
                oTable.$("input[type='checkbox']").prop("checked",false);
            }
        });
        
        /*$("#selectAll").click(function () {
    $(".common_class").prop('checked', $(this).prop('checked'));
});*/
        
    });
    </script>
	<!-- /data table checkbox all triger -->
	
	<script>
    $(function () {
       $(".textarea").wysihtml5();
    });

    CKEDITOR.replace('editor1' ,{
      filebrowserImageBrowseUrl : 'kcfinder'
      
    });
    CKEDITOR.replace('editor2' ,{
      filebrowserImageBrowseUrl : 'kcfinder'
      
    });
    </script>
    
    <script>
	    if ( window.history.replaceState ) {
            window.history.replaceState( null, null, window.location.href );
        }
	</script>

	<script>
	$("form").submit(function(){
	    if($('form > :input[required]:visible').val() != ""){
            $('#spin',this).show();	
        }
	});
	</script>
	
	<!-- copy to clipboard link referral -->
    <script>
    function myFunction() {
        /* Get the text field */
        var copyText = document.getElementById("referral");

        /* Select the text field */
        copyText.select();
        copyText.setSelectionRange(0, 99999); /* For mobile devices */

        /* Copy the text inside the text field */
        navigator.clipboard.writeText(copyText.value);

        /* Alert the copied text */
        alert("Tercopy : " + copyText.value);
    } 
    </script>
    
    <!-- data table post array checkbox -->
    <script>
    $(document).ready(function (){
        var table = $('#example').DataTable();
   
        // Handle form submission event 
        $("#checkbox_whatsapp").click(function(e){
            // Prevent actual form submission
            e.preventDefault();
            
            $('#spin_').show();
            // Serialize form data
            //var data = table.$('input,select,textarea').serialize();
            var data = $('#frm-example').serialize();
            
            // Submit form data via Ajax
            $.ajax({
                type:"POST",
                url: 'proccess-checkbox-whatsapp.php',
                data: data,
                success: function(data){
                    console.log('Server response', data);
                    //$('#example-console-form').html(data);
                    $('#spin_').hide();
                    setTimeout("location.href = '<?php echo actual_link(); ?>';",0);
                }
            });
        });      
    });
    </script>
    
	<style>
	.cke_chrome{
        border-radius: 6px; 
        border:0px;	
    }
    .cke_top{
        border-radius: 6px 6px 0px 0px;
	    border: 1px solid #e2e2e2; 
    }
    .cke_contents{
		border-radius: 0px 0px 6px 6px;
        border-left: 1px solid #e2e2e2;	
	    border-right: 1px solid #e2e2e2;
        border-bottom: 1px solid #e2e2e2;		
    }
    .cke_bottom{
        display:none;
    }
	</style>
	
	<!-- button datepicker -->
	<style>
	    .btn-outline-secondary {
	        height:100%;
	        border-radius:0 3px 3px 0;
	        background:#eaeaea;}
	</style>
	
	<!--<script>
	    const messages = document.getElementById('messages');

function appendMessage() {
	const message = document.getElementsByClassName('message')[0];
  const newMessage = message.cloneNode(true);
  messages.appendChild(newMessage);
}

function getMessages() {
	// Prior to getting your messages.
  shouldScroll = messages.scrollTop + messages.clientHeight === messages.scrollHeight;
  /*
   * Get your messages, we'll just simulate it by appending a new one syncronously.
   */
  appendMessage();
  // After getting your messages.
  if (!shouldScroll) {
    scrollToBottom();
  }
}

function scrollToBottom() {
  messages.scrollTop = messages.scrollHeight;
}

scrollToBottom();

//setInterval(getMessages, 1000);

	</script>-->
	
  </body>
</html>
