<?php
// error_reporting(0);

// ===============================
// INCLUDE FILE
// ===============================
include "../app.siakad-akperpasarrebo.ac.id/jangan_dibuka/perhatian.php";
include "../app.siakad-akperpasarrebo.ac.id/jangan_dibuka/library.php";
include "../app.siakad-akperpasarrebo.ac.id/jangan_dibuka/fungsi_indotgl.php";
include "../app.siakad-akperpasarrebo.ac.id/jangan_dibuka/fungsi_thumb.php";
include "../app.siakad-akperpasarrebo.ac.id/jangan_dibuka/class_paging.php";
include "libs/classes/class.phpmailer.php";

// ===============================
// VALIDASI PARAMETER
// ===============================
if (!isset($_GET['id']) || $_GET['id'] == '') {
    die('ID tidak valid');
}

$ia = mysqli_real_escape_string($conn, $_GET['id']);

// ===============================
// QUERY IDENTITAS (1x SAJA)
// ===============================
$get_identitas = mysqli_query($conn, "
    SELECT 
        id_identitas,
        nama_website,
        website,
        meta_deskripsi,
        meta_keyword,
        gambar,
        alamat,
        no_tlp,
        no_fax,
        email
    FROM identitas
    WHERE id_identitas = '$ia'
");

if (!$get_identitas || mysqli_num_rows($get_identitas) == 0) {
    echo "<script>
        alert('Gagal Memanggil SIAKAD, Tidak Ditemukan Link Yang Diminta!');
        window.location.href='http://app.siakad-akperpasarrebo.ac.id/';
    </script>";
    exit;
}

$gi = mysqli_fetch_assoc($get_identitas);

// ===============================
// SESSION
// ===============================
session_start();
include "timeout.php";

// SIMPAN KE SESSION (FIX VARIABLE)
$_SESSION['id_identitas']    = $gi['id_identitas'];
$_SESSION['nama_website']    = $gi['nama_website'];
$_SESSION['meta_deskripsi']  = $gi['meta_deskripsi'];
$_SESSION['meta_keyword']    = $gi['meta_keyword'];
$_SESSION['gambar']          = $gi['gambar'];
$_SESSION['alamat']          = $gi['alamat'];
$_SESSION['no_tlp']          = $gi['no_tlp'];
$_SESSION['no_fax']          = $gi['no_fax'];
$_SESSION['email']           = $gi['email'];
$_SESSION['website']         = $gi['website'];

$_SESSION['login'] = 1;
timer();

// REGENERATE SESSION ID (AMAN)
session_regenerate_id(true);
?>

<!DOCTYPE HTML>
<html lang="id">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title><?php echo htmlspecialchars($gi['nama_website']); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<?php echo htmlspecialchars($gi['meta_deskripsi']); ?>">
<meta name="keywords" content="<?php echo htmlspecialchars($gi['meta_keyword']); ?>">
<meta name="author" content="BR.">

<link rel="icon" type="image/png" sizes="32x32" href="img/logo-pasarrebo.png">
<link rel="icon" type="image/png" sizes="16x16" href="img/logo-pasarrebo.png">
<link rel="apple-touch-icon" sizes="180x180" href="img/logo-pasarrebo.png">
<link rel="shortcut icon" href="img/logo-pasarrebo.png">

<link href="https://fonts.googleapis.com/css?family=Work+Sans:300,400,500,700,800" rel="stylesheet">

<link rel="stylesheet" href="css_front/animate.css">
<link rel="stylesheet" href="css_front/icomoon.css">
<link rel="stylesheet" href="css_front/bootstrap.css">
<link rel="stylesheet" href="css_front/magnific-popup.css">
<link rel="stylesheet" href="css_front/owl.carousel.min.css">
<link rel="stylesheet" href="css_front/owl.theme.default.min.css">
<link rel="stylesheet" href="css_front/style.css">

<script src="js_front/modernizr-2.6.2.min.js"></script>
<!--[if lt IE 9]>
<script src="js_front/respond.min.js"></script>
<![endif]-->
</head>

<body>
<div id="page">

<?php
include "modul/mod_menu/menu.php";
include "konten.php";
include "modul/mod_footer/footer.php";
?>

</div>

<div class="gototop js-top">
    <a href="#" class="js-gotop"><i class="icon-arrow-up"></i></a>
</div>

<script src="js_front/jquery.min.js"></script>
<script src="js_front/jquery.easing.1.3.js"></script>
<script src="js_front/bootstrap.min.js"></script>
<script src="js_front/jquery.waypoints.min.js"></script>
<script src="js_front/jquery.stellar.min.js"></script>
<script src="js_front/owl.carousel.min.js"></script>
<script src="js_front/jquery.countTo.js"></script>
<script src="js_front/jquery.magnific-popup.min.js"></script>
<script src="js_front/magnific-popup-options.js"></script>

<script src="https://maps.googleapis.com/maps/api/js?key=AIzaSyCefOgb1ZWqYtj7raVSmN4PL2WkTrc-KyA"></script>
<script src="js_front/google_map.js"></script>
<script src="js_front/main.js"></script>
<script src="https://www.google.com/recaptcha/api.js"></script>

</body>
</html>
