donation/app/Views/template_creation.php

89 lines
4.6 KiB
PHP

<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<div class="float-right">
<a href="<?= base_url()."template_creation_form/0"; ?>" class="btn btn-primary"><i class="ri-file-edit-line"></i> Add Template </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_customer" class="table w-100 nowrap">
<thead class="thead-light">
<tr>
<th hidden></th>
<th>Template Name</th>
<th>Mode</th>
<th>Created at</th>
<th>Created by</th>
<th>Status</th>
<th>Action</th>
</tr>
</thead>
<?php foreach ($template as $temp) :
if ($temp['isactive']) {
$class = 'badge badge-soft-success';
$message = 'Active';
} else {
$class = 'badge badge-soft-danger';
$message = 'In-Active';
} ?>
<tr>
<td hidden><?= $temp['template_id']; ?></td>
<td><?= $temp['template_name']; ?></td>
<td><?= $temp['mode']; ?></td>
<td><?= $temp['formatted_created_on']; ?></td>
<td><?= $temp['created_by_name']; ?></td>
<td><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td>
<td>
<a href="<?= base_url()."template_creation_form/".$temp['template_id']; ?>" class="edit-button" title="Click to Edit Template" ><i class="ri-pencil-line"></i></a>
<?php if ($temp['isactive']) { ?> <a href="<?php echo "template_creation_delete/".$temp['template_id']; ?>" class="delete-button" title="Click to Delete Template" ><i class="ri-delete-bin-line"></i></a> <?php } ?>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div><!-- end row-->
<script>
$(document).ready(function() {
$('#scroll-horizontal-datatable_customer').DataTable({
"order": [
[0, "desc"]
] // 4 is the column index of "created_on" in your table
// Other DataTables configuration options
});
});
</script>
<!-- <script>
$(document).ready(function() {
$('#bs-example-modal-lg').on('show.bs.modal', function(event) {
var primaryKey = $(event.relatedTarget).data('primary-key');
console.log(primaryKey);
var groupName = $(event.relatedTarget).data('modal-title');
$('#myLargeModalLabel').text(groupName);
});
});
</script> -->