CHANGE_TRACKER_ISSUE : AADHAVAN
This commit is contained in:
parent
4d29b494cf
commit
27c6a2cc3c
@ -70,7 +70,7 @@ class BranchController extends BaseController
|
|||||||
|
|
||||||
$BranchModel->insert($data);
|
$BranchModel->insert($data);
|
||||||
|
|
||||||
return;
|
return json_encode(true);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -91,6 +91,7 @@ class ClientController extends BaseController
|
|||||||
$client_id =$this->session->get('is_client_logged_in');
|
$client_id =$this->session->get('is_client_logged_in');
|
||||||
|
|
||||||
$data['doc_list'] = $this->ClientDocsModel->getTemplate($client_id);
|
$data['doc_list'] = $this->ClientDocsModel->getTemplate($client_id);
|
||||||
|
// print_r($client_id);die;
|
||||||
// print_r($data['doc_list']);die;
|
// print_r($data['doc_list']);die;
|
||||||
|
|
||||||
$clientdata = $this->ClientBranchModel->where('id', $client_id)->get()->getRow();
|
$clientdata = $this->ClientBranchModel->where('id', $client_id)->get()->getRow();
|
||||||
@ -192,12 +193,28 @@ class ClientController extends BaseController
|
|||||||
$number = '91'. $client_branch_data['mobile_no']; // Replace with dynamic recipient number
|
$number = '91'. $client_branch_data['mobile_no']; // Replace with dynamic recipient number
|
||||||
$message = 'Login OTP is: ' . $otp;
|
$message = 'Login OTP is: ' . $otp;
|
||||||
|
|
||||||
try {
|
if($client_branch_data['whatsapp'] == 1){
|
||||||
$notificationHelper->sendWhatsAppMessage($number, $message);
|
try {
|
||||||
return $this->respond(['success' => true, 'otp' => $otp]);
|
$notificationHelper->sendWhatsAppMessage($number, $message);
|
||||||
} catch (\Exception $e) {
|
// return $this->respond(['success' => true, 'otp' => $otp]);
|
||||||
return $this->respond(['Error' => $e->getMessage()]);
|
} catch (\Exception $e) {
|
||||||
|
return $this->respond(['Error' => $e->getMessage()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($client_branch_data['sms'] == 1){
|
||||||
|
try {
|
||||||
|
$notificationHelper->sendSms();
|
||||||
|
// return $this->respond(['success' => true, 'otp' => $otp]);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->respond(['Error' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return $this->respond(['success' => true, 'otp' => $otp]);
|
||||||
|
|
||||||
|
|
||||||
// Return success response with OTP
|
// Return success response with OTP
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|||||||
@ -59,19 +59,93 @@ class MasterController extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getBusinessDetails($businessIds) {
|
||||||
|
// This is just a placeholder for your actual database call
|
||||||
|
// Replace this with your actual query logic
|
||||||
|
$businessDetails = [];
|
||||||
|
foreach ($businessIds as $businessId) {
|
||||||
|
// Example data fetched from the database
|
||||||
|
$businessDetails[] = $this->BusinessModel->select('business_name')->where('business_id', $businessId)->first();
|
||||||
|
}
|
||||||
|
return $businessDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function service_group_list()
|
public function service_group_list()
|
||||||
{
|
{
|
||||||
if(!$this->session->has('is_staff_logged_in')){ return redirect()->to(base_url().'staff'); }
|
if(!$this->session->has('is_staff_logged_in')){ return redirect()->to(base_url().'staff'); }
|
||||||
|
|
||||||
$data['serviceGroupList'] = $this->ServiceGroupModel->select('service_group.* , COUNT(services.service_id) as service_count')
|
// Fetch all service groups
|
||||||
->join('services', 'service_group.service_group_id = services.service_group_id', 'left')
|
$serviceGroups = $this->ServiceGroupModel->select('service_group.*')
|
||||||
// ->where('service_group.business_id',$this->session->get('logged_in_staff_business_id'))
|
->findAll();
|
||||||
->groupBy('service_group.service_group_id')
|
|
||||||
->findAll();
|
// Fetch services grouped by service_group_id
|
||||||
|
$services = $this->ServiceGroupModel->select('service_group.service_group_id, services.service_name')
|
||||||
|
->join('services', 'service_group.service_group_id = services.service_group_id', 'left')
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
// Initialize an array to store service counts and service names by group
|
||||||
|
$serviceCounts = [];
|
||||||
|
$serviceNamesByGroup = [];
|
||||||
|
|
||||||
|
// Group services by service group id and count services
|
||||||
|
foreach ($services as $service) {
|
||||||
|
$serviceGroupId = $service['service_group_id'];
|
||||||
|
if (!isset($serviceCounts[$serviceGroupId])) {
|
||||||
|
$serviceCounts[$serviceGroupId] = 0;
|
||||||
|
$serviceNamesByGroup[$serviceGroupId] = [];
|
||||||
|
}
|
||||||
|
if (!empty($service['service_name'])) {
|
||||||
|
$serviceCounts[$serviceGroupId]++;
|
||||||
|
$serviceNamesByGroup[$serviceGroupId][] = $service['service_name'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Assign service counts and names to service groups
|
||||||
|
foreach ($serviceGroups as &$group) {
|
||||||
|
$groupId = $group['service_group_id'];
|
||||||
|
$group['service_count'] = isset($serviceCounts[$groupId]) ? $serviceCounts[$groupId] : 0;
|
||||||
|
$group['service_list'] = isset($serviceNamesByGroup[$groupId]) ? $serviceNamesByGroup[$groupId] : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the modified service groups to the data array
|
||||||
|
$data['serviceGroupList'] = $serviceGroups;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($serviceGroups as &$group) {
|
||||||
|
$groupId = $group['service_group_id'];
|
||||||
|
$group['service_count'] = isset($serviceNamesByGroup[$groupId]) ? count($serviceNamesByGroup[$groupId]) : 0;
|
||||||
|
$group['service_list'] = isset($serviceNamesByGroup[$groupId]) ? $serviceNamesByGroup[$groupId] : [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set the modified service groups to the data array
|
||||||
|
$data['serviceGroupList'] = $serviceGroups;
|
||||||
|
|
||||||
|
|
||||||
$data['business_list'] = $this->BusinessModel->findAll();
|
$data['business_list'] = $this->BusinessModel->findAll();
|
||||||
|
|
||||||
$staffdata = $this->StaffModel->where('staff_id',$this->session->get('is_staff_logged_in'))->get()->getRow();
|
$staffdata = $this->StaffModel->where('staff_id',$this->session->get('is_staff_logged_in'))->get()->getRow();
|
||||||
|
|
||||||
|
|
||||||
|
foreach ($data['serviceGroupList'] as $key => $value) {
|
||||||
|
// Decode the JSON encoded business_id
|
||||||
|
$businessIds = json_decode($value['business_id'], true);
|
||||||
|
|
||||||
|
// Find the business details
|
||||||
|
$businessDetails = $this->getBusinessDetails($businessIds);
|
||||||
|
|
||||||
|
// Add business count
|
||||||
|
$value['business_count'] = count($businessIds);
|
||||||
|
|
||||||
|
// Add business details to the service group
|
||||||
|
$value['business_list'] = $businessDetails;
|
||||||
|
|
||||||
|
// Update the serviceGroupList array with the new data
|
||||||
|
$data['serviceGroupList'][$key] = $value;
|
||||||
|
}
|
||||||
|
// echo "<pre>";
|
||||||
|
// print_r($data);die;
|
||||||
echo view('layout/header', ['Data'=>$staffdata]);
|
echo view('layout/header', ['Data'=>$staffdata]);
|
||||||
echo view('service_group_list',$data);
|
echo view('service_group_list',$data);
|
||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
@ -266,10 +340,12 @@ class MasterController extends BaseController
|
|||||||
$data['templateData'] = $this->TemplateModel->where('md5(template_id)',$id)->get()->getRow();
|
$data['templateData'] = $this->TemplateModel->where('md5(template_id)',$id)->get()->getRow();
|
||||||
|
|
||||||
$data['serviceData'] = $this->ServiceModel->where('service_id',$data['templateData']->service_id)->get()->getRow();
|
$data['serviceData'] = $this->ServiceModel->where('service_id',$data['templateData']->service_id)->get()->getRow();
|
||||||
$data['AllServiceData'] = $this->ServiceModel->where('branch_id',$this->session->get('logged_in_staff_branch_id'))->findAll();
|
// $data['AllServiceData'] = $this->ServiceModel->where('branch_id',$this->session->get('logged_in_staff_branch_id'))->findAll();
|
||||||
|
$data['AllServiceData'] = $this->ServiceModel->findAll();
|
||||||
|
|
||||||
$data['serviceGroupData'] = $this->ServiceGroupModel->where('service_group_id',$data['templateData']->service_group_id)->get()->getRow();
|
$data['serviceGroupData'] = $this->ServiceGroupModel->where('service_group_id',$data['templateData']->service_group_id)->get()->getRow();
|
||||||
$data['AllServiceGroupData'] = $this->ServiceGroupModel->where('branch_id',$this->session->get('logged_in_staff_branch_id'))->findAll();
|
// $data['AllServiceGroupData'] = $this->ServiceGroupModel->where('branch_id',$this->session->get('logged_in_staff_branch_id'))->findAll();
|
||||||
|
$data['AllServiceGroupData'] = $this->ServiceGroupModel->findAll();
|
||||||
|
|
||||||
$data['BusinessData'] = $this->BusinessModel->where('business_id',$data['templateData']->template_header_business)->where('isactive',1)->get()->getRow();
|
$data['BusinessData'] = $this->BusinessModel->where('business_id',$data['templateData']->template_header_business)->where('isactive',1)->get()->getRow();
|
||||||
$data['AllBusinessData'] = $this->BusinessModel->where('isactive',1)->findAll();
|
$data['AllBusinessData'] = $this->BusinessModel->where('isactive',1)->findAll();
|
||||||
@ -581,7 +657,6 @@ class MasterController extends BaseController
|
|||||||
{
|
{
|
||||||
|
|
||||||
$docData = $this->request->getVar();
|
$docData = $this->request->getVar();
|
||||||
$docData['is_active'] = 1;
|
|
||||||
$docData['created_by'] = $this->session->has('is_staff_logged_in');
|
$docData['created_by'] = $this->session->has('is_staff_logged_in');
|
||||||
$docData['body_html'] = $this->TemplateModel->where('template_id',$this->request->getVar('template_id'))->get()->getRow()->body_html;
|
$docData['body_html'] = $this->TemplateModel->where('template_id',$this->request->getVar('template_id'))->get()->getRow()->body_html;
|
||||||
$insert = $this->ClientDocsModel->insert($docData);
|
$insert = $this->ClientDocsModel->insert($docData);
|
||||||
@ -635,6 +710,7 @@ class MasterController extends BaseController
|
|||||||
$DateAndYears = $this->dateAndYearPlaceholder();
|
$DateAndYears = $this->dateAndYearPlaceholder();
|
||||||
}
|
}
|
||||||
//replace Date and Year values in template content
|
//replace Date and Year values in template content
|
||||||
|
// print_r($DateAndYears);die;
|
||||||
foreach (json_decode($DateAndYears,true) as $key => $value) {
|
foreach (json_decode($DateAndYears,true) as $key => $value) {
|
||||||
$placeHolder = '%'.$key.'%';
|
$placeHolder = '%'.$key.'%';
|
||||||
$data['body_html'] = str_replace($placeHolder,$value,$data['body_html']);
|
$data['body_html'] = str_replace($placeHolder,$value,$data['body_html']);
|
||||||
@ -763,7 +839,7 @@ class MasterController extends BaseController
|
|||||||
|
|
||||||
$MailHelper = new MailHelper();
|
$MailHelper = new MailHelper();
|
||||||
|
|
||||||
$clientData = $this->ClientDocsModel->select('client.name , client_branch.email, client_branch.mobile_no')
|
$clientData = $this->ClientDocsModel->select('client.name , client_branch.email, client_branch.*')
|
||||||
->join('client_branch', 'client_docs.client_branch_id = client_branch.id', 'left')
|
->join('client_branch', 'client_docs.client_branch_id = client_branch.id', 'left')
|
||||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
->where('client_docs.id', $doc_id)->get()->getRow();
|
->where('client_docs.id', $doc_id)->get()->getRow();
|
||||||
@ -784,14 +860,20 @@ class MasterController extends BaseController
|
|||||||
$notificationHelper = new NotificationHelper();
|
$notificationHelper = new NotificationHelper();
|
||||||
$number = '91'.$clientData->mobile_no; // Replace with dynamic recipient number
|
$number = '91'.$clientData->mobile_no; // Replace with dynamic recipient number
|
||||||
|
|
||||||
try {
|
|
||||||
$whatsApp_message = "Dear " . $clientData->name . "," . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve." ;
|
// print_r($clientData);die;
|
||||||
$notificationHelper->sendWhatsAppMessage($number, $whatsApp_message, $url);
|
if($clientData->whatsapp == 1){
|
||||||
// return $this->respond(['success' => true, 'otp' => $otp]);
|
$whatsApp_message = "Dear " . $clientData->name . "," . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve." ;
|
||||||
} catch (\Exception $e) {
|
$notificationHelper->sendWhatsAppMessage($number, $whatsApp_message, $url);
|
||||||
return $this->respond(['Error' => $e->getMessage()]);
|
// return $this->respond(['success' => true, 'otp' => $otp]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($clientData->sms == 1){
|
||||||
|
$notificationHelper->sendSms();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$statusData['client_docs_id'] = $doc_id;
|
$statusData['client_docs_id'] = $doc_id;
|
||||||
$statusData['is_staff'] = 1;
|
$statusData['is_staff'] = 1;
|
||||||
$statusData['created_by'] = $this->session->get('is_staff_logged_in');
|
$statusData['created_by'] = $this->session->get('is_staff_logged_in');
|
||||||
@ -845,13 +927,24 @@ class MasterController extends BaseController
|
|||||||
$notificationHelper = new NotificationHelper();
|
$notificationHelper = new NotificationHelper();
|
||||||
$number = '91'.$clientData->mobile_no; // Replace with dynamic recipient number
|
$number = '91'.$clientData->mobile_no; // Replace with dynamic recipient number
|
||||||
|
|
||||||
try {
|
if($clientData->whatsapp == 1){
|
||||||
$whatsApp_message = "Dear " . $clientData->name . "," . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve." ;
|
try {
|
||||||
$notificationHelper->sendWhatsAppMessage($number, $whatsApp_message, $url);
|
$whatsApp_message = "Dear " . $clientData->name . "," . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve." ;
|
||||||
return $this->respond(['success' => true, 'data' => 'Remember Send Successfully']);
|
$notificationHelper->sendWhatsAppMessage($number, $whatsApp_message, $url);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->respond(['Error' => $e->getMessage()]);
|
return $this->respond(['Error' => $e->getMessage()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($clientData->sms == 1){
|
||||||
|
try {
|
||||||
|
$notificationHelper->sendSms();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->respond(['Error' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->respond(['success' => true, 'data' => 'Remember Send Successfully']);
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
return $this->response->setJSON(['status' => 'failed','code' => 500,'data' => $exception],500);
|
return $this->response->setJSON(['status' => 'failed','code' => 500,'data' => $exception],500);
|
||||||
}
|
}
|
||||||
@ -878,11 +971,22 @@ class MasterController extends BaseController
|
|||||||
$number = '91'.$mobile_no; // Replace with dynamic recipient number
|
$number = '91'.$mobile_no; // Replace with dynamic recipient number
|
||||||
$message = 'Document Verification OTP : ' . $otp;
|
$message = 'Document Verification OTP : ' . $otp;
|
||||||
|
|
||||||
try {
|
|
||||||
$notificationHelper->sendWhatsAppMessage($number, $message);
|
if($client_data['whatsapp'] == 1){
|
||||||
return $this->respond(['success' => true, 'otp' => $otp]);
|
try {
|
||||||
} catch (\Exception $e) {
|
$notificationHelper->sendWhatsAppMessage($number, $message);
|
||||||
return $this->respond(['Error' => $e->getMessage()]);
|
return $this->respond(['success' => true, 'otp' => $otp]);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->respond(['Error' => $e->getMessage()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($client_data['sms'] == 1){
|
||||||
|
try {
|
||||||
|
$notificationHelper->sendSms();
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $this->respond(['Error' => $e->getMessage()]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -3,11 +3,13 @@
|
|||||||
// app/Helpers/NotificationHelper.php
|
// app/Helpers/NotificationHelper.php
|
||||||
|
|
||||||
namespace App\Helpers;
|
namespace App\Helpers;
|
||||||
|
use CodeIgniter\API\ResponseTrait;
|
||||||
|
|
||||||
class NotificationHelper
|
class NotificationHelper
|
||||||
{
|
{
|
||||||
protected $email;
|
protected $email;
|
||||||
protected $logger;
|
protected $logger;
|
||||||
|
use ResponseTrait;
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
@ -79,6 +81,37 @@ class NotificationHelper
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sendSms()
|
||||||
|
{
|
||||||
|
$apiKey = 'HgvlULWCIrs'; // Your API key
|
||||||
|
// $mobileNumbers = '919894638731'; // Recipient mobile numbers
|
||||||
|
$mobileNumbers = '916379103977'; // Recipient mobile numbers
|
||||||
|
$DLTTemplateID = '1105171896608602869'; // DLT Template ID
|
||||||
|
$senderId = 'LDRAJ'; // Sender ID
|
||||||
|
$message = 'Dear Gowtham, 986532 is OTP to approve Service group for service name purposes.';
|
||||||
|
$serviceName = 'TEMPLATE_BASED'; // Service name
|
||||||
|
|
||||||
|
// URL encode the message
|
||||||
|
$encodedMessage = urlencode($message);
|
||||||
|
|
||||||
|
// Initialize cURL
|
||||||
|
$ch = curl_init();
|
||||||
|
|
||||||
|
// Set cURL options
|
||||||
|
curl_setopt($ch, CURLOPT_URL, "https://smsapi.24x7sms.com/api_2.0/SendSMS.aspx?APIKEY=$apiKey&MobileNo=$mobileNumbers&SenderID=$senderId&Message=$encodedMessage&ServiceName=$serviceName&DLTTemplateID=$DLTTemplateID");
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
|
||||||
|
|
||||||
|
// Execute cURL request and get the response
|
||||||
|
$output = curl_exec($ch);
|
||||||
|
|
||||||
|
// Close cURL session
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
// Output the response (for testing purposes)
|
||||||
|
// return $this->response->setJSON(['response' => $output]);
|
||||||
|
return json_encode(['response' => $output]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -120,7 +120,7 @@
|
|||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="branchname">Business</label>
|
<label for="branchname">Business</label>
|
||||||
<select name="business" id="business" class="form-control">
|
<select name="business" id="business" class="form-control" required="">
|
||||||
<option value="0">Select Business</option>
|
<option value="0">Select Business</option>
|
||||||
<?php foreach ($business_list as $key => $value) { ?>
|
<?php foreach ($business_list as $key => $value) { ?>
|
||||||
<option value="<?php echo $value['business_id'] ?>"><?php echo $value['business_name'] ?></option>
|
<option value="<?php echo $value['business_id'] ?>"><?php echo $value['business_name'] ?></option>
|
||||||
@ -233,7 +233,10 @@
|
|||||||
if(!formDataValidate){
|
if(!formDataValidate){
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
if($('#business').val() == 0){
|
||||||
|
toastr.warning('Select Business');
|
||||||
|
return;
|
||||||
|
}
|
||||||
var formData = {
|
var formData = {
|
||||||
business_id: $('#business').val(),
|
business_id: $('#business').val(),
|
||||||
gstno: $('#gst_no').val(),
|
gstno: $('#gst_no').val(),
|
||||||
@ -274,7 +277,7 @@
|
|||||||
console.log(response);
|
console.log(response);
|
||||||
$('#business_branch_submit').removeAttr('disabled');
|
$('#business_branch_submit').removeAttr('disabled');
|
||||||
|
|
||||||
$('#bike_model_login-modal').modal('hide');
|
$('#branch-create-modal').modal('hide');
|
||||||
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
},
|
},
|
||||||
@ -292,7 +295,7 @@
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
// console.log(response);
|
// console.log(response);
|
||||||
$('#business').val(response.business_id);
|
$('#business').val(response.business_id).trigger('change');
|
||||||
$('#branch_name').val(response.branch_name);
|
$('#branch_name').val(response.branch_name);
|
||||||
$('#gst_no').val(response.gstno);
|
$('#gst_no').val(response.gstno);
|
||||||
$('#email').val(response.email);
|
$('#email').val(response.email);
|
||||||
@ -315,6 +318,7 @@
|
|||||||
|
|
||||||
$('#add_branch_model_open').click( function(){
|
$('#add_branch_model_open').click( function(){
|
||||||
$('#branch_action_type').html('Add Branch');
|
$('#branch_action_type').html('Add Branch');
|
||||||
|
$('#business').val(0).trigger('change');
|
||||||
$('#model_form_data')[0].reset();
|
$('#model_form_data')[0].reset();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
<h4 class="page-title"><?php echo $page_name; ?></h4>
|
<h4 class="page-title"><?php echo $page_name; ?></h4>
|
||||||
<div class="page-title-right">
|
<div class="page-title-right">
|
||||||
<a onclick="window.history.back()" class="btn btn-secondary waves-effect waves-light"> Back </a>
|
<a onclick="window.history.back()" class="btn btn-secondary waves-effect waves-light" style="color: #fff;background-color: #6c757d;border-color: #6c757d;"> Back </a>
|
||||||
|
|
||||||
<ol class="breadcrumb m-0">
|
<ol class="breadcrumb m-0">
|
||||||
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Minton</a></li>
|
<!-- <li class="breadcrumb-item"><a href="javascript: void(0);">Minton</a></li>
|
||||||
|
|||||||
@ -267,6 +267,8 @@
|
|||||||
|
|
||||||
$('#add_branch_model_open').click(function () {
|
$('#add_branch_model_open').click(function () {
|
||||||
$('#branch_type').html('Create Branch');
|
$('#branch_type').html('Create Branch');
|
||||||
|
$('#client').val(0).trigger('change');
|
||||||
|
$('#client_branch_model_form_data')[0].reset(); // Reset form elements
|
||||||
})
|
})
|
||||||
|
|
||||||
function submitBranch(event,params) {
|
function submitBranch(event,params) {
|
||||||
|
|||||||
@ -159,6 +159,7 @@
|
|||||||
gst_no : $('#gst_no').val()
|
gst_no : $('#gst_no').val()
|
||||||
},
|
},
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
console.log(response);
|
||||||
if(response.success){
|
if(response.success){
|
||||||
gst_error.html('');
|
gst_error.html('');
|
||||||
$('#generate_otp_id').hide();
|
$('#generate_otp_id').hide();
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
<thead class="bg-light">
|
<thead class="bg-light">
|
||||||
<tr>
|
<tr>
|
||||||
<th>Group Name</th>
|
<th>Group Name</th>
|
||||||
|
<th>No Of Business</th>
|
||||||
<th>No Of Service</th>
|
<th>No Of Service</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -42,7 +43,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
|
|
||||||
<td><?php echo $value['group_name']; ?></td>
|
<td><?php echo $value['group_name']; ?></td>
|
||||||
<td><?php echo $value['service_count']; ?></td>
|
<td class="business-count" data-toggle="modal" data-target="#business_list_view_modal" data-business-list='<?php echo json_encode($value['business_list']); ?>'>
|
||||||
|
<span><?php echo $value['business_count']; ?></span>
|
||||||
|
</td>
|
||||||
|
<td class="service-count" data-toggle="modal" data-target="#service_list_view_modal" data-service-list='<?php echo json_encode($value['service_list']); ?>'>
|
||||||
|
<span><?php echo $value['service_count']; ?></span>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group dropdown">
|
<div class="btn-group dropdown">
|
||||||
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
|
||||||
@ -116,7 +122,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary waves-effect" style="color: #fff;background-color: #6c757d;border-color: #6c757d;" data-dismiss="modal">Close</button>
|
||||||
<button type="submit" class="btn btn-info waves-effect waves-light">Save</button>
|
<button type="submit" class="btn btn-info waves-effect waves-light">Save</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -160,7 +166,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary waves-effect" style="color: #fff;background-color: #6c757d;border-color: #6c757d;" data-dismiss="modal">Close</button>
|
||||||
<button type="submit" class="btn btn-info waves-effect waves-light">Save</button>
|
<button type="submit" class="btn btn-info waves-effect waves-light">Save</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -168,6 +174,66 @@
|
|||||||
</div>
|
</div>
|
||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Business List Modal -->
|
||||||
|
<div class="modal fade" id="business_list_view_modal" tabindex="-1" role="dialog" aria-labelledby="businessListModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="businessListModalLabel">Business List</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Business Name</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="business-list">
|
||||||
|
<!-- Business list items will be appended here by JavaScript -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Service List Modal -->
|
||||||
|
<div class="modal fade" id="service_list_view_modal" tabindex="-1" role="dialog" aria-labelledby="serviceListModalLabel" aria-hidden="true">
|
||||||
|
<div class="modal-dialog" role="document">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h5 class="modal-title" id="serviceListModalLabel">Service List</h5>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||||
|
<span aria-hidden="true">×</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<table class="table table-striped">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Service Name</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="service-list">
|
||||||
|
<!-- Service list items will be appended here by JavaScript -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- ============================================================== -->
|
<!-- ============================================================== -->
|
||||||
<!-- End Page content -->
|
<!-- End Page content -->
|
||||||
<!-- ============================================================== -->
|
<!-- ============================================================== -->
|
||||||
@ -176,6 +242,40 @@
|
|||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0/js/select2.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.1.0/js/select2.min.js"></script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Event listener for business count click
|
||||||
|
$('.business-count').on('click', function() {
|
||||||
|
var businessList = $(this).data('business-list'); // Get the business list data
|
||||||
|
var businessListContainer = $('#business-list'); // Get the table body container
|
||||||
|
|
||||||
|
// Clear any existing list items
|
||||||
|
businessListContainer.empty();
|
||||||
|
|
||||||
|
// Append each business to the table
|
||||||
|
businessList.forEach(function(business) {
|
||||||
|
businessListContainer.append('<tr><td>' + business.business_name + '</td></tr>');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// Event listener for service count click
|
||||||
|
$('.service-count').on('click', function() {
|
||||||
|
var serviceList = $(this).data('service-list'); // Get the service list data
|
||||||
|
console.log(serviceList);
|
||||||
|
var serviceListContainer = $('#service-list'); // Get the table body container
|
||||||
|
|
||||||
|
// Clear any existing list items
|
||||||
|
serviceListContainer.empty();
|
||||||
|
|
||||||
|
// Append each service to the table
|
||||||
|
serviceList.forEach(function(service) {
|
||||||
|
console.log(service);
|
||||||
|
serviceListContainer.append('<tr><td>' + service + '</td></tr>');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
$('.Select2').select2({
|
$('.Select2').select2({
|
||||||
|
|||||||
@ -137,7 +137,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary waves-effect" style="color: #fff;background-color: #6c757d;border-color: #6c757d;" data-dismiss="modal">Close</button>
|
||||||
<button type="submit" class="btn btn-info waves-effect waves-light">Save</button>
|
<button type="submit" class="btn btn-info waves-effect waves-light">Save</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -186,7 +186,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary waves-effect" style="color: #fff;background-color: #6c757d;border-color: #6c757d;" data-dismiss="modal">Close</button>
|
||||||
<button type="submit" class="btn btn-info waves-effect waves-light">Save</button>
|
<button type="submit" class="btn btn-info waves-effect waves-light">Save</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<h4 class="page-title">Share Documents</h4>
|
<h4 class="page-title">Share Documents</h4>
|
||||||
|
|
||||||
<div class="page-title-right">
|
<div class="page-title-right">
|
||||||
<a href="javascript:void(0);" data-toggle="modal" data-target="#bs-example-modal-lg" class="btn btn-primary waves-effect waves-light">Share Docs </a>
|
<a href="javascript:void(0);" id="share_docs_add" data-toggle="modal" data-target="#bs-example-modal-lg" class="btn btn-primary waves-effect waves-light">Share Docs </a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -70,6 +70,9 @@
|
|||||||
<td style="border: none;">
|
<td style="border: none;">
|
||||||
<input class="form-control form-control-sm" type="text" id="searchDocStatus" placeholder="Search Doc Status">
|
<input class="form-control form-control-sm" type="text" id="searchDocStatus" placeholder="Search Doc Status">
|
||||||
</td>
|
</td>
|
||||||
|
<td style="border: none;">
|
||||||
|
<input class="form-control form-control-sm" type="text" id="searchApproveDate" placeholder="Search Approve Date">
|
||||||
|
</td>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@ -114,8 +117,8 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php if(count($value['doc_status']) > 0){ ?>
|
<?php if(count($value['doc_status']) > 0){ ?>
|
||||||
<span><?php echo $value['doc_status'][0]['doc_created_date'] ?></span>
|
<span class="formatted-date" data-date="<?php echo $value['doc_status'][0]['doc_created_date']; ?>"></span>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="btn-group dropdown">
|
<div class="btn-group dropdown">
|
||||||
@ -246,7 +249,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-secondary waves-effect" style="background-color:grey ; color:white;" data-dismiss="modal">Close</button>
|
||||||
<button type="submit" class="btn btn-info waves-effect waves-light">Create</button>
|
<button type="submit" class="btn btn-info waves-effect waves-light">Create</button>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@ -302,6 +305,42 @@
|
|||||||
<!-- ============================================================== -->
|
<!-- ============================================================== -->
|
||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
function formatDate(dateString) {
|
||||||
|
var options = {
|
||||||
|
year: 'numeric',
|
||||||
|
month: 'short',
|
||||||
|
day: 'numeric',
|
||||||
|
hour: '2-digit',
|
||||||
|
minute: '2-digit',
|
||||||
|
hour12: true
|
||||||
|
};
|
||||||
|
var date = new Date(dateString);
|
||||||
|
return date.toLocaleString('en-US', options).replace(',', '').toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function() {
|
||||||
|
// Select all elements with the class 'formatted-date'
|
||||||
|
var dateElements = document.querySelectorAll('.formatted-date');
|
||||||
|
|
||||||
|
// Iterate over the elements and format the date
|
||||||
|
dateElements.forEach(function(element) {
|
||||||
|
var dateString = element.getAttribute('data-date');
|
||||||
|
var formattedDate = formatDate(dateString);
|
||||||
|
element.textContent = formattedDate;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$('#share_docs_add').click(function() {
|
||||||
|
// $('#share-docs')[0].reset();
|
||||||
|
$('#client_branch_id').val('').trigger('change');
|
||||||
|
$('#service_group_id').val('').trigger('change');
|
||||||
|
$('#service_id').val('').trigger('change');
|
||||||
|
$('#template_id').val('').trigger('change');
|
||||||
|
})
|
||||||
|
|
||||||
function fetchDataAndRedirect(selectedOption) {
|
function fetchDataAndRedirect(selectedOption) {
|
||||||
// var selectedOption = $('#add_30days_old_dispatched_data').val();
|
// var selectedOption = $('#add_30days_old_dispatched_data').val();
|
||||||
console.log("-------------------");
|
console.log("-------------------");
|
||||||
@ -346,6 +385,7 @@
|
|||||||
var searchTextCategory = $('#searchServiceName').val().toLowerCase();
|
var searchTextCategory = $('#searchServiceName').val().toLowerCase();
|
||||||
var searchTextUnitPrice = $('#searchDocumentName').val().toLowerCase();
|
var searchTextUnitPrice = $('#searchDocumentName').val().toLowerCase();
|
||||||
var searchTextRackNo = $('#searchDocStatus').val().toLowerCase();
|
var searchTextRackNo = $('#searchDocStatus').val().toLowerCase();
|
||||||
|
var searchApproveDate = $('#searchApproveDate').val().toLowerCase();
|
||||||
|
|
||||||
$('#share_docs_table tbody tr').each(function() {
|
$('#share_docs_table tbody tr').each(function() {
|
||||||
var cellTextSKU = $(this).find('td:nth-child(1)').text().toLowerCase();
|
var cellTextSKU = $(this).find('td:nth-child(1)').text().toLowerCase();
|
||||||
@ -353,7 +393,8 @@
|
|||||||
var cellTextManufacturerName = $(this).find('td:nth-child(3)').text().toLowerCase();
|
var cellTextManufacturerName = $(this).find('td:nth-child(3)').text().toLowerCase();
|
||||||
var cellTextCategory = $(this).find('td:nth-child(4)').text().toLowerCase();
|
var cellTextCategory = $(this).find('td:nth-child(4)').text().toLowerCase();
|
||||||
var cellTextUnitPrice = $(this).find('td:nth-child(5)').text().toLowerCase();
|
var cellTextUnitPrice = $(this).find('td:nth-child(5)').text().toLowerCase();
|
||||||
var cellTextRackNo = $(this).find('td:nth-child(7)').text().toLowerCase();
|
var cellTextRackNo = $(this).find('td:nth-child(6)').text().toLowerCase();
|
||||||
|
var cellTextApproveDate = $(this).find('td:nth-child(7)').text().toLowerCase();
|
||||||
|
|
||||||
// Show the row if all search fields match
|
// Show the row if all search fields match
|
||||||
if (cellTextSKU.includes(searchTextSKU) &&
|
if (cellTextSKU.includes(searchTextSKU) &&
|
||||||
@ -361,7 +402,8 @@
|
|||||||
cellTextManufacturerName.includes(searchTextManufacturerName) &&
|
cellTextManufacturerName.includes(searchTextManufacturerName) &&
|
||||||
cellTextCategory.includes(searchTextCategory) &&
|
cellTextCategory.includes(searchTextCategory) &&
|
||||||
cellTextUnitPrice.includes(searchTextUnitPrice) &&
|
cellTextUnitPrice.includes(searchTextUnitPrice) &&
|
||||||
cellTextRackNo.includes(searchTextRackNo)) {
|
cellTextRackNo.includes(searchTextRackNo) &&
|
||||||
|
cellTextApproveDate.includes(searchApproveDate)) {
|
||||||
$(this).show();
|
$(this).show();
|
||||||
} else { $(this).hide();}
|
} else { $(this).hide();}
|
||||||
});
|
});
|
||||||
@ -510,6 +552,11 @@
|
|||||||
|
|
||||||
e.preventDefault(); // Prevent the form from submitting normally
|
e.preventDefault(); // Prevent the form from submitting normally
|
||||||
|
|
||||||
|
if($('#client_branch_id').val()){
|
||||||
|
toastr.warning('Select Client');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Create a FormData object
|
// Create a FormData object
|
||||||
var formData = new FormData(this);
|
var formData = new FormData(this);
|
||||||
console.log(formData);
|
console.log(formData);
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
<h4 class="page-title"><?php echo $page_heading; ?></h4>
|
<h4 class="page-title"><?php echo $page_heading; ?></h4>
|
||||||
|
|
||||||
<div class="page-title-right">
|
<div class="page-title-right">
|
||||||
<button type="reset" onclick="window.history.back()" class="btn btn-secondary waves-effect">
|
<button type="reset" onclick="window.history.back()" class="btn btn-secondary waves-effect" style="color: #fff;background-color: #6c757d;border-color: #6c757d;">
|
||||||
Back to List
|
Back to List
|
||||||
</button>
|
</button>
|
||||||
<ol class="breadcrumb m-0">
|
<ol class="breadcrumb m-0">
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
<h4 class="page-title"> <?php if(isset($templateData)){ echo 'Edit'; }else{ echo 'Create'; } ?> Template</h4>
|
<h4 class="page-title"> <?php if(isset($templateData)){ echo 'Edit'; }else{ echo 'Create'; } ?> Template</h4>
|
||||||
<div class="page-title-right">
|
<div class="page-title-right">
|
||||||
<button type="reset" onclick="window.history.back()" class="btn btn-secondary waves-effect">
|
<button type="reset" onclick="window.history.back()" class="btn btn-secondary waves-effect" style="color: #fff;background-color: #6c757d;border-color: #6c757d;">
|
||||||
Back
|
Back
|
||||||
</button>
|
</button>
|
||||||
<ol class="breadcrumb m-0">
|
<ol class="breadcrumb m-0">
|
||||||
@ -59,7 +59,7 @@
|
|||||||
<select class="select2-dropdown form-control" id="service_group_id" required>
|
<select class="select2-dropdown form-control" id="service_group_id" required>
|
||||||
<option value="">Select Service Group </option>
|
<option value="">Select Service Group </option>
|
||||||
<?php if(isset($AllServiceGroupData)){ foreach ($AllServiceGroupData as $key => $value) { ?>
|
<?php if(isset($AllServiceGroupData)){ foreach ($AllServiceGroupData as $key => $value) { ?>
|
||||||
<option value="<?php echo $value['service_group_id']; ?>" <?php if(isset($serviceGroupData)){ echo ($value['service_group_id'] == $serviceGroupData->service_group_id) ? 'selected' : ''; } ?> ><?php echo $value['group_name']; ?></option>
|
<option data-id='<?php echo $value['business_id']; ?>' value="<?php echo $value['service_group_id']; ?>" <?php if(isset($serviceGroupData)){ echo ($value['service_group_id'] == $serviceGroupData->service_group_id) ? 'selected' : ''; } ?> ><?php echo $value['group_name']; ?></option>
|
||||||
<?php } } ?>
|
<?php } } ?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -104,7 +104,7 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-light" onClick="history.back()" data-dismiss="modal">Close</button>
|
<button type="button" class="btn btn-light" onClick="history.back()" data-dismiss="modal" style="color: #fff;background-color: #6c757d;border-color: #6c757d;">Close</button>
|
||||||
<button type="button" id="savedata" class="btn btn-primary">Save </button>
|
<button type="button" id="savedata" class="btn btn-primary">Save </button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -251,11 +251,34 @@ $(document).ready(function() {
|
|||||||
$("#service_group_id").on("change", function()
|
$("#service_group_id").on("change", function()
|
||||||
{
|
{
|
||||||
var value = $(this).val();
|
var value = $(this).val();
|
||||||
|
var selectedOption = $(this).find('option:selected');
|
||||||
|
var business_id = selectedOption.data('id');
|
||||||
|
console.log("Business ID:", business_id);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?= base_url("get_service_data") ?>?service_group_id=' + value,
|
url: '<?= base_url("get_service_data") ?>?service_group_id=' + value,
|
||||||
type: 'GET',
|
type: 'GET',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
|
|
||||||
|
$('#service_id').empty();
|
||||||
|
$('#template_header_business').empty();
|
||||||
|
|
||||||
|
var foundBusiness = false;
|
||||||
|
<?php if(isset($AllBusinessData)) {
|
||||||
|
foreach ($AllBusinessData as $key => $value) { ?>
|
||||||
|
for (var i = 0; i < business_id.length; i++) {
|
||||||
|
if ('<?php echo $value['business_id']; ?>' == business_id[i]) {
|
||||||
|
foundBusiness = true;
|
||||||
|
$('#template_header_business').append($('<option>', {
|
||||||
|
value: '<?php echo $value['business_id']; ?>',
|
||||||
|
text: '<?php echo addslashes($value['business_name']); ?>'
|
||||||
|
}));
|
||||||
|
// Break out of loop once found
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<?php }} ?>
|
||||||
|
|
||||||
if (response.count > 0) {
|
if (response.count > 0) {
|
||||||
|
|
||||||
$('#service_id option:not(:first)').remove();
|
$('#service_id option:not(:first)').remove();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user