-
Notifications
You must be signed in to change notification settings - Fork 0
/
slider.php
41 lines (40 loc) · 1.09 KB
/
slider.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
<script>
function delSlider(id)
{
if(confirm("You want to delete this Slider ?"))
{
window.location.href='delete_slider.php?id='+id;
}
}
</script>
<table class="table table-bordered table-striped table-hover">
<tr>
<td colspan="5"><a href="dashboard.php?option=add_slider" class="btn btn-primary">Add New</a></td>
</tr>
<tr style="height:40">
<th>Sr No</th>
<th>Image</th>
<th>Caption</th>
<th>Update</th>
<th>Delete</th>
</tr>
<?php
$i=1;
$sql=mysqli_query($con,"select * from slider");
while($res=mysqli_fetch_assoc($sql))
{
$id=$res['id'];
$img=$res['image'];
$path="../image/Slider/$img";
?>
<tr>
<td><?php echo $i;$i++; ?></td>
<td><img src="<?php echo $path;?>" width="50" height="50"/></td>
<td><?php echo $res['caption']; ?></td>
<td><a href="dashboard.php?option=update_slider&id=<?php echo $id; ?>"><span class="glyphicon glyphicon-pencil"></span></a></td>
<td><a href="#" onclick="delSlider('<?php echo $id; ?>')"><span class="glyphicon glyphicon-remove" style='color:red'></span></a></td>
</tr>
<?php
}
?>
</table>