| Server IP : 127.0.0.1 / Your IP : 192.168.99.1 Web Server : Apache/2.4.35 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9 System : Windows NT WIN-JEJMB9EN0L0 10.0 build 14393 (Windows Server 2016) AMD64 User : Administrator ( 0) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /karepmu_le371267hjsdasdasX/admin/modul/mod_modul/ |
Upload File : |
<?php
session_start();
if (empty($_SESSION['username']) AND empty($_SESSION['passuser'])){
echo "<link href='style.css' rel='stylesheet' type='text/css'>
<center>Untuk mengakses modul, Anda harus login <br>";
echo "<a href=../../index.php><b>LOGIN</b></a></center>";
}
else{
session_start();
include "../../../config/koneksi.php";
$module=$_GET[module];
$act=$_GET[act];
// Hapus modul
if ($module=='modul' AND $act=='hapus'){
mysql_query("DELETE FROM modul WHERE id_modul='$_GET[id]'");
header('location:../../media.php?module='.$module);
}
// Input modul
elseif ($module=='modul' AND $act=='input'){
// Cari angka urutan terakhir
$u=mysql_query("SELECT urutan FROM modul ORDER by urutan DESC");
$d=mysql_fetch_array($u);
$urutan=$d[urutan]+1;
// Input data modul
mysql_query("INSERT INTO modul(nama_modul,
username,
link,
publish,
aktif,
status,
urutan)
VALUES('$_POST[nama_modul]',
'$_SESSION[namauser]',
'$_POST[link]',
'$_POST[publish]',
'$_POST[aktif]',
'$_POST[status]',
'$urutan')");
header('location:../../media.php?module='.$module);
}
// Update modul
elseif ($module=='modul' AND $act=='update'){
mysql_query("UPDATE modul SET nama_modul = '$_POST[nama_modul]',
link = '$_POST[link]',
publish = '$_POST[publish]',
aktif = '$_POST[aktif]',
status = '$_POST[status]',
urutan = '$_POST[urutan]'
WHERE id_modul = '$_POST[id]'");
header('location:../../media.php?module='.$module);
}
}
?>