vb_book/app/Views/setting_list.php
2024-10-29 15:37:48 +05:30

78 lines
4.3 KiB
PHP
Executable File

<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="float-right">
<a href="<?= base_url()."sitesetting_page/0"; ?>" class="btn btn-primary"><i class="mdi mdi-playlist-plus"></i> Add Setting </a>
</div><!-- end col-->
<br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
<?php if (session()->getFlashdata('success') || session()->getFlashdata('error')) : ?>
<?php if (session()->getFlashdata('success')) : ?>
<div class="alert alert-success alert-dismissible fade show" role="alert">
<?= session('success') ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php endif; ?>
<?php if (session()->getFlashdata('error')) : ?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<?= session('error') ?>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<?php endif; ?>
<?php endif; ?>
<div class="table-responsive">
<table id="scroll-horizontal-datatable" class="table w-100 nowrap">
<thead class="thead-light">
<tr>
<th>Site Name</th>
<th>Site Short Name</th>
<th>Site email</th>
<th>Mobile Number</th>
<th>Copyright</th>
<th>Site Icon</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php foreach ($details as $row):
if ($row['isactive']) {
$class = 'badge badge-soft-success';
$message = 'Active';
} else {
$class = 'badge badge-soft-danger';
$message = 'In-Active';
}
$edit_page_route = base_url()."sitesetting_page/".$row['setting_id'];
?>
<tr>
<td><?php echo $row['site_name'] ; ?></td>
<td><?php echo $row['site_short_name'] ; ?></td>
<td><?php echo $row['site_email'] ; ?></td>
<td><?php echo $row['mobile'] ; ?></td>
<td><?php echo $row['copyright'] ; ?></td>
<td><?php echo $row['favicon'] ; ?></td>
<td>
<span class="<?php echo $class; ?>"><?php echo $message; ?></span>
</td>
<td>
<a href="<?= $edit_page_route; ?>" class="edit-button" title="Click to Edit Site Setting"><i class="ri-pencil-line"></i></a>
<?php if($loggedin_person_role === 'sadmin' && (int)$row['isactive'] === 1): ?>
<a href="<?= base_url() . "delete_sitesetting/" . $row['setting_id']; ?>" class="delete-button" title="Click to Delete Site Setting"><i class="ri-delete-bin-line"></i></a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<!-- end row-->