71 lines
3.5 KiB
PHP
71 lines
3.5 KiB
PHP
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="float-right">
|
|
<a href="<?= base_url() . "new_Donor/0"; ?>" class="btn btn-primary"><i class="ri-map-pin-user-fill"></i> Add Donor </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">×</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">×</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>Name</th>
|
|
<th>Mobile Number</th>
|
|
<th>Email</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<?php foreach ($customer as $value) :?>
|
|
<tr>
|
|
<td hidden><?$value['doner_id'];?></td>
|
|
<?php if($value['doner_type'] == 'option2') { ?>
|
|
<td><?= $value['org_name']; ?></td>
|
|
<?php } else { ?>
|
|
<td><?= $value['first_name'].' '.$value['last_name'] ; ?></td>
|
|
<?php } ?>
|
|
<td><?= $value['mobile_no']; ?></td>
|
|
<td><?= $value['email']; ?></td>
|
|
<td>
|
|
<a href="<?= "new_Donor/" . $value['doner_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
|
|
<a href="<?= "delete_customer/" . $value['doner_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() {
|
|
$('#scroll-horizontal-datatable_customer').DataTable({
|
|
"order": [[0, "desc"]] // 4 is the column index of "created_on" in your table
|
|
// Other DataTables configuration options
|
|
});
|
|
});
|
|
</script>
|