-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetailpelanggan.php
80 lines (76 loc) · 2.78 KB
/
detailpelanggan.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php include "header.php"; ?>
<div class="container">
<div class="row">
<div class="col-lg-12">
<h3>Detail Data Pelanggan</h3><br/><br/>
<?php
include "koneksi.php";
$id = $_GET['id'];
$tampil = "SELECT * FROM pelanggan WHERE id_pelanggan='$id'";
$qtampil = mysql_query($tampil);
$hasil = mysql_fetch_array($qtampil);
$idpel = $hasil['id_pelanggan'];
$nama = $hasil['nama_pelanggan'];
$alamat = $hasil['alamat_pelanggan'];
$nomer = $hasil['nomer_hp'];
$merk = $hasil['id_merk'];
?>
<form class="form-horizontal" action="processpelanggan.php?act=update" method="POST">
<div class="form-group">
<label for="inputEmail" class="col-lg-2 control-label">Nama Pelanggan</label>
<div class="col-lg-7">
<input type="text" class="form-control" id="inputEmail" value="<?php echo $nama; ?>" placeholder="Nama Pelanggan" name="nama" required>
<input type="hidden" value="<?php echo $idpel; ?>" name="idpel" />
<input type="hidden" value="<?php echo $nama ?>" name="lama" />
</div>
</div>
<div class="form-group">
<label for="inputEmail" class="col-lg-2 control-label">Alamat Pelanggan</label>
<div class="col-lg-7">
<input type="text" class="form-control" id="inputEmail" value="<?php echo $alamat; ?>" placeholder="Alamat Pelanggan" name="alamat" required>
</div>
</div>
<div class="form-group">
<label for="inputEmail" class="col-lg-2 control-label">Nomer HP Pelanggan</label>
<div class="col-lg-7">
<input type="text" class="form-control" id="inputEmail" value="<?php echo $nomer; ?>" placeholder="Nomer HP Pelanggan" name="nomer" required>
</div>
</div>
<div class="form-group">
<label for="inputEmail" class="col-lg-2 control-label">Merk Kendaraan</label>
<div class="col-lg-7">
<select name="merk" class="form-control" required>
<option value="">-Pilih Merk Kendaraan-</option>
<?php
include "koneksi.php";
$tampil2 = "SELECT * FROM merk";
$qtampil2 = mysql_query($tampil2);
while($hasil = mysql_fetch_array($qtampil2)) {
$idm = $hasil['id_merk'];
$namam = $hasil['nama_merk'];
?>
<option value="<?php echo $idm; ?>" <?php if($idm == $merk) echo 'selected'; ?> ><?php echo $namam; ?></option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<div class="col-lg-7 col-lg-offset-2">
<button type="reset" class="btn btn-default">Cancel</button>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
</div>
</div>
<footer>
<p>Copyright © 2015</p>
</footer>
</div>
<script src="theme/js/jquery-1.10.2.min.js"></script>
<script src="theme/js/bootstrap.min.js"></script>
<script src="theme/js/bootswatch.js"></script>
</body>
</html>