Notification template classes removed : ps

This commit is contained in:
VE10-Sanjeev 2023-10-04 11:29:59 +05:30
parent 8a60495a2a
commit a89b7c0d56
8 changed files with 233 additions and 275 deletions

View File

@ -118,5 +118,7 @@ define('order_child_column', ["invoice_id","wp_api_line_items_id","customer_id"]
define('WAAI_TOKEN', '65156a8cc4358'); define('WAAI_TOKEN', '65156a8cc4358');
define('WAAI_INSTANCE', '65156ADE3E24F'); define('WAAI_INSTANCE', '65156ADE3E24F');
define('SEND_WAAI_URL', 'https://waai.in/api/send'); define('SEND_WAAI_URL', 'https://waai.in/api/send');
define('SEND_WAAI_GROUP_URL', 'https://waai.in/api/send_group');

View File

@ -341,7 +341,7 @@ class Invoice extends BaseController
$model = new InvoiceModel(); $model = new InvoiceModel();
$where = ['I.business_id' => (int)get_business_id(), 'I.invoice_id' => $invoice_id, 'I.isactive' => 1]; $where = ['I.business_id' => (int)get_business_id(), 'I.invoice_id' => $invoice_id, 'I.isactive' => 1];
$details = $model->getDetailForApproveNotifications($where); $details = $model->getDetailForApproveNotifications($where);
$records = [];
$reference_number = ""; $reference_number = "";
$invoice_serial_number = ""; $invoice_serial_number = "";
$recipient_name = ""; $recipient_name = "";
@ -384,9 +384,10 @@ class Invoice extends BaseController
$records['page_name'] = 'Approve Template'; $records['page_name'] = 'Approve Template';
// view('approve_template',$records); // view('approve_template',$records);
// $this->logger->info("Approve : Request data = ".json_encode($records)); // $this->logger->info("Approve : Request data = ".json_encode($records));
view('approve_template',$records); // view('approve_template',$records);
$records['template_name'] = 'approve_template'; $records['template_name'] = 'approve_template';
$records['item'] = $details['item'];
$records['subject'] = $invoice_serial_number . " - Approval Notification"; $records['subject'] = $invoice_serial_number . " - Approval Notification";
$records['description'] = "<html><head><title>VBP Approve Information</title></head><body> $records['description'] = "<html><head><title>VBP Approve Information</title></head><body>
@ -413,7 +414,7 @@ class Invoice extends BaseController
$params->instance_id = WAAI_INSTANCE; $params->instance_id = WAAI_INSTANCE;
$params->access_token = WAAI_TOKEN; $params->access_token = WAAI_TOKEN;
$this->logger->info("Invoice: approve notification Email Request data = ".json_encode($records)); $this->logger->info("Invoice: approve notification Email Request data = ".json_encode($records));
$email_result = $notification->sendEmail($details); $email_result = $notification->sendEmail($records);
$this->logger->info("Invoice: approve notification Email Response = " . json_encode($email_result)); $this->logger->info("Invoice: approve notification Email Response = " . json_encode($email_result));
$this->logger->info("Invoice: approve notification Whatsapp Request data = ".json_encode($params)); $this->logger->info("Invoice: approve notification Whatsapp Request data = ".json_encode($params));
$whatsapp_result = $notification->sendWhatsAppMessage(SEND_WAAI_URL, "POST", $params); $whatsapp_result = $notification->sendWhatsAppMessage(SEND_WAAI_URL, "POST", $params);

View File

@ -10,8 +10,6 @@ class Notifications extends BaseController
## Email Section : ## Email Section :
public function mail_custom_notifications() public function mail_custom_notifications()
{ {
$successMessage = session()->getFlashdata('success');
$validationErrors = session()->getFlashdata('error');
$request = \Config\Services::request(); $request = \Config\Services::request();
if ($request->is('post')) { if ($request->is('post')) {
$records = $request->getVar(); $records = $request->getVar();
@ -39,24 +37,34 @@ class Notifications extends BaseController
$this->logger->info("Whatsapp : sending message instance id = " . WAAI_INSTANCE); $this->logger->info("Whatsapp : sending message instance id = " . WAAI_INSTANCE);
try { try {
$this->logger->info("Whatsapp : sending message instance id = " . WAAI_INSTANCE); $this->logger->info("Whatsapp : sending message instance id = " . WAAI_INSTANCE);
$params->number = (int)'91' . $records['mobile']; if ($records['categories'] == 'SEND_WAAI_GROUP_URL') {
if($records['group_id'] != ""){ $params->group_id = $records['group_id']; }
else{ throw new \Exception("Group Id Missing Please Try again.."); }
}else if ($records['categories'] == 'SEND_WAAI_URL') {
if($records['mobile'] != ""){ $params->number = (int)'91' . $records['mobile']; }
else{ throw new \Exception("Mobile Number Missing Please Try again.."); }
}else{
throw new \Exception("Please Choose your Category");
}
if ($records['type'] == 'media') {
if($records['media_url'] != ""){ $params->media_url = $records['media_url']; }
else{ throw new \Exception("Media Url Missing Please Try again.."); }
}
$url = constant($records['categories']);
$params->type = $records['type'] == "" ? "text" : $records['type']; $params->type = $records['type'] == "" ? "text" : $records['type'];
$params->instance_id = WAAI_INSTANCE; $params->instance_id = WAAI_INSTANCE;
$params->access_token = WAAI_TOKEN; $params->access_token = WAAI_TOKEN;
$params->message = $records['description']; $params->message = $records['description'];
if ($records['type'] == 'media') {
$params->media_url = $records['media_url'];
}
$this->logger->info("Whatsapp : sending message request type b4 = " . gettype($params)); $this->logger->info("Whatsapp : sending message request type b4 = " . gettype($params));
helper('notification'); helper('notification');
$notification = new NotificationHelper(); $notification = new NotificationHelper();
$success = $notification->sendWhatsAppMessage(SEND_WAAI_URL, "POST", $params); $success = $notification->sendWhatsAppMessage($url, "POST", $params);
session()->setFlashdata('success', 'Message : ' . $success); session()->setFlashdata('success', 'Message : ' . $success);
$this->logger->info("Whatsapp : Reponse = " . $success); $this->logger->info("Whatsapp : Reponse = " . $success);
} catch (\Exception $e) { } catch (\Exception $e) {
$this->logger->error("Whatsapp : Exception Message = " . $e->getMessage() . "<br> File: " . $e->getFile() . "<br> Line: " . $e->getLine() . "<br>"); $this->logger->error("Whatsapp : Exception Message = " . $e->getMessage() . "<br> File: " . $e->getFile() . "<br> Line: " . $e->getLine() . "<br>");
$error = "An error occurred: " . $e->getMessage(); session()->setFlashdata('error', 'Message: ' . $e->getMessage());
session()->setFlashdata('error', 'Message: ' . $error);
} }
} }
$data['page_name'] = 'Custom Notifications'; $data['page_name'] = 'Custom Notifications';

View File

@ -17,10 +17,15 @@ class NotificationHelper
public function sendEmail($records) public function sendEmail($records)
{ {
$this->logger->info('Helper : Email'); $this->logger->info('Helper : Email Request Data type = '.gettype($records));
$cc = isset($records['carboncopy']) ? $records['carboncopy'] : ''; $cc = isset($records['carboncopy']) ? $records['carboncopy'] : '';
$bcc = isset($records['blindcarboncopy']) ? $records['blindcarboncopy'] : ''; $bcc = isset($records['blindcarboncopy']) ? $records['blindcarboncopy'] : '';
try { try {
if($records['recipient_email'] == "" && $records['subject'] == ""){
throw new \Exception("Email and Subject are Must Please Try again..");
}
$this->email->setTo($records['recipient_email']); $this->email->setTo($records['recipient_email']);
$this->logger->info('Helper : Email recipient = '.$records['recipient_email']); $this->logger->info('Helper : Email recipient = '.$records['recipient_email']);
$this->email->setFrom('no-reply@tripapprovaltool.com', isset($records['company'])?$records['company']:"VBP"); $this->email->setFrom('no-reply@tripapprovaltool.com', isset($records['company'])?$records['company']:"VBP");
@ -28,6 +33,7 @@ class NotificationHelper
$this->logger->info('Helper : Email subject = '.$records['subject']); $this->logger->info('Helper : Email subject = '.$records['subject']);
if($records['template_name'] != ""){ if($records['template_name'] != ""){
$this->logger->info('Helper : Email Template = '.$records['template_name']); $this->logger->info('Helper : Email Template = '.$records['template_name']);
$this->logger->info("Helper : Email Request data = ".json_encode($records));
$emailContent = view($records['template_name'],$records); $emailContent = view($records['template_name'],$records);
$this->email->setMessage($emailContent); $this->email->setMessage($emailContent);
}else{ }else{
@ -38,7 +44,7 @@ class NotificationHelper
if (!empty($cc)) { if (!empty($cc)) {
$ccRecipients = explode(',', $cc); $ccRecipients = explode(',', $cc);
$this->logger->info('Helper : Email CC recipient = '.$ccRecipients); $this->logger->info('Helper : Email carboncopy CC recipient = '.$ccRecipients);
foreach ($ccRecipients as $ccRecipient) { foreach ($ccRecipients as $ccRecipient) {
$this->email->setCC(trim($ccRecipient)); $this->email->setCC(trim($ccRecipient));
} }
@ -46,7 +52,7 @@ class NotificationHelper
if (!empty($bcc)) { if (!empty($bcc)) {
$bccRecipients = explode(',', $bcc); $bccRecipients = explode(',', $bcc);
$this->logger->info('Helper : Email BCC recipient = '.$bccRecipients); $this->logger->info('Helper : Email blindcarboncopy BCC recipient = '.$bccRecipients);
foreach ($bccRecipients as $bccRecipient) { foreach ($bccRecipients as $bccRecipient) {
$this->email->setBCC(trim($bccRecipient)); $this->email->setBCC(trim($bccRecipient));
} }
@ -59,8 +65,8 @@ class NotificationHelper
throw new \Exception('Email sending failed.'); throw new \Exception('Email sending failed.');
} }
} catch (\Exception $e) { } catch (\Exception $e) {
$this->logger->error('Email Error: ' . $e->getMessage()); $this->logger->error('Helper : Email Error: ' . $e->getMessage());
$message['error'] = 'Helper : Email Exception Occur : ' . $e->getMessage(); $message['error'] = 'Email Exception Occur : ' . $e->getMessage();
} }
return $message; return $message;
} }
@ -111,7 +117,7 @@ class NotificationHelper
curl_close($curl); curl_close($curl);
}catch (\Exception $e) { }catch (\Exception $e) {
$this->logger->error('Helper : Whatsapp Exception Occur = ' . $e->getMessage()); $this->logger->error('Helper : Whatsapp Exception Occur = ' . $e->getMessage());
$final_result = "Exception Errno returned".$e->getMessage()." <br/>"; $final_result = "Exception Errno returned ".$e->getMessage()." <br/>";
} }
return $final_result; return $final_result;
} }

View File

@ -1,108 +1,9 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', Helvetica Neue, Roboto;font-size: 15px;width: 600px;margin: 0 auto;text-align: center;-webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;text-rendering: optimizeLegibility;">
<body style="background-color: rgb(189 194 199);">
<head>
<meta charset="UTF-8">
<title><?= $browser_title ?></title>
<meta name="description" content="The small framework with powerful features">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" type="image/png" href="<?= $favicon; ?>">
<!-- STYLES -->
<style {csp-style-nonce}>
* {
transition: background-color 300ms ease, color 300ms ease;
}
*:focus {
background-color: rgba(221, 72, 20, .2);
outline: none;
}
html,
body {
/* background-color: rgba(247, 248, 249, 1); */
background-color: rgb(189 194 199);
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", Helvetica Neue, Roboto;
font-size: 15px;
width: 600px;
margin: 0 auto;
text-align: center;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-rendering: optimizeLegibility;
}
header {
padding: .4rem 0rem 0rem;
}
.menulogo {
padding: 0rem 2rem;
}
.menucontent {
padding: 0rem 2rem;
text-align: center;
}
section {
padding: 0rem 2rem;
}
section a {
color: rgba(221, 72, 20, 1);
}
.further {
padding: 0rem 2rem;
font-family: Helvetica Neue, Helvetica, Roboto, Arial, sans-serif;
background-color: rgb(255, 255, 255);
}
footer {
padding: 0rem 2rem;
text-align: center;
}
footer .copyrights {
background-color: rgba(62, 62, 62, 1);
color: rgba(200, 200, 200, 1);
padding: 25px 35px;
}
.row {
display: flex;
justify-content: space-between;
text-align: left;
}
.column {
flex: 1;
text-align: left;
}
.space {
display: block;
margin-block-start: 1em;
margin-block-end: 1em;
margin-inline-start: 0px;
margin-inline-end: 0px;
}
.row-1 {
display: flex;
align-items: center;
margin: 12px 0px;
}
</style>
</head>
<body>
<!-- HEADER: MENULOGO + MENUCONTENT SECTION --> <!-- HEADER: MENULOGO + MENUCONTENT SECTION -->
<header> <header style="padding: .4rem 0rem 0rem;">
<div class="menulogo"> <div style="padding: 0rem 2rem;">
<div style="padding : 15px 35px; <div style="padding : 15px 35px;
background-color : rgb(255,255,255); background-color : rgb(255,255,255);
border-radius : 5px 5px 0px 0px; border-radius : 5px 5px 0px 0px;
@ -114,21 +15,19 @@
</div> </div>
</div> </div>
<div class="menucontent"> <div style="padding: 0rem 2rem;text-align: center;">
<div style="padding : 15px 35px; background-color : rgb(249,249,249); "> <div style="padding : 15px 35px; background-color : rgb(249,249,249); ">
<div align="center"> <div align="center">
<h2><span>Thanks for your Order</span></h2> <h2><span>Thanks for your Order</span></h2>
<div> <div>
<p style="padding : 35px 0px 0px; "> <p style="padding : 35px 0px 0px; ">
<span style="font-size : 24px; ">Order <?= $invoice_serial_number.'('.$invoice_order_number.')'; ?>.</span><br> <span style="font-size : 24px; ">Order #<?= $invoice_serial_number ? $invoice_order_number.'('.$invoice_serial_number.')' : $invoice_order_number ; ?>.</span><br>
</p>
<p style="padding : 10px 0px 0px; ">
<span style="font-size : 24px; "> Hi <?= $recipient_name; ?>, Thank you for your purchase.</span><br>
</p> </p>
<p style="padding : 10px 0px 0px; "> <p style="padding : 10px 0px 0px; ">
<span style="font-size : 24px; ">We are processing your order.</span><br> <span style="font-size : 20px; ">Hi <?= $recipient_name; ?>, Thank you for your purchase.</span><br>
</p>
<p style="padding : 10px 0px 0px; ">
<span style="font-size : 20px; ">We are processing your order.</span><br>
</p> </p>
<div style="width : 204px;"> <div style="width : 204px;">
<a href="https://vijayabharathambooks.com" style="display : block; text-decoration : none; background-color : rgb(244,105,46); <a href="https://vijayabharathambooks.com" style="display : block; text-decoration : none; background-color : rgb(244,105,46);
@ -142,57 +41,55 @@
</div> </div>
</header> </header>
<!-- CONTENT --> <!-- CONTENT -->
<section> <section style="padding: 0rem 2rem;">
<div style="padding : 20px 35px; background-color : rgb(255,255,255); "> <div style="padding : 20px 35px; background-color : rgb(255,255,255); ">
<?php if (!empty($item)) { <?php if (!empty($item)) {
foreach ($item as $ii) { ?> foreach ($item as $ii) { ?>
<div class="row-1"> <table border="0" cellpadding="0" cellspacing="0" width="100%">
<div style="flex:0; vertical-align: middle; display: inline-block;"> <tr>
<a href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank"><img id="1695982823501100004_imgsrc_url_1" width="150" src="https://vijayabharathambooks.com/wp-content/uploads/2023/01/front-1-300x450.jpg"></a><br> <td align="left" valign="top" width="30%">
<a style="color: rgba(221, 72, 20, 1);" href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank"><img src="https://vijayabharathambooks.com/wp-content/uploads/2023/01/front-1-300x450.jpg" alt="Image" style="max-width: 100%; height: auto; display: block;"></a><br>
</td>
<td valign="middle" width="70%" style="padding:16px;">
<div><a style="color: rgba(221, 72, 20, 1);" href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank">
<span style="font-size : 15px; margin : 0px; padding : 0px; font-weight : 400; line-height : 18.2px; "><?= $ii->title; ?><small> (#VB-65)</small></span>
</a><br>
</div> </div>
<div class="column"> <div>
<div style="padding-left:15px;">
<a href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank"><?= $ii->title; ?><small> (#VB-65)</small></a><br>
<p style="text-align:left;"> <p style="text-align:left;">
<span style="color : rgb(60, 67, 74); "><span style=" font-weight : 400; line-height : 18.2px; ">x <?= $ii->quantity; ?></span></span> <span style="color : rgb(60, 67, 74); "><span style=" font-weight : 400; line-height : 18.2px; ">x <?= $ii->quantity; ?></span></span>
<span style="color : rgb(60, 67, 74); float:right; "><span style="text-align : right; white-space : nowrap; font-weight : 400; line-height : 18.2px; ">&nbsp;<?= $ii->unit_price; ?></span></span> <span style="color : rgb(60, 67, 74); float:right; "><span style="text-align : right; white-space : nowrap; font-weight : 400; line-height : 18.2px; ">&nbsp;<?= $ii->subtotal; ?></span></span>
</p> </p>
</div> </div>
</div> </td>
</div> </tr>
</table>
<?php }}else{?> <?php }}else{?>
<div class="row-1"> <table border="0" cellpadding="0" cellspacing="0" width="100%">
<div style="flex:0; vertical-align: middle; display: inline-block;"> <tr>
<a href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank"><img id="1695982823501100004_imgsrc_url_1" width="150" src="https://vijayabharathambooks.com/wp-content/uploads/2023/01/front-1-300x450.jpg"></a><br> <td align="left" valign="top" width="30%">
<a style="color: rgba(221, 72, 20, 1);" href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank"><img src="https://vijayabharathambooks.com/wp-content/uploads/2023/01/front-1-300x450.jpg" alt="Image" style="max-width: 100%; height: auto; display: block;"></a><br>
</td>
<td valign="middle" width="70%" style="padding:16px;">
<div><a style="color: rgba(221, 72, 20, 1);" href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank">
<span style="font-size : 15px; margin : 0px; padding : 0px; font-weight : 400; line-height : 18.2px; ">பசும்பொன் தேவர் போற்றிய ஆர்.எஸ்.எஸ்<small> (#VB-65)</small>
</span>
</a><br>
</div> </div>
<div class="column"> <div>
<div style="padding-left:15px;">
<a href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank">பசும்பொன் தேவர் போற்றிய ஆர்.எஸ்.எஸ்<small> (#VB-65)</small></a><br>
<p style="text-align:left;"> <p style="text-align:left;">
<span style="color : rgb(60, 67, 74); "><span style=" font-weight : 400; line-height : 18.2px; ">x 1</span></span> <span style="color : rgb(60, 67, 74); "><span style=" font-weight : 400; line-height : 18.2px; ">x 1</span></span>
<span style="color : rgb(60, 67, 74); float:right; "><span style="text-align : right; white-space : nowrap; font-weight : 400; line-height : 18.2px; ">&nbsp;125</span></span> <span style="color : rgb(60, 67, 74); float:right; "><span style="text-align : right; white-space : nowrap; font-weight : 400; line-height : 18.2px; ">&nbsp;125</span></span>
</p> </p>
</div> </div>
</div> </td>
</div> </tr>
<div class="row-1"> </table>
<div style="flex:0; vertical-align: middle; display: inline-block;">
<a href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank"><img id="1695982823501100004_imgsrc_url_1" width="150" src="https://vijayabharathambooks.com/wp-content/uploads/2023/01/front-1-300x450.jpg"></a><br>
</div>
<div class="column">
<div style="padding-left:15px;">
<a href="https://vijayabharathambooks.com/books/pasumpon-thevar-potriya-rss/" target="_blank">பசும்பொன் தேவர் போற்றிய ஆர்.எஸ்.எஸ்<small> (#VB-65)</small></a><br>
<p style="text-align:left;">
<span style="color : rgb(60, 67, 74); "><span style=" font-weight : 400; line-height : 18.2px; ">x 1</span></span>
<span style="color : rgb(60, 67, 74); float:right; "><span style="text-align : right; white-space : nowrap; font-weight : 400; line-height : 18.2px; ">&nbsp;125</span></span></p>
</div>
</div>
</div>
<?php } ?> <?php } ?>
</div> </div>
<div style="padding : 15px 35px; background-color : rgb(249,249,249); " width="100%" align="center"> <div style="padding : 15px 35px; background-color : rgb(249,249,249); " align="center">
<div class="row"> <div style="display: flex;justify-content: space-between;text-align: left;width: 100%;">
<div class="column"> <div style="text-align: left; width: 48%;">
<div style=" width : 265px; line-height : 30px; "> <div style=" width : 265px; line-height : 30px; ">
<p><span style="font-size : 20px; ">Payment Method</span><br> <p><span style="font-size : 20px; ">Payment Method</span><br>
</p> </p>
@ -208,7 +105,7 @@
<p>Flexible Shipping<br> </p> <p>Flexible Shipping<br> </p>
</div> </div>
</div> </div>
<div class="column"> <div style="text-align: left; width: 26%;">
<div style=" color : rgb(68,68,68); line-height : 24px; "> <div style=" color : rgb(68,68,68); line-height : 24px; ">
<div style="padding : 0px; border : 0px hidden; text-align : left; "> <div style="padding : 0px; border : 0px hidden; text-align : left; ">
<p>Subtotal<br></p> <p>Subtotal<br></p>
@ -223,7 +120,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="column"> <div style="text-align: left; width: 26%;">
<div style=" color : rgb(68,68,68); line-height : 24px; "> <div style=" color : rgb(68,68,68); line-height : 24px; ">
<div style="padding : 0px; border : 0px hidden; text-align : right; "> <div style="padding : 0px; border : 0px hidden; text-align : right; ">
<p><span style="font-weight : 300;"><span></span>&nbsp;<?= $subtotal; ?></span><br></p> <p><span style="font-weight : 300;"><span></span>&nbsp;<?= $subtotal; ?></span><br></p>
@ -240,21 +137,16 @@
</div> </div>
</div> </div>
</div> </div>
<div style="text-align : left;">
<h3>Note</h3> <div style="line-height:24px;text-align: left;font-size: 24px;color: #333;padding-top: 15px;">Note</div>
<div style="display: flex;justify-content: space-between;text-align: left;width: 100%;">
<p> A publisher manages the design, editing, and production process with the help of proofreaders, printers, and editors. Publishers make schedules for every stage of the process and work backward from the planned date for publication. They distribute promotional catalogs to libraries and booksellers. </p><br> <p> A publisher manages the design, editing, and production process with the help of proofreaders, printers, and editors. Publishers make schedules for every stage of the process and work backward from the planned date for publication. They distribute promotional catalogs to libraries and booksellers. </p><br>
</div> </div>
</div> </div>
</section> <div style="background-color: rgb(255, 255, 255);width: 100%;display:flex;text-align: left;">
<section> <div style="width: 50%;padding-left: 2.5em;" >
<div class="further"> <h1 style="font-size: 24px; color: #333;">Billing Address</h1>
<div class="row"> <div style="font-weight : 300; color : rgb(68,68,68); line-height : 22px; ">
<div class="column">
<div> <!-- padding : 25px 0px 0px; -->
<!-- <h3><span style="font-weight: normal;">Billing Address</span></h3> -->
<h3>Billing Address</h3>
</div>
<div style=" font-weight : 300; color : rgb(68,68,68); line-height : 22px; padding : 5px 0px; background-image : none; background-color : transparent; ">
<p> <p>
<span>ARAVIND S<br></span> <span>ARAVIND S<br></span>
<span>22/2, SriKrishna Apartments<br> </span> <span>22/2, SriKrishna Apartments<br> </span>
@ -267,12 +159,10 @@
</p> </p>
</div> </div>
</div> </div>
<div class="column"> <div style="width: 50%;" >
<div> <!-- Content for the right side -->
<!-- <h3><span style="font-weight: normal;">Shipping Address</span></h3> --> <h1 style="font-size: 24px; color: #333;">Shipping Address</h1>
<h3>Shipping Address</h3> <div style="text-align: left; font-weight : 300; color : rgb(68,68,68); line-height : 22px;">
</div>
<div style=" font-weight : 300; color : rgb(68,68,68); line-height : 22px; padding : 5px 0px; background-image : none; background-color : transparent; ">
<p> <p>
<span>ARAVIND S<br></span> <span>ARAVIND S<br></span>
<span>22/2, SriKrishna Apartments<br> </span> <span>22/2, SriKrishna Apartments<br> </span>
@ -281,17 +171,19 @@
<span>Tamil Nadu<br></span> <span>Tamil Nadu<br></span>
<span><a href="tel:+919445062922" style="color : rgb(68,68,68); font-weight : 300; " target="_blank">+919445062922</a><br></span> <span><a href="tel:+919445062922" style="color : rgb(68,68,68); font-weight : 300; " target="_blank">+919445062922</a><br></span>
<span><a href="mailto:arasubu@gmail.com" style="color : rgb(68,68,68); font-weight : 300; " target="_blank">arasubu@gmail.com</a><br></span> <span><a href="mailto:arasubu@gmail.com" style="color : rgb(68,68,68); font-weight : 300; " target="_blank">arasubu@gmail.com</a><br></span>
</p> </p>
</div> </div>
</div> </div>
</div> </div>
</div>
</section> </section>
<!-- FOOTER: DEBUG INFO + COPYRIGHTS --> <!-- FOOTER: DEBUG INFO + COPYRIGHTS -->
<footer> <footer style="padding: 0rem 2rem;text-align: center;">
<div class="copyrights"> <div style="background-color: rgba(62, 62, 62, 1);color: rgba(200, 200, 200, 1);padding: 25px 35px;">
<p class="space"><span style="font-size : 20px; line-height : 22px; ">Get in Touch<br></span></p> <p style="display: block;margin-block-start: 1em;margin-block-end: 1em;margin-inline-start: 0px;margin-inline-end: 0px; text-align : center; line-height : 22px; padding: 20px 0px;color : rgb(245, 245, 245);">
<p class="space" style="text-align : center; line-height : 22px; padding: 20px 0px;"> <span style="font-size : 20px; line-height : 22px; ">Get in Touch<br></span>
</p>
<p style="display: block;margin-block-start: 1em;margin-block-end: 1em;margin-inline-start: 0px;margin-inline-end: 0px; text-align : center; line-height : 22px; padding: 20px 0px;">
<span style="color : rgb(245, 245, 245); "> <span style="color : rgb(245, 245, 245); ">
<span style="font-size : 12px; ">For any questions, please send an email to&nbsp;</span> <span style="font-size : 12px; ">For any questions, please send an email to&nbsp;</span>
</span> </span>

View File

@ -103,7 +103,7 @@
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="subject" class="col-4 col-form-label">subject</label> <label for="subject" class="col-4 col-form-label">Subject</label>
<div class="col-7"> <div class="col-7">
<input type="text" placeholder="Subject" class="form-control" id="subject" name="subject"> <input type="text" placeholder="Subject" class="form-control" id="subject" name="subject">
</div> </div>
@ -127,17 +127,38 @@
</div> </div>
<div id="whatsappFormDiv"> <div id="whatsappFormDiv">
<form role="form" class="parsley-examples" method="POST" enctype="multipart/form-data" action="<?= base_url() . "whatsapp_custom_notifications"; ?>"> <form role="form" class="parsley-examples" method="POST" enctype="multipart/form-data" action="<?= base_url() . "whatsapp_custom_notifications"; ?>">
<div class="form-group row">
<label for="group_id" class="col-4 col-form-label">Categories</label>
<div class="col-7">
<select class="form-control" id="categories" name="categories">
<option value="">Choose your Category Type</option>
<option value="SEND_WAAI_URL">Individual</option>
<option value="SEND_WAAI_GROUP_URL">Group</option>
</select>
</div>
</div>
<div id="fields-for-groupid" style="display: none;">
<div class="form-group row">
<label for="group_id" class="col-4 col-form-label">Group Id</label>
<div class="col-7">
<input type="text" placeholder="Group ID" class="form-control" id="group_id" name="group_id">
</div>
</div>
</div>
<div id="fields-for-mobile" style="display: none;">
<div class="form-group row"> <div class="form-group row">
<label for="mobile" class="col-4 col-form-label">Mobile Number</label> <label for="mobile" class="col-4 col-form-label">Mobile Number</label>
<div class="col-7"> <div class="col-7">
<input type="number" placeholder="Mobile Number" class="form-control" id="mobile" name="mobile"> <!-- <input type="number" placeholder="Mobile Number" class="form-control" id="mobile" name="mobile"> -->
<input type="text" class="form-control" id="mobile" name="mobile" placeholder="Mobile Number" data-toggle="input-mask" data-mask-format="0000000000">
</div>
</div> </div>
</div> </div>
<div class="form-group row"> <div class="form-group row">
<label for="type" class="col-4 col-form-label">Message Type</label> <label for="type" class="col-4 col-form-label">Message Type</label>
<div class="col-7"> <div class="col-7">
<select class="form-control" id="type" name="type"> <select class="form-control" id="type" name="type">
<option value=null>Choose your Message Type</option> <option value="">Choose your Message Type</option>
<option value="text">Text</option> <option value="text">Text</option>
<option value="media">Media</option> <option value="media">Media</option>
</select> </select>
@ -212,12 +233,36 @@
dropdown.addEventListener("change", function() { dropdown.addEventListener("change", function() {
// Determine which option is selected and show the corresponding fields // Determine which option is selected and show the corresponding fields
const selectedOption = dropdown.value; const selectedOption = dropdown.value;
if (selectedOption === "media") { if(selectedOption === "media"){
fieldsForMediaURL.style.display = "block"; fieldsForMediaURL.style.display = "block";
} else { } else {
fieldsForMediaURL.style.display = "none"; fieldsForMediaURL.style.display = "none";
document.getElementById("media_url").value = ""; document.getElementById("media_url").value = "";
} }
});
const categories = document.getElementById("categories");
const fieldsForGroupID = document.getElementById("fields-for-groupid");
const fieldsForMobile = document.getElementById("fields-for-mobile");
// Add a change event listener to the dropdown
categories.addEventListener("change", function () {
// Determine which option is selected and show the corresponding fields
const selectedCategories = categories.value;
if (selectedCategories === "SEND_WAAI_GROUP_URL") {
fieldsForGroupID.style.display = "block";
fieldsForMobile.style.display = "none";
document.getElementById("mobile").value = "";
} else if (selectedCategories === "SEND_WAAI_URL") {
fieldsForMobile.style.display = "block";
fieldsForGroupID.style.display = "none";
document.getElementById("group_id").value = "";
} else {
fieldsForMobile.style.display = "none";
fieldsForGroupID.style.display = "none";
document.getElementById("mobile").value = "";
document.getElementById("group_id").value = "";
}
}); });
</script> </script>

View File

@ -484,6 +484,11 @@
<!-- Plugins js--> <!-- Plugins js-->
<script src="<?= base_url()."public/assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.min.js" ?>"></script> <script src="<?= base_url()."public/assets/libs/admin-resources/jquery.vectormap/jquery-jvectormap-1.2.2.min.js" ?>"></script>
<script src="<?= base_url()."public/assets/libs/admin-resources/jquery.vectormap/maps/jquery-jvectormap-world-mill-en.js" ?>"></script> <script src="<?= base_url()."public/assets/libs/admin-resources/jquery.vectormap/maps/jquery-jvectormap-world-mill-en.js" ?>"></script>
<script src="<?= base_url()."public/assets/libs/jquery-mask-plugin/jquery.mask.min.js" ?>"></script>
<script src="<?= base_url()."public/assets/libs/autonumeric/autoNumeric-min.js" ?>"></script>
<!-- Init js-->
<script src="<?= base_url()."public/assets/js/pages/form-masks.init.js"?>"></script>
<!-- Dashboard init--> <!-- Dashboard init-->
<!-- <script src="<?= base_url()."public/assets/js/pages/dashboard-sales.init.js" ?>"></script> --> <!-- <script src="<?= base_url()."public/assets/js/pages/dashboard-sales.init.js" ?>"></script> -->

View File

@ -47,8 +47,7 @@
<div class="form-group col-md-4"> <div class="form-group col-md-4">
<label for="mobile_no" class="col-form-label">Mobile Number<span class="text-danger">*</span></label> <label for="mobile_no" class="col-form-label">Mobile Number<span class="text-danger">*</span></label>
<input data-parsley-type="number" type="text" class="form-control" id="mobile_no" name="mobile_no" placeholder="Mobile Number (Enter only numbers)" required data-parsley-type="number" value="<?= isset($details['mobile_no']) ? $details['mobile_no'] : '' ?>" pattern="[0-9]{10}" maxlength="10" autofocus /> <input type="text" class="form-control" id="mobile_no" name="mobile_no" placeholder="Mobile Number (Enter only numbers)" data-toggle="input-mask" data-mask-format="0000000000" value="<?= isset($details['mobile_no']) ? $details['mobile_no'] : '' ?>" autofocus>
</div> </div>
<!-- ... (other form elements) ... --> <!-- ... (other form elements) ... -->