MEMBER 1. Tabel member
2. Form Pendaftaran Member : formmember.php
3. Script Form Pendaftaran Member
<script src="development-bundle/jquery-1.8.0.min.js"> <script src="development-bundle/ui/ui.core.js"> <script src="development-bundle/ui/ui.datepicker.js"> <script src="development-bundle/ui/i18n/ui.datepicker-id.js"> <script type="text/javascript"> $(document).ready(function(){ $("#tgl").datepicker({ dateFormat : "dd/mm/yy", changeMonth : true, changeYear : true }); }); <script type="text/javascript"> $(document).ready(function(){ $("#tgl2").datepicker({ dateFormat : "dd/mm/yy", changeMonth : true, changeYear : true });
}); <script type="text/javascript"> function Validasi(){ var angka = "0123456789"; var x = 0; var nama=document.getElementById('xnama').value; var email=document.getElementById('xemail').value; var notelepon=document.getElementById('xtelepon').value; if (nama==""){ alert("Nama Harus Diisi"); form1.xnama.focus(); return false; } if (notelepon.length!=12) { alert("no telepon harus 12 karakter"); form1.xtelepon.focus(); return false; } if ((email.indexOf('@',0)==-1) || (email.indexOf('.',0)==-1)){ alert("Email Kurang Tepat"); form1.xemail.focus(); return false; } for (var i=0; i < notelepon.length; i++) { digitb = "" + notelepon.substring(i, i+1); if (angka.indexOf(digitb) == "-1") { window.alert("Karakter pada No Telepon yang dimasukkan salah (harus angka semua)"); form1.xemail.focus(); return false; } } return true; }
//ambil data dari tombol edit $act=$_GET["act"]; //panggil data berdasarkan idmember if($act=='edit') {
$angka1=$_GET["idmember"]; $qryedit=mysql_query("select * from member WHERE idmember='$angka1'"); $data=mysql_fetch_array($qryedit); } ?>
4. Proses Penyimpanan Member -> prosesmember.php
=$_POST["xangka"]; =strtoupper($_POST["xnama"]); =strtoupper($_POST["xtempatlahir"]); =$_POST["xtgllahir"]; =substr($tgllahir, 6,4).'-'.substr($tgllahir, 3,2).'-'.substr($tgllahir, 0,2); =strtoupper($_POST["xalamat"]); =$_POST["xtelepon"]; =$_POST["xemail"]; =$_POST["xagama"]; =$_POST["xjkelamin"]; =$_POST["xinformasi"]; =$_POST["xstatus"]; =$_FILES['xfoto']['name'];
if(isset($_POST["submit"])) { $simpan=mysql_query("INSERT INTO member (idmember, nama, tempatlahir, tgllahir, alamat, telepon, email, agama, jeniskelamin, informasi, status, foto) VALUES('$idmember', '$nama', '$tempatlahir', '$tgl', '$alamat', '$telepon', '$email', '$agama', '$jkelamin', '$informasi', '$status', '$namafile')"); //Cek File if (strlen($namafile)>0) { //upload Photo if (is_uploaded_file($_FILES['xfoto']['tmp_name'])) { move_uploaded_file ($_FILES['xfoto']['tmp_name'], "file/".$namafile); } } echo "<script> alert('Data sudah tersimpan');"; } if(isset($_POST["edit"])) { //Cek File if (strlen($namafile)>0) { //hapus file lama $fotolama=$_POST["xfotolama"]; unlink('file/'.$fotolama); //upload Photo if (is_uploaded_file($_FILES['xfoto']['tmp_name'])) { move_uploaded_file ($_FILES['xfoto']['tmp_name'], "file/".$namafile); } $edit=mysql_query("UPDATE member SET nama='$nama', tempatlahir='$tempatlahir', tgllahir='$tgl', alamat='$alamat', telepon='$telepon', email='$email', agama='$agama', jeniskelamin='$jkelamin', informasi='$informasi', status='$status', foto='$namafile' WHERE idmember='$idmember'"); } else { $edit=mysql_query("UPDATE member SET nama='$nama', tempatlahir='$tempatlahir', tgllahir='$tgl', alamat='$alamat',
telepon='$telepon', email='$email', agama='$agama', jeniskelamin='$jkelamin', informasi='$informasi', status='$status' WHERE idmember='$idmember'"); } echo "<script> alert('Data sudah diupdate');"; //header('Location:datapendaftar.php'); } if(isset($_GET["act"])) { $idmember=$_GET["idmember"]; $hapus=mysql_query("DELETE FROM member WHERE idmember='$idmember'"); header('Location:index.php?kirim=datamember'); } if(!isset($_GET["act"])) { ?>
DATA PENDAFTARAN No Daftar Nama Lengkap Tempat Lahir Tgl Lahir Alamat Lengkap Telepon/HP Email : Agama Jenis Kelamin Informasi Dari Status :: lihat semua data
5. Tampilan Data Member -> datamember.php
DATA MEMBER
6. Form Pencarian Data Member -> formcarimember.php
PENCARIAN DATA MEMBER
7. Hasil Cari Member -> hasilcarimember.php
=$_POST["katakunci"]; =$_POST["pilih"];
if(empty($katakunci) or empty($pilih)) { echo "
"; } else {
$cek=mysql_query("select * from member where $pilih like '%$katakunci%'"); $ketemu=mysql_num_rows($cek); if($ketemu<1) { echo "
"; } else { echo "
Data dengan kata kunci $katakunci ditemukan sebanyak $ketemu data
"; ?>
DATA PENDAFTAR