noifications acknowlegdement UI : ps

This commit is contained in:
VE10-Sanjeev 2024-01-03 18:15:18 +05:30
parent 687fc818e8
commit 96cea2ac3d
5 changed files with 101 additions and 1 deletions

View File

@ -149,8 +149,9 @@ $routes->get('campaign_creation_form/(:any)', 'Notifications::campaign_creation_
$routes->get('campaign_creation_delete/(:any)', 'Notifications::campaign_creation_delete/$1');
$routes->post("campaign_creation_insert", "Notifications::campaign_creation_insert");
$routes->get('process_scheduled_notifications/', 'Notifications::processScheduledNotifications');
$routes->get('acknowlegdement', 'Notifications::noifications_acknowlegdement');
# Api integration Routes
$routes->post('api/(:any)', 'ApiIntegration::api_integration/$1');

View File

@ -780,4 +780,17 @@ class Notifications extends BaseController
}
############## Auto Scheduled Notification Ends ################
################################################################
# Notification Acknowlegdement
################################################################
## notification acknowlegdement
public function noifications_acknowlegdement(){
$model = new NotificationModel();
$data['noifications_acknowlegdement'] = $model->get_noifications_acknowlegdement_data();
$data['page_name'] = 'Notifications Acknowlegdement';
$this->render_page('noifications_acknowlegdement', $data);
}
############## Notification Acknowlegdement Ends ################
}

View File

@ -265,6 +265,34 @@ public function customerGroupQueryExecution($queries){
return $statement;
}
public function get_noifications_acknowlegdement_data()
{
$query = $this->db->table("notification_history_children");
$query->select('
notification_history_children.id AS child_id,
notification_history_children.fkid AS parent_id,
notification_history_children.customer_id,
CONCAT(customers.first_name, " ", customers.last_name) AS customers_name,
notification_history_children.receiving_entity,
notification_history_children.receiving_status,
notification_history_children.result,
notification_history_children.sent_time,
DATE_FORMAT(notification_history_children.sent_time, "%d/%m/%Y %H:%i:%s") AS formatted_sent_time,
notification_history_parents.campaign_id,
notification_campaign.campaign_name,
notification_history_parents.status AS parents_status,
notification_history_parents.start_date_time,
DATE_FORMAT(notification_history_parents.start_date_time, "%d/%m/%Y %H:%i:%s") AS formatted_start_date_time
');
$query->join('notification_history_parents', 'notification_history_parents.id = notification_history_children.fkid', 'left');
$query->join('customers', 'customers.customer_id = notification_history_children.customer_id', 'left');
$query->join('notification_campaign', 'notification_campaign.campaign_id = notification_history_parents.campaign_id', 'left');
$query->groupBy('notification_history_children.id');
return $query->get()->getResultArray();
}
}

View File

@ -0,0 +1,55 @@
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
<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>Mode</th>
<th>Schedule At</th>
<th>Sent At</th>
<th>Campaign Name</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<?php foreach ($noifications_acknowlegdement as $na) :
if ((int)$na['receiving_status'] == 1) { $class = 'text-success'; $icon = '<i class="ri-chat-check-fill"></i>'; $result = "";}
else { $class = 'text-danger'; $icon = '<i class="ri-chat-delete-fill"></i>'; $result = "";}
?>
<tr>
<td hidden><?= $na['child_id']; ?></td>
<td><?= $na['customers_name']; ?></td>
<td><?= $na['receiving_entity']; ?></td>
<td><?= $na['formatted_start_date_time']; ?></td>
<td><?= $na['formatted_sent_time']; ?></td>
<td><?= $na['campaign_name']; ?></td>
<td><span class="<?= $class; ?>" title="<?= $result; ?>"><?= $icon; ?></span></td>
<!-- <td><?= $na['receiving_status']; ?></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"]]
});
});
</script>

View File

@ -250,6 +250,9 @@
<li>
<a href="<?= base_url()."campaign_creation"; ?>">Notification Campaign</a>
</li>
<li>
<a href="<?= base_url()."acknowlegdement"; ?>">Notification Acknowlegdement</a>
</li>
<li>
<a href="<?= base_url()."mail_custom_notifications"; ?>">Custom Notifications</a>
</li>