Notification fixes : ps

This commit is contained in:
VE10-Sanjeev 2024-01-08 22:57:13 +05:30
parent 714fc37a57
commit 67d9b51186
3 changed files with 16 additions and 10 deletions

View File

@ -102,12 +102,13 @@ class Notifications extends BaseController
$receiving_status = $success['receiving_status'];
$parents_status = $success['receiving_status'];
$history_msg = strtolower(gettype($success)) == "string" ? $success : json_encode($success['reponse']);
session()->setFlashdata('success', 'Message : ' . $success['message']);
$tag = (int)$receiving_status === 0 ? 'success' : 'error' ;
session()->setFlashdata($tag, 'Message : ' . $success['message']);
$this->logger->info("Whatsapp : Reponse = " . $success['message']);
} catch (\Exception $e) {
$this->logger->error("Whatsapp : Exception Message = " . $e->getMessage() . "<br> File: " . $e->getFile() . "<br> Line: " . $e->getLine() . "<br>");
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
$history_msg = strtolower(gettype($success)) == "string" ? $success : json_encode($success['reponse']);
$history_msg = $e->getMessage();
}
$NotificationModel = new NotificationModel();
$history_parents_data = ['campaign_id' => 0,'status' => $parents_status];

View File

@ -143,7 +143,7 @@ class NotificationHelper
curl_close($curl);
} catch (\Exception $e) {
$this->logger->error('Helper : Whatsapp Exception Occur = ' . $e->getMessage());
$final_result['message'] = "Exception Errno returned " . $e->getMessage() . " <br/>";
$final_result['message'] = $e->getMessage();
$final_result['receiving_status'] = 0 ;
}
$final_result['reponse'] = json_decode($curl_exec);

View File

@ -19,21 +19,26 @@
</thead>
<tbody>
<?php foreach ($noifications_acknowlegdement as $na) :
$customer = (int)$na['customer_id'] > 0 ? $na['customers_name'] : "--" ;
$campaign = "--";
switch ((int)$na['campaign_id']) {
case 0: $campaign = "Custom Notify"; break;
case 1: case 2: $campaign = "Expiry Notify"; break;
default: $campaign = $na['campaign_name'];
}
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 = "";}
if ((int)$na['receiving_status'] == 1) { $class = 'text-success text-center display-1'; $icon = '<i class="ri-chat-check-fill"></i>'; $result = "";}
else { $class = 'text-danger text-center display-1'; $icon = '<i class="ri-chat-delete-fill"></i>'; $result = "";}
?>
<tr>
<td hidden><?= $na['child_id']; ?></td>
<td><?= $na['customers_name']; ?></td>
<td><?= $customer; ?></td>
<td><?= $na['receiving_entity']; ?></td>
<td><?= $na['formatted_start_date']; ?></td>
<td><?= $na['formatted_sent_date_time']; ?></td>
<td><?= $na['campaign_name']; ?></td>
<td><span class="<?= $class; ?>" title="<?= $result; ?>"><?= $icon; ?></span></td>
<td><?= $campaign; ?></td>
<td><div class="<?= $class; ?>" title="<?= $result; ?>" style="font-size: 1.4rem !important"><?= $icon; ?></div></td>
<!-- <td><?= $na['receiving_status']; ?></td> -->
</tr>
<?php endforeach; ?>