70 lines
3.2 KiB
PHP
70 lines
3.2 KiB
PHP
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<div class="float-right">
|
|
<a href="new_campaign/0" class="btn btn-primary"><i class="fe-shopping-bag"></i> Add Campaign </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="basic-datatable_new" class="table dt-responsive nowrap w-100">
|
|
<thead class="thead-light">
|
|
|
|
<tr>
|
|
<th hidden ></th>
|
|
<th>Campaign Name</th>
|
|
<th>Description</th>
|
|
<th>Date</th>
|
|
<th>Action</th>
|
|
</tr>
|
|
</thead>
|
|
<?php foreach ($campaign as $value) :?>
|
|
<tr>
|
|
<td hidden><?= $value['campaign_id']; ?></td>
|
|
<td><?= $value['name']; ?></td>
|
|
<td><?= $value['description']; ?></td>
|
|
<td><?= date("d-m-Y", strtotime($value['start_date'])). ' - ' . date("d-m-Y", strtotime($value['end_date'])); ?> </td>
|
|
<td>
|
|
<a href="<?= "new_campaign/" . $value['campaign_id']; ?>" class="edit-button"><i class="ri-pencil-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 table = $('#basic-datatable_new').DataTable({
|
|
"order": [[0, "dsc"]] // Sort by the first (index 0) column (id) in ascending order
|
|
});
|
|
});
|
|
|
|
</script>
|
|
|
|
|
|
|