File "merchant-view.php"
Full path: /home/fsibplc/public_html/localhost/admin/merchant-view.php
File
size: 4.68 B (4.68 KB bytes)
MIME-type: text/x-php
Charset: utf-8
Download Open Edit Advanced Editor Back
<?php
include('config/dbcon.php');
include('authentication.php');
//include('../all/config.php');
//session_start();
include('include/header.php');
?>
<div class="container-fluid px-4">
<div class="row mt-4">
<div class="col-md-12">
<?php include('message.php'); ?>
<div class="card">
<div class="card-header">
<h4>View Merchant<a href="merchant-add.php" class="btn btn-primary float-end">Add Merchant</a></h4>
</div>
<div class="card-body">
<div class="table-responsive">
<table class="table bordered table-striped">
<thead>
<tr>
<th>ID</th>
<th>Merchant Name</th>
<th>Image</th>
<th>Status</th>
<th>Edit</th>
<?php if( $_SESSION['auth_role'] == 2): ?>
<th>Delete</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php
$service = "SELECT * FROM merchant_card WHERE status !='2'";
$service_run = mysqli_query($con, $service);
if(mysqli_num_rows($service_run)>0)
{
$sn_count = 1;
foreach($service_run as $service)
{
?>
<tr>
<td><?= $sn_count ?></td>
<td><?= $service['merchant_name'] ?></td>
<td>
<img src="../<?= $service['image'] ?>" width="60px" height="60px" />
</td>
<td>
<?= $service['status'] == '1' ? 'Hidden':'Visible' ?>
</td>
<td>
<a href="merchant-edit.php?id=<?= $service['id'] ?>" class="btn btn-success">Edit</a>
</td>
<?php if( $_SESSION['auth_role'] == 2): ?>
<td>
<form action="code-superadmin.php" method="POST">
<button type="submit" name="merchant_detete_btn" value="<?= $service['id'] ?>" class="btn btn-danger" onclick='return checkDelete()'>Delete</button>
</form>
</td>
<?php endif; ?>
</tr>
<?php
$sn_count++;
}
}else{
?>
<tr>
<td colspan="7">No Record Found</td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script type="text/javascript">
function checkDelete(){
return confirm('Are you sure you want to delete this record?');
}
</script>
<?php
include('include/footer.php');
include('include/script.php');
?>