vb_book/app/Views/scheme_list.php
2024-12-09 12:27:33 +05:30

70 lines
3.6 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() . "new_scheme/0" ?>" class="btn btn-primary"><i class="ri-currency-line"></i> Add Scheme </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="datatable-buttons" class="table dt-responsive w-100"> -->
<table id="scroll-horizontal-datatable_scheme" class="table w-100 nowrap">
<thead class="thead-light">
<tr>
<th hidden></th>
<th>Scheme Name</th>
<th>Price</th>
<th>Duration</th>
<th hidden>Category</th>
<th align="center" id="action-column">Action</th>
</tr>
</thead>
<?php foreach ($scheme as $row) : ?>
<tr>
<td hidden><?= $row['book_id']; ?></td>
<td><?= $row['short_code']; ?></td>
<td><?= $row['price']; ?></td>
<td><?= $row['duration']; ?></td>
<td hidden><?= $row['category_name']; ?></td>
<td>
<a href="<?= base_url() . "new_scheme/" . $row['book_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
<a href="<?= base_url() . "delete_scheme/" . $row['book_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div><!-- end row-->
<script>
$(document).ready(function() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_scheme').DataTable({
"order": [ [0, "desc"] ],
"columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
});
});
</script>