Isi File koneksi.php:
<?php
date_default_timezone_set("Asia/Jakarta");
$host = "localhost";
$username = "pdvqknyo_meliora88since26";
$password = 'q5ZVe#wp$sAt,jM_';
$database = "pdvqknyo_meliora88style";
$koneksi = mysqli_connect($host, $username, $password, $database);
if ($koneksi) {
include_once 'fungsi_umum.php';
// ==========================================================
// PENGATURAN LISENSI LIVECHAT (Cukup ubah angka di bawah ini)
// ==========================================================
$no_lisensi_livechat = "19769618";
// ==========================================================
$alamat_website = 'https://meliora88.shop/';
$alamat_admin = 'https://admin.meliora88.shop/';
$alamat_staff = 'https://meliora88.shop/staff/';
// Ambil semua data dari tabel pengaturan sekaligus agar lebih ringan
$query_pengaturan = mysqli_query($koneksi, "SELECT * FROM pengaturan");
while ($row = mysqli_fetch_array($query_pengaturan)) {
$nama = $row['nama_pengaturan'];
// Membuat variabel dinamis seperti $id_judul_web, $isi_1_judul_web, dll
${"id_" . $nama} = $row['id_pengaturan'];
// Kondisi khusus untuk LiveChat agar "terkunci" secara otomatis
if ($nama == 'script_livechat_web') {
${"isi_1_" . $nama} = '
<script>
window.__lc = window.__lc || {};
window.__lc.license = ' . $no_lisensi_livechat . ';
;(function(n,t,c){function i(n){return e._h?e._h.apply(null,n):e._q.push(n)}var e={_q:[],_h:null,_v:"2.0",on:function(){i(["on",c.call(arguments)])},init:function(){var n=t.createElement("script");n.async=!0,n.type="text/javascript",n.src="https://cdn.livechatinc.com/tracking.js",t.head.appendChild(n)}};!n.__lc.asyncInit&&e.init(),n.LiveChatWidget=n.LiveChatWidget||e}(window,document,[].slice))
</script>';
}
else if ($nama == 'link_livechat_web') {
${"isi_1_" . $nama} = 'https://direct.lc.chat/' . $no_lisensi_livechat . '/';
}
else {
// Untuk pengaturan lainnya, gunakan fungsi aman()
${"isi_1_" . $nama} = aman($row['isi_1_pengaturan']);
}
${"isi_2_" . $nama} = aman($row['isi_2_pengaturan']);
${"isi_3_" . $nama} = aman($row['isi_3_pengaturan']);
}
} else {
echo "Kesalahan : Tidak dapat terhubung ke database." . PHP_EOL;
exit;
}
?>