65
45 LAMPIRAN Lampiran File Admin Biaya _add <?php include ('inc/config.php'); //data dari user if (isset($_POST['tambahLogin'])) { $id_kota = $_POST['id_kota']; $nama_kota = $_POST['nama_kota']; $biaya = $_POST['biaya']; $sql = "INSERT INTO biaya_kirim(id_kota,nama_kota,biaya) VALUES('$id_kota', '$nama_kota','$biaya')"; $result = mysql_query($sql) or die(mysql_error()); //check if query successful if ($result) { header('location:index.php?page=biaya_view&status=0'); } else { header('location:index.php?page=biaya_view&status=1'); } mysql_close(); } ?> Bayar_view : <?php 45

LAMPIRAN - repository.bsi.ac.id · 48

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: LAMPIRAN - repository.bsi.ac.id · 48

45

LAMPIRAN

Lampiran File Admin

Biaya _add

<?php

include ('inc/config.php');

//data dari user

if (isset($_POST['tambahLogin'])) {

$id_kota = $_POST['id_kota'];

$nama_kota = $_POST['nama_kota'];

$biaya = $_POST['biaya'];

$sql = "INSERT INTO biaya_kirim(id_kota,nama_kota,biaya)

VALUES('$id_kota', '$nama_kota','$biaya')";

$result = mysql_query($sql) or die(mysql_error());

//check if query successful

if ($result) {

header('location:index.php?page=biaya_view&status=0');

} else {

header('location:index.php?page=biaya_view&status=1');

}

mysql_close();

}

?>

Bayar_view :

<?php

45

Page 2: LAMPIRAN - repository.bsi.ac.id · 48

46

include ('inc/config.php');

?><table width="600px" border=0>

<tr style="background-color:#F79307">

<td>No pembayaran</td><td>Tgl_pembayaran</td><td>No Pesan</td><td>Total Harga</td><td>Status</td><td>Operasi</td></tr>

<?php

if(isset($_GET['del'])){

$no_pembayaran=$_GET['id'];

$hapus ="delete from pembayaran where no='$no'";

mysql_query($hapus) or die(mysql_error()); }

if(isset($_GET['app'])){

$no_pembayaran=$_GET['id'];

$app ="update pembayaran set status='sudah' where no='$no_pembayaran'";

mysql_query($app) or die(mysql_error()); }

$sql="";

if(isset($_POST['btnCari'])){

$cari=$_POST['cari'];

//ambil data dari table admin

$sql="SELECT * FROM pembayaran where kd_pesan like '%$cari

%'"; }else{

$sql="SELECT * FROM pembayaran order by kd_pesan

DESC"; }

$result=mysql_query($sql) or die(mysql_error());

Page 3: LAMPIRAN - repository.bsi.ac.id · 48

47

//proses menampilkan data

while($rows=mysql_fetch_array($result)){

?>

<tr>

<td><?php echo $rows['no'];?></td>

<td><?php echo $rows['tanggal'];?></td>

<td><?php echo $rows['kd_pesan'];?></td>

<td><?php echo $rows['total_bayar'];?></td>

<td><?php echo $rows['status'];?></td>

<td>

<a href="index.php?page=bayar_view&app=true&id=<?php echo$rows['no']?>">

<img src="image/approve.jpg"></a>

<a href="index.php?page=bayar_view&del=true&id=<?php echo $rows['no']?>"onclick="return askUser()";>

<img src="image/b_drop.png"></a>

</td>

</tr>

<?php

}

//tutup koneksi

?>

Page 4: LAMPIRAN - repository.bsi.ac.id · 48

48

<tr><td align=right colspan='4'>

<?php

if (isset($_GET['status'])) {

if ($_GET['status'] == 0) {

echo " Operasi data berhasil";

} else {

echo "operasi gagal";

}

}

?>

</td>

<td align=right></td></tr>

<tr></tr>

</table>

<?php

mysql_close();

//close database

//tampilan siapa yang login

?>

Bayar_form_add

<form id="form1" name="form1" method="post" action="bayar_add.php">

<td>

<table>

<tr>

<td width="120">no</td>

Page 5: LAMPIRAN - repository.bsi.ac.id · 48

49

<td width="350">

<input name="no" type="text" id="no" size="40" />

</td>

</tr>

<tr>

<td width="120">tanggal</td>

<td width="350">

<input name="tanggal" type="text" id="tanggal" size="40"/>

</td>

</tr>

<tr>

<td width="120">kd_pesan</td>

<td width="350">

<input name="no_pesan" type="text" id="no_pesan"size="40" />

</td>

</tr>

<tr>

<td width="120">total_bayar</td>

<td width="350">

<input name="total_bayar" type="total_harga"id="total_bayar" size="40" />

</td>

</tr>

<tr>

Page 6: LAMPIRAN - repository.bsi.ac.id · 48

50

<td>&nbsp;</td>

<td>

<input type="submit" name="tambahLogin"value="Tambah" />

<input type="reset" name="resetbtn"

value="Reset" /> </td>

</tr>

<tr>

<td colspan='2'><div id="form1_errorloc"style="color:red"></div></td>

</tr>

</table></td>

</form>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("no_bayar","req","nomor bayar masih kosong ");

frmvalidator.addValidation("tgl_bayar","req","tanggal bayar masih kosong ");

frmvalidator.addValidation("no_pesan","req","nomor pesan masih kosong ");

frmvalidator.addValidation("total_harga","req","total harga masih kosong ");

frmvalidator.addValidation("no_bayar","alnum_s","nomor bayar tidak boleh adaspasi ");

</script>

Page 7: LAMPIRAN - repository.bsi.ac.id · 48

51

Bayar_form_add

<?php

include ('inc/config.php');

$id = $_GET['id'];

//ambil data dari table feedback

$sql = "select * from barang where kd_batik='$id' ";

$result = mysql_query($sql) or

die(mysql_error()); ?>

<h2>Change Bayar</h2>

<table>

<form id="form1" name="form1" method="post"action="bayar_edit.php">

<?php

//proses menampilkan data

while($rows=mysql_fetch_array($result)){

?>

<td width="120">no</td>

<td width="350"><?php echo $rows['no'];?></td>

</tr>

<input type="text" id="no" name="no" value=<?php echo$rows['no'];?> />

<tr>

<td width="120">tgl_bayar</td>

<td width="350">

<input name="tanggal" type="tanggal" id="tanggal"size="40"

value=<?php echo $rows['tanggal'];?>>

</td>

Page 8: LAMPIRAN - repository.bsi.ac.id · 48

52

</tr>

<tr>

<td width="120">kd_pesan</td>

<td width="350">

<input name="kd_pesan" type="kd_pesan" id="kd_pesan"size="40"

value=<?php echo $rows['kd_pesan'];?>>

</td>

</tr>

<tr>

<td width="120">total_bayar</td>

<td width="350">

<input name="total_bayar" type="total_bayar"id="total_bayar" size="40"

value=<?php echo $rows['total_harga'];?>>

</td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input type="submit" name="submitUser" value="Submit"/>

<input type="reset" name="resetbtn"

value="Reset" /> </td>

</tr>

<?php

//loop while

}

Page 9: LAMPIRAN - repository.bsi.ac.id · 48

53

?>

</form>

</table>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("no_bayar","req","nomor bayar masih kosong ");

frmvalidator.addValidation("tgl_bayar","req","tanggal bayar masih kosong ");

frmvalidator.addValidation("no_pesan","req","nomor pesan masih kosong ");

frmvalidator.addValidation("total_harga","req","total harga masih kosong ");

frmvalidator.addValidation("no_bayar","alnum_s","nomor bayar tidak boleh adaspasi ");

</script>

Bayar_edit

<?php

include ('inc/config.php');

//data dari user

if (isset($_POST['submitUser'])) {

$no = $_POST['no'];

$tanggal = $_POST['tanggal'];

$no_pesan = $_POST['no_pesan'];

$total_bayar = $_POST['total_bayar'];

$sql = " update bayar set tanggal='$tanggal' ,

Page 10: LAMPIRAN - repository.bsi.ac.id · 48

54

no_pesan='$no_pesan', total_harga='$total_harga' wheretotal_bayar='$total_bayar'";

//echo $sql;

$result = mysql_query($sql) or die(mysql_error());

//check if query successful

if ($result) {

header('location:index.php?page=batik_view&status=0');

} else {

header('location:index.php?page=batik_view&status=1');

}

mysql_close();

}

?>

Bayar_Add

<?php

include ('inc/config.php');

//data dari user

if (isset($_POST['tambahLogin'])) {

$no = $_POST['no'];

$tanggal = $_POST['tanggal'];

$no_pesan = $_POST['no_pesan'];

$total_bayar = $_POST['total_bayar'];

$sql = "INSERT INTO pembayaran(no,tanggal,kd_pesan,total_bayar)

VALUES('$no', '$tanggal', '$kd_pesan','$total_bayar')";

$result = mysql_query($sql) or die(mysql_error());

Page 11: LAMPIRAN - repository.bsi.ac.id · 48

55

//check if query successful

if ($result) {

header('location:index.php?page=bayar_view&status=0');

} else {

header('location:index.php?page=bayar_view&status=1');

}

mysql_close();

}

?>

Batik_view

<?php

//include ('ind/config.php');

?><table border=0>

<tr style="background-color:#F79307">

<td>Kd buku</td><td>Judul</td><td>Harga</td><td>Operasi</td></tr>

<?php

if(isset($_GET['del'])){

$kd_barang=$_GET['id'];

$hapus ="delete from barang where kd_barang='$kd_barang'";

mysql_query($hapus) or die(mysql_error());

}

$sql="";

if(isset($_POST['btnCari'])){

$cari=$_POST['cari'];

$sql="SELECT * FROM barang where kd_barang like '%$cari

%'"; }else{

Page 12: LAMPIRAN - repository.bsi.ac.id · 48

56

$sql="SELECT * FROM barang ORDER BY kd_barang

DESC"; }

$result=mysql_query($sql) or die(mysql_error());

//proses menampilkan data

while($rows=mysql_fetch_array($result)){

?>

<tr>

<td><?php echo $rows['kd_barang'];?></td>

<td><?php echo $rows['judul'];?></td>

<td><?php echo $rows['harga'];?></td>

<td>

<!--<a href="index.php?page=buku_form_edit&id=<?php echo$rows['kd_barang']?>">

<img src="image/b_edit.png"></a>-->

<a href="index.php?page=buku_view&del=true&id=<?php echo$rows['kd_barang']?>" onclick="return askUser()";>

<img src="image/b_drop.png"></a>|

detail

</td>

</tr>

<?php

}

//tutup koneksi

?>

Page 13: LAMPIRAN - repository.bsi.ac.id · 48

57

<tr><td align=right colspan='4'>

<?php

if (isset($_GET['status'])) {

if ($_GET['status'] == 0) {

echo " Operasi data berhasil";

} else {

echo "operasi gagal";

}

}

?>

</td>

<td align=right><a href="index.php?page=batik_form_add">

<img src="image/add.jpg"> Tambah</a></td></tr>

<td align=right><a href="batik_cetak.php" target='_blank'>

cetak</a></td></tr>

<tr></tr>

</table>

<?php

mysql_close();

//close database

//tampilan siapa yang login

?>

Form_edit_batik

<?php

include ('inc/config.php');

$id = $_GET['id'];

Page 14: LAMPIRAN - repository.bsi.ac.id · 48

58

//ambil data dari table feedback

$sql = "select * from barang where kd_barang='$id' ";

$result = mysql_query($sql) or die(mysql_error());

while($rows=mysql_fetch_array($result)){

?>

<td width="120">kode_batik</td>

<td width="350"><?php echo $rows['kd_barang'];?></td>

</tr>

<input type="hidden" id="kd_barang" name="kd_barang"value=<?php echo $rows['kd_barang'];?> />

<tr>

<td width="120">kode_kategori</td>

<td width="350">

<input name="kd_kategori" type="kd_kategori"id="kd_kategori" size="40"

value=<?php echo $rows['kd_kategori'];?>>

</td>

</tr>

<tr>

<td width="120">ukuran</td>

<td width="350">

<input name="ukuran" type="ukuran" id="ukuran"size="40"

value=<?php echo $rows['ukuran'];?>>

</td>

</tr>

<tr>

<td>&nbsp;</td>

Page 15: LAMPIRAN - repository.bsi.ac.id · 48

59

<td>&nbsp;</td>

<td>

<input type="submit" name="submitUser" value="Submit"/>

<input type="reset" name="resetbtn" value="Reset" />

</td>

</tr>

<?php

//loop while

}

?>

</form>

</table>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTMLform

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("kd_barang", "req", "kode buku masih kosong");

frmvalidator.addValidation("kd_kategori", "req", "kode jenis masih kosong ");

frmvalidator.addValidation("ukuran", "req", "ukuran masih kosong ");

frmvalidator.addValidation("ukuran", "num", "input harus angka ");

frmvalidator.addValidation("ukuran", "lt=42", "input harus angka harus

<43");

frmvalidator.addValidation("ukuran", "gt=35", "input harus angka harus>35");

Page 16: LAMPIRAN - repository.bsi.ac.id · 48

60

rmvalidator.addValidation("username","maxlen=20"," nama tidak bolehlebih dari 20 ");

frmvalidator.addValidation("email","maxlen=50");

frmvalidator.addValidation("email","req");

frmvalidator.addValidation("email","email");

frmvalidator.addValidation("komentar","req","komentar masihkosong");*/

</script>

Batik_form

<form id="form1" name="form1" method="post" enctype="multipart/form-data"

action="batik_add.php">

<td>

<table>

<tr>

<td width="120">kode_barang</td>

<td width="350">

<input name="kd_barang" type="text" id="kd_barang"size="10" />

</td>

</tr>

<tr>

<td width="120">Judul</td>

<td width="350">

<input name="judul" type="text" id="judul" size="40" />

</td>

</tr>

<tr>

<td width="120">Gambar</td>

Page 17: LAMPIRAN - repository.bsi.ac.id · 48

61

<td width="350">

<input name="gambar" type="file" id="gambar" size="10"/>

</td>

</tr>

<tr>

<td width="120">Harga</td>

<td width="350">

<input name="harga" type="text" id="harga" size="10" />

</td>

</tr>

<tr>

<td width="120">kd_kategori</td>

<td width="350">

<select name='kd_kategori'>

<?php combo_kategori();?>

</select>

</td>

</tr>

<tr>

<td width="120">deskripsi</td>

<td width="350">

<textarea name='deskripsi' cols='60' rows='10'></textarea>

</td>

</tr>

<tr>

<td>&nbsp;</td>

Page 18: LAMPIRAN - repository.bsi.ac.id · 48

62

<td>

<input type="submit" name="tambah" value="Tambah" />

<input type="reset" name="resetbtn" value="Reset" />

</td>

</tr>

<tr>

<td colspan='2'><div id="form1_errorloc"style="color:red"></div></td>

</tr>

</table></td>

</form>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("kd_barang","req","kode batik masih kosong ");

frmvalidator.addValidation("kd_kategori","req","kode kategori masih kosong ");

frmvalidator.addValidation("harga","req","harga masih kosong ");

</script>

Batik_edit

<?php

include ('inc/config.php');

if (isset($_POST['submitUser'])) {

$kd_barang = $_POST['kd_barang'];

Page 19: LAMPIRAN - repository.bsi.ac.id · 48

63

$kd_kategori = $_POST['kd_kategori'];

$sql = " update barang set kd_kategori='$kd_kategori' wherekd_barang='$kd_barang'";

$result = mysql_query($sql) or die(mysql_error());

//check if query successful

if ($result) {

header('location:index.php?page=buku_view&status=0');

} else {

header('location:index.php?page=buku_view&status=1');

}

mysql_close();

}

?>

Batik_cetak

<html>

<head>

<link rel="stylesheet" type="text/css" media="screen"href="style2.css" />

</head>

<body>

<h2 align="center"> Laporan Daftar Batik </h2>

<h1 align="center"> Toko Batik </h1> <p

align="center">

jl pemuda raya Jakarta

</p>

<hr>

Page 20: LAMPIRAN - repository.bsi.ac.id · 48

64

<br/>

<?php?>

<table align='center'>

<tr style="background-color:#F79307">

<td>No</td><td>Kode barang</td><td>Judul</td>

<td>Harga</td><td>Gambar</td>

</tr>

<?php

include ('inc/config.php');

$sql="SELECT * FROM barang";

$result=mysql_query($sql) or die(mysql_error());

//proses menampilkan data

$no=1;

while($rows=mysql_fetch_array($result)){

?>

<tr> <td><?php $no;?></td>

<td><?php echo $rows['kd_barang'];?></td>

<td><?php echo $rows['judul'];?></td>

<td><?php echo $rows['harga'];?></td>

<td><?php echo $rows['gambar'];?></td>

</tr>

<?php

$no++;

}

?>

Page 21: LAMPIRAN - repository.bsi.ac.id · 48

65

</table>

<?mysql_close();

?>

</body>

</html>

Batik_add

<?php

include ('inc/config.php');

//data dari user

if (isset($_POST['tambah'])) {

$kd_barang = $_POST['kd_barang'];

$kd_kategori = $_POST['kd_kategori'];

$harga = $_POST['harga'];

$deskripsi = $_POST['deskripsi'];

$judul = $_POST['judul'];

$lokasi_file = $_FILES['gambar']['tmp_name'];

$nama_file = $_FILES['gambar']['name'];

$nama_file_baru = date('dmYHis').$nama_file;

$direktori = "../gambar/".$nama_file_baru;

if (move_uploaded_file($lokasi_file, $direktori)) {

$sql = "INSERT INTObarang(kd_barang,judul,kd_kategori,harga,deskripsi,gambar)

Page 22: LAMPIRAN - repository.bsi.ac.id · 48

66

VALUES('".$kd_barang."','".$judul."','".$kd_kategori."','".$harga."','".$des kripsi."','".$nama_file_baru."')";

$result = mysql_query($sql) or die(mysql_error());

//check if query successful

if ($result) {

header('location:index.php?page=batik_view&status=0');

} else {

header('location:index.php?page=batik_view&status=1');

}

mysql_close();

}

}

?>

Form_login

<?php

include ('inc/config.php');

$id = $_GET['id'];

//ambil data dari table feedback

$sql = "select * from det_pesan where no_det_pesan='$id'

"; $result = mysql_query($sql) or die(mysql_error()); ?>

<h2>Change Detai Pesan</h2>

<table>

<form id="form1" name="form1" name="form2" method="post"action="det_pesan_edit.php">

<?php

//proses menampilkan data

Page 23: LAMPIRAN - repository.bsi.ac.id · 48

67

while($rows=mysql_fetch_array($result)){

?>

<td width="120">no_det_pesan</td>

<td width="350"><?php echo $rows['no_det_pesan'];?></td>

</tr>

<input type="hidden" id="no_det_pesan" name="no_det_pesan"value=<?php echo $rows['no_det_pesan'];?> />

<tr>

<td width="120">no_pesan</td>

<td width="350">

<input name="no_pesan" type="no_pesan" id="no_pesan"size="40"

value=<? echo $rows['no_pesan'];?>>

</td>

</tr>

<tr>

<td width="120">kd_batik</td>

<td width="350">

<input name="kd_batik" type="kd_batik" id="kd_batik"size="40"

value=<?php echo $rows['kd_buku'];?>>

</td>

</tr>

<tr>

<td width="120">total_pesan</td>

<td width="350">

<input name="total_pesan" type="total_pesan"id="total_pesan" size="40"

value=<?php echo $rows['total_pesan'];?>>

Page 24: LAMPIRAN - repository.bsi.ac.id · 48

68

</td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input type="submit" name="submitUser" value="Submit"/>

<input type="reset" name="resetbtn"

value="Reset" /> </td>

</tr>

<?php

//loop while

}

?>

</form>

</table>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("no_det_pesan","req","nomor detail pesan masihkosong ");

frmvalidator.addValidation("no_pesan","req","nomor pesan masih kosong ");

frmvalidator.addValidation("kd_batik","req","kode batik masih kosong ");

frmvalidator.addValidation("total_pesan","req","total pesan masih kosong ");

Page 25: LAMPIRAN - repository.bsi.ac.id · 48

69

frmvalidator.addValidation("no_det_pesan","alnum_s","nomor detail tidak bolehada spasi ");

frmvalidator.addValidation("no_pesan","alnum_s","nomor pesan tidak boleh adaspasi");

frmvalidator.addValidation("total_pesan","minlen=1","total pesan minimal 1 ");

</script>

Det_pesan_form_edit

<?php

include ('inc/config.php');

$id = $_GET['id'];

//ambil data dari table feedback

$sql = "select * from det_pesan where no_det_pesan='$id'

"; $result = mysql_query($sql) or die(mysql_error()); ?>

<h2>Change Detai Pesan</h2>

<table>

<form id="form1" name="form1" name="form2" method="post"action="det_pesan_edit.php">

<?php

//proses menampilkan data

while($rows=mysql_fetch_array($result)){

?>

<td width="120">no_det_pesan</td>

<td width="350"><?php echo $rows['no_det_pesan'];?></td>

</tr>

<input type="hidden" id="no_det_pesan" name="no_det_pesan"value=<?php echo $rows['no_det_pesan'];?> />

<tr>

<td width="120">no_pesan</td>

Page 26: LAMPIRAN - repository.bsi.ac.id · 48

70

<td width="350">

<input name="no_pesan" type="no_pesan" id="no_pesan"size="40"

value=<? echo $rows['no_pesan'];?>>

</td>

</tr>

<tr>

<td width="120">kd_batik</td>

<td width="350">

<input name="kd_batik" type="kd_batik" id="kd_batik"size="40"

value=<?php echo $rows['kd_buku'];?>>

</td>

</tr>

<tr>

<td width="120">total_pesan</td>

<td width="350">

<input name="total_pesan" type="total_pesan"id="total_pesan" size="40"

value=<?php echo $rows['total_pesan'];?>>

</td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input type="submit" name="submitUser" value="Submit"/>

<input type="reset" name="resetbtn"

value="Reset" /> </td>

Page 27: LAMPIRAN - repository.bsi.ac.id · 48

71

</tr>

<?php

//loop while

}

?>

</form>

</table>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("no_det_pesan","req","nomor detail pesan masihkosong ");

frmvalidator.addValidation("no_pesan","req","nomor pesan masih kosong ");

frmvalidator.addValidation("kd_batik","req","kode batik masih kosong ");

frmvalidator.addValidation("total_pesan","req","total pesan masih kosong ");

frmvalidator.addValidation("no_det_pesan","alnum_s","nomor detail tidak bolehada spasi ");

frmvalidator.addValidation("no_pesan","alnum_s","nomor pesan tidak boleh adaspasi");

frmvalidator.addValidation("total_pesan","minlen=1","total pesan minimal 1 ");

</script>

Det_pesan_view

<?php

include ('inc/config.php');

?><table width="600px" border=0>

Page 28: LAMPIRAN - repository.bsi.ac.id · 48

72

<tr style="background-color:#F79307">

<td>No Detail Pesan</td><td>No Pesan</td>

<td>Kode Batik</td><td>Total Pesan</td><td>Operasi</td></tr>

<?php

if(isset($_GET['del'])){

$no_det_pesan=$_GET['id'];

$hapus ="delete from det_pesan where no_det_pesan='$no_det_pesan'";

mysql_query($hapus);

}

$sql="";

if(isset($_POST['btnCari'])){

$cari=$_POST['cari'];

//ambil data dari table admin

$sql="SELECT * FROM det_pesan where no_det_pesan like '%$cari

%'"; }else{

$sql="SELECT * FROM det_pesan";

}

$result=mysql_query($sql) or die(mysql_error());

//proses menampilkan data

while($rows=mysql_fetch_array($result)){

?>

<tr>

<td><?php echo $rows['no_det_pesan'];?></td>

Page 29: LAMPIRAN - repository.bsi.ac.id · 48

73

<td><?php echo $rows['no_pesan'];?></td>

<td><?php echo $rows['kd_barang'];?></td>

<td><?php echo $rows['total_pesan'];?></td>

<td>

<a href="index.php?page=det_pesan_form_edit&id=<?php echo$rows['no_det_pesan']?>">

<img src="image/b_edit.png">

<a href="index.php?page=det_pesan_view&del=true&id=<?php echo$rows['no_det_pesan']?>" onclick="return askUser()";>

<img src="image/b_drop.png"></a>

</td>

</tr>

<?php

}

//tutup koneksi

?>

<tr><td align=right colspan='3'>

<?php

if (isset($_GET['status'])) {

if ($_GET['status'] == 0) {

echo " Operasi data berhasil";

} else {

echo "operasi gagal";

Page 30: LAMPIRAN - repository.bsi.ac.id · 48

74

}

}

?>

</td>

<td align=right></td></tr>

</table>

<?php

mysql_close();

?>

<form id="form1" name="form1" method="post" action="det_pesan_add.php">

<td>

<table>

<tr>

<td width="120">no_det_pesan</td>

<td width="350">

<input name="no_det_pesan" type="text"id="no_det_pesan" size="40" />

</td>

</tr>

<tr>

<td width="120">no_pesan</td>

<td width="350">

<input name="no_pesan" type="no_pesan" id="no_pesan"size="40" />

</td>

</tr>

<tr>

Page 31: LAMPIRAN - repository.bsi.ac.id · 48

75

<td width="120">kd_batik</td>

<td width="350">

<input name="kd_batik" type="kd_batik" id="kd_batik"size="40" />

</td>

</tr>

<tr>

<td width="120">total_pesan</td>

<td width="350">

<input name="total_pesan" type="total_pesan"id="total_pesan" size="40" />

</td>

</tr>

<tr>

<td>&nbsp;</td>

<td>&nbsp;</td>

<td>

<input type="submit" name="tambahLogin"value="Tambah" />

<input type="reset" name="resetbtn"

value="Reset" /> </td>

</tr>

<tr>

<td colspan='2'><div id="form1_errorloc"style="color:red"></div></td>

</tr>

</table></td>

</form>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

Page 32: LAMPIRAN - repository.bsi.ac.id · 48

76

//You should create the validator only after the definition of the HTMLform

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("no_det_pesan", "req", "nomor detail pesanmasih kosong ");

frmvalidator.addValidation("no_pesan", "req", "nomor pesan masih kosong ");

frmvalidator.addValidation("kd_batik", "req", "kode batik masih kosong");

frmvalidator.addValidation("total_pesan", "req", "total pesan masihkosong ");

frmvalidator.addValidation("no_det_pesan", "alnum_s", "nomor detailtidak boleh ada spasi ");

frmvalidator.addValidation("no_pesan", "alnum_s", "nomor pesan tidakboleh ada spasi");

frmvalidator.addValidation("total_pesan", "minlen=1", "total pesanminimal 1 ");

</script>

Det_pesan_add

<?php

include ('inc/config.php');

//data dari user

if (isset($_POST['tambahLogin'])) {

$no_det_pesan = $_POST['no_det_pesan'];

$no_pesan = $_POST['no_pesan'];

$kd_batik = $_POST['kd_batik'];

$total_pesan = $_POST['total_pesan'];

Page 33: LAMPIRAN - repository.bsi.ac.id · 48

77

$sql = "INSERT INTOdet_pesan(no_det_pesan,no_pesan,kd_batik,total_pesan)

VALUES('$no_det_pesan', '$no_pesan','$kd_batik','$total_pesan')";

$result = mysql_query($sql) or die(mysql_error());

//check if query successful

if ($result) {

header('location:index.php?page=det_pesan_view&status=0');

} else {

header('location:index.php?page=det_pesan_view&status=1');

}

mysql_close();

}

?>

Det_pesan_edit

<?php

include ('inc/config.php');

//data dari user

if (isset($_POST['submitUser'])) {

$no_det_pesan = $_POST['no_det_pesan'];

$no_pesan = $_POST['no_pesan'];

$kd_batik = $_POST['kd_batik'];

$total_pesan = $_POST['total_pesan'];

$sql = " update det_pesan set no_pesan='$no_pesan' ,

kd_batik='$kd_batik', total_pesan='$total_pesan'

where no_det_pesan='$no_det_pesan'";

Page 34: LAMPIRAN - repository.bsi.ac.id · 48

78

//echo $sql;

$result = mysql_query($sql) or die(mysql_error());

//check if query successful

if ($result) {

header('location:index.php?page=batik_view&status=0');

} else {

header('location:index.php?page=batik_view&status=1');

}

mysql_close();

}

?>

Form_costumer_view

<?php

include('inc/config.php');

?><table width="600px" border=0>

<tr style="background-color:#F79307">

<td>Kd customer</td><td>Nama</td><td>Alamat</td><td>KodePos</td><td>No Telp</td><td>Email</td>

<td>Kd Pesan</td><td>Total Bayar</td><td>Operasi</td></tr>

<?php

if(isset($_GET['del'])){

$kd_customer=$_GET['id'];

$hapus ="delete from customer where

kd_pemesan='$kd_pemesan'"; mysql_query($hapus);

Page 35: LAMPIRAN - repository.bsi.ac.id · 48

79

}

$sql="";

if(isset($_POST['btnCari'])){

$cari=$_POST['cari'];

//ambil data dari table admin

$sql="SELECT * FROM customer where kd_pemesan like '%$cari

%'"; }else{

$sql="SELECT * FROM customer";

}

$result=mysql_query($sql) or die(mysql_error());

while($rows=mysql_fetch_array($result)){

error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));

?>

<tr>

<td><?php echo $rows['kd_pemesan']; ?></td>

<td><?php echo $rows['Nama']; ?></td>

<td><?php echo $rows['Alamat']; ?></td>

<td><?php echo $rows['kd_pos']; ?></td>

<td><?php echo $rows['No_telp']; ?></td>

<td><?php echo $rows['Email']; ?></td>

<td><?php echo $rows['kd_pesan']; ?></td>

<td><?php echo $rows['total_bayar']; ?></td>

Page 36: LAMPIRAN - repository.bsi.ac.id · 48

80

<td>

<a href="index.php?page=customer_form_edit&id=<?php echo$rows['kd_customer']?>">

<img src="image/b_edit.png"></a>-->

<a href="index.php?page=customer_view&del=true&id=<?php echo$rows['kd_customer']?>" onclick="return askUser()";>

<img src="image/b_drop.png"></a>

</td>

</tr>

<?php

}

?>

<tr><td align=right colspan='6'>

<?php

if(isset($_GET['status'])){

if($_GET['status']==0){

echo " Operasi data berhasil";

}else{

echo "operasi gagal";

}

}

?>

</td>

<td align=right><!--<a href="index.php?page=customer_form_add">

<img src="image/add.jpg"> Add</a>--></td></tr> <tr></tr>

</table>

Page 37: LAMPIRAN - repository.bsi.ac.id · 48

81

<?php

mysql_close();

?>

Costumer_form_edit

<?php

include('inc/config.php');

$id=$_GET['id'];

//ambil data dari table feedback

$sql="select * from pemesan where kd_pemesan='$id'

"; $result=mysql_query($sql) or die(mysql_error());

?>

<h2>Change Pemesan</h2>

<table>

<form id="form1" name="form1" name="form2" method="post"action="bayar_edit.php">

<?php

//proses menampilkan data

while($rows=mysql_fetch_array($result)){

?>

<td width="120">kd_pemesan</td>

<td width="350"><?php echo $rows['kd_pemesan'];?> </td>

</tr>

Page 38: LAMPIRAN - repository.bsi.ac.id · 48

82

<input type="hidden" id="kd_pemesan" name="kd_pemesan" value=<?php echo $rows['kd_pemesan'];?> />

<tr>

<td width="120">Nama</td>

<td width="350"><input name="Nama" type="Nama" id="Nama"

size="40" value=<?php echo $rows['Nama'];?>></td>

</tr>

<tr>

<td width="120">Alamat</td>

<td width="350"><input name="Alamat" type="Alamat" id="Alamat"

size="40" value=<?php echo $rows['Alamat'];?>></td>

</tr>

<tr>

<td width="120">kd_pos</td>

<td width="350"><input name="kd_pos" type="kd_pos" id="kd_pos"

size="40" value=<?php echo $rows['kd_pos'];?>></td>

</tr>

<tr>

<td width="120">No_telp</td>

<td width="350"><input name="No_telp" type="No_telp" id="No_telp"size="40"

Page 39: LAMPIRAN - repository.bsi.ac.id · 48

83

value=<?php echo $rows['No_telp'];?>></td>

</tr>

<tr>

<td width="120">Email</td>

<td width="350"><input name="Email" type="Email" id="Email"

size="40" value=<?php echo $rows['Email'];?>></td>

</tr>

<tr>

<td>&nbsp;</td>

<td>&nbsp;</td>

<td><input type="submit" name="submitUser" value="Submit" /> <inputtype="reset" name="resetbtn" value="Reset" /></td>

</tr>

<?php

//loop while

}

?>

</form>

</table>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

Page 40: LAMPIRAN - repository.bsi.ac.id · 48

84

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("kd_pemesan","req","kode pemesan masih kosong ");

frmvalidator.addValidation("Nama","req","nama masih kosong ");

frmvalidator.addValidation("Alamat","req","alamat masih kosong ");

frmvalidator.addValidation("kd_pos","req","kode pos masih kosong ");

frmvalidator.addValidation("No_telp","req","no. telp masih kosong");

frmvalidator.addValidation("email","req","email masih kosong");

frmvalidator.addValidation("kd_pemesan","alnum_s ","kode pemesantidak boleh ada spasi ");

frmvalidator.addValidation("Alamat","minlen=10","alamat kuranglengkap ");

frmvalidator.addValidation("kd_pos","num","input harus angka ");

frmvalidator.addValidation("No_telp","num","input harus angka ");

frmvalidator.addValidation("email","maxlen=50","maksimal panjangemail 50 karakter");

</script>

Costumer_form_add

<form id="form1" name="form1" method="post" action="pemesan_add.php">

<td>

<table border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF">

<tr>

<td width="120">kd_pemesan</td>

<td width="350"><input name="kd_pemesan" type="text" id="kd_pemesan"size="40" /></td>

</tr>

<tr>

<td width="120">Nama</td>

Page 41: LAMPIRAN - repository.bsi.ac.id · 48

85

<td width="350"><input name="Nama" type="Nama" id="Nama" size="40" /></td>

</tr>

<tr>

<td width="120">Alamat</td>

<td width="350"><input name="Alamat" type="Alamat" id="Alamat" size="40" /></td>

</tr>

<tr>

<td width="120">kd_pos</td>

<td width="350"><input name="kd_pos" type="kd_pos" id="kd_pos" size="40" /></td>

</tr>

<tr>

<td width="120">No_telp</td>

<td width="350"><input name="No_telp" type="No_telp" id="No_telp"size="40" /></td>

</tr>

<tr>

<td width="120">Email</td>

<td width="350"><input name="Email" type="Email" id="Email" size="40" /></td>

Page 42: LAMPIRAN - repository.bsi.ac.id · 48

86

</tr>

<tr>

<td>&nbsp;</td>

<td>&nbsp;</td>

<td><input type="submit" name="tambahLogin" value="Tambah" /> <inputtype="reset" name="resetbtn" value="Reset" /></td>

</tr>

<tr>

<td colspan='2'>

<div id="form1_errorloc" style="color:red">

</div>

</td>

</tr>

</table>

</td>

</form>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("kd_pemesan","req","kode pemesan masih kosong ");

frmvalidator.addValidation("Nama","req","nama masih kosong ");

frmvalidator.addValidation("Alamat","req","alamat masih kosong ");

Page 43: LAMPIRAN - repository.bsi.ac.id · 48

87

frmvalidator.addValidation("kd_pos","req","kode pos masih kosong ");

frmvalidator.addValidation("No_telp","req","no. telp masih kosong");

frmvalidator.addValidation("email","req","email masih kosong");

frmvalidator.addValidation("kd_pemesan","alnum_s ","kode pemesantidak boleh ada spasi ");

frmvalidator.addValidation("Alamat","minlen=10","alamat kuranglengkap ");

frmvalidator.addValidation("kd_pos","num","input harus angka ");

frmvalidator.addValidation("No_telp","num","input harus angka ");

frmvalidator.addValidation("email","maxlen=50","maksimal panjangemail 50 karakter");

</script>

Costumer_form_edit

<?php

include('inc/config.php');

//data dari user

if(isset($_POST['submitUser'])){

$kd_pemesan=$_POST['kd_pemesan'];

$Nama=$_POST['Nama'];

$Alamat=$_POST['Alamat'];

$kd_pos=$_POST['kd_pos'];

$No_telp=$_POST['No_telp'];

$Email=$_POST['Email'];

$sql=" update pemesan set kd_pemesan='$kd_pemesan' ,Nama='$Nama', Alamat='$Alamat',

kd_pos='$kd_pos',No_telp='$No_telp',Email='$Email', wherekd_pemesan='$kd_pemesan'";

Page 44: LAMPIRAN - repository.bsi.ac.id · 48

88

//echo $sql;

$result=mysql_query($sql) or die(mysql_error());

//check if query successful

if($result){

header('location:index.php?page=batik_view&status=0');

}else {

header('location:index.php?page=batik_view&status=1');

}

mysql_close();

}

?>

<?php

include('inc/config.php');

//data dari user

if(isset($_POST['tambahLogin'])){

$kd_pemesan=$_POST['kd_pemesan'];

$Nama=$_POST['Nama'];

$Alamat=$_POST['Alamat'];

$kd_pos=$_POST['kd_pos'];

$No_telp=$_POST['No_telp'];

$Email=$_POST['Email'];

$sql="INSERT INTOpemesan(kd_pemesan,Nama,Alamat,kd_pos,No_telp,Email)

VALUES('$kd_pemesan', '$Nama','$Alamat','kd_pos','No_telp','Email')";

$result=mysql_query($sql) or die(mysql_error());

Page 45: LAMPIRAN - repository.bsi.ac.id · 48

89

//check if query successful

if($result){

header('location:index.php?page=cart.php');

}else {

header('location:index.php?page=cart.php');

}

mysql_close();

}

?>

Biaya_view

<?php

include ('inc/config.php');?><table width="600px" border=0>

<tr style="background-color:#F79307">

<td>id_kota</td><td>nama_kota</td><td>biaya</td><td>Operasi</td></tr>

<?php

error_reporting(E_ALL ^ (E_NOTICE | E_WARNING));

$batas=4;

$halaman=$_GET['halaman'];

$posisi=null;

if(empty($halaman)){

$posisi=0;

$halaman=1;

}else{

$posisi=($halaman-1)* $batas;

}

Page 46: LAMPIRAN - repository.bsi.ac.id · 48

90

//===========================

if(isset($_GET['del'])){

$id_kota=$_GET['id'];

$hapus ="delete from biaya_kirim where id_kota='$id_kota'";

mysql_query($hapus);

}

$sql="";

if(isset($_POST['btnCari'])){

$cari=$_POST['cari'];

//ambil data dari table admin

$sql="SELECT * FROM biaya_kirim where id_kota like '%$cari

%'"; }else{

$sql="SELECT * FROM biaya_kirim limit $posisi,

$batas"; }

$result=mysql_query($sql) or die(mysql_error());

$no=1;

//proses menampilkan data

while($rows=mysql_fetch_array($result)){

?>

<tr>

<td><?php echo $no+$posisi;?></td>

<td><?php echo $rows['nama_kota'];?></td>

<td><?php echo $rows['biaya'];?></td>

Page 47: LAMPIRAN - repository.bsi.ac.id · 48

91

<td>

<a href="index.php?page=biaya_kirim_form_edit&id=<?php echo$rows['id_kota']?>">

<img src="image/b_edit.png"></a>

<a href="index.php?page=biaya_view&del=true&id=<?php echo$rows['id_kota']?>" onclick="return askUser()";>

<img src="image/b_drop.png"></a>

</td>

</tr>

<?php

$no++;

}

//tutup koneksi

?>

<tr><td align=right colspan='2'>

<?php

if(isset($_GET['status'])) {

if($_GET['status'] == 0) {

echo " Operasi data berhasil";

} else {

echo "operasi gagal";

}

}?>

</td>

<td align=right><a href="index.php?

page=biaya_kirim_form_add"> <img src="image/add.jpg">

Add</a></td></tr> <tr></tr>

Page 48: LAMPIRAN - repository.bsi.ac.id · 48

92

</table>

<?php

//=============CUTHERE====================================

$tampil2 = mysql_query("select * from biaya_kirim");

$jmldata = mysql_num_rows($tampil2);

$jumlah_halaman = ceil($jmldata / $batas);

echo "Halaman :";

for($i = 1; $i <= $jumlah_halaman; $i++)

if($i != $halaman) {

echo "<ahref=index.php?page=biaya_view&halaman=$i>$i</a>|";

} else {

echo "<b>$i</b>|";

}

mysql_close();?>

<br>

Jumlah data :<?php $jmldata;?>

<?mysql_close();

//close database

//tampilan siapa yang login?>

Biaya_kirim_form_add

<form id="form1" name="form1" method="post" action="biaya_add.php">

<td>

<table>

Page 49: LAMPIRAN - repository.bsi.ac.id · 48

93

<tr>

<td width="120">nama_kota</td>

<td width="350">

<input name="nama_kota" type="nama_kota"id="nama_kota" size="40" />

</td>

</tr>

<tr>

<td width="120">biaya</td>

<td width="350">

<input name="biaya" type="biaya" id="biaya" size="40" />

</td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input type="submit" name="tambahLogin"value="Tambah" />

<input type="reset" name="resetbtn"

value="Reset" /> </td>

</tr>

<tr>

<td colspan='2'><div id="form1_errorloc"style="color:red"></div></td>

</tr>

</table></td>

</form>

<script language="javaScript" type="text/javascript"

Page 50: LAMPIRAN - repository.bsi.ac.id · 48

94

xml:space="preserve">

//You should create the validator only after the definition of the HTMLform

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("nama_kota", "req", "nama kota masih kosong ");

frmvalidator.addValidation("biaya", "req", "biaya masih kosong ");

</script>

Biaya_kirim_edit

<?php

include ('inc/config.php');

$id = $_GET['id'];

//ambil data dari table feedback

$sql = "select * from biaya_kirim where id_kota='$id'

"; $result = mysql_query($sql) or die(mysql_error()); ?

>

<h2>Change Biaya Kirim</h2>

<table>

<form id="form1" name="form1" method="post"action="biaya_edit.php">

<?php

//proses menampilkan data

while($rows=mysql_fetch_array($result)){

?>

Page 51: LAMPIRAN - repository.bsi.ac.id · 48

95

<td width="120">id_kota</td>

<td width="350"><?php echo $rows['id_kota'];?></td>

</tr>

<input type="hidden" id="id_kota" name="id_kota" value=<?phpecho $rows['id_kota'];?> />

<tr>

<td width="120">nama_kota</td>

<td width="350">

<input name="nama_kota" type="nama_kota"id="nama_kota" size="40"

value=<?php echo $rows['nama_kota'];?>>

</td>

</tr>

<tr>

<td width="120">biaya</td>

<td width="350">

<input name="biaya" type="biaya" id="biaya" size="40"

value=<?php echo $rows['biaya'];?>>

</td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input type="submit" name="submitUser" value="Submit"/>

<input type="reset" name="resetbtn"

value="Reset" /> </td>

Page 52: LAMPIRAN - repository.bsi.ac.id · 48

96

</tr>

<?php

//loop while

}

?>

</form>

</table>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("id_kota","req","id kota masih kosong ");

frmvalidator.addValidation("Nama_kota","req","Nama_kota masih kosong ");

frmvalidator.addValidation("biaya","req","biaya masih kosong ");

</script>

Biaya_edit

<?php

include ('inc/config.php');

//data dari user

if (isset($_POST['submitUser'])) {

$id_kota = $_POST['id_kota'];

$nama_kota = $_POST['nama_kota'];

$biaya = $_POST['biaya'];

Page 53: LAMPIRAN - repository.bsi.ac.id · 48

97

$sql = " update biaya_kirim set nama_kota='$nama_kota', biaya='$biaya'where id_kota='$id_kota'";

//echo $sql;

$result = mysql_query($sql) or die(mysql_error());

//check if query successful

if ($result) {

header('location:index.php?page=biaya_view&status=0');

} else {

header('location:index.php?page=biaya_view&status=1');

}

mysql_close();

}

?>

Form_login

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<title>Login Toko Batik </title>

Page 54: LAMPIRAN - repository.bsi.ac.id · 48

98

<link rel="stylesheet" type="text/css" media="screen, tv, projection"href="../css/html.css" />

<link rel="stylesheet" type="text/css" media="screen, tv, projection"href="../css/layout.css" />

<script type="text/javascript" src="../js/validjs.js"></script>

</head>

<body>

<!-- Full site width container -->

<div class="width100">

<!-- #header: holds main image, menu and top actions bar -->

<div id="header" class="floatLeft width100">

<div class="floatLeft width100 rightBorder">

<div id="title">

<h1>Administrasi</h1>

<p>

Halaman Administrasi

</p>

</div>

</div>

Page 55: LAMPIRAN - repository.bsi.ac.id · 48

99

</div>

<div>

<h1> Login page</h1>

<form id="form1" name="form1" method="post"action="pengelola_check_login.php">

<table align="center">

<tr>

<td >username</td>

<td ><input name="username" type="text" id="username" />

<div id="form1_username_errorloc" style="color:red">

</div>

</td>

</tr>

<tr>

<td>password</td>

<td><input name="password" type="text" id="password" /> <div id="form1_password_errorloc" style="color:red">

</td>

<tr>

<td colspan="3" align="right">

<input type="submit" name="Submit" value="Submit" />

<input type="reset" name="" value="Reset" /></td>

Page 56: LAMPIRAN - repository.bsi.ac.id · 48

100

</tr>

<tr>

<td colspan='2'>

<!-- <div id="form1_errorloc" style="color:green">

<?php

if (isset($_GET['status'])) {

echo "The username or password you entered isincorrect";

}

?>

</div>-->

</td>

</tr>

</table>

</form>

<script language="JavaScript" type="text/javascript"

xml:space="preserve">//<![CDATA[

//You should create the validator only after thedefinition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("username", "req");

frmvalidator.addValidation("password", "req");

Page 57: LAMPIRAN - repository.bsi.ac.id · 48

101

//]]></script>

</div>

<!-- end left column, 75% width -->

<!-- end #content -->

<!-- #footer: holds submenu and copyright info -->

<div id="footer" class="floatRight width100">

<p>

copyright(c) Bosque|<a href="../index.php">home</a>

</p>

</div>

<!-- end #footer -->

</div>

<!-- end full site width container -->

Page 58: LAMPIRAN - repository.bsi.ac.id · 48

102

</body>

</html

Batik_add

<?php

include ('inc/config.php');

//data dari user

if (isset($_POST['tambah'])) {

$kd_barang = $_POST['kd_barang'];

$kd_kategori = $_POST['kd_kategori'];

$harga = $_POST['harga'];

$deskripsi = $_POST['deskripsi'];

$judul = $_POST['judul'];

$lokasi_file = $_FILES['gambar']['tmp_name'];

$nama_file = $_FILES['gambar']['name'];

$nama_file_baru = date('dmYHis').$nama_file;

$direktori = "../gambar/".$nama_file_baru;

if (move_uploaded_file($lokasi_file, $direktori)) {

$sql = "INSERT INTObarang(kd_barang,judul,kd_kategori,harga,deskripsi,gambar)

VALUES('".$kd_barang."','".$judul."','".$kd_kategori."','".$harga."','".$des kripsi."','".$nama_file_baru."')";

$result = mysql_query($sql) or die(mysql_error());

Page 59: LAMPIRAN - repository.bsi.ac.id · 48

103

//check if query successful

if ($result) {

header('location:index.php?page=batik_view&status=0');

} else {

header('location:index.php?page=batik_view&status=1');

}

mysql_close();

}

}

?>

Pengelola_logout

<?php

session_start();

session_destroy();

header("location:form_login.php");

?>

Pengelola_form_login

<html>

<head>

<script language="JavaScript" src="script/validator.js"

type="text/javascript" xml:space="preserve"></script>

</head>

<body>

<h1> Form Login </h1>

<form id="form1" name="form1" method="post"action="login_proses.php">

<td>

Page 60: LAMPIRAN - repository.bsi.ac.id · 48

104

<table align="center" border="0" cellpadding="3"cellspacing="1" bgcolor="#FFFFFF">

<tr>

<td >username*</td>

<td >

<input name="username" type="text"id="username" />

</td>

</tr>

<tr>

<td>password*</td>

<td>

<input name="password" type="password"id="password" />

</td>

</tr>

<tr>

<td colspan="2" align="right">

<input type="submit" name="Submit"value="Submit" />

<input type="reset" name="" value="Reset"/>

</td>

</tr>

<tr>

<td colspan='2'>

<div id="form1_errorloc" style="color:red">

<?php

Page 61: LAMPIRAN - repository.bsi.ac.id · 48

105

if (isset($_GET['status'])) {

echo "The username orpassword you entered is incorrect";

}

?>

</div></td>

</tr>

</table></td>

</form>

<script language="JavaScript" type="text/javascript"

xml:space="preserve">

//<![CDATA[

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("username","req","Username masih kosong ");

frmvalidator.addValidation("password","req","Password masih kosong ");

</script>

Pengelola_edit_form

<?php

include ('inc/config.php');

$id = $_GET['id'];

//ambil data dari table feedback

$sql = "select * from admin where username='$id' ";

Page 62: LAMPIRAN - repository.bsi.ac.id · 48

106

$result = mysql_query($sql) or die(mysql_error());

?>

<h2>Change password</h2>

<table>

<form id="form1" name="form1" method="post"action="pengelola_edit.php">

<?php

//proses menampilkan data

while($rows=mysql_fetch_array($result)){

?>

<td width="120">username</td>

<td width="350"><?php echo $rows['username'];?></td>

<input type="hidden" id="username" name="username"value=<?php echo $rows['username'];?> />

<input type="text" id="username" name="username" value=<?phpecho $rows['username'];?> /> --></td>

</tr>

<tr>

<td width="120">password</td>

<td width="350">

<input name="password" type="password" id="password" size="40" value=<?php echo $rows['password'];?> />

</td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

Page 63: LAMPIRAN - repository.bsi.ac.id · 48

107

<input type="submit" name="submitUser" value="Submit"/>

<input type="reset" name="resetbtn"

value="Reset" /> </td>

</tr>

<?php

//loop while

}

?>

</form>

</table>

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTML form

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("username","req","username masih kosong ");

frmvalidator.addValidation("password","req","password masih kosong ");

frmvalidator.addValidation("username","maxlen=20"," username tidak bolehlebih dari 20 ");

frmvalidator.addValidation("password","alnum_s","password tidak boleh ada spasi ");

</script>

Pengelola_form_add

<form id="form1" name="form1" method="post" action="pengelola_add.php">

<td>

Page 64: LAMPIRAN - repository.bsi.ac.id · 48

108

<table>

<tr>

<td width="120">username</td>

<td width="350">

<input name="username" type="text" id="username"size="40" />

</td>

</tr>

<tr>

<td width="120">password</td>

<td width="350">

<input name="password" type="password" id="password"size="40" />

</td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input type="submit" name="tambahPengelola"value="Tambah" />

<input type="reset" name="resetbtn"

value="Reset" /> </td>

</tr>

<tr>

<td colspan='2'><div id="form1_errorloc"style="color:red"></div></td>

</tr>

</table></td>

</form>

Page 65: LAMPIRAN - repository.bsi.ac.id · 48

109

<script language="javaScript" type="text/javascript"

xml:space="preserve">

//You should create the validator only after the definition of the HTMLform

var frmvalidator = new Validator("form1");

frmvalidator.EnableOnPageErrorDisplaySingleBox();

frmvalidator.EnableMsgsTogether();

frmvalidator.addValidation("username", "req", "username masih kosong");

frmvalidator.addValidation("password", "req", "password masih kosong");

frmvalidator.addValidation("username", "maxlen=20", " username tidakboleh lebih dari 20 ");

frmvalidator.addValidation("password", "alnum_s", "password tidak boleh ada spasi ");

</script>