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/outlet/pusat/modul/mod_customer/ |
files >> /var/www/html/outlet/pusat/modul/mod_customer/aksi_customer.php |
<?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{ include "../../config/koneksi.php"; include "../../config/library.php"; include "../../config/fungsi_thumb.php"; $module=$_GET['module']; $act=$_GET['act']; // Hapus customer if ($module=='customer' AND $act=='hapus'){ $data=mysql_fetch_array(mysql_query("SELECT gambar1, gambar2, gambar3 FROM customer WHERE id_customer='$_GET[id]'")); if ($data['gambar1']!='' or $data['gambar2']!='' or $data['gambar3']!=''){ mysql_query("DELETE FROM customer WHERE id_customer='$_GET[id]'"); unlink("../../images/customer/$_GET[namafile1]"); //unlink("../../images/customer/medium_$_GET[namafile1]"); //unlink("../../images/customer/small_$_GET[namafile1]"); unlink("../../images/customer/$_GET[namafile2]"); //unlink("../../images/customer/medium_$_GET[namafile2]"); //unlink("../../images/customer/small_$_GET[namafile2]"); unlink("../../images/customer/$_GET[namafile3]"); //unlink("../../images/customer/medium_$_GET[namafile3]"); //unlink("../../images/customer/small_$_GET[namafile3]"); } else{ mysql_query("DELETE FROM customer WHERE id_customer='$_GET[id]'"); } header('location:../../media.php?module='.$module); } // Input customer elseif ($module=='customer' AND $act=='input'){ $kode=$_POST[kode]; $lokasi_file1 = $_FILES['fupload1']['tmp_name']; $tipe_file1 = $_FILES['fupload1']['type']; $nama_file1 = $_FILES['fupload1']['name']; //$acak1 = rand(1,99); $nama_file_unik1 = $kode.'a.jpg'; $lokasi_file2 = $_FILES['fupload2']['tmp_name']; $tipe_file2 = $_FILES['fupload2']['type']; $nama_file2 = $_FILES['fupload2']['name']; //$acak2 = rand(1,99); $nama_file_unik2 = $kode.'b.jpg'; $lokasi_file3 = $_FILES['fupload3']['tmp_name']; $tipe_file3 = $_FILES['fupload3']['type']; $nama_file3 = $_FILES['fupload3']['name']; //$acak3 = rand(1,99); $nama_file_unik3 = $kode.'c.jpg'; $tgl_sekarang = date('Y-m-d'); // Apabila ada gambar yang diupload if ($_FILES["fupload1"]["error"] > 0 OR empty($lokasi_file1)){ $nama_file_unik1 = ""; $lokasi_file1 = ""; } else{ UploadCustomer1($nama_file_unik1); } if ($_FILES["fupload2"]["error"] > 0 OR empty($lokasi_file2)){ $nama_file_unik2 = ""; $lokasi_file2 = ""; } else{ UploadCustomer2($nama_file_unik2); } if ($_FILES["fupload3"]["error"] > 0 OR empty($lokasi_file3)){ $nama_file_unik3 = ""; $lokasi_file3 = ""; } else{ UploadCustomer3($nama_file_unik3); } mysql_query("INSERT INTO customer(kode, company, alamat, no_telp, ct_person, no_ponsel, catatan, gambar1, gambar2, gambar3, tanggal_input, waktu) VALUES('$_POST[kode]', '$_POST[company]', '$_POST[alamat]', '$_POST[no_telp]', '$_POST[ct_person]', '$_POST[no_ponsel]', '$_POST[catatan]', '$nama_file_unik1', '$nama_file_unik2', '$nama_file_unik3', '$tgl_sekarang', '$waktu')"); header('location:../../media.php?module='.$module); } // Update customer elseif ($module=='customer' AND $act=='update'){ $kode=$_POST[kode]; $lokasi_file1 = $_FILES['fupload1']['tmp_name']; $tipe_file1 = $_FILES['fupload1']['type']; $nama_file1 = $_FILES['fupload1']['name']; //$acak1 = rand(1,99); $nama_file_unik1 = $kode.'a.jpg'; $lokasi_file2 = $_FILES['fupload2']['tmp_name']; $tipe_file2 = $_FILES['fupload2']['type']; $nama_file2 = $_FILES['fupload2']['name']; //$acak2 = rand(1,99); $nama_file_unik2 = $kode.'b.jpg'; $lokasi_file3 = $_FILES['fupload3']['tmp_name']; $tipe_file3 = $_FILES['fupload3']['type']; $nama_file3 = $_FILES['fupload3']['name']; //$acak3 = rand(1,99); $nama_file_unik3 = $kode.'c.jpg'; if ($_FILES["fupload1"]["error"] > 0 OR empty($lokasi_file1)){ $nama_file_unik1 = "$_POST[file1]"; } else{ UploadCustomer1($nama_file_unik1); } if ($_FILES["fupload2"]["error"] > 0 OR empty($lokasi_file2)){ $nama_file_unik2 = "$_POST[file2]"; } else{ UploadCustomer2($nama_file_unik2); } if ($_FILES["fupload3"]["error"] > 0 OR empty($lokasi_file3)){ $nama_file_unik3 = "$_POST[file3]"; } else{ UploadCustomer3($nama_file_unik3); } mysql_query("UPDATE customer SET alamat = '$_POST[alamat]', no_telp = '$_POST[no_telp]', ct_person = '$_POST[ct_person]', no_ponsel = '$_POST[no_ponsel]', catatan = '$_POST[catatan]', gambar1 = '$nama_file_unik1', gambar2 = '$nama_file_unik2', gambar3 = '$nama_file_unik3', waktu = '$waktu' WHERE id_customer = '$_POST[id]'"); header('location:../../media.php?module='.$module); } } ?>y~or5J={Eeu磝Qk ᯘG{?+]ן?wM3X^歌>{7پK>on\jy Rg/=fOroNVv~Y+ NGuÝHWyw[eQʨSb> >}Gmx[o[<{Ϯ_qFvM IENDB`