
<?php
if ($c['level'] == "superadmin") {
	?>

	<?php
	if (isset($_POST['upload'])) {
    $id = $_POST['id'];
    $id_livechat = $_POST['id_livechat'];
    $no_whatsapp = $_POST['no_whatsapp'];
    $facebok = $_POST['facebok'];
    $telegram = $_POST['telegram'];

    $query = mysqli_query($koneksi, "
        UPDATE tb_contact 
        SET 
            id_livechat = '$id_livechat',
            no_whatsapp = '$no_whatsapp',
            facebok = '$facebok',
            telegram = '$telegram'
        WHERE id = '$id'
    ");

    if ($query) {
        echo "<script>alert('Data Berhasil Diubah');window.location='?page=contact';</script>";
    } else {
        echo "<script>alert('Data Gagal Diubah');window.location='?page=contact';</script>";
    }
}
	?>

	<?php
}else{
	?>
	<script type="text/javascript">
		window.location = "?page=dashboard";
	</script>
	<?php
}
?>