-
Notifications
You must be signed in to change notification settings - Fork 0
/
list.php
90 lines (83 loc) · 3.19 KB
/
list.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
<!DOCTYPE html>
<html>
<head>
<title>Blog Database All Blogs </title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url().'assets/css/bootstrap.min.css';?>">
</head>
<body>
<div class="navbar navbar-dark bg-dark">
<div class="container">
<a href="#" class="navbar-brand">Blog database</a>
</div>
</div>
<div class="container" style="padding-top: 10px;">
<div class="row">
<div class="col-md-12">
<?php
$success=$this->session->userdata('success');
if($success !="") {
?>
<div class="alert alert-success"><?php echo $success;?></div>
<?php
}
?>
<?php
$failure=$this->session->userdata('failure');
if($failure !="") {
?>
<div class="alert alert-success"><?php echo $failure;?></div>
<?php
}
?>
</div>
<div class="col-md-12">
<div class="row">
<div class="col-6"><h3>All blogs</h3></div>
<div class="col-md-6 text-right">
<a href="<?php echo base_url().'index.php/user/create';?>" class="btn btn-primary">Create</a>
</div>
</div>
<hr>
</div>
</div>
<div class="row">
<div class="col-md-12">
<table class="table table-striped">
<tr>
<th>Name</th>
<th>Description</th>
<th>Category</th>
<th>Author</th>
<th>Published (date/time)</th>
<th>Status</th>
<th>Edit</th>
<th>Delete</th>
</tr>
<?php if(!empty($name)) { foreach($name as $user) {?>
<tr>
<td><?php echo $user['Name']?></td>
<td><?php echo $user['Description']?></td>
<td><?php echo $user['Category']?></td>
<td><?php echo $user['Author']?></td>
<td><?php echo $user['Published (date/time)']?></td>
<td><?php echo $user['Status']?></td>
<td>
<a href="<?php echo base_url().'index.php/user/edit/'.$user['Name']?>" class="btn btn-primary">
Edit</a>
</td>
<td>
<a href="<?php echo base_url().'index.php/user/delete/'.$user['Name']?>" class="btn btn-danger">
Delete</a>
</td>
</tr>
<?php } } else { ?>
<tr>
<td colspan="S"> Records not found </td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>
</body>
</html>