/
leave_type.php
58 lines (57 loc) · 2.3 KB
/
leave_type.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
<?php
require('top.inc.php');
if($_SESSION['ROLE']!=1){
header('location:add_employee.php?id='.$_SESSION['USER_ID']);
die();
}
if(isset($_GET['type']) && $_GET['type']=='delete' && isset($_GET['id'])){
$id=mysqli_real_escape_string($con,$_GET['id']);
mysqli_query($con,"delete from leave_type where id='$id'");
}
$res=mysqli_query($con,"select * from leave_type order by id desc");
?>
<div class="content pb-0">
<div class="orders">
<div class="row">
<div class="col-xl-12">
<div class="card">
<div class="card-body">
<h4 class="box-title">Leave Type Master </h4>
<h4 class="box_title_link"><a href="add_leave_type.php">Add Leave Type</a> </h4>
</div>
<div class="card-body--">
<div class="table-stats order-table ov-h">
<table class="table ">
<thead>
<tr>
<th width="5%">S.No</th>
<th width="5%">ID</th>
<th width="70%">Leave Type</th>
<th width="20%"></th>
</tr>
</thead>
<tbody>
<?php
$i=1;
while($row=mysqli_fetch_assoc($res)){?>
<tr>
<td><?php echo $i?></td>
<td><?php echo $row['id']?></td>
<td><?php echo $row['leave_type']?></td>
<td><a href="add_leave_type.php?id=<?php echo $row['id']?>">Edit</a> <a href="leave_type.php?id=<?php echo $row['id']?>&type=delete">Delete</a></td>
</tr>
<?php
$i++;
} ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
require('footer.inc.php');
?>