Customer group,notify template creation 2 : ps

This commit is contained in:
VE10-Sanjeev 2023-10-27 18:20:53 +05:30
parent 602b165d90
commit 6b0066c732
28 changed files with 285 additions and 375 deletions

View File

@ -21,7 +21,7 @@ class Business extends BaseController
$where = ['isactive !=' => NULL];
}
$BusinessModel = new BusinessModel();
$data['page_name'] = 'Buiness Listing';
$data['page_name'] = 'Buiness Details';
$data['businesses'] = $BusinessModel->where($where)->findAll();
// $data['lastQuery'] = $BusinessModel->getLastQuery();
// print_r($data);die;

View File

@ -24,7 +24,7 @@ class Customer extends BaseController
}
$CustomerModel = new CustomerModel();
$data['page_name'] = 'Customer Listing';
$data['page_name'] = 'Customer Details';
$data['customer'] = $CustomerModel->where($where)->orderBy('customer_id', 'DESC')->findAll();
// print_r($data); die();
@ -43,7 +43,7 @@ class Customer extends BaseController
if ($id === '0') {
// Add Customer
$data['page_name'] = 'Add Customer';
$data['page_name'] = 'Add Customer Details';
$data['customer'] = [];
$data['customer_billing'] = [];
$data['customer_shipping'] = [];
@ -51,7 +51,7 @@ class Customer extends BaseController
$data['invoices'] = [];
} else if ($id !== '0') {
// Edit Customer
$data['page_name'] = 'Edit Customer';
$data['page_name'] = 'Edit Customer Details';
// Load your Customer Model
$customerModel = new CustomerModel();
@ -292,7 +292,7 @@ class Customer extends BaseController
}
public function customer_group(){
$data['page_name'] = 'Customer Group';
$data['page_name'] = 'Customer Group Details';
$model = new CustomerModel();
$data['customer_group'] = $model->getGroupDetails();
$this->render_page('customer_group', $data);
@ -303,33 +303,35 @@ class Customer extends BaseController
$data['field'] = [
'' => 'Choose the Field',
'city' => 'City',
'state' => 'State',
'type' => 'Type',
'postal code' => 'Postal Code',
'schemes' => 'Schemes',
'category' => 'Category'
'C.type' => 'Type',
'CA.city' => 'City',
'CA.state' => 'State',
'CM.name' => 'Category',
'I.invoice_date' => 'Invoice Date',
'S.to_subscription' => 'Due Date',
];
$data['operator'] = [
'' => 'Choose the operator',
'equal' => 'equal to (=)',
'not equal' => 'not equal (!=)',
'like' => 'like (%)',
'contain' => 'contain (in)',
'not contain' => 'not contain (not in)',
'between' => 'between (between)',
'greater than' => 'greater than (>)',
'greater than or equal to' => 'greater than or equal to (>=)',
'less than' => 'lesser than (<)',
'less than or equal to' => 'greater than or equal to (<=)'
'equal' => 'Equal to (=)',
'not equal' => 'Not Equal (!=)',
'like' => 'Like (%)',
'greater than' => 'Greater than (>)',
'greater than or equal to' => 'Greater than or Equal to (>=)',
'less than' => 'Less than (<)',
'less than or equal to' => 'Less than or Equal to (<=)',
'contain' => 'Contain (in)',
'not contain' => 'Not Contain (not in)',
'between' => 'Between',
'is null' => 'Is NULL',
'is not null' => 'Is Not NULL',
];
$data['customer_group'] = [];
if ($id === '0') {
// Add Customer
$data['page_name'] = 'Customer Group From';
$data['page_name'] = 'Add Customer Group';
} else if ($id !== '0') {
// Edit Customer
$data['page_name'] = 'Customer Group From';
$data['page_name'] = 'Edit Customer Group';
// Load your Customer Model
$model = new CustomerModel();
@ -339,9 +341,9 @@ class Customer extends BaseController
if (!empty($result)) {
$data['customer_group']['groupname'] = $result[0]['group_name'];
$data['customer_group']['column'] = unserialize($result[0]['column']);
$data['customer_group']['operator'] = unserialize($result[0]['operator']);
$data['customer_group']['values'] = unserialize($result[0]['value']);
$data['customer_group']['column'] = $result[0]['column'] ? unserialize($result[0]['column']) : [];
$data['customer_group']['operator'] = $result[0]['operator'] ? unserialize($result[0]['operator']) : [];
$data['customer_group']['values'] = $result[0]['value'] ? unserialize($result[0]['value']) : [];
$data['customer_group']['group_id'] = $result[0]['group_id'];
$data['customer_group']['isactive'] = $result[0]['isactive'];
}
@ -349,6 +351,7 @@ class Customer extends BaseController
$this->render_page('customer_group_form', $data);
}
public function preview_customer_group($id){
try {
helper('session');
$model = new CustomerModel();
$model->setTable('customer_groups');
@ -356,10 +359,23 @@ class Customer extends BaseController
$result = $model->where($where)->findAll();
$db = \Config\Database::connect();
$sql = (string)$result[0]['group_query'];
if($sql){
$query = $db->query($sql);
$results = $query->getResultArray();
if(empty($results)){
throw new \Exception("Data Not Available");
}else{
return $this->response->setJSON($results);
}
}else{
return $this->response->setJSON([]);
}
} catch (\Exception $e) {
$this->logger->error("Customer Group: Err Occur = ".$e->getMessage()." File = ". $e->getFile() . " Line = " . $e->getLine());
session()->setFlashdata('error', 'Message: ' . $e->getMessage());
}
}
public function delete_customer_group($id){
try {
helper('session');
@ -419,23 +435,23 @@ class Customer extends BaseController
// Handle different operators and build corresponding conditions
switch ($operator) {
case 'equal':
$conditionStrings[] = "$column = '$value'";
$conditionStrings[] = "LOWER($column) = LOWER('$value') ";
break;
case 'not equal':
$conditionStrings[] = "$column <> '$value'";
$conditionStrings[] = "LOWER($column) <> LOWER('$value') ";
break;
case 'like':
$conditionStrings[] = "$column LIKE '%$value%'";
$conditionStrings[] = "LOWER($column) LIKE '%$value%'";
break;
case 'contain':
case 'where in':
case 'in':
$values = explode(',', $value);
$conditions[] = "$column IN ('" . implode("', '", $values) . "')";
$conditionStrings[] = "LOWER($column) IN ('" . implode("', '", $values) . "')";
break;
case 'not contain':
case 'where not in':
case 'not in':
$values = explode(',', $value);
$conditions[] = "$column NOT IN ('" . implode("', '", $values) . "')";
$conditionStrings[] = "LOWER($column) NOT IN ('" . implode("', '", $values) . "')";
break;
case 'between':
$dates = explode(',', $value);
@ -453,6 +469,12 @@ class Customer extends BaseController
case 'less than or equal to':
$conditionStrings[] = "$column <= $value";
break;
case 'is null':
$conditionStrings[] = "$column IS NULL";
break;
case 'is not null':
$conditionStrings[] = "$column IS NOT NULL";
break;
}
}
@ -467,20 +489,28 @@ class Customer extends BaseController
// Now you can use $whereCondition in your SQL query
$db = \Config\Database::connect();
$sql = "SELECT customer_id,CONCAT(first_name,'',last_name) as customer_name,email,mobile_no FROM customers WHERE ".$whereCondition;
// $sql = "SELECT customer_id,CONCAT(first_name,'',last_name) as customer_name,email,mobile_no FROM customers WHERE ".$whereCondition;
$sql = "SELECT CA.city,CA.state,I.invoice_date,C.customer_id,CONCAT(C.first_name,'',C.last_name) as customer_name,C.email,C.mobile_no ,S.to_subscription as due_date, C.isactive ,count(I.invoice_id) as invoice_count_raised_by_customer, S.scheme_id , CM.name
FROM customers as C
LEFT JOIN invoice I on I.customer_id = C.customer_id and I.isactive = 1
LEFT JOIN customer_addresses CA on CA.customer_id = C.customer_id and CA.address_type = 1 and CA.isactive = 1
LEFT JOIN subscription S on S.customer_id = C.customer_id
LEFT JOIN category CM on CM.id = S.scheme_id
WHERE C.isactive = 1 AND ".$whereCondition." GROUP BY C.customer_id";
$this->logger->info("Customer Group: SQL = ".$sql);
// echo $sql;
// Execute the query
$query = $db->query($sql);
// Get the result
$results = $query->getResult();
$this->logger->info("Customer Group: ".json_encode($results));
$group_id = $request_data['group_id']; // Get the ID for update
$isactive = $request_data['isactive'];
$isactive = $group_id != "" ? $request_data['isactive'] : 'on';
if($string_flag == "save"){
$data['group_query'] = $sql;
$data['group_id'] = $group_id;
$data['isactive'] = $group_id ? (($isactive == 'on') ? 1 : 0) : 1;
$data['isactive'] = (($isactive == 'on') ? 1 : 0);
$data['created_by'] = $session_uid;
$data['updated_by'] = $session_uid;
$statement = $model->saveGroupDetails($data);

View File

@ -141,7 +141,7 @@ class Notifications extends BaseController
}
public function template_creation(){
$data['page_name'] = 'Template';
$data['page_name'] = 'Template Details';
$model = new NotificationModel();
$data['template'] = $model->getTemplateDetails();
$this->render_page('template_creation', $data);
@ -221,15 +221,14 @@ class Notifications extends BaseController
$session_uid = get_logged_user_id();
$id = $this->request->getPost('template_id');
$subject = $this->request->getPost('subject') ? $this->request->getPost('subject') : NULL;
$isactive = $this->request->getPost('isactive');
$isactive = $id != "" ? $this->request->getPost('isactive') : 'on';
$data = [
'template_id' => $id,
'template_name' => $this->request->getPost('templatename'),
'subject' => $subject,
'message' => $this->request->getPost('templatemessage'),
'mode' => $this->request->getPost('mode'),
'group_id' => $this->request->getPost('group_id'),
'isactive' => $id ? (($isactive == 'on') ? 1 : 0) : 1,
'isactive' => (($isactive == 'on') ? 1 : 0),
'created_by' => $session_uid,
'updated_by' => $session_uid
];
@ -243,8 +242,6 @@ class Notifications extends BaseController
}else{
throw new \Exception("Template: Err Occur");
}
}catch(\Exception $e) {
$this->logger->error("Template: Err Occur =".$e->getMessage());
session()->setFlashdata('error', 'Message: ' .$e->getMessage());
@ -253,7 +250,7 @@ class Notifications extends BaseController
}
public function campaign_creation(){
$data['page_name'] = 'Campaign';
$data['page_name'] = 'Campaign Details';
$model = new NotificationModel();
$data['campaign'] = $model->getCampaignDetails();
$this->render_page('campaign_creation', $data);

View File

@ -22,7 +22,7 @@ class Scheme extends BaseController
}
$SchemeModel = new SchemeModel();
$data['page_name'] = 'Scheme Listing';
$data['page_name'] = 'Scheme Details';
$data['scheme'] = $SchemeModel->getSchemeNamesAndDurationsByBusiness($session_bid);

View File

@ -41,8 +41,7 @@ class NotificationModel extends Model
return $this->db->table('templates as T' )
->join('users as U1', 'U1.user_id = T.created_by', 'left')
->join('users as U2', 'U2.user_id = T.updated_by', 'left')
->join('customer_groups as CG', 'CG.group_id = T.group_id', 'left')
->select('T.template_id,T.template_name,T.mode,CG.group_id,CG.group_name,T.created_on,T.created_by,T.updated_on,T.updated_by,DATE_FORMAT(T.created_on, "%d-%m-%Y %h:%i %p") AS formatted_created_on,concat(U1.first_name," ",U1.last_name) as created_by_name,concat(U2.first_name," ",U2.last_name) as updated_by_name,T.isactive')
->select('T.template_id,T.template_name,T.mode,T.created_on,T.created_by,T.updated_on,T.updated_by,DATE_FORMAT(T.created_on, "%d-%m-%Y %h:%i %p") AS formatted_created_on,concat(U1.first_name," ",U1.last_name) as created_by_name,concat(U2.first_name," ",U2.last_name) as updated_by_name,T.isactive')
->get()->getResultArray();
}

View File

@ -3,7 +3,7 @@
<div class="card">
<div class="card-body">
<div class="float-right">
<a href="<?= base_url() . "book_page/0"; ?>" class="btn btn-primary waves-effect"> <span> <i class="mdi mdi-book-plus"></i></span> Add New </a>
<a href="<?= base_url() . "book_page/0"; ?>" class="btn btn-primary waves-effect"> <span> <i class="mdi mdi-book-plus"></i></span> Add Book </a>
</div>
<br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
@ -66,7 +66,7 @@
<td>
<a href="<?php echo $edit_page_route; ?>" class="edit-button"> <i class="ri-pencil-line"></i></a>
<a href="<?php echo "delete_books/" . $row['book_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
<a href="<?= base_url() . "delete_books/" . $row['book_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
</td>

View File

@ -32,7 +32,7 @@
<h4 class="header-title"><?= $page_name; ?></h4>
<p class="sub-header"> </p>
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?php echo base_url(); ?>insert_business">
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_business"; ?>" >
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-6">

View File

@ -39,9 +39,9 @@
<td><?= $business['postal_code']; ?></td>
<td><?= $business['business_logo']; ?></td>
<td>
<a href="<?= "new_bussiness/" . $business['business_id']; ?>" class="edit-button" title="Click to Edit Business"><i class="ri-pencil-line"></i></a>
<a href="<?= base_url() . "new_bussiness/" . $business['business_id']; ?>" class="edit-button" title="Click to Edit Business"><i class="ri-pencil-line"></i></a>
<?php if($loggedin_person_role === 'sadmin'): ?>
<a href="<?= "delete_business/" . $business['business_id']; ?>" class="delete-button" title="Click to Delete Business"><i class="ri-delete-bin-line"></i></a>
<a href="<?= base_url() . "delete_business/" . $business['business_id']; ?>" class="delete-button" title="Click to Delete Business"><i class="ri-delete-bin-line"></i></a>
<?php endif; ?>
</td>
</tr>

View File

@ -62,7 +62,7 @@
<td><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="<?php echo "campaign_creation_delete/".$c['campaign_id']; ?>" class="delete-button" title="Click to Delete Campaign" ><i class="ri-delete-bin-line"></i></a> <?php } ?>
<?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> <?php } ?>
</td>
</tr>
<?php endforeach; ?>

View File

@ -24,16 +24,6 @@
<?php } ?>
</select>
</div>
<div class="form-group col-md-12">
<label for="template_id" class="col-form-label">Template<span class="text-danger"></span></label>
<select id="template_id" name="template_id" class="form-control" onchange="changeFields(this)" required>
<option value="">Choose the Template</option>
<?php foreach ($template_details as $value) { ?>
<option value="<?php echo $value['template_id']; ?>" <?php if (isset($campaign_details['template_id']) && ($campaign_details['template_id'] === $value['template_id'])) echo "selected"; ?>>
<?php echo $value['template_name']; ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-4">
<label for="mode" class="col-form-label col-md-3">Mode<span class="text-danger"></span></label>
<div class="col-md-9 mt-1">
@ -48,7 +38,7 @@
</div>
</div>
<div class="form-group col-md-8">
<label for="scheduled" class="col-form-label">Scheduled date/Time<span class="text-danger"></span></label>
<label for="scheduled" class="col-form-label">Scheduled Date/Time<span class="text-danger"></span></label>
<div class="row">
<div class="col-6">
<input class="form-control" type="date" name="scheduled_date" id="example-date" value="<?= isset($campaign_details['scheduled_date']) ? $campaign_details['scheduled_date'] : '' ?>">
@ -58,6 +48,16 @@
</div>
</div>
</div>
<div class="form-group col-md-12">
<label for="load_templateid" class="col-form-label">Template<span class="text-danger"></span></label>
<select id="load_templateid" name="template_id" class="form-control" required>
<option value="">Choose the Template</option>
<!-- <?php foreach ($template_details as $value) { ?>
<option value="<?php echo $value['template_id']; ?>" <?php if (isset($campaign_details['template_id']) && ($campaign_details['template_id'] === $value['template_id'])) echo "selected"; ?>>
<?php echo $value['template_name']; ?></option>
<?php } ?> -->
</select>
</div>
<!-- <div class="form-group col-md-12">
<label for="templatemessage" class="col-form-label">Template Message<span class="text-danger"> *</span></label>
<textarea id="summernote-basic" name="templatemessage" class="form-control" rows="7">
@ -95,45 +95,45 @@
<script>
$(document).ready(function() {
// Listen for changes in the radio buttons
// $('input[name="mode"]').on('change', function() {
// var selectedValue = $(this).val();
// if (selectedValue === 'Email') {
// $('#emailSubject').show();
// } else {
// $('#emailSubject').hide();
// }
// });
var mode = "<?= isset($campaign_details['mode']) ? $campaign_details['mode'] : ""; ?>";
var template = "<?= isset($campaign_details['template_id']) ? $campaign_details['template_id'] : ""; ?>";
load_details(mode,template);
$('input[name="mode"]').on('change', function() {
var selectedValue = $(this).val();
console.log('selectedValue',selectedValue);
load_details(selectedValue,template);
});
if(mode != ""){
var emailRadio = document.getElementById("emailRadio");
var whatsappRadio = document.getElementById("whatsappRadio");
if(mode == 'Email'){
emailRadio.checked = true;
whatsappRadio.checked = false;
}else if(mode == 'Whatsapp'){
}
if(mode == 'Whatsapp'){
emailRadio.checked = false;
whatsappRadio.checked = true;
}
load_details(mode,template);
}
});
</script>
<script>
function changeFields(element) {
var selectedValue = $(element).val();
var emailRadio = document.getElementById("emailRadio");
var whatsappRadio = document.getElementById("whatsappRadio");
if(mode == 'Email'){
emailRadio.checked = true;
whatsappRadio.checked = false;
$('#emailSubject').show();
}else if(mode == 'Whatsapp'){
emailRadio.checked = false;
whatsappRadio.checked = true;
$('#emailSubject').hide();
}
function load_details(mode,template) {
var mode = (mode != "") ? mode : 'Email';
var temp_arr = <?php echo json_encode($template_details); ?>;
var filtered_data = $.grep(temp_arr, function(item) {
return item['mode'] === mode;
});
$('#load_templateid').empty();
$('#load_templateid').append($('<option>', { value: "", text: "Choose the Template" }));
$.each(filtered_data, function(k, v) {
$('#load_templateid').append($('<option>', {
value: v.template_id,
text: v.template_name,
selected: (v.template_id == template) ? true : false
}));
});
}
</script>

View File

@ -24,7 +24,7 @@
<!-- Customer Details Tab -->
<div class="tab-pane fade show active" id="customerDetails" role="tabpanel" aria-labelledby="customerDetails-tab">
<!-- Customer details form fields -->
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?php echo base_url(); ?>insert_customer">
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_customer"; ?>" >
<div class="form-group">
</div>

View File

@ -52,9 +52,9 @@
<td><?= $group['created_by_name']; ?></td>
<td><span class="<?php echo $class; ?>"><?php echo $message; ?></span></td>
<td>
<a href="<?= "view_customer_group/" . $group['group_id']; ?>" class="edit-button" title="Edit" ><i class="ri-pencil-line"></i></a>
<a href="<?= base_url() . "view_customer_group/" . $group['group_id']; ?>" class="edit-button" title="Edit" ><i class="ri-pencil-line"></i></a>
<a class="preview-button" title="Preview" data-toggle="modal" data-target="#scrollable-modal" data-primary-key="<?php echo $group['group_id']; ?>" data-group-name="<?php echo $group['group_name']; ?>"><i class="ri-pages-line"></i></a>
<?php if ($group['isactive']) { ?> <a href="<?= "delete_customer_group/" . $group['group_id']; ?>" class="delete-button" title="Delete" ><i class="ri-delete-bin-line"></i></a> <?php } ?>
<?php if ($group['isactive']) { ?> <a href="<?= base_url() . "delete_customer_group/" . $group['group_id']; ?>" class="delete-button" title="Delete" ><i class="ri-delete-bin-line"></i></a> <?php } ?>
</td>
</tr>
<?php endforeach; ?>
@ -75,10 +75,11 @@
</button>
</div>
<div class="modal-body" id="ajax-content">
<table id="data-table">
<table class="table table-bordered" id="data-table">
<thead>
<tr>
<th style="width:40%;">Name</th>
<th style="width:10%;">#</th>
<th style="width:30%;">Name</th>
<th style="width:30%;">Email</th>
<th style="width:30%;">Mobile</th>
</tr>
@ -110,28 +111,26 @@ $(document).ready(function() {
$('#scrollable-modal').on('show.bs.modal', function(event) {
// Get the data-primary-key attribute from the modal trigger
var primaryKey = $(event.relatedTarget).data('primary-key');
console.log(primaryKey);
var groupName = $(event.relatedTarget).data('group-name');
$('#scrollableModalTitle').text(groupName + ' - Data Preview');
console.log(groupName);
// Get the table reference
var table = $("#data-table tbody");
var route = "<?= base_url().'preview_customer_group/'?>"+primaryKey;
console.log(route);
$.ajax({
method: 'GET',
url: route,
success: function(response) {
if (response.length > 0) {
// Get the table reference
var table = $("#data-table tbody");
// Clear existing rows
table.empty();
$x=0;
// Loop through the response and create table rows
$.each(response, function (index, item) {
var row = $("<tr>");
row.append($("<td style='width:40%;'>").text(item.customer_name));
row.append($("<td style='width:10%;'>").text(++$x));
row.append($("<td style='width:30%;'>").text(item.customer_name));
row.append($("<td style='width:30%;'>").text(item.email));
row.append($("<td style='width:30%;'>").text(item.mobile_no));
table.append(row);
@ -139,11 +138,14 @@ $(document).ready(function() {
} else {
// Handle the case where there is no data
table.empty();
table.append("<tr><td colspan='3' style='width:100%;'>No data available</td></tr>");
table.append("<tr><td colspan='4' style='width:100%; text-align: center; vertical-align: middle;'>No data available</td></tr>");
}
},
error: function () {
alert("An error occurred.");
// alert("An error occurred.");
console.log("CG Preview List - An error occurred.");
table.empty();
table.append("<tr><td colspan='4' style='width:100%; text-align: center; vertical-align: middle;'>No data available</td></tr>");
}
});
});

View File

@ -4,7 +4,7 @@
<div class="card-body">
<h4 class="header-title"><?= $page_name; ?></h4>
<p class="sub-header"></p>
<form id="myForm" class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?php echo base_url(); ?>insert_customer_group">
<form id="myForm" class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_customer_group"; ?>" >
<div class="form-row">
<div class="form-group col-md-12">
<label for="groupname" class="col-form-label">Group Name<span class="text-danger"> *</span></label>
@ -15,8 +15,8 @@
<br />
<div class="form-row">
<div class="form-group col-md-12">
<h4>Select Criteria</h4>
<br />
<h4 class="header-title">Select Criteria</h4>
<table class="table table-borderless" id="itemTable">
<thead>
<tr>
@ -27,7 +27,7 @@
</tr>
</thead>
<tbody>
<?php if(!empty($customer_group)){ for ($i = 0; $i < count($customer_group['column']); $i++) { ?>
<?php if(!empty($customer_group) && !empty($customer_group['column'])){ for ($i = 0; $i < count($customer_group['column']); $i++) { ?>
<tr>
<td style="width:30%;">
<select class="form-control" data-toggle="select2" id="column" name="column[]">
@ -90,9 +90,6 @@
</table>
<div class="form-group text-right m-b-0">
<button type="button" id="addItem" class="btn btn-soft-dark btn-rounded waves-effect waves-light mr-3 add-item"> + Add New Criteria</button>
<!-- <a class="btn" id="addItem">
<h4><i class="fa fa-plus" aria-hidden="true"></i> Add More Item</h4>
</a> -->
</div>
<?php if (!empty($customer_group)) { ?>
<div class="form-group text-right checkbox checkbox-purple mr-3">
@ -121,10 +118,11 @@
</button>
</div>
<div class="modal-body" id="ajax-content">
<table id="data-table">
<table class="table table-bordered" id="data-table">
<thead>
<tr>
<th style="width:40%;">Name</th>
<th style="width:10%;">#</th>
<th style="width:30%;">Name</th>
<th style="width:30%;">Email</th>
<th style="width:30%;">Mobile</th>
</tr>
@ -154,10 +152,30 @@
document.getElementById("addItem").addEventListener("click", function() {
var fieldArray = <?php echo json_encode($field); ?>;
var operatorArray = <?php echo json_encode($operator); ?>;
// <select class="form-control" data-toggle="select2" id="operator" name="operator[]">
// <select class="form-control" data-toggle="select2" id="column" name="column[]">
var table = document.getElementById("itemTable").getElementsByTagName("tbody")[0];
var rows = table.getElementsByTagName("tr");
var hasValue = false;
// Check if any existing fields are empty
for (var i = 0; i < rows.length; i++) {
var cells = rows[i].getElementsByTagName("td");
for (var j = 0; j < cells.length; j++) {
var input = cells[j].querySelector('input, select');
if (input && input.value.trim() === "") {
alert("Field in row " + (i + 1) + " is empty.");
return; // Exit the loop after the first empty field is found.
}else {
hasValue = true;
}
}
}
if (!hasValue) {
alert("At least one row should contain a value.");
return; // Exit the function to prevent adding a new row.
}
var newRow = table.insertRow(table.rows.length);
var cell1 = newRow.insertCell(0);
@ -165,16 +183,17 @@
var cell3 = newRow.insertCell(2);
var cell4 = newRow.insertCell(3);
const select1 = document.createElement('select');
select1.className = 'form-control';
select1.id = 'column';
select1.name = 'column[]';
select1.setAttribute("data-toggle", "select2");
const select2 = document.createElement('select');
select2.className = 'form-control';
select2.id = 'operator';
select2.name = 'operator[]';
select2.setAttribute("data-toggle", "select2");
for (const fieldvalue in fieldArray) {
const fieldoption = document.createElement('option');
@ -190,11 +209,19 @@
select2.appendChild(optionElement);
}
const inputElement = document.createElement('input');
inputElement.type = 'text';
inputElement.className = 'form-control';
inputElement.name = 'values[]';
inputElement.placeholder = 'Enter the Values';
cell1.appendChild(select1);
cell2.appendChild(select2);
cell3.innerHTML = '<input type="text" class="form-control" id="values" name="values[]" placeholder="Enter the Values" />';
cell3.appendChild(inputElement);
cell4.innerHTML = '<button type="button" class="btn btn-soft-danger btn-rounded waves-effect waves-light mr-1 remove-item"><i class="fa fa-trash"></i></button>';
$(select1).select2();
$(select2).select2();
});
</script>
@ -202,7 +229,13 @@
// Function to remove a row from the table
function removeItem(row) {
var table = document.getElementById("itemTable").getElementsByTagName("tbody")[0];
var rows = table.getElementsByTagName("tr");
if (rows.length > 1) {
table.removeChild(row);
} else {
alert('At least one row should contain a value.');
}
}
// Attach the removeItem function to the Remove buttons using event delegation
@ -213,6 +246,27 @@
}
});
</script>
<!-- function removeItem(row) {
var table = document.getElementById("itemTable").getElementsByTagName("tbody")[0];
var rows = table.getElementsByTagName("tr");
var hasValue = false; // Flag to track if the row to be removed has a value.
// Check if the row to be removed has values
var cells = row.getElementsByTagName("td");
for (var j = 0; j < cells.length; j++) {
var input = cells[j].querySelector('input, select');
if (input && input.value.trim() !== "") {
hasValue = true;
break; // Exit the loop after the first value is found in the row.
}
}
if (hasValue || rows.length > 1) {
table.removeChild(row);
} else {
alert('At least one row should contain a value.');
}
} -->
<!-- <script>
document.getElementById('previewButton').addEventListener('click', function() {
@ -247,6 +301,8 @@
var formData = $("#myForm").serialize();
var groupName = $("#groupname").val();
// Use AJAX to load content into the modal
// Get the table reference
var table = $("#data-table tbody");
$.ajax({
type: "POST",
url: "<?= base_url() . 'insert_customer_group' ?>",
@ -254,17 +310,15 @@
dataType: "json", // Expect JSON response
success: function(response) {
if (response.length > 0) {
// Get the table reference
var table = $("#data-table tbody");
$('#scrollableModalTitle').text(groupName + ' - Data Preview');
// Clear existing rows
table.empty();
$x=0;
// Loop through the response and create table rows
$.each(response, function (index, item) {
var row = $("<tr>");
row.append($("<td style='width:40%;'>").text(item.customer_name));
row.append($("<td style='width:10%;'>").text(++$x));
row.append($("<td style='width:30%;'>").text(item.customer_name));
row.append($("<td style='width:30%;'>").text(item.email));
row.append($("<td style='width:30%;'>").text(item.mobile_no));
table.append(row);
@ -272,11 +326,14 @@
} else {
// Handle the case where there is no data
table.empty();
table.append("<tr><td colspan='3' style='width:100%;'>No data available</td></tr>");
table.append("<tr><td colspan='4' style='width:100%; text-align: center; vertical-align: middle;'>No data available</td></tr>");
}
},
error: function () {
alert("An error occurred.");
// alert("An error occurred.");
console.log("CG Preview Form - An error occurred.");
table.empty();
table.append("<tr><td colspan='4' style='width:100%; text-align: center; vertical-align: middle;'>No data available</td></tr>");
}
});
});

View File

@ -3,7 +3,7 @@
<div class="card">
<div class="card-body">
<div class="float-right">
<a href="new_customer/0" class="btn btn-primary"><i class="ri-map-pin-user-fill"></i> Add New </a>
<a href="<?= base_url() . "new_customer/0"; ?>" class="btn btn-primary"><i class="ri-map-pin-user-fill"></i> Add Customer </a>
</div><!-- end col-->
<br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4>

View File

@ -4,7 +4,7 @@
<div class="card-body">
<h4 class="header-title"><?= $page_name; ?></h4>
<p class="sub-header"> </p>
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?php echo base_url(); ?>insert_event">
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_event"; ?>" >
<div class="form-group">
<div class="form-row">

View File

@ -3,7 +3,7 @@
<div class="card">
<div class="card-body">
<div class="float-right">
<a href="new_event/0" class="btn btn-primary"><i class="fe-shopping-bag"></i> Add New </a>
<a href="new_event/0" class="btn btn-primary"><i class="fe-shopping-bag"></i> Add Event </a>
</div><!-- end col-->
<br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4>

View File

@ -17,7 +17,7 @@
<div class="card-body">
<h4 class="header-title"><?= $page_name; ?></h4>
<!-- <p class="sub-header"><?php print_r($invoice_details); ?> </p> -->
<form method="POST" enctype="multipart/form-data" action="<?php echo base_url(); ?>save_invoice">
<form method="POST" enctype="multipart/form-data" action="<?= base_url() . "save_invoice";?>" >
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-6">

View File

@ -5,7 +5,7 @@
<div class="card">
<div class="card-body">
<div class="float-right">
<a href="new_book_invoice/0" class="btn btn-primary"><i class="ri-currency-line"></i> Add New </a>
<a href="<?= base_url() . "new_book_invoice/0"; ?> class="btn btn-primary"><i class="ri-currency-line"></i> Add Invoice </a>
<!-- HTML for the "Add New" button -->
<!-- <div id="standard-modal" >
@ -82,12 +82,12 @@
<td><?= $row['customer_name']; ?></td>
<td><?= $row['status']; ?></td>
<td> <span data-plugin="counterup"><?= $row['total_amount']; ?></span></td>
<td><a href="<?= "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a>&nbsp;
<td><a href="<?= base_url() . "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a>&nbsp;
<?php if ($row['invoice_type'] == 1): ?>
<a href="<?= "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<?php elseif ($row['invoice_type'] == 2): ?>
<a href="<?= "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<a href="<?= base_url() . "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<?php endif; ?>
<a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>&nbsp;

View File

@ -4,7 +4,7 @@
<div class="card-body">
<h4 class="header-title"><?= $page_name; ?></h4>
<p class="sub-header"> </p>
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?php echo base_url(); ?>insert_scheme">
<form class="needs-validation" novalidate method="POST" enctype="multipart/form-data" action="<?= base_url() . "insert_scheme";?>">
<div class="form-group">
<div class="form-row">

View File

@ -3,7 +3,7 @@
<div class="card">
<div class="card-body">
<div class="float-right">
<a href="new_scheme/0" class="btn btn-primary"><i class="ri-currency-line"></i> Add New </a>
<a href="new_scheme/0" class="btn btn-primary"><i class="ri-currency-line"></i> Add Scheme </a>
</div><!-- end col-->
<br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4>
@ -46,8 +46,8 @@
<td><?= $row['duration']; ?></td>
<td hidden><?= $row['category_name']; ?></td>
<td>
<a href="<?= "new_scheme/" . $row['book_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
<a href="<?php echo "delete_scheme/" . $row['book_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
<a href="<?= base_url() . "new_scheme/" . $row['book_id']; ?>" class="edit-button"><i class="ri-pencil-line"></i></a>
<a href="<?= base_url() . "delete_scheme/" . $row['book_id']; ?>" class="delete-button"><i class="ri-delete-bin-line"></i></a>
</td>
</tr>
<?php endforeach; ?>

View File

@ -3,7 +3,7 @@
<div class="card">
<div class="card-body">
<div class="float-right">
<a href="<?= base_url()."sitesetting_page/0"; ?>" class="btn btn-primary"><i class="mdi mdi-playlist-plus"></i> Add New </a>
<a href="<?= base_url()."sitesetting_page/0"; ?>" class="btn btn-primary"><i class="mdi mdi-playlist-plus"></i> Add Setting </a>
</div><!-- end col-->
<br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4>

View File

@ -6,7 +6,7 @@
<!-- Add a "Print Addresses" button -->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#printAddressesModal">Print Addresses</button>
<a href="<?= base_url()."new_subscription_invoice/0"; ?>" class="btn btn-primary"><i class="ri-shield-user-line"></i> Add New</a>
<a href="<?= base_url()."new_subscription_invoice/0"; ?>" class="btn btn-primary"><i class="ri-shield-user-line"></i> Add Subscription</a>
</div><!-- end col-->
<br>
@ -44,12 +44,12 @@
<td><?= $row['customer_name']; ?></td>
<td><?= $row['status']; ?></td>
<td> <span data-plugin="counterup"><?= $row['total_amount']; ?></span></td>
<td><a href="<?= "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a>&nbsp;
<td><a href="<?= base_url() . "approve_invoice/" . $row['invoice_id']; ?>" class="approve-button" title="Approve the Invoice"><i class="ri-checkbox-circle-fill"></i></a>&nbsp;
<?php if ($row['invoice_type'] == 1): ?>
<a href="<?= "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<a href="<?= base_url() . "new_subscription_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<?php elseif ($row['invoice_type'] == 2): ?>
<a href="<?= "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<a href="<?= base_url() . "new_book_invoice/" . $row['invoice_id']; ?>" class="edit-button" title="Edit the Invoice"><i class="ri-pencil-line" title="Edit the Invoice"></i></a>&nbsp;
<?php endif; ?>
<a href="<?= base_url("generate_invoice_pdf/{$row['invoice_id']}") ?>" class="download-pdf-button" title="Download the Invoice"><i class="ri-file-download-line"></i></a>&nbsp;

View File

@ -5,7 +5,7 @@
<!-- < -->
<p class="sub-header"> </p>
<form class="needs-validation" method="POST" enctype="multipart/form-data"
action="<?php echo base_url(); ?>add_subscription">
action="<?= base_url() . "add_subscription";?>" >
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-6">

View File

@ -784,11 +784,11 @@
<!-- Summernote js -->
<script src="<?= base_url() . "public/assets/libs/summernote/summernote-bs4.min.js" ?>"></script>
<!-- <script src="<?= base_url() . "public/assets/libs/select2/js/select2.min.js" ?>"></script> -->
<!-- <script src="<?= base_url() . "public/assets/libs/bootstrap-maxlength/bootstrap-maxlength.min.js" ?>"></script> -->
<script src="<?= base_url() . "public/assets/libs/select2/js/select2.min.js" ?>"></script>
<script src="<?= base_url() . "public/assets/libs/bootstrap-maxlength/bootstrap-maxlength.min.js" ?>"></script>
<!-- Init js -->
<script src="<?= base_url() . "public/assets/js/pages/form-summernote.init.js" ?>"></script>
<!-- <script src="<?= base_url() . "public/assets/js/pages/form-advanced.init.js" ?>"></script> -->
<script src="<?= base_url() . "public/assets/js/pages/form-advanced.init.js" ?>"></script>
<script>
// Automatically close both success and error messages after 5 seconds (5000 milliseconds)

View File

@ -13,7 +13,7 @@
<!-- plugin css -->
<link href="<?= base_url()."public/assets/libs/multiselect/css/multi-select.css" ?>" rel="stylesheet" type="text/css" />
<link href="<?= base_url()."public/assets/libs/select2/css/select2.min.css" ?>" rel="stylesheet" type="text/css" />
<link href="<?= base_url()."public/assets/libs/selectize/css/selectize.bootstrap3.css" ?>" rel="stylesheet" type="text/css" />
<!-- <link href="<?= base_url()."public/assets/libs/selectize/css/selectize.bootstrap3.css" ?>" rel="stylesheet" type="text/css" /> -->
<!-- third party css -->
<link href="<?= base_url()."public/assets/libs/datatables.net-bs4/css/dataTables.bootstrap4.min.css" ?>" rel="stylesheet" type="text/css" />

View File

@ -4,75 +4,6 @@
<ul class="list-unstyled topnav-menu float-right mb-0">
<li class="d-none d-lg-block">
<form class="app-search">
<div class="app-search-box dropdown">
<div class="input-group">
<input type="search" class="form-control" placeholder="Search..." id="top-search">
<div class="input-group-append">
<button class="btn" type="submit">
<i class="fe-search"></i>
</button>
</div>
</div>
<div class="dropdown-menu dropdown-lg" id="search-dropdown">
<!-- item-->
<div class="dropdown-header noti-title">
<h5 class="text-overflow mb-2">Found <span class="text-danger">09</span> results</h5>
</div>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<i class="fe-home mr-1"></i>
<span>Analytics Report</span>
</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<i class="fe-aperture mr-1"></i>
<span>How can I help you?</span>
</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<i class="fe-settings mr-1"></i>
<span>User profile settings</span>
</a>
<!-- item-->
<div class="dropdown-header noti-title">
<h6 class="text-overflow mb-2 text-uppercase">Users</h6>
</div>
<div class="notification-list">
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="media">
<img class="d-flex mr-2 rounded-circle" src="<?= base_url()."public/assets/images/users/avatar-2.jpg" ?>" alt="Generic placeholder image" height="32">
<div class="media-body">
<h5 class="m-0 font-14">Erwin E. Brown</h5>
cat<span class="font-12 mb-0">UI Designer</span>
</div>
</div>
</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="media">
<img class="d-flex mr-2 rounded-circle" src="<?= base_url()."public/assets/images/users/avatar-5.jpg" ?>" alt="Generic placeholder image" height="32">
<div class="media-body">
<h5 class="m-0 font-14">Jacob Deo</h5>
<span class="font-12 mb-0">Developer</span>
</div>
</div>
</a>
</div>
</div>
</div>
</form>
</li>
<li class="dropdown d-inline-block d-lg-none">
<a class="nav-link dropdown-toggle arrow-none waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
<i class="fe-search noti-icon"></i>
@ -125,100 +56,6 @@
</div>
</li>
<li class="dropdown notification-list topbar-dropdown">
<a class="nav-link dropdown-toggle waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
<i class="fe-bell noti-icon"></i>
<span class="badge badge-danger rounded-circle noti-icon-badge">5</span>
</a>
<div class="dropdown-menu dropdown-menu-right dropdown-lg">
<!-- item-->
<div class="dropdown-item noti-title">
<h5 class="m-0">
<span class="float-right">
<a href="" class="text-dark">
<small>Clear All</small>
</a>
</span>Notification
</h5>
</div>
<div class="noti-scroll" data-simplebar>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item active">
<div class="notify-icon bg-soft-primary text-primary">
<i class="mdi mdi-comment-account-outline"></i>
</div>
<p class="notify-details">Doug Dukes commented on Admin Dashboard
<small class="text-muted">1 min ago</small>
</p>
</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon">
<img src="<?= base_url()."public/assets/images/users/avatar-2.jpg" ?>" class="img-fluid rounded-circle" alt="" />
</div>
<p class="notify-details">Mario Drummond</p>
<p class="text-muted mb-0 user-msg">
<small>Hi, How are you? What about our next Next Edition of "The big bull" </small>
</p>
</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon">
<img src="<?= base_url()."public/assets/images/users/avatar-4.jpg" ?>" class="img-fluid rounded-circle" alt="" />
</div>
<p class="notify-details">Rory Dalyell</p>
<p class="text-muted mb-0 user-msg">
<small>Wow ! this 'Reinforced Concrete Design' 7th Edt. looks good and awesome interior designers also </small>
</p>
</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-soft-warning text-warning">
<i class="mdi mdi-account-plus"></i>
</div>
<p class="notify-details">New Customer registered.
<small class="text-muted">5 hours ago</small>
</p>
</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-info">
<i class="mdi mdi-comment-account-outline"></i>
</div>
<p class="notify-details">Caleb Flakelar commented on Whatsapp
<small class="text-muted">4 days ago</small>
</p>
</a>
<!-- item-->
<a href="javascript:void(0);" class="dropdown-item notify-item">
<div class="notify-icon bg-secondary">
<i class="mdi mdi-heart"></i>
</div>
<p class="notify-details">Carlos Crouch liked "The big bull" book
<b>Admin</b>
<small class="text-muted">13 days ago</small>
</p>
</a>
</div>
<!-- All-->
<a href="javascript:void(0);" class="dropdown-item text-center text-primary notify-item notify-all">
View all
<i class="fe-arrow-right"></i>
</a>
</div>
</li>
<li class="dropdown notification-list topbar-dropdown">
<a class="nav-link dropdown-toggle nav-user mr-0 waves-effect waves-light" data-toggle="dropdown" href="#" role="button" aria-haspopup="false" aria-expanded="false">
<img src="<?= $profile_picture; ?>" alt="user-image" class="rounded-circle">

View File

@ -31,7 +31,6 @@
<tr>
<th hidden></th>
<th>Template Name</th>
<th>Group Name</th>
<th>Mode</th>
<th>Created at</th>
<th>Created by</th>
@ -50,7 +49,6 @@
<tr>
<td hidden><?= $temp['template_id']; ?></td>
<td><?= $temp['template_name']; ?></td>
<td><?= $temp['group_name']; ?></td>
<td><?= $temp['mode']; ?></td>
<td><?= $temp['formatted_created_on']; ?></td>
<td><?= $temp['created_by_name']; ?></td>

View File

@ -6,22 +6,12 @@
<form class="parsley-examples" action="<?= base_url() . "template_creation_insert"; ?>" method="post" enctype="multipart/form-data">
<div class="form-group">
<div class="form-row">
<div class="form-group col-md-6">
<div class="form-group col-md-12">
<label for="templatename" class="col-form-label">Template Name<span class="text-danger"> *</span></label>
<input type="text" class="form-control" id="templatename" name="templatename" value="<?= isset($template_details['template_name']) ? $template_details['template_name'] : '' ?>" placeholder="Template Name" required />
<div class="invalid-feedback"> Please provide. </div>
</div>
<div class="form-group col-md-6">
<label for="group_id" class="col-form-label">Group<span class="text-danger"></span></label>
<select id="group_id" name="group_id" class="form-control" required>
<option value="">Choose the Group</option>
<?php foreach ($group_details as $value) { ?>
<option value="<?php echo $value['group_id']; ?>" <?php if (isset($template_details['group_id']) && ($template_details['group_id'] === $value['group_id'])) echo "selected"; ?>>
<?php echo $value['group_name']; ?></option>
<?php } ?>
</select>
</div>
<div class="form-group col-md-12">
<label for="mode" class="col-form-label col-md-3">Mode<span class="text-danger"></span></label>
<div class="col-md-9 mt-1">
<div class="custom-control custom-radio custom-control-inline">
@ -35,7 +25,7 @@
</div>
</div>
<div class="form-group col-md-12" id="emailSubject" style="display: block;">
<div class="form-group col-md-6" id="emailSubject" style="display: block;">
<label for="templatename" class="col-form-label">subject</label>
<input type="text" class="form-control" id="subject" name="subject" value="<?= isset($template_details['subject']) ? $template_details['subject'] : '' ?>" placeholder="Subject" />
</div>