vb_book/app/Views/campaign_creation.php

91 lines
5.4 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()."campaign_creation_form/0"; ?>" class="btn btn-primary"><i class="ri-file-edit-line"></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">&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>Campaign Name</th>
<th>Template Name</th>
<th>Group Name</th>
<th>Total Customer</th>
<!-- <th>Scheduled at</th> -->
<th>Created at</th>
<th>Created by</th>
<th>Status</th>
<th align="center" id="action-column">Action</th>
</tr>
</thead>
<?php foreach ($campaign as $c) :
if ($c['isactive']) {
$class = 'badge badge-soft-success';
$message = 'Active';
} else {
$class = 'badge badge-soft-danger';
$message = 'In-Active';
}
$scheduled_date = $c['scheduled_date'] != "" ? date('d/m/Y', strtotime($c['scheduled_date'])) : "";
$scheduled_time = $c['scheduled_time'] != "" ? date('h:i A', strtotime($c['scheduled_time'])) : "";
?>
<tr>
<td hidden><?= $c['campaign_id']; ?></td>
<td data-order="<?= $c['campaign_name']; ?>"><?= $c['campaign_name']; ?></td>
<td data-order="<?= $c['template_name']; ?>"><?= $c['template_name']; ?></td>
<td data-order="<?= $c['group_name']; ?>"><?= $c['group_name']; ?></td>
<td data-order="<?= $c['customer_group_count']; ?>"><?= $c['customer_group_count']; ?></td>
<!-- <td></td> -->
<td data-order="<?= $c['formatted_created_on']; ?>"><?= $c['formatted_created_on']; ?></td>
<td data-order="<?= $c['created_by_name']; ?>"><?= $c['created_by_name']; ?></td>
<td data-order="<?= $message; ?>"><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td>
<td>
<a href="<?= base_url()."campaign_creation_form/".$c['campaign_id']; ?>" class="edit-button" title="Click to Edit Campaign" ><i class="ri-pencil-line"></i></a>
<?php if ($c['isactive']) { ?>
<a href="<?= base_url() . "campaign_creation_delete/".$c['campaign_id']; ?>" class="delete-button" title="Click to Delete Campaign" ><i class="ri-delete-bin-line"></i></a>
<!-- <a href="<?= base_url()."process_customergroup_notifications/".$c['template_id']."/".$c['campaign_id']; ?>" class="send-button" title="Send Now" ><i class="ri-mail-send-fill"></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() {
var actionColumnIndex = $('#action-column').index();
$('#scroll-horizontal-datatable_customer').DataTable({
"order": [ [0, "desc"] ],
"columnDefs": [{ "targets": [actionColumnIndex], "orderable": false }]
});
});
</script>