-
Notifications
You must be signed in to change notification settings - Fork 4
/
edriv.php
34 lines (27 loc) · 1.37 KB
/
edriv.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
<?php
session_start();
require("config.php");
if(isset($_SESSION['id'])){
$uid = $_SESSION['id'];
$query = mysql_query("select * from bus");
$query1 = mysql_query("select min(id) as min from bus");
$row = mysql_fetch_assoc($query1);
$min = $row['min'];
?>
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<table width="650" height="62" align="center">
<tr align="center"><td width="95">Driver Name</td><td width="95">Bus Reg No</td><td width="101"> </td></tr>
<?php
for($pe=$min;$pe<=5;$pe++){
$sql1= mysql_query("select * from drivers where ID='$pe'");
$r1=mysql_fetch_array($sql1);
$id= $r1['ID'];
$bus_reg = $r1['BUS_REG'];
$name = $r1['DRIVER'];
?>
<tr align="center"><td><?php echo $name;?></td><td><?php echo $bus_reg;?></td><td><a href="edit.php?page=2&id=<?php echo $id ?>">Edit</a></td>
<td><form method="post" action="delete.php?page=2&id=<?php echo $id?>"><button type="submit" name="delete" > delete</button> </form></td></tr>
<?php }
}
?> <form method="post" action="addelement.php?page=2"><button type="submit" name="addel" > add</button> </form>
<form align="bottom" method="post" action="javascript:window.print()"><button type="submit" name="print" > print</button> </form>