| Current Path : /var/www/html/nadineandmiabeauty/admin/ |
| Current File : /var/www/html/nadineandmiabeauty/admin/viewblog.php |
<?php
require_once('autoload.php');
include_once('header.php');
$config = config::getAppConfig();
$user->checklogin($config['loginPath']);
$db = new pdocrudhandler();
$res = $db->select($config['table']['blog'],array("*"));
if($res['status'] == 'success'){
?>
<div class="content " id="main-cont">
<div class="container-fluid">
<?php
require_once ('alertmsg/alerts.php');
?>
<table class="table table-hover table-striped">
<thead>
<tr>
<th>ID</th>
<th>Blog title</th>
<th>Blog Heading</th>
<th>Blog Summary</th>
<th>Blog Description</th>
<th>Blog Image</th>
<th>Edit</th>
<th>Delete</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0; $i < $res['rowsAffected'] ; $i++) {
?>
<tr>
<td><?php echo $i ?></td>
<td><?php echo $res['result'][$i]->btitle; ?></td>
<td><?php echo $res['result'][$i]->bheading; ?></td>
<td><?php echo $res['result'][$i]->bsummary; ?></td>
<td><?php echo $res['result'][$i]->bdescription; ?></td>
<td><?php echo $res['result'][$i]->bimage; ?></td>
<td><a href="editblog.php?id=<?php echo $res['result'][$i]->id; ?>" class="btn btn-info btn-sm" ><i class="ti-upload"></i></a></td>
<td><form method="post" action="classes/allfunctions.php?"><input type="hidden" name="action" id="action" value="deleteblog">
<input type="hidden" name="id" value="<?php echo $res['result'][$i]->id; ?>">
<button><i class="ti-trash"></i></button></form></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<?php
require_once('footer.php');
?>