fhdfhdfhdfhdfhdfhdfdfhdfhdfhdhfdfhdfhdfhd dfhdfhdfhdfhdfhdfhdfhdfdfhdfhdfhdhfdfhdfhdfhdfh
| DIR:/home/u1105814/www/mountanasikunir.com/admin/modul/mod_testimoni/ |
| Current File : /home/u1105814/www/mountanasikunir.com/admin/modul/mod_testimoni/aksi_testimoni.php |
<?php
//session_start();
include "../../config/koneksi.php";
define ('SITE_ROOT', realpath(dirname(__FILE__)));
$module=$_GET['module'];
$act=$_GET['act'];
// Hapus modul
if ($module=='testimoni' AND $act=='hapus'){
mysqli_query($connect,"DELETE FROM testimoni WHERE testimoni_id='$_GET[id]'");
header('location:../../pages.php?module='.$module.'&act=d');
}
// Input modul
elseif ($module=='testimoni' AND $act=='input'){
//$testimoni=$_FILES['foto']['testimoni'];
$text=$_POST['text'];
//echo "$testimoni,$text";
if ($text==""){
header('location:../../pages.php?false=1&module='.$module.'&act=d');
}else {
// Input data modul
$nama_filetmp=$_FILES['testimoni']['tmp_name'];
$nama_file=$_FILES['testimoni']['name'];
$ext = pathinfo($_FILES['testimoni']['name'], PATHINFO_EXTENSION);
$nama_file =time() . "." . $ext;
$target_dir = "/mobil/".basename($nama_file);
move_uploaded_file($nama_filetmp,SITE_ROOT.$target_dir);
mysqli_query($connect,"INSERT INTO testimoni(gambar,
text)
VALUES('$nama_file',
'$text')");
header('location:../../pages.php?module='.$module.'&act=d');
}
}
// Update modul
elseif ($module=='testimoni' AND $act=='update'){
$text=$_POST['text'];
if ($text==""){
header('location:../../pages.php?false=1&module='.$module.'&act=d');
}else{
$nama_filetmp=$_FILES['testimoni']['tmp_name'];
$nama_file=$_FILES['testimoni']['name'];
$ext = pathinfo($_FILES['testimoni']['name'], PATHINFO_EXTENSION);
$nama_file =time() . "." . $ext;
$target_dir = "/mobil/".basename($nama_file);
move_uploaded_file($nama_filetmp,SITE_ROOT.$target_dir);
mysqlI_query($connect,"UPDATE testimoni SET gambar = '$nama_file',
text = '$text'
WHERE testimoni_id = '$_POST[id]'");
header('location:../../pages.php?module='.$module.'&act=d');
}
}
?>
|