CHANGE_DOC_LIST : AADHAVAN
This commit is contained in:
parent
876646938f
commit
0b1ca98138
@ -46,6 +46,7 @@ use CodeIgniter\Router\RouteCollection;
|
|||||||
$routes->get('get_client_branch/(:any)','ClientController::get_client_branch/$1');
|
$routes->get('get_client_branch/(:any)','ClientController::get_client_branch/$1');
|
||||||
$routes->post('status_client_branch','ClientController::status_client_branch');
|
$routes->post('status_client_branch','ClientController::status_client_branch');
|
||||||
$routes->post('client_upload','ClientController::client_upload');
|
$routes->post('client_upload','ClientController::client_upload');
|
||||||
|
$routes->get('check_gst','ClientController::check_gst');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -473,6 +473,17 @@ class ClientController extends BaseController
|
|||||||
echo "No file uploaded.";
|
echo "No file uploaded.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function check_gst(){
|
||||||
|
|
||||||
|
$gst_no = $this->request->getVar('gst_no');
|
||||||
|
$branch =$this->ClientBranchModel->where('gst_no',$gst_no)->first();
|
||||||
|
if($branch){
|
||||||
|
return json_encode(true);
|
||||||
|
}else{
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -170,6 +170,7 @@ class MasterController extends BaseController
|
|||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function service_create()
|
public function service_create()
|
||||||
{
|
{
|
||||||
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'); }
|
||||||
@ -319,49 +320,21 @@ class MasterController extends BaseController
|
|||||||
->join('service_group', 'service_group.service_group_id = template.service_group_id', 'left')
|
->join('service_group', 'service_group.service_group_id = template.service_group_id', 'left')
|
||||||
->join('client_branch', 'client_branch.id = client_docs.client_branch_id', 'left')
|
->join('client_branch', 'client_branch.id = client_docs.client_branch_id', 'left')
|
||||||
->join('client', 'client.client_id = client_branch.client_id ' , 'left')
|
->join('client', 'client.client_id = client_branch.client_id ' , 'left')
|
||||||
// ->where('client.business_id', $business_id)
|
->where('client_docs.business_id', $business_id)
|
||||||
->where('client_docs.created_at >=', $financialYearStart)
|
->where('client_docs.created_at >=', $financialYearStart)
|
||||||
->where('client_docs.created_at <=', $financialYearEnd)
|
->where('client_docs.created_at <=', $financialYearEnd)
|
||||||
// ->where("JSON_CONTAINS(service_group.business_id, '" . $business_id . "')")
|
// ->where("JSON_CONTAINS(service_group.business_id, '" . $business_id . "')")
|
||||||
->orderBy('client_docs.id', 'DESC')
|
->orderBy('client_docs.id', 'DESC')
|
||||||
->get()
|
->get()
|
||||||
->getResultArray();
|
->getResultArray();
|
||||||
$business_id_check = 0;
|
|
||||||
foreach ($data['doc_list'] as $index => $value) {
|
|
||||||
foreach (json_decode($value['business_id']) as $key => $values) {
|
|
||||||
if($values == $business_id){
|
|
||||||
$business_id_check = $business_id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($business_id_check != 0){
|
|
||||||
$data['doc_list'][$index] =$value;
|
|
||||||
}else{
|
|
||||||
unset($data['doc_list'][$index]); // Remove the element completely
|
|
||||||
}
|
|
||||||
$business_id_check = 0;
|
|
||||||
}
|
|
||||||
$docStatusByClientId = [];
|
$docStatusByClientId = [];
|
||||||
|
|
||||||
// $data['clientdata'] = $this->ClientModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
|
|
||||||
// ->join('client_branch', 'client.client_id = client_branch.client_id', 'left')
|
|
||||||
// ->findAll();
|
|
||||||
$data['clientdata'] = $this->ClientBranchModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
|
$data['clientdata'] = $this->ClientBranchModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
|
||||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
// ->where('client.business_id',$this->session->get('logged_in_staff_business_id'))
|
|
||||||
->findAll();
|
->findAll();
|
||||||
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
|
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
|
||||||
// foreach ($data['serviceGroupData'] as $key => $value) {
|
|
||||||
// $check_its_okay = 0;
|
|
||||||
// foreach (json_decode($value['business_id']) as $values) {
|
|
||||||
// if($values == $business_id){
|
|
||||||
// $check_its_okay =1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if($check_its_okay == 0){
|
|
||||||
// unset($data['serviceGroupData'][$key]);
|
|
||||||
// }
|
|
||||||
// $check_its_okay = 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$business_id = $this->session->get('logged_in_staff_business_id');
|
$business_id = $this->session->get('logged_in_staff_business_id');
|
||||||
@ -375,47 +348,20 @@ class MasterController extends BaseController
|
|||||||
->join('service_group', 'service_group.service_group_id = template.service_group_id', 'left')
|
->join('service_group', 'service_group.service_group_id = template.service_group_id', 'left')
|
||||||
->join('client_branch', 'client_branch.id = client_docs.client_branch_id', 'left')
|
->join('client_branch', 'client_branch.id = client_docs.client_branch_id', 'left')
|
||||||
->join('client', 'client.client_id = client_branch.client_id ' , 'left')
|
->join('client', 'client.client_id = client_branch.client_id ' , 'left')
|
||||||
// ->where('client.business_id', $business_id)
|
->where('client_docs.business_id', $business_id)
|
||||||
->where('client_docs.created_at >=', $financialYearStart)
|
->where('client_docs.created_at >=', $financialYearStart)
|
||||||
->where('client_docs.created_at <=', $financialYearEnd)
|
->where('client_docs.created_at <=', $financialYearEnd)
|
||||||
// ->where("JSON_CONTAINS(service_group.business_id, '" . $business_id . "')")
|
// ->where("JSON_CONTAINS(service_group.business_id, '" . $business_id . "')")
|
||||||
->orderBy('client_docs.id', 'DESC')
|
->orderBy('client_docs.id', 'DESC')
|
||||||
->get()
|
->get()
|
||||||
->getResultArray();
|
->getResultArray();
|
||||||
$business_id_check = 0;
|
|
||||||
foreach ($data['doc_list'] as $index => $value) {
|
|
||||||
foreach (json_decode($value['business_id']) as $key => $values) {
|
|
||||||
if($values == $business_id){
|
|
||||||
$business_id_check = $business_id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if($business_id_check != 0){
|
|
||||||
$data['doc_list'][$index] =$value;
|
|
||||||
}else{
|
|
||||||
unset($data['doc_list'][$index]); // Remove the element completely
|
|
||||||
}
|
|
||||||
$business_id_check = 0;
|
|
||||||
}
|
|
||||||
$docStatusByClientId = [];
|
$docStatusByClientId = [];
|
||||||
// Fetch all doc_status entries and group them by client_docs_id
|
// Fetch all doc_status entries and group them by client_docs_id
|
||||||
$data['clientdata'] = $this->ClientBranchModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
|
$data['clientdata'] = $this->ClientBranchModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
|
||||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
// ->where('client.business_id',$this->session->get('logged_in_staff_business_id'))
|
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
|
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
|
||||||
// foreach ($data['serviceGroupData'] as $key => $value) {
|
|
||||||
// $check_its_okay = 0;
|
|
||||||
// foreach (json_decode($value['business_id']) as $values) {
|
|
||||||
// if($values == $business_id){
|
|
||||||
// $check_its_okay =1;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// if($check_its_okay == 0){
|
|
||||||
// unset($data['serviceGroupData'][$key]);
|
|
||||||
// }
|
|
||||||
// $check_its_okay = 0;
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($data['doc_list'] as $doc) {
|
foreach ($data['doc_list'] as $doc) {
|
||||||
@ -442,24 +388,11 @@ class MasterController extends BaseController
|
|||||||
}else{
|
}else{
|
||||||
$data['business_list'] = $this->BusinessModel->findAll();
|
$data['business_list'] = $this->BusinessModel->findAll();
|
||||||
}
|
}
|
||||||
// echo "<pre>";
|
|
||||||
// print_r($data);die;
|
|
||||||
echo view('layout/header', ['Data'=>$staffdata]);
|
echo view('layout/header', ['Data'=>$staffdata]);
|
||||||
echo view('share_docs',$data);
|
echo view('share_docs',$data);
|
||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function set_include_archived_session($checked_or_not) {
|
|
||||||
if($checked_or_not == true){
|
|
||||||
// $includeArchived = $this->request->getGet('include_archived');
|
|
||||||
$this->session->set('include_archived', $checked_or_not);
|
|
||||||
}else{
|
|
||||||
$this->session->set('include_archived', $checked_or_not);
|
|
||||||
}
|
|
||||||
// print_r($this->session->get('include_archived'));die;
|
|
||||||
return $this->response->setJSON(['status' => 'success']);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function shared_doc_non_financial_year_to(){
|
public function shared_doc_non_financial_year_to(){
|
||||||
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'); }
|
||||||
$currentDate = new \DateTime();
|
$currentDate = new \DateTime();
|
||||||
@ -477,6 +410,8 @@ class MasterController extends BaseController
|
|||||||
$financialYearStart = $financialYearStart->format('Y-m-d');
|
$financialYearStart = $financialYearStart->format('Y-m-d');
|
||||||
$financialYearEnd = $financialYearEnd->format('Y-m-d');
|
$financialYearEnd = $financialYearEnd->format('Y-m-d');
|
||||||
$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();
|
||||||
|
$business_id = $this->session->get('logged_in_staff_business_id');
|
||||||
|
|
||||||
if($this->session->get('logged_in_staff_role') == 'Admin'){
|
if($this->session->get('logged_in_staff_role') == 'Admin'){
|
||||||
$data['doc_list'] = $this->ClientDocsModel->select('client_docs.* , services.service_name ,
|
$data['doc_list'] = $this->ClientDocsModel->select('client_docs.* , services.service_name ,
|
||||||
service_group.group_name , client_branch.name as client_branch_name ,
|
service_group.group_name , client_branch.name as client_branch_name ,
|
||||||
@ -486,9 +421,10 @@ class MasterController extends BaseController
|
|||||||
->join('service_group', 'service_group.service_group_id = template.service_group_id', 'left')
|
->join('service_group', 'service_group.service_group_id = template.service_group_id', 'left')
|
||||||
->join('client_branch', 'client_branch.id = client_docs.client_branch_id', 'left')
|
->join('client_branch', 'client_branch.id = client_docs.client_branch_id', 'left')
|
||||||
->join('client', 'client.client_id = client_branch.client_id', 'left')
|
->join('client', 'client.client_id = client_branch.client_id', 'left')
|
||||||
|
->where('client_docs.business_id', $business_id)
|
||||||
->orderBy('client_docs.id','DESC')
|
->orderBy('client_docs.id','DESC')
|
||||||
->findAll();
|
->findAll();
|
||||||
$data['clientdata'] = $this->ClientBranchModel->select('client.name as client_name , client_branch.name as client_branch_name , client_branch.id as client_branch_id')
|
$data['clientdata'] = $this->ClientBranchModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
|
||||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
// ->where('client.business_id',$this->session->get('logged_in_staff_business_id'))
|
// ->where('client.business_id',$this->session->get('logged_in_staff_business_id'))
|
||||||
->findAll();
|
->findAll();
|
||||||
@ -524,17 +460,24 @@ class MasterController extends BaseController
|
|||||||
$doc['doc_status'] = isset($docStatusByClientId[$doc['id']]) ? $docStatusByClientId[$doc['id']] : [];
|
$doc['doc_status'] = isset($docStatusByClientId[$doc['id']]) ? $docStatusByClientId[$doc['id']] : [];
|
||||||
}
|
}
|
||||||
$data['business_list'] = $this->BusinessModel->findAll();
|
$data['business_list'] = $this->BusinessModel->findAll();
|
||||||
// foreach (json_decode($staffdata->business_id) as $key => $value) {
|
|
||||||
// $business = $this->BusinessModel->where('business_id', $value)->first();
|
|
||||||
// if ($business) {
|
|
||||||
// $data['business_list'][] = $business;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
echo view('layout/header', ['Data'=>$staffdata]);
|
echo view('layout/header', ['Data'=>$staffdata]);
|
||||||
echo view('share_docs',$data);
|
echo view('share_docs',$data);
|
||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function set_include_archived_session($checked_or_not) {
|
||||||
|
if($checked_or_not == true){
|
||||||
|
// $includeArchived = $this->request->getGet('include_archived');
|
||||||
|
$this->session->set('include_archived', $checked_or_not);
|
||||||
|
}else{
|
||||||
|
$this->session->set('include_archived', $checked_or_not);
|
||||||
|
}
|
||||||
|
// print_r($this->session->get('include_archived'));die;
|
||||||
|
return $this->response->setJSON(['status' => 'success']);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function shared_document_edit()
|
public function shared_document_edit()
|
||||||
{
|
{
|
||||||
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'); }
|
||||||
@ -573,10 +516,10 @@ class MasterController extends BaseController
|
|||||||
public function create_docs()
|
public function create_docs()
|
||||||
{
|
{
|
||||||
$docData = $this->request->getVar();
|
$docData = $this->request->getVar();
|
||||||
$docData['created_by'] = $this->session->has('is_staff_logged_in');
|
$docData['created_by'] = $this->session->get('is_staff_logged_in');
|
||||||
$docData['business_id'] = $this->session->has('logged_in_staff_business_id');
|
$docData['business_id'] = $this->session->get('logged_in_staff_business_id');
|
||||||
$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;
|
||||||
print_r($docData);die;
|
// print_r($docData);die;
|
||||||
|
|
||||||
$insert = $this->ClientDocsModel->insert($docData);
|
$insert = $this->ClientDocsModel->insert($docData);
|
||||||
if($insert){
|
if($insert){
|
||||||
@ -729,7 +672,8 @@ class MasterController extends BaseController
|
|||||||
|
|
||||||
public function change_doc_status()
|
public function change_doc_status()
|
||||||
{
|
{
|
||||||
try {
|
|
||||||
|
// try {
|
||||||
$doc_id = $this->request->getPost('doc_id');
|
$doc_id = $this->request->getPost('doc_id');
|
||||||
$is_active = $this->request->getPost('is_active');
|
$is_active = $this->request->getPost('is_active');
|
||||||
$data['is_active'] = $is_active;
|
$data['is_active'] = $is_active;
|
||||||
@ -776,7 +720,7 @@ class MasterController extends BaseController
|
|||||||
];
|
];
|
||||||
$MailHelper->send_url_email($clientData->email , '', $subject, $message, $mail_config);
|
$MailHelper->send_url_email($clientData->email , '', $subject, $message, $mail_config);
|
||||||
$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
|
||||||
if($clientData->whatsapp == 1){
|
if($clientData->whatsapp == 1){
|
||||||
$whatsApp_message = "Dear " . substr($clientData->client_name, 0, 20) . "," . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve." ;
|
$whatsApp_message = "Dear " . substr($clientData->client_name, 0, 20) . "," . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve." ;
|
||||||
// $notificationHelper->sendWhatsAppMessage($number, $whatsApp_message, $url);
|
// $notificationHelper->sendWhatsAppMessage($number, $whatsApp_message, $url);
|
||||||
@ -802,9 +746,9 @@ class MasterController extends BaseController
|
|||||||
$result = "No Match's";
|
$result = "No Match's";
|
||||||
return $this->response->setJSON(['status' => 'failed','code' => 404,'data' => $result],404);
|
return $this->response->setJSON(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||||
}
|
}
|
||||||
} 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);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rememeber_notification()
|
public function rememeber_notification()
|
||||||
@ -826,6 +770,7 @@ class MasterController extends BaseController
|
|||||||
->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();
|
||||||
}
|
}
|
||||||
|
// print_r($clientData);die;
|
||||||
// helper('url');
|
// helper('url');
|
||||||
$url ='<a href="' . generate_signed_url('preview', ['doc_id'=>md5((string)$doc_id)], 36000) . '">Preview and Approve Document</a>';
|
$url ='<a href="' . generate_signed_url('preview', ['doc_id'=>md5((string)$doc_id)], 36000) . '">Preview and Approve Document</a>';
|
||||||
// $businessData = $this->BranchModel->select('branches.* , business.business_name ')
|
// $businessData = $this->BranchModel->select('branches.* , business.business_name ')
|
||||||
|
|||||||
@ -7,8 +7,6 @@ class MailHelper
|
|||||||
public static function send_otp_email($email_id, $otp)
|
public static function send_otp_email($email_id, $otp)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$subject = 'BB-Sign Verify Document';
|
$subject = 'BB-Sign Verify Document';
|
||||||
$message = "Hai,
|
$message = "Hai,
|
||||||
<br>
|
<br>
|
||||||
@ -82,18 +80,10 @@ class MailHelper
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
$email->setFrom($config['sender_email'], $config['sender_name']);
|
$email->setFrom($config['sender_email'], $config['sender_name']);
|
||||||
// $email->setMailType('html');
|
|
||||||
// $email->setFrom('bbone@venbait.in', 'BB-Sign');
|
|
||||||
$email->setTo($email_id);
|
$email->setTo($email_id);
|
||||||
$email->setSubject($subject);
|
$email->setSubject($subject);
|
||||||
$email->setMessage($message);
|
$email->setMessage($message);
|
||||||
|
|
||||||
// $email->setMailType('html');
|
|
||||||
// $email->setFrom('bbone@venbait.in', 'BB-Sign');
|
|
||||||
// $email->setTo($email_id);
|
|
||||||
// $email->setSubject($subject);
|
|
||||||
// $email->setMessage($message);
|
|
||||||
// print_r($email);die;
|
|
||||||
if ($email->send()) {
|
if ($email->send()) {
|
||||||
return ['status' => 'success', 'code' => 200, 'message' => 'Email Sent Successfully...', 'data' => $email_id];
|
return ['status' => 'success', 'code' => 200, 'message' => 'Email Sent Successfully...', 'data' => $email_id];
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -55,6 +55,8 @@ class NotificationHelper
|
|||||||
'Content-Type: application/json',
|
'Content-Type: application/json',
|
||||||
'Content-Length: ' . strlen($postdata)
|
'Content-Length: ' . strlen($postdata)
|
||||||
]);
|
]);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||||
|
|
||||||
// Execute cURL session
|
// Execute cURL session
|
||||||
$response = curl_exec($ch);
|
$response = curl_exec($ch);
|
||||||
|
|||||||
@ -254,7 +254,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div class="form-group text-right">
|
<div class="form-group text-right">
|
||||||
<button class="btn btn-info waves-effect waves-light" type="submit" id="client_submit_button" onclick="submitBranch(this)">Submit</button>
|
<button class="btn btn-info waves-effect waves-light" type="submit" id="client_submit_button" onclick="submitClient(this, event)">Submit</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
@ -269,7 +269,6 @@
|
|||||||
<!-- End Page content -->
|
<!-- End Page content -->
|
||||||
<!-- ============================================================== -->
|
<!-- ============================================================== -->
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$('#individual_client').click(function () {
|
$('#individual_client').click(function () {
|
||||||
@ -378,7 +377,20 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function submitBranch(params) {
|
function submitClient(params, event) {
|
||||||
|
event.preventDefault();
|
||||||
|
<?php
|
||||||
|
$session = \Config\Services::session(); ?>
|
||||||
|
var business_session = <?php echo $session->get('logged_in_staff_business_id') ?>;
|
||||||
|
|
||||||
|
if (business_session && business_session !== "") {
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
// toastr.waring('Select Business First');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
var formData = {
|
var formData = {
|
||||||
@ -399,12 +411,40 @@
|
|||||||
formData.individual = 1;
|
formData.individual = 1;
|
||||||
// formData.whatsapp = $('#individual_client').prop('checked');
|
// formData.whatsapp = $('#individual_client').prop('checked');
|
||||||
}else{
|
}else{
|
||||||
|
formData.individual = 0;
|
||||||
formData.gst_no = $('#gst_no').val();
|
formData.gst_no = $('#gst_no').val();
|
||||||
formData.branch_email = $('#branch_email').val();
|
formData.branch_email = $('#branch_email').val();
|
||||||
formData.contact = $('#contact').val();
|
formData.contact = $('#contact').val();
|
||||||
formData.state_code = $('#state_code').val();
|
formData.state_code = $('#state_code').val();
|
||||||
formData.branch_name = $('#branch_name').val();
|
formData.branch_name = $('#branch_name').val();
|
||||||
formData.branch_mobile_no = $('#branch_mobile_no').val();
|
formData.branch_mobile_no = $('#branch_mobile_no').val();
|
||||||
|
|
||||||
|
|
||||||
|
var formDatagst = {
|
||||||
|
gst_no: $('#gst_no').val(),
|
||||||
|
};
|
||||||
|
var queryString = $.param(formDatagst);
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: '<?= base_url("check_gst"); ?>'+ '?' + queryString ,
|
||||||
|
data: formData,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(response) {
|
||||||
|
console.log(response);
|
||||||
|
if(response == true){
|
||||||
|
$('#gst_no').val('');
|
||||||
|
$('#gst_no').focus();
|
||||||
|
// toastr.waring('GST Number Already Exists');
|
||||||
|
$('#client_submit_button').attr('disabled','false');
|
||||||
|
return ;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
// Handle error response here
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
formData.sms = $('#sms').prop('checked');
|
formData.sms = $('#sms').prop('checked');
|
||||||
formData.whatsapp = $('#whatsapp').prop('checked');
|
formData.whatsapp = $('#whatsapp').prop('checked');
|
||||||
@ -436,7 +476,10 @@
|
|||||||
success: function(response) {
|
success: function(response) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
if(response == true){
|
if(response == true){
|
||||||
|
$('#client_submit_button').attr('disabled','false');
|
||||||
|
|
||||||
$('#bike_model_login-modal').modal('hide');
|
$('#bike_model_login-modal').modal('hide');
|
||||||
|
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
}else{
|
}else{
|
||||||
$('#client_submit_button').attr('disabled','false');
|
$('#client_submit_button').attr('disabled','false');
|
||||||
@ -449,6 +492,8 @@
|
|||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$('#client_submit_button').attr('disabled','false');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -552,7 +552,7 @@
|
|||||||
|
|
||||||
// Create a FormData object
|
// Create a FormData object
|
||||||
var formData = new FormData(this);
|
var formData = new FormData(this);
|
||||||
console.log(formData);
|
// console.log(formData);
|
||||||
// Make an AJAX POST request
|
// Make an AJAX POST request
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: '<?= base_url()."create_docs"; ?>',
|
url: '<?= base_url()."create_docs"; ?>',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user