• Tidak ada hasil yang ditemukan

T0 Lampiran Institutional Repository | Satya Wacana Christian University: Sistem Informasi Rental Mobil Berbasis Responsive Web Design Untuk Lembu Waras Rent Car

N/A
N/A
Protected

Academic year: 2018

Membagikan "T0 Lampiran Institutional Repository | Satya Wacana Christian University: Sistem Informasi Rental Mobil Berbasis Responsive Web Design Untuk Lembu Waras Rent Car"

Copied!
9
0
0

Teks penuh

(1)

52

Kode Program 1.0 Halaman login

<?php

session_start();

$alert=$_GET[alert];

include"../koneksi.php";

$user=$_POST[user];

$pass=$_POST[pass];

if($user==NULL && $pass==NULL)

{

header("location:index.php?alert=1");

}

elseif($user==NULL && $pass!=NULL)

{

header("location:index.php?alert=2");

}

elseif($user!=NULL && $pass==NULL)

{

header("location:index.php?alert=3");

}

else{

$a=mysql_query("SELECT * FROM user WHERE user='$user' AND

pass='$pass' AND status='aktif'");

if(mysql_num_rows($a) > 0){

$i=mysql_fetch_array($a);

(2)

session_register("nama");

session_register("user");

session_register("pass");

session_register("user_level");

$_SESSION["travel"] = TRUE;

$_SESSION[id_petugas]=$i[id_petugas];

$_SESSION[nama]=$i[nama];

$_SESSION[user]=$i[user];

$_SESSION[pass]=$i[pass];

$_SESSION[user_level]=$i[user_level];

?>

<script type="text/javascript">

alert("Berhasil Masuk Sistem !");

window.location='../backand/index.php';

</script>

<?php

//header("location:index1.php");

}

else

{

?>

<script type="text/javascript">

alert("Kombinasi Nama Pengguna dan Sandi Tidak Cocok !");

window.location='index.php';

</script>

<?php

}

}

(3)

Kode Program 1.1 Tambah Mobil

<?php

include "../koneksi.php";

if($simpandata){

$tanggal = date("d F Y");

//kode upload file

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

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

$lokasifolder="../imgproduk/".$nm_file;

if(!file_exists($lokasifolder)){

move_uploaded_file($myfile,$lokasifolder);

}

$simpan="INSERT INTO mobil VAlUES

('','$merk','$ket','$harga','$nm_file')";

$querysimpan=mysql_query($simpan);

echo "<script>window.alert('Data berhasil di simpan')</script>";

}

?>

Kode Program 1.2 Tambah Pelanggan

<?php

include "../koneksi.php";

$tanggal=date("d-m-Y");

if($simpandata){

$simpan="INSERT INTO pelanggan VAlUES

('','$no_identitas','$nama','$alamat','$kelamin','$hp','$tanggal')";

$querysimpan=mysql_query($simpan);

echo "<script>window.alert('Data berhasil disimpan !')</script>";

echo "<script>window.location='index.php?option=pelanggan'</script>";

(4)

?>

Kode Program 1.3 Data Pelanggan

<?php

include "../koneksi.php";

$batas=20;

$no=1;

$halaman=$_GET['halaman'];

if(empty($halaman)){

$posisi=0;

$halaman=1;

}else{

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

}

$data="SELECT * FROM pelanggan ORDER BY id ASC LIMIT

$posisi,$batas";

$query=mysql_query($data);

$no=$posisi+1;

?>

<script>

var ajaxku;

var idnya;

function update(id){

idnya = id;

ajaxku = buatajax();

idinput = "jumlah"+id;

idloading = "loading"+id;

jumlah = document.getElementById(idinput).value;

var url="";

(5)

url=url+"&jml="+jumlah

url=url+"&sid="+Math.random();

ajaxku.onreadystatechange=stateChanged;

ajaxku.open("GET",url,true);

ajaxku.send(null);

document.getElementById(idloading).innerHTML = "<img

src=ajax-loader.gif>";

}

function buatajax(){

if (window.XMLHttpRequest){

return new XMLHttpRequest();

}

if (window.ActiveXObject){

return new ActiveXObject("Microsoft.XMLHTTP");

}

return null;

}

function stateChanged(){

var data;

if (ajaxku.readyState==4){

data=ajaxku.responseText;

subtotalx = document.getElementById("subtotal").innerHTML;

sub = parseFloat(subtotalx);

idharga = "harga"+idnya;

idloading = "loading"+idnya;

harganya = document.getElementById(idharga).innerHTML;

hrg = parseFloat(harganya);

if(data.length>0){

hargabaru = parseFloat(data);

subtotalbaru = sub-hrg+hargabaru;

(6)

document.getElementById(idharga).innerHTML = data

document.getElementById("subtotal").innerHTML = subtotalbaru;

}

}

}

</script>

<script type="text/javascript">

function confirm()

{

var msg;

msg= "Apakah Mang Kemed Yakin Akan Menghapus Data ? " ;

var agree=confirm(msg);

if (agree)

return true ;

else

return false ;

}

</script>

<div class="table-responsive">

<h5><a href="index.php?option=pelanggan">TAMBAH PELANGGAN

</a></h5>

<table width="1167" class="table striped bordered

table-hover" id="dataTables-example">

<thead>

<tr>

<th width="20">No</th>

<th width="212">No Identitas KTP/SIM </th>

<th width="193">Nama</th>

<th width="409">Alamat</th>

<th width="124">Hp</th>

(7)

<th width="80">Action</th>

</tr>

</thead>

<tbody>

<?php while($arraytampil=mysql_fetch_array($query))

{?>

<tr class="odd gradeX">

<td><?php echo "$no";?></td>

<td><?php echo "$arraytampil[1]"; ?></td>

<td><?php echo "$arraytampil[2]"; ?></td>

<td><?php echo "$arraytampil[3]"; ?></td>

<td><?php echo "$arraytampil[5]"; ?></td>

<td><?php echo "$arraytampil[4]"; ?></td>

<td>

<a href="index.php?option=update_pel&amp;id=<?php echo

"$arraytampil[0]"; ?>">Edit </a>|

<a href="del_pel.php?&amp;id=<?php echo "$arraytampil[0]"; ?>"

>Del</a></td>

</tr>

<?php $no++;} ?>

</tbody>

</table>

</div>

<?php

$tampil2="SELECT * FROM pelanggan";

$sql2=mysql_query($tampil2) or die(mysql_error());

$jmldata=mysql_num_rows($sql2);

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

echo"<center><br>Halaman : ";

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

(8)

if($i!=$halaman){

echo"<a href=index.php?option=daftar_pelanggan&halaman=$i>$i</a> |

";

}else{

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

}

}

echo"<p><center>Total Data : <b>$jmldata</b></center></p>";

(9)

Referensi

Dokumen terkait

[r]

dan pimpinan-Nya akhirnya Penulis dapat menyelesaikan Skripsi yang berjudul “Sistem Informasi Berbasis Web pada Rental Two Rent Salatiga”.. Skripsi ini di susun

[r]

Maksud dari penelitian ini adalah untuk membangun aplikasi rental mobil berbasis desktop guna membantu Callysta Rent Car dalam dalam mencatat data konsumen, data

Dengan adanya sistem penyewaan mobil yang telah terkomputerisasi banyak sekali keuntungan yang diperoleh oleh pihak Jennete Rent Car seperti informasi yang tersedia dapat

Masalah saat ini dengan Rizal Rent Car adalah belum efektifnya memberikan informasi unit yang tersedia dalam sewa mobil ini karena masih menggunakan pamflet dan spanduk dan tidak

Berharap agar informasi yang telah disampaikan dapat berguna bagi Rental Mobil Adira Rent Car dan aplikasi yang dibuat dapat membantu dalam meningkatkan

Pada penelitian ini, peneliti mengambil judul “Pembuatan Sistem Informasi Rental Mobil Pada Purnama Rent Car Ploso Pacitan” Rental mobil merupakan salah satu bisnis yang