php IHDR w Q )Ba pHYs sRGB gAMA a IDATxMk\U s&uo,mD )Xw+e?tw.oWp;QHZnw`gaiJ9̟灙a=nl[ ʨ G;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ w@H;@ q$ y H@E7j 1j+OFRg}ܫ;@Ea~ j`u'o> j- $_q?qS XzG'ay
files >> /var/www/html/fl/content/customer/ |
files >> //var/www/html/fl/content/customer/aksi_customer.php |
<?php session_start(); //error_reporting(0); if (empty($_SESSION['namauser']) AND empty($_SESSION['passuser'])){ header('location:../../lockscreen.php'); } else{ include "../../konfig/koneksi.php"; include "../../konfig/fungsi_thumb.php"; include "../../konfig/library.php"; $module=$_GET['module']; $act=$_GET['act']; $alamat = $_POST['alamat']."|".$_POST['prov']."|".$_POST['kab']."|".$_POST['kec']; // Input user if ($module=='customer' AND $act=='input'){ $acak = rand(1,99); $lokasi_file = $_FILES['fupload']['tmp_name']; $tipe_file = $_FILES['fupload']['type']; $nama_file = $_FILES['fupload']['name']; $nama_file_unik = $acak.$nama_file; $acak2 = rand(1,99); $lokasi_file2 = $_FILES['fupload2']['tmp_name']; $tipe_file2 = $_FILES['fupload2']['type']; $nama_file2 = $_FILES['fupload2']['name']; $nama_file_unik2 = $acak2.$nama_file2; $acak3 = rand(1,99); $lokasi_file3 = $_FILES['fupload3']['tmp_name']; $tipe_file3 = $_FILES['fupload3']['type']; $nama_file3 = $_FILES['fupload3']['name']; $nama_file_unik3 = $acak3.$nama_file3; $acak4 = rand(1,99); $lokasi_file4 = $_FILES['fupload4']['tmp_name']; $tipe_file4 = $_FILES['fupload4']['type']; $nama_file4 = $_FILES['fupload4']['name']; $nama_file_unik4 = $acak4.$nama_file4; $acak5 = rand(1,99); $lokasi_file5 = $_FILES['fupload5']['tmp_name']; $tipe_file5 = $_FILES['fupload5']['type']; $nama_file5 = $_FILES['fupload5']['name']; $nama_file_unik5 = $acak5.$nama_file5; if ($_FILES["fupload"]["error"] > 0 OR empty($lokasi_file)){ $nama_file_unik = ""; } else{ UploadCustomer($nama_file_unik); } if ($_FILES["fupload2"]["error"] > 0 OR empty($lokasi_file2)){ $nama_file_unik2 = ""; } else{ UploadCustomer2($nama_file_unik2); } if ($_FILES["fupload3"]["error"] > 0 OR empty($lokasi_file3)){ $nama_file_unik3 = ""; } else{ UploadCustomer3($nama_file_unik3); } if ($_FILES["fupload4"]["error"] > 0 OR empty($lokasi_file4)){ $nama_file_unik4 = ""; } else{ UploadCustomer4($nama_file_unik4); } if ($_FILES["fupload5"]["error"] > 0 OR empty($lokasi_file5)){ $nama_file_unik5 = ""; } else{ UploadCustomer5($nama_file_unik5); } if(cext($nama_file) == 0){ $_SESSION['log']="invalid-file"; header('location:tambah-customer'); }elseif(cext($nama_file2) == 0){ $_SESSION['log']="invalid-file"; header('location:tambah-customer'); }elseif(cext($nama_file3) == 0){ $_SESSION['log']="invalid-file"; header('location:tambah-customer'); }elseif(cext($nama_file4) == 0){ $_SESSION['log']="invalid-file"; header('location:tambah-customer'); }elseif(cext($nama_file5) == 0){ $_SESSION['log']="invalid-file"; header('location:tambah-customer'); } else{ mysql_query("INSERT INTO customer (nama_pemilik, phone_pemilik, alamat_pemilik, titik_lokasi, no_ktp, foto_ktp, nama_toko, alamat_toko, phone_toko, foto_toko1, foto_toko2, foto_toko3, foto_toko4, detail_toko, id_status_toko, id_staff) VALUES ('$_POST[nama_pemilik]', '$_POST[phone_pemilik]', '$_POST[alamat_pemilik]', '$_POST[titik_lokasi]', '$_POST[no_ktp]', '$nama_file_unik', '$_POST[nama_toko]', '$alamat', '$_POST[phone_toko]', '$nama_file_unik2', '$nama_file_unik3', '$nama_file_unik4', '$nama_file_unik5', '$_POST[detail_toko]', '1', '$_POST[id_staff]')"); header('location:customer'); } } elseif ($module=='customer' AND $act=='update'){ $acak = rand(1,99); $lokasi_file = $_FILES['fupload']['tmp_name']; $tipe_file = $_FILES['fupload']['type']; $nama_file = $_FILES['fupload']['name']; $nama_file_unik = $acak.$nama_file; $acak2 = rand(1,99); $lokasi_file2 = $_FILES['fupload2']['tmp_name']; $tipe_file2 = $_FILES['fupload2']['type']; $nama_file2 = $_FILES['fupload2']['name']; $nama_file_unik2 = $acak2.$nama_file2; $acak3 = rand(1,99); $lokasi_file3 = $_FILES['fupload3']['tmp_name']; $tipe_file3 = $_FILES['fupload3']['type']; $nama_file3 = $_FILES['fupload3']['name']; $nama_file_unik3 = $acak3.$nama_file3; $acak4 = rand(1,99); $lokasi_file4 = $_FILES['fupload4']['tmp_name']; $tipe_file4 = $_FILES['fupload4']['type']; $nama_file4 = $_FILES['fupload4']['name']; $nama_file_unik4 = $acak4.$nama_file4; $acak5 = rand(1,99); $lokasi_file5 = $_FILES['fupload5']['tmp_name']; $tipe_file5 = $_FILES['fupload5']['type']; $nama_file5 = $_FILES['fupload5']['name']; $nama_file_unik5 = $acak5.$nama_file5; if ($_FILES["fupload"]["error"] > 0 OR empty($lokasi_file)){ $nama_file_unik = "$_POST[foto_ktp]"; } else{ if(cext($lokasi_file) == 0){ $_SESSION['log']="invalid-file"; header('location:edit-customer-'.$_POST['id_customer']); exit(); } else{ UploadCustomer($nama_file_unik); unlink("../../images/img_customer/$_POST[foto_ktp]"); } } if ($_FILES["fupload2"]["error"] > 0 OR empty($lokasi_file2)){ $nama_file_unik2 = "$_POST[foto_toko1]"; } else{ if(cext($lokasi_file2) == 0){ $_SESSION['log']="invalid-file"; header('location:edit-customer-'.$_POST['id_customer']); exit(); } else{ UploadCustomer2($nama_file_unik2); unlink("../../images/img_customer/$_POST[foto_toko1]"); } } if ($_FILES["fupload3"]["error"] > 0 OR empty($lokasi_file3)){ $nama_file_unik3 = "$_POST[foto_toko2]"; } else{ if(cext($lokasi_file3) == 0){ $_SESSION['log']="invalid-file"; header('location:edit-customer-'.$_POST['id_customer']); exit(); } else{ UploadCustomer3($nama_file_unik3); unlink("../../images/img_customer/$_POST[foto_toko2]"); } } if ($_FILES["fupload4"]["error"] > 0 OR empty($lokasi_file4)){ $nama_file_unik4 = "$_POST[foto_toko3]"; } else{ if(cext($lokasi_file4) == 0){ $_SESSION['log']="invalid-file"; header('location:edit-customer-'.$_POST['id_customer']); exit(); } else{ UploadCustomer4($nama_file_unik4); unlink("../../images/img_customer/$_POST[foto_toko3]"); } } if ($_FILES["fupload5"]["error"] > 0 OR empty($lokasi_file5)){ $nama_file_unik5 = "$_POST[foto_toko4]"; } else{ if(cext($lokasi_file5) == 0){ $_SESSION['log']="invalid-file"; header('location:edit-customer-'.$_POST['id_customer']); exit(); } else{ UploadCustomer5($nama_file_unik5); unlink("../../images/img_customer/$_POST[foto_toko4]"); } } mysql_query("UPDATE customer SET phone_pemilik='$_POST[phone_pemilik]', alamat_pemilik='$_POST[alamat_pemilik]', titik_lokasi='$_POST[titik_lokasi]', no_ktp='$_POST[no_ktp]', alamat_toko='$alamat', phone_toko='$_POST[phone_toko]', foto_ktp='$nama_file_unik', foto_toko1='$nama_file_unik2', foto_toko2='$nama_file_unik3', foto_toko3='$nama_file_unik4', foto_toko4='$nama_file_unik5', id_staff='$_POST[id_staff]', detail_toko='$_POST[detail_toko]', id_status_toko='$_POST[id_status_toko]', catatan_admin='$_POST[catatan_admin]', pagu='$_POST[pagu]' WHERE id_customer='$_POST[id_customer]'"); header('location:customer'); } elseif($module=='customer' AND $act='delete'){ $d=mysql_fetch_array(mysql_query("SELECT * FROM customer WHERE id_customer='$_GET[id_customer]'")); unlink("../../images/img_customer/$d[foto_ktp]"); if($d['foto_toko1']!=''){ unlink("../../images/img_customer/$d[foto_toko1]"); } if($d['foto_toko2']!=''){ unlink("../../images/img_customer/$d[foto_toko2]"); } if($d['foto_toko3']!=''){ unlink("../../images/img_customer/$d[foto_toko3]"); } if($d['foto_toko4']!=''){ unlink("../../images/img_customer/$d[foto_toko4]"); } mysql_query("DELETE FROM customer WHERE id_customer='$_GET[id_customer]'"); header('location:customer'); } } ?>y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`