<?php 
//error_reporting(0);
define("BASEPATH", dirname(__FILE__));
session_start();
$codes="dmFsaWQucGhw";
$codes2="dmFsaWQyLnBocA==";
$_SESSION['cek']='A';
if (file_exists('config.php')) {
	
	include('Hash.php');
    include "config.php";
    include "fungsi.php";
    include "fungsi2.php";
        
    $query = mysqli_query($con,"SHOW TABLES LIKE 'akunn'");
	if (mysqli_num_rows($query) != 1) {
		//include 'install.php';
	}elseif($versi < $update) {
		include 'upgrade.php';
	}else{
	    
        if(empty($_SESSION['id']))
        header("location:login/");
        
        if(!empty($_SESSION['UserId'])<>$lisensi)
        header("location:login/");
        
        extract($_POST);
        
        if (isset($_POST['grup']) && is_numeric($_POST['grup'])) {
				$idgrup = $_POST['grup'];
				$_SESSION['sesgrup'] = $_POST['grup'];
			} else {
				if (isset($_SESSION['sesgrup'])) {
					$idgrup = $_SESSION['sesgrup'];
				}
			}
			
        if (substr($weburl,-1)== '/') {
        	$weburl = substr($weburl,0,-1);
        }
        
        if(!isset($_GET['page'])){
            header("location:index.php?page=home");
        }
	}    

?>
<!DOCTYPE html>
<html lang="en">

  <head><meta http-equiv="Content-Type" content="text/html; 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="Tools Email Marketing Auto BiznisTop">
    <meta name="author" content="Yanto Naim">

    <title>Auto BiznisTop</title>

    <!-- Bootstrap core CSS-->
    <link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <link rel="shortcut icon" href="images/abt.png" />
    
    <link href="css/dataTables.bootstrap.min.css" rel="stylesheet">
    <link href="css/buttons.bootstrap.min.css" rel="stylesheet">

    <!-- Custom fonts for this template-->
    <link href="vendor/fontawesome-free/css/all.min.css" rel="stylesheet" type="text/css">

    <!-- Page level plugin CSS-->
    <link href="vendor/datatables/dataTables.bootstrap4.css" rel="stylesheet">

    <!-- Custom styles for this template-->
    <link href="css/sb-admin.css" rel="stylesheet">
    <link href="css/tab.css" rel="stylesheet">
    
    <link href="css/jquery.dataTables.min.css" rel="stylesheet">
    <link href="css/buttons.dataTables.min.css" rel="stylesheet">
    
    <script src="js/sweetalert.min.js"></script> 
    
    <script src="vendor/jquery/jquery-demo.js"></script>
    
    <script type="text/javascript" src="js/Chart.js"></script>
    
    <script type="text/javascript" src="js/cekkarakter.js"></script>
    
    <script src="js/jquery.js"></script>
    
    <script src="js/jquery-latest.js"></script> 
		<script>
		var refreshId = setInterval(function()
		{
			 $('#responsecontainer').load('autores.php');
			 $('#responsecontainer2').load('autosheet.php');
			 $('#responsecontainer3').load('notifauto.php');
		}, 1500);
	</script>
    
    <script type="text/javascript">
  
		function ajax() {
		if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
			xmlhttp=new XMLHttpRequest();
		}else{// code for IE6, IE5
			xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
						  
		xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4 && xmlhttp.status==200){
		document.getElementById("autosend").innerHTML = xmlhttp.responseText;
		}
		}
						  
		xmlhttp.open("GET","autosend.php",true);
		xmlhttp.send();
		setTimeout("ajax()", 5000);
		}  
	</script>
    
    <script type="text/javascript" language="JavaScript">
    function konfirmasi(){
        tanya = confirm("Anda Yakin Akan Menghapus Data ?");
        if (tanya == true) return true;
        else return false;
    }
    function konfirmasi2(){
        tanya = confirm("Anda Yakin Akan mengubah menjadi prospek buyer ?");
        if (tanya == true) return true;
        else return false;
    }
    </script>
    
    <script type="text/javascript">
        function deleteConfirm(){
        var result = confirm("Apakah anda yakin ingin menghapus data yang terceklist");
        if(result){
        return true;
        }else{
        return false;
        }
        }
        function hapusConfirm(){
        var result = confirm("Apakah anda yakin ingin menghapus keseluruhan data ?");
        if(result){
        return true;
        }else{
        return false;
        }
        }
         
        $(document).ready(function(){
        $('#select_all').on('click',function(){
        if(this.checked){
        $('.checkbox').each(function(){
        this.checked = true;
        });
        }else{
        $('.checkbox').each(function(){
        this.checked = false;
        });
        }
        });
        });
    </script>
    
    <script>
		function hanyaAngka(evt) {
		  var charCode = (evt.which) ? evt.which : event.keyCode
		   if (charCode > 31 && (charCode < 48 || charCode > 57))
 
		    return false;
		  return true;
		}
	</script>
	
	<script>
    	$(document).ready(function() {
            var table = $('#example').DataTable( {
                lengthChange: false,
                buttons: [ 'copy', 'excel','print' ]
            } );
         
            table.buttons().container()
                .appendTo( '#example_wrapper .col-sm-6:eq(0)' );
        } );
        
    </script>
    
    <!-- select -->
    <link rel="stylesheet" href="css/select2.min.css"/>
    <!-- select -->
	
  </head>
   
    <!--
    Kode Notif pesan
    1 = pesan email ke subscriber sukses
    2 = pesan email ke subscriber gagal
    3 = info subscriber unsub
    4 = bc sukses
    5 = bc gagal
    6 = Auto pesan sukses
    7 = Auto pesan gagal
    8 = subscriber membaca email pertama
    9 = subscriber membaca broadcast email
    0 = subscriber membaca pesan auto
    -->


  <body id="page-top" onload="ajax()">
      
      <!-- Load Facebook SDK for JavaScript -->
      <div id="fb-root"></div>
      <script>(function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (d.getElementById(id)) return;
        js = d.createElement(s); js.id = id;
        js.src = "https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0";
        fjs.parentNode.insertBefore(js, fjs);
      }(document, 'script', 'facebook-jssdk'));</script>
  

    <nav class="navbar navbar-expand navbar-dark bg-dark static-top"> 
        
      <a class="navbar-brand mr-1" href="index.php?page=home">Auto BiznisTop 3.0</a>

      <button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#">
        <i class="fas fa-bars"></i>
      </button>
        
      <!-- Navbar Search -->
      <form class="d-none d-md-inline-block form-inline ml-auto mr-0 mr-md-3 my-2 my-md-0">
        <div class="input-group">
          <input type="text" class="form-control" placeholder="Cari..." aria-label="Search" aria-describedby="basic-addon2">
          <div class="input-group-append">
            <button class="btn btn-primary" type="button">
              <i class="fas fa-search"></i>
            </button>
          </div>
        </div>
      </form>

        <!-- Right navbar links -->
        <ul class="navbar-nav ml-auto">
          <!-- Messages Dropdown Menu -->
          <li class="nav-item dropdown">
            <a class="nav-link" data-toggle="dropdown" href="#">
              <i class="far fa-comments"></i>
              <span class="badge badge-danger navbar-badge">3</span>
            </a>
            <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
              <a href="#" class="dropdown-item">
                <!-- Message Start -->
                <div class="media">
                  <img src="images/avatar5.png" alt="User Avatar" class="img-size-50 mr-3 img-circle">
                  <div class="media-body">
                    <h3 class="dropdown-item-title">
                      beta
                      <span class="float-right text-sm text-danger"><i class="fas fa-star"></i></span>
                    </h3>
                    <p class="text-sm">versi pengembangan...</p>
                    <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
                  </div>
                </div>
                <!-- Message End -->
              </a>
              <div class="dropdown-divider"></div>
              <a href="#" class="dropdown-item">
                <!-- Message Start -->
                <div class="media">
                  <img src="images/avatar5.png" alt="User Avatar" class="img-size-25 img-circle mr-3">
                  <div class="media-body">
                    <h3 class="dropdown-item-title">
                      beta
                      <span class="float-right text-sm text-muted"><i class="fas fa-star"></i></span>
                    </h3>
                    <p class="text-sm">versi pengembangan...</p>
                    <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
                  </div>
                </div>
                <!-- Message End -->
              </a>
              <div class="dropdown-divider"></div>
              <a href="#" class="dropdown-item">
                <!-- Message Start -->
                <div class="media">
                  <img src="images/avatar5.png" alt="User Avatar" class="img-size-25 img-circle mr-3">
                  <div class="media-body">
                    <h3 class="dropdown-item-title">
                      beta
                      <span class="float-right text-sm text-warning"><i class="fas fa-star"></i></span>
                    </h3>
                    <p class="text-sm">versi pengembangan...</p>
                    <p class="text-sm text-muted"><i class="far fa-clock mr-1"></i> 4 Hours Ago</p>
                  </div>
                </div>
                <!-- Message End -->
              </a>
              <div class="dropdown-divider"></div>
              <a href="#" class="dropdown-item dropdown-footer">See All Messages</a>
            </div>
          </li>
          <!-- Notifications Dropdown Menu -->
          <li class="nav-item dropdown">
            <a class="nav-link" data-toggle="dropdown" href="#">
              <i class="far fa-bell"></i>
              <span class="badge badge-warning navbar-badge">15</span>
            </a>
            <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
              <span class="dropdown-item dropdown-header">15 Notifications [beta]</span>
              <div class="dropdown-divider"></div>
              <a href="#" class="dropdown-item">
                <i class="fas fa-envelope mr-2"></i> 4 new messages
                <span class="float-right text-muted text-sm">3 mins</span>
              </a>
              <div class="dropdown-divider"></div>
              <a href="#" class="dropdown-item">
                <i class="fas fa-users mr-2"></i> 8 friend requests
                <span class="float-right text-muted text-sm">12 hours</span>
              </a>
              <div class="dropdown-divider"></div>
              <a href="#" class="dropdown-item">
                <i class="fas fa-file mr-2"></i> 3 new reports
                <span class="float-right text-muted text-sm">2 days</span>
              </a>
              <div class="dropdown-divider"></div>
              <a href="#" class="dropdown-item dropdown-footer">See All Notifications</a>
            </div>
          </li>
          
          <li class="nav-item dropdown no-arrow">
              <a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                <i class="fas fa-user-circle fa-fw"></i>
              </a>
              <div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown">
                <a class="dropdown-item" href="index.php?page=akun"><img src="images/setting.png"> Setting</a>
                <a class="dropdown-item" href="index.php?page=tempe"><img src="images/temp.png"> Template Email</a>
                <!-- <a class="dropdown-item" href="https://emailbuilder.biznis.top/" target="_blank"><img src="images/konsul.png">Email Builder</a> -->
                <a class="dropdown-item" href="index.php?page=qrc"><img src="images/qrcode2.png"> QRCode Diskon/Event</a>
                <a class="dropdown-item" href="index.php?page=unsub"><img src="images/unsub.png"> Alasan Unsub</a>
                <a class="dropdown-item" href="index.php?page=wacs"><img src="images/warotator.png"> WA CS (Rotator)</a>
                <a class="dropdown-item" href="index.php?page=notif&set=woowaandroid"><img src="images/logo2.png"> Notif via Woowa </a>
                <a class="dropdown-item" href="index.php?page=apismtp&set=mailketing"><img src="images/apismtp.png"> API smtp </a>
                <a class="dropdown-item" href="index.php?page=logo"><img src="images/glogo.png"> Logo</a>
                <a class="dropdown-item" href="index.php?page=emailtest"><img src="images/testkirim.png"> Test Ngirim Email/WA/SMS</a>
                <a class="dropdown-item" href="index.php?page=bonus"><img src="images/bonus.png"> Bonus Produk</a>
                <a class="dropdown-item" href="index.php?page=ubahpass"><img src="images/ubahpass.png"> Ubah Username & Password</a>
                <a class="dropdown-item" href="https://www.youtube.com/channel/UClHw_BExm4rhAVZbFjzBWRw" target="_blank"><img src="images/pandyu.png"> Panduan Youtube</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" href="https://www.facebook.com/groups/925464977566774/" target="_blank"><img src="images/konsul.png">Grup Support</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" href="index.php?page=up"><img src="images/installl.png"> Instal Update</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal"><img src="images/logout.png"> Keluar</a>
              </div>
            </li>
          
        </ul>
      </nav>
      <!-- /.navbar -->

    <div id="wrapper">

      <!-- Sidebar -->
      <ul class="sidebar navbar-nav">
        <li class="nav-item active">
          <a class="nav-link" href="index.php?page=home">
            <i class="fas fa-fw fa-tachometer-alt"></i>
            <span>Dashboard</span>
          </a>
        </li>
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <i class="fas fa-fw fa-folder"></i>
            <span>Grup/Segmen</span>
          </a>
          <div class="dropdown-menu" aria-labelledby="pagesDropdown">
            <h6 class="dropdown-header">Sub Menu Grup:</h6>
            <a class="dropdown-item" href="index.php?page=listgrup"><img src="images/grup.png"> List Grup</a>
            <a class="dropdown-item" href="index.php?page=grupprospek"><img src="images/list.png"> List Prospek Grup</a>
            <a class="dropdown-item" href="index.php?page=pesanauto"><img src="images/pesanauto.png"> AutoPesan/Champ</a>
            <a class="dropdown-item" href="index.php?page=api"><img src="images/api.png"> Rest API</a>
          </div>
        </li>
        
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <i class="fas fa-fw fa-folder"></i>
            <span>Broadcast</span>
          </a>
          <div class="dropdown-menu" aria-labelledby="pagesDropdown">
            <h6 class="dropdown-header">Sub Menu Grup:</h6>
            <a class="dropdown-item" href="index.php?page=broadnew"><img src="images/broad.png"> New Broadcast</a>
            <a class="dropdown-item" href="index.php?page=broadtrack"><img src="images/track.png"> Tracking BC Email</a>
            <a class="dropdown-item" href="index.php?page=emailsender"><img src="images/sender.png"> Email Sender</a>
          </div>
        </li>
        
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <i class="fas fa-fw fa-folder"></i>
            <span>Prospek</span>
          </a>
          <div class="dropdown-menu" aria-labelledby="pagesDropdown">
            <h6 class="dropdown-header">Sub Menu Prospek:</h6>
            <a class="dropdown-item" href="index.php?page=listprosfek"><img src="images/listprospek.png"> List Prospek All</a>
            <a class="dropdown-item" href="index.php?page=prosfekadd"><img src="images/addprospek.png"> Add Prospek</a>
            <a class="dropdown-item" href="index.php?page=prosfekimport"><img src="images/import.png"> Import Prospek</a>
          </div>
        </li>
        
        <li class="nav-item dropdown">
          <a class="nav-link dropdown-toggle" href="#" id="pagesDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
            <i class="fas fa-fw fa-folder"></i>
            <span>Link Tracking</span>
          </a>
          <div class="dropdown-menu" aria-labelledby="pagesDropdown">
            <h6 class="dropdown-header">Sub Menu Link:</h6>
            <a class="dropdown-item" href="index.php?page=newlink"><img src="images/link.png"> Buat Link</a>
          </div>
        </li>
        
      </ul>

      <div id="content-wrapper">

        <!-- konten -->
		<?php include"menuklik.php"; ?>
        <!-- /.container-fluid -->

        <!-- Ftr -->
        
        <?php echo base64_decode($coder);?> 
        
        
      </div>
      <!-- /.content-wrapper -->

    </div>
    <!-- /#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">Ready to Leave?</h5>
            <button class="close" type="button" data-dismiss="modal" aria-label="Close">
              <span aria-hidden="true">×</span>
            </button>
          </div>
          <div class="modal-body">Yakin mau keluar?</div>
          <div class="modal-footer">
            <button class="btn btn-secondary" type="button" data-dismiss="modal">Cancel</button>
            <a class="btn btn-primary" href="keluar.php">Ya</a>
          </div>
        </div>
      </div>
    </div>

    <!-- Bootstrap core JavaScript-->
    <script src="vendor/jquery/jquery.min.js"></script>
    
    <script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="vendor/bootstrap/js/bootstrap.min.js"></script>


    <!-- Core plugin JavaScript-->
    <script src="vendor/jquery-easing/jquery.easing.min.js"></script>

    <!-- Page level plugin JavaScript
    <script src="vendor/chart.js/Chart.js"></script>
    <script src="vendor/chart.js/Chart.min.js"></script>
    
    <script src="vendor/datatables/jquery.dataTables.js"></script>-->
    <script src="vendor/datatables/dataTables.bootstrap4.js"></script>

    <!-- Custom scripts for all pages-->
    <script src="js/sb-admin.min.js"></script>

    <!-- Demo scripts for this page
    <script src="js/demo/chart-area-demo.js"></script>-->
    <script src="js/demo/datatables-demo.js"></script>
    
	<script src="//cdn.ckeditor.com/4.11.1/full/ckeditor.js"></script>
	
	<script src="js/scripts.js"></script>
	<script src="js/custom.js"></script>
	
	<script type="text/javascript" src="js/jquery.js"></script>
	
	<script type="text/javascript" src="js/jquery.dataTables.min.js"></script>
	
	<script src="js/select2.min.js"></script>
        <script>
            $(document).ready(function () {
                $("#cari").select2({
                    placeholder: "ketik nama grup"
                });

            });
        </script>
	
	<script type"text/javascript">
      jQuery(document).ready(function ($){
           $('#tabs').tab();
      });
    </script>

  </body>

</html>
<?php
    include base64_decode('ZWFrdW4y').'.php';
}else{
    $u = base64_decode('Y29uZmln');
    $uv = 'x'.$u.'.php';
    if (file_exists($uv)) {
        include base64_decode($codes2);
    }else{    
        include base64_decode($codes);
    }    
}
?>