<?php
// Konfigurasi database
$servername = "localhost";
$database = "u645251767_stiesp";
$username = "u645251767_stiesp";
$password = "Stiesp@2025";

// Koneksi
$conn = mysqli_connect($servername, $username, $password, $database);
if (!$conn) {
    die("Koneksi gagal: " . mysqli_connect_error());
}

// Ambil data biaya formulir
$formulirQuery = "SELECT * FROM setting WHERE jenis_set = 'biaya formulir'";
$formulirResult = mysqli_query($conn, $formulirQuery);
if (!$formulirResult) {
    die("Query Gagal (biaya formulir): " . mysqli_error($conn));
}

$formulir = [];
while ($row = mysqli_fetch_assoc($formulirResult)) {
    $key = strtoupper(trim($row['nama_set']));
    $formulir[$key] = $row['nilai_set'];
}

// Mapping kategori ke kode formulir
$kategori_to_formulir = [
    'Diploma' => 'D3',
    'Sarjana' => 'S1',
    'Magister' => 'S2'
];

// Ambil data biaya
$biayaQuery = "SELECT * FROM biaya ORDER BY biaya_awal ASC";
$biayaResult = mysqli_query($conn, $biayaQuery);
if (!$biayaResult) {
    die("Query Gagal (biaya): " . mysqli_error($conn));
}

// Kelompokkan data biaya
$groups = [];
while ($row = mysqli_fetch_assoc($biayaResult)) {
    $key = $row['biaya_awal'] . '-' . $row['biaya_spp'];
    if (!isset($groups[$key])) {
        $groups[$key] = [
            'kategori' => $row['kategori'],
            'biaya_awal' => $row['biaya_awal'],
            'biaya_spp' => $row['biaya_spp'],
            'jurusan' => []
        ];
    }
    $groups[$key]['jurusan'][] = $row['jurusan'];
}

// Ambil data kampus
$kampusQuery = "SELECT * FROM setting WHERE jenis_set = 'kampus'";
$kampusResult = mysqli_query($conn, $kampusQuery);
if (!$kampusResult) {
    die("Query Gagal (kampus): " . mysqli_error($conn));
}

$kampusData = [];
while ($row = mysqli_fetch_assoc($kampusResult)) {
    $kampusData[$row['nama_set']] = $row['nilai_set'];
}

// Ambil data sosial media (fb, ig, dll)
$sosmedQuery = "SELECT * FROM setting WHERE jenis_set IN ('fb', 'ig')";
$sosmedResult = mysqli_query($conn, $sosmedQuery);
$sosmedData = [];
while ($row = mysqli_fetch_assoc($sosmedResult)) {
    $sosmedData[$row['nama_set']] = $row['nilai_set'];
}
?>
<!DOCTYPE html>
<html lang="en" class="no-js">
<head>
        <!-- Meta tags -->
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Kelas karyawan, Kuliah karyawan, sties purwakarta, biaya kuliah kampus di purwakarta, kampus kelas karyawan purwakarta, kelas karyawan purwakarta, kelas fleksibel sties, kampus murah, S1 Ekonomi Syariah dan S1 Perbankan Syariah, kelas karyawan fleksibel, pendaftaran online, kampus syariah di purwakarta" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="STIES Indonesia salah satu Perguruan Tinggi Swasta Terbaik dan rekomendasi kampus murah di Kota Purwakarta, tersedia kelas karyawan dan elearning atau kelas jarak jauh/online dengan biaya murah dan terjangkau cukup Rp 600.000/Bulan dengan jurusan s1 Ekonomi Syariah dan s1 Perbankan Syariah." />
    
    <title>STIES Indonesia Purwakarta (Kelas Karyawan)</title>
    <meta property="og:title" content="STIES Indonesia (Kelas Karyawan)">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://sties-purwakarta.info">
    <meta property="og:image" content="https://sties-purwakarta.info/images/fb-ogimage.png" />
    <meta property="og:image:width" content="1200" />
    <meta property="og:image:height" content="630" />
    <meta property="og:description" content="STIES Indonesia salah satu Perguruan Tinggi Swasta Terbaik dan rekomendasi kampus murah di Kota Purwakarta, tersedia kelas karyawan dan elearning atau kelas jarak jauh/online dengan biaya murah dan terjangkau cukup Rp 600.000/Bulan dengan jurusan s1 Ekonomi Syariah dan s1 Perbankan Syariah.">
    <meta name="twitter:card" content="summary_large_image">
    <meta name="twitter:creator" content="@_kuliahkaryawan">
    <meta name="twitter:site" content="@_kuliahkaryawan">
    <meta name="twitter:title" content="STIES Indonesia (Kelas Karyawan)">
    <meta name="twitter:description" content="STIES Indonesia salah satu Perguruan Tinggi Swasta Terbaik dan rekomendasi kampus murah di Kota Purwakarta, tersedia kelas karyawan dan elearning atau kelas jarak jauh/online dengan biaya murah dan terjangkau cukup Rp 600.000/Bulan dengan jurusan s1 Ekonomi Syariah dan s1 Perbankan Syariah.">
    <meta name="twitter:domain" content="https://sties-purwakarta.info">
    <meta name="twitter:image:src" content="https://sties-purwakarta.info/images/twitter-og.png">
    <meta name="author" content="Kuliah Karyawan Team" />
    <meta http-equiv="cache-control" content="public" />
    <meta name="application-name" content="STIES Purwakarta| Kuliah Karyawan K2" />
    <meta name="msapplication-TileColor" content="#9800CB" />
    <meta name="msapplication-TileImage" content="https://sties-purwakarta.info/assets/favicons/mstile-144x144.png" />
    <meta name="msapplication-square70x70logo" content="https://sties-purwakarta.info/assets/favicons/mstile-70x70.png" />
    <meta name="msapplication-square150x150logo" content="https://sties-purwakarta.info/assets/favicons/mstile-150x150.png" />
    <meta name="msapplication-wide310x150logo" content="https://sties-purwakarta.info/assets/favicons/mstile-310x150.png" />
    <meta name="msapplication-square310x310logo" content="https://sties-purwakarta.info/assets/favicons/mstile-310x310.png" />
    <meta name="theme-color" content="#9800CB" />

    <link rel="apple-touch-icon" sizes="57x57" href="https://sties-purwakarta.info//images/favicons/apple-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="https://sties-purwakarta.info//images/favicons/apple-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="https://sties-purwakarta.info//images/favicons/apple-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="https://sties-purwakarta.info//images/favicons/apple-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="https://sties-purwakarta.info//images/favicons/apple-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="https://sties-purwakarta.info//images/favicons/apple-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="https://sties-purwakarta.info//images/favicons/apple-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="https://sties-purwakarta.info//images/favicons/apple-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="https://sties-purwakarta.info//images/favicons/apple-icon-180x180.png">
    <link rel="icon" type="image/png" sizes="192x192"  href="https://sties-purwakarta.info//images/favicons/android-icon-192x192.png">
    <link rel="icon" type="image/png" sizes="32x32" href="https://sties-purwakarta.info//images/favicons/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="96x96" href="https://sties-purwakarta.info//images/favicons/favicon-96x96.png">
    <link rel="icon" type="image/png" sizes="16x16" href="https://sties-purwakarta.info//images/favicons/favicon-16x16.png">
    <link rel="manifest" href="https://sties-purwakarta.info//images/favicons/manifest.json">
    <meta name="msapplication-TileColor" content="#ffffff">
    <meta name="msapplication-TileImage" content="https://sties-purwakarta.info//images/favicons/ms-icon-144x144.png">
    <meta name="theme-color" content="#ffffff">


        
        <link
        href="https://fonts.googleapis.com/css?family=Heebo:400,700|IBM+Plex+Sans:600"
        rel="stylesheet"
        />
        <link rel="stylesheet" href="dist/css/style.css" />
        <link rel="stylesheet" href="dist/css/navbar.css" />
        <script src="https://unpkg.com/scrollreveal@4.0.0/dist/scrollreveal.min.js"></script>
        
        <style>
          .header {
            background-color: #bdbdbd;
          }
        </style>
</head>
    <body class="is-boxed has-animations">
        <div class="body-wrap boxed-container">
            <!-- Navbar -->
            <header class="header">
                <a href="#" class="header__logo"> <?= htmlspecialchars($kampusData['nama kampus'] ?? 'Kampus Tidak Diketahui') ?></a>
                <ion-icon
                    name="menu-outline"
                    class="header__toggle"
                    id="nav-toggle"
                ></ion-icon>
                <nav class="nav" id="nav-menu">
                    <div class="nav__content bd-grid">
                        <ion-icon
                            name="close-outline"
                            class="nav__close"
                            id="nav-close"
                        ></ion-icon>

                        <div class="nav__perfil">
                            <div>
                                 <img class="logo vertical-logo" style="width: 150px;"  src="https://sties-purwakarta.info/images/logo/logo2.png" alt="UYP Kuliah Karyawan">
                            </div>
                        </div>

                        <div class="nav__menu">
                            <ul class="nav__list">
                                <li class="nav__item">
                                    <a href="./" class="nav__link active"
                                        >Beranda</a
                                    >
                                </li>
                                <li class="nav__item">
                                    <a
                                        target="_blank"
                                        href="https://pendaftaran.sties-purwakarta.info/"
                                        class="nav__link"
                                        >Pendaftaran Online</a
                                    >
                                </li>
                                <li class="nav__item">
                                    <a href="#features" class="nav__link"
                                        >Biaya Kuliah</a
                                    >
                                </li>
                                <li class="nav__item">
                                    <a
                                        href="https://kontak.kuliahkaryawan.net/?akreditasi.sties-purwakarta.info"
                                        class="nav__link"
                                        >Kontak</a
                                    >
                                </li>
                            </ul>
                        </div>

                        <div class="nav__social">
                            <a
                                href="https://www.facebook.com/k2.stiesi.purwakarta"
                                target="_blank"
                                class="nav__social-icon"
                                ><ion-icon name="logo-facebook"></ion-icon
                            ></a>
                            <a
                                href="https://www.instagram.com/stiesindonesia_/"
                                target="_blank"
                                class="nav__social-icon"
                                ><ion-icon name="logo-instagram"></ion-icon
                            ></a>
                        </div>
                    </div>
                </nav>
            </header>
            
            <main>
                <section class="hero">
                    <div class="container">
                        <div class="hero-inner">
                            <div class="hero-copy">
                                <h2 class="hero-title mt-0">
                                    Yuk, Cari Tahu Syarat dan Tata Cara
                                    Pendaftaran di <?= htmlspecialchars($kampusData['nama kampus'] ?? 'Kampus Tidak Diketahui') ?>
                                </h2>
                                <p class="hero-paragraph">
                                    Mau Kuliah dengan biaya terjangkau dan waktu
                                    yang fleksibel ? yuk segera daftarkan diri
                                    anda sekarang ! <br />
                                </p>

                                <div class="hero-cta">
                                    <div class="lights-toggle">
                                        <input
                                            id="lights-toggle"
                                            type="checkbox"
                                            name="lights-toggle"
                                            class="switch"
                                            checked="checked"
                                        />
                                        <label
                                            for="lights-toggle"
                                            class="text-xs"
                                            ><span></span>
                                            <span class="label-text"></span
                                        ></label>
                                    </div>
                                </div>
                            </div>
                            <div class="hero-media">
                                <div class="header-illustration">
                                    <img
                                        class="header-illustration-image asset-light"
                                        src="dist/images/header-illustration-light.svg"
                                        alt="Header illustration"
                                    />
                                    <img
                                        class="header-illustration-image asset-dark"
                                        src="dist/images/header-illustration-dark.svg"
                                        alt="Header illustration"
                                    />
                                </div>
                                <div class="hero-media-illustration">
                                    <img
                                        class="hero-media-illustration-image asset-light"
                                        src="dist/images/hero-media-illustration-light.svg"
                                        alt="Hero media illustration"
                                    />
                                    <img
                                        class="hero-media-illustration-image asset-dark"
                                        src="dist/images/hero-media-illustration-dark.svg"
                                        alt="Hero media illustration"
                                    />
                                </div>
                                <div class="hero-media-container">
                                    <img
                                        class="hero-media-image asset-light"
                                        src="https://sties-purwakarta.info/images/logo/logo2.png"
                                        width="400px"
                                        alt="Hero media"
                                        style="margin-top:40px;"
                                    />
                                    <img
                                        class="hero-media-image asset-dark"
                                        src="dist/images/logok22025.png"
                                        alt="Hero media"
                                        width="200px"
                                    />
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
                
                <section class="cta section">
                    <div class="container-sm">
                        <div class="cta-inner section-inner">
                            <div class="cta-header text-center">
                                <h2 class="section-title mt-0">
                                    Ngampus Tiap Hari Ga Capek ? Lebih Nyaman
                                    dan Fleksibel Kuliah di  <?= htmlspecialchars($kampusData['nama kampus'] ?? 'Kampus Tidak Diketahui') ?> Kuliah
                                    Karyawan
                                </h2>
                                <p class="section-paragraph text-justify">
                                    Bayangin deh 🤔 kuliah tanpa stress kena
                                    macet 🚗 , gak pusing mikirin biaya mahal 🤑
                                    , bebas mau kuliah dimana ajah, kalau mager
                                    ? kuliah dikamar juga bisa. Mau gak ? Pasti
                                    mau dong ! 😎 <br /><br />
                                    Yuk Langsung daftar online di bawah ini 👇🏻
                                </p>
                                <div class="cta-cta">
                                    <a
                                        target="_blank"
                                        class="button button-primary"
                                        href="https://pendaftaran.sties-purwakarta.info/"
                                        >Daftar Online</a
                                    >
                                </div>
                            </div>
                        </div>
                    </div>
                </section>

                <section class="cta section">
                    <div class="container-sm">
                        <div class="cta-inner section-inner">
                            <div class="cta-header">
                                <h2 class="section-title mt-0">
                                    Memangnya Apa Kelebihan Kuliah Karyawan (K2)
                                    ?
                                </h2>
                                <p class="text-justify">
                                    Kelebihan Kuliah di
                                    <a
                                        target="_blank"
                                        href="https://kuliahkaryawan.net/"
                                        ><b>Kelas Karyawan</b></a
                                    >
                                    yaitu mahasiswa bisa kuliah dimana saja,
                                    apalagi kalian yang sedang sibuk berkerja,
                                     Maka dari itu
                                    <a target="_blank"
                                        href="https://sties-purwakarta.info/"
                                        ><b> <?= htmlspecialchars($kampusData['nama kampus'] ?? 'Kampus Tidak Diketahui') ?></b></a>
                                    sekarang ada kelas karyawannya, dimana
                                    jadwal kuliah fleksibel dan akses materi
                                    kuliah tanpa batas, kuliah juga full
                                    online/daring, biaya kuliah lebih terjangkau
                                    dari kuliah reguler makin hemat. Mantap Kan ! Jadi Tunggu Apalagi
                                    Buruan Daftar Kuliah di  <?= htmlspecialchars($kampusData['nama kampus'] ?? 'Kampus Tidak Diketahui') ?> 🤷🏼‍♀️
                                </p>
                                <p>
                                    <b>Baca Juga :</b>
                                    <a
                                        target="_blank"
                                        href="https://sties-purwakarta.info/"
                                        >Kuliah Karyawan Bekasi</a
                                    >
                                </p>

                                <p>
                                    <b>Baca Juga :</b>
                                    <a
                                        target="_blank"
                                        href="https://uwi.web.id/"
                                        >Biaya Kuliah Karyawan Kampus Bogor</a
                                    >
                                </p>
                                <p>
                                    <b>Baca Juga :</b>
                                    <a
                                        target="_blank"
                                        href="https://umiba.info/"
                                        >Biaya Kuliah Kelas Karyawan Jakarta
                                        Selatan</a
                                    >
                                </p>
                                <p>
                                    <b>Baca Juga :</b>
                                    <a
                                        target="_blank"
                                        href="https://stesbn.info/"
                                        >Kuliah Kelas Karyawan Tangerang
                                        Selatan</a
                                    >
                                </p>
                            </div>
                        </div>
                    </div>
                </section>
                
                <!--Biaya-->
                <section class="py-6" id="features">
                    <div class="container">
                        <div class="row">
                            <div class="col-md-10 mx-auto">
                                <h2 class="dot-circle text-center">Rincian Biaya Kuliah  <?= htmlspecialchars($kampusData['nama kampus'] ?? 'Kampus Tidak Diketahui') ?></h2>
                                <div class="row mt-6">
                                    <div class="col-sm-6 mb-5">
                                        <div class="media">
                                            <div class="icon-box mt-0 ml-0">
                                                <div class="icon-box-inner small-xs text-primary">
                                                    <span data-feather="dollar-sign" width="30" height="30"></span>
                                                </div>
                                            </div>
                
<?php foreach ($groups as $group): ?>
    <?php
        // Ambil key formulir sesuai kategori
        $formulir_key = $kategori_to_formulir[$group['kategori']] ?? null;
        // Ambil nilai biaya formulir, kalau tidak ada default 'Rp 0'
        $biaya_formulir = $formulir_key ? ($formulir[$formulir_key] ?? 'Rp 150.000') : 'Rp 150.000';
    ?>
    <div class="media-body">
        <h5 class="text-center mt-0">
            <?= implode(', ', $group['jurusan']) ?><br>
        </h5>
        <span>
            <p class="text-center"><b>Kelas Karyawan</b><br /></p>
            <p class="text-center">
                Biaya Pendaftaran <b><?= $biaya_formulir ?></b> (Uang Formulir)<br />
                Biaya Awal Masuk <b>Rp <?= number_format($group['biaya_awal'], 0, ',', '.') ?>,-</b> Sudah Termasuk Angs 1 UKT + Biaya Almamater + KTM + PKKMB<br>
                <b>Rp <?= number_format($group['biaya_spp'], 0, ',', '.') ?>,-</b>/Bulan Flat Sampai Lulus
            </p>
        </span>
    </div>
<?php endforeach; ?>


                
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>
            </main>

            <footer class="site-footer has-top-divider">
                <div class="container">
                    <div class="site-footer-inner">
                        <div class="brand footer-brand">
                            <a href="#">
                                <img
                                    class="asset-light"
                                    src="src/images/logo-light.svg"
                                    alt="Logo"
                                />
                                <img
                                    class="asset-dark"
                                    src="src/images/logo-dark.svg"
                                    alt="Logo"
                                />
                            </a>
                        </div>
                        <ul class="footer-links list-reset">
                            <li>
                                <a href="#">Privacy</a>
                            </li>
                            <li>
                                <a href="https://kontak.kuliahkaryawan.net/?biayakuliah.sties-purwakarta.info">Kontak</a>
                            </li>
                        </ul>
                        <ul class="footer-social-links list-reset">
                            <li>
                                <a
                                    href="<?= htmlspecialchars($sosmedData['Facebook'] ?? '#') ?>"
                                    target="_blank"
                                >
                                    <span class="screen-reader-text">Facebook</span>
                                    <svg width="16" height="16" xmlns="http://www.w3.org/2000/svg">
                                        <path
                                            d="M6.023 16L6 9H3V6h3V4c0-2.7 1.672-4 4.08-4 1.153 0 2.144.086 2.433.124v2.821h-1.67c-1.31 0-1.563.623-1.563 1.536V6H13l-1 3H9.28v7H6.023z"
                                            fill="#FFF"
                                        />
                                    </svg>
                                </a>
                            </li>
                                                        <li>
                                <a
                                    href="https://twitter.com/_kuliahkaryawan"
                                    target="_blank"
                                >
                                    <span class="screen-reader-text"
                                        >Twitter</span
                                    >
                                    <svg
                                        width="16"
                                        height="16"
                                        xmlns="http://www.w3.org/2000/svg"
                                    >
                                        <path
                                            d="M16 3c-.6.3-1.2.4-1.9.5.7-.4 1.2-1 1.4-1.8-.6.4-1.3.6-2.1.8-.6-.6-1.5-1-2.4-1-1.7 0-3.2 1.5-3.2 3.3 0 .3 0 .5.1.7-2.7-.1-5.2-1.4-6.8-3.4-.3.5-.4 1-.4 1.7 0 1.1.6 2.1 1.5 2.7-.5 0-1-.2-1.5-.4C.7 7.7 1.8 9 3.3 9.3c-.3.1-.6.1-.9.1-.2 0-.4 0-.6-.1.4 1.3 1.6 2.3 3.1 2.3-1.1.9-2.5 1.4-4.1 1.4H0c1.5.9 3.2 1.5 5 1.5 6 0 9.3-5 9.3-9.3v-.4C15 4.3 15.6 3.7 16 3z"
                                            fill="#FFF"
                                        />
                                    </svg>
                                </a>
                            </li>
                            <li>
                                <a href="./">
                                    <span class="screen-reader-text"
                                        >Google</span
                                    >
                                    <svg
                                        width="16"
                                        height="16"
                                        xmlns="http://www.w3.org/2000/svg"
                                    >
                                        <path
                                            d="M7.9 7v2.4H12c-.2 1-1.2 3-4 3-2.4 0-4.3-2-4.3-4.4 0-2.4 2-4.4 4.3-4.4 1.4 0 2.3.6 2.8 1.1l1.9-1.8C11.5 1.7 9.9 1 8 1 4.1 1 1 4.1 1 8s3.1 7 7 7c4 0 6.7-2.8 6.7-6.8 0-.5 0-.8-.1-1.2H7.9z"
                                            fill="#FFF"
                                        />
                                    </svg>
                                </a>
                            </li>
                        </ul>
                        <div class="footer-copyright">
                            &copy; CV. Edukasi Indonesia Jaya (Edunesia), All
                            Rights Reserved
                        </div>
                    </div>
                </div>
            </footer>
        </div>
        <script src="https://code.jquery.com/jquery-1.6.4.js"></script>
        <script>
            $.getJSON(
                "https://kuliahkaryawan.net/api/Biayaasaindo/1",
                function (data) {
                    let biayaPendaftaranS1 = `${data.biaya_pendaftaran_s1}`;
                    $(".biayaPendaftaranS1").html(biayaPendaftaranS1);
                    
                    let biayaAwalS1 = `${data.biaya_awal_s1}`;
                    $(".biayaAwalS1").html(biayaAwalS1);
                    
        		    let biayaBulananS1 = `${data.biaya_bulanan_s1}`;
                    $(".biayaBulananS1").html(biayaBulananS1);
                    
                    
                }
            ); 
        </script>
        <script src="https://unpkg.com/ionicons@5.1.2/dist/ionicons.js"></script>
        <script src="dist/js/main.min.js"></script>
        <script src="dist/js/navbar.js"></script>
    </body>
</html>
