forked from hananda/simdatindo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
listatm.php
111 lines (103 loc) · 2.65 KB
/
listatm.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
session_start();
include "koneksi.php";
error_reporting(0);
$waktu=time()+25200;
$expired=30;
if (empty($_SESSION['username']) AND empty($_SESSION['password']))
{
include "formlogin.php";
}
else
{
?>
<html>
<head>
<link href="css/test.css" type="text/css" rel="stylesheet" > <link href="images/icon.jpg" rel="shortcut icon" />
<link href="images/icon.jpg" rel="shortcut icon" />
<title>ATM Logistic</title>
<style>
table{
border:medium none black;
width:1000px;
margin-bottom:10px;
}
</style>
</head>
</html>
<body>
<div id="header">
</div>
<div id="main_content">
<?php
include "atas.php";
?>
</h2>
<table align="center" width="753" border="0">
<tr>
<font size="5">
<td width="51"><div align="center"><strong>No.</strong></div></td>
<td width="135"><div align="center"><strong>ID</strong></div></td>
<td width="173"><div align="center"><strong>BANK</strong></div></td>
<td width="315"><div align="center"><strong>Lokasi</strong></div></td>
<td width="175"><div align="center"><strong>Serial Number</strong></div></td>
<td width="170"><div align="center"><strong>Install Date</strong></div></td>
</font>
</tr>
<?php
if(isset($_POST['pilih']))
{
$bank1 = $_POST['Bank'];
if($bank1 == ALL)
{
$query = "SELECT * FROM tbl_atm ORDER BY bank";
$result = custom_query($query) or die('Error');
}
else
{
$query = "SELECT * FROM tbl_atm WHERE bank = '$bank1' ORDER BY id_atm";
$result = custom_query($query) or die('Error');
}
while ($r1 = mysqli_fetch_array($result))
{
$no++
?>
<tr>
<td><div align="center"><?php echo $no; ?></div></td>
<td><div align="center"><?php echo $r1['id_atm']; ?></div></td>
<td><div align="center"><?php echo $r1['bank']; ?></div></td>
<td><div align="left"><?php echo $r1['lokasi']; ?></div></td>
<td><div align="center"><?php echo $r1['sn']; ?></div></td>
<td><div align="center"><?php echo $r1['install_date']; ?></div></td>
<?php
if ($_SESSION[level] == "admin")
{
?>
<td width="33"><div align="center"><a href="editatm.php?id_atm=<?php echo $r1['id_atm']; ?>">Edit</a></div></td>
<td width="64"><div align="center"><a href="hapusatm.php?id_atm=<?php echo $r1['id_atm']; ?>" title="Hapus" onClick="return konfirmasihapus()">Hapus</a></div></td>
<script type="text/javascript">
function konfirmasihapus()
{
var jawab;
jawab = confirm("Apakah anda yakin akan menghapus data ini?")
if(jawab)
{ return true;
} else {return false;}
}
</script>
<?php
}
?>
</tr>
<?php
}
}
?>
</table>
<?php
include "menu.php";
}
?>
</div>
<div id="footer"></div>
</body>