CHANGE_CLIENT_LOGIN_BY_GST : AADHAVAN
This commit is contained in:
parent
c98e034f00
commit
7d204e1663
@ -43,19 +43,19 @@ class ClientController extends BaseController
|
||||
if($this->session->has('is_client_logged_in')){ return redirect()->to(base_url().'client_home'); }
|
||||
if($this->request->getmethod() == 'POST')
|
||||
{
|
||||
$pan_no = $this->request->getPost('pan_no');
|
||||
$clientdata = $this->ClientModel->where('pan_no', $pan_no)->first();
|
||||
$gst_no = $this->request->getPost('gst_no');
|
||||
$client_branch_data = $this->ClientBranchModel->where('gst_no', $gst_no)->first();
|
||||
|
||||
if($clientdata)
|
||||
if($client_branch_data)
|
||||
{
|
||||
if($clientdata['is_active'] == 0)
|
||||
if($client_branch_data['is_active'] == 0)
|
||||
{
|
||||
$this->session->setTempdata('error','Client Deactivated',3);
|
||||
return redirect()->to(base_url());
|
||||
}
|
||||
|
||||
|
||||
$this->session->set('is_client_logged_in',$clientdata['client_id']);
|
||||
$this->session->set('is_client_logged_in',$client_branch_data['id']);
|
||||
// $this->session->set('logged_in_client_name',$clientdata['org_name']);
|
||||
|
||||
return redirect()->to(base_url().'client_home');
|
||||
@ -83,9 +83,9 @@ class ClientController extends BaseController
|
||||
$client_id =$this->session->get('is_client_logged_in');
|
||||
|
||||
$data['doc_list'] = $this->ClientDocsModel->getTemplate($client_id);
|
||||
// print_r($data['doc_list']);die;
|
||||
// print_r($client_id);die;
|
||||
|
||||
$clientdata = $this->ClientModel->where('client_id', $client_id)->get()->getRow();
|
||||
$clientdata = $this->ClientBranchModel->where('id', $client_id)->get()->getRow();
|
||||
|
||||
if($clientdata){
|
||||
echo view('layout/header', ['Data'=>$clientdata]);
|
||||
@ -159,18 +159,18 @@ class ClientController extends BaseController
|
||||
public function generate_otp()
|
||||
{
|
||||
try {
|
||||
$pan_no = $this->request->getPost('pan_no');
|
||||
$gst_no = $this->request->getPost('gst_no');
|
||||
|
||||
$client_data = $this->ClientModel->where('pan_no', $pan_no )->first();
|
||||
$client_branch_data = $this->ClientBranchModel->where('gst_no', $gst_no )->first();
|
||||
|
||||
if($client_data){
|
||||
if($client_branch_data){
|
||||
|
||||
$id = $client_data['client_id'];
|
||||
$id = $client_branch_data['id'];
|
||||
|
||||
$data = [
|
||||
'otp' => '123456'
|
||||
];
|
||||
$update = $this->ClientModel->update($id , $data);
|
||||
$update = $this->ClientBranchModel->update($id , $data);
|
||||
|
||||
if($update){
|
||||
return json_encode(true);
|
||||
@ -189,15 +189,15 @@ class ClientController extends BaseController
|
||||
public function verify_otp()
|
||||
{
|
||||
try {
|
||||
$pan_no = $this->request->getPost('pan_no');
|
||||
$gst_no = $this->request->getPost('gst_no');
|
||||
$otp = $this->request->getPost('otp');
|
||||
|
||||
$client_data = $this->ClientModel->where('pan_no', $pan_no )->where('otp', $otp)->first();
|
||||
$client_branch_data = $this->ClientBranchModel->where('gst_no', $gst_no )->where('otp', $otp)->first();
|
||||
$data = ['otp' =>''];
|
||||
|
||||
if($client_data){
|
||||
$id = $client_data['client_id'];
|
||||
$update = $this->ClientModel->update($id , $data);
|
||||
if($client_branch_data){
|
||||
$id = $client_branch_data['id'];
|
||||
$update = $this->ClientBranchModel->update($id , $data);
|
||||
if($update){
|
||||
return json_encode(true);
|
||||
}
|
||||
|
||||
@ -18,7 +18,7 @@ class ClientDocsModel extends Model
|
||||
$this->join('template', 'template.template_id = client_docs.template_id');
|
||||
$this->join('services', 'services.service_id = template.service_id');
|
||||
$this->where('client_docs.is_active', 1);
|
||||
$this->where('client_docs.client_id', $client_id);
|
||||
$this->where('client_docs.client_branch_id', $client_id);
|
||||
return $this->findAll();
|
||||
|
||||
}
|
||||
|
||||
@ -86,10 +86,10 @@
|
||||
<?php endif;?>
|
||||
|
||||
<div class="form-group">
|
||||
<div id="pan_error" style="margin-bottom: 4px;"></div>
|
||||
<div id="gst_error" style="margin-bottom: 4px;"></div>
|
||||
<div id="otp_sent_success" style="margin-bottom: 4px;"></div>
|
||||
<label for="pan_no">PAN Number</label>
|
||||
<input class="form-control" type="text" id="pan_no" name="pan_no" required placeholder="Enter your PAN">
|
||||
<label for="gst_no">GST Number</label>
|
||||
<input class="form-control" type="text" id="gst_no" name="gst_no" required placeholder="Enter your GST">
|
||||
</div>
|
||||
<!-- Preloader -->
|
||||
<div class="loader-mask" style="display:none;">
|
||||
@ -116,7 +116,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-0 text-center" id="resend_reenter_otp_hide" style="margin-top: 10px;display:none;">
|
||||
<a href="#" id="reenter_pan">Re-Enter PAN</a> |
|
||||
<a href="#" id="reenter_pan">Re-Enter GST</a> |
|
||||
<a href="#" id="resend_otp">Resend OTP</a>
|
||||
</div>
|
||||
|
||||
@ -149,27 +149,27 @@
|
||||
$('#generate_otp_id').click(function (params) {
|
||||
|
||||
event.preventDefault(); // Prevent form submission
|
||||
var pan_error = $('#pan_error')
|
||||
var gst_error = $('#gst_error')
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: '<?php echo base_url()."generate_otp"?>',
|
||||
method: 'POST',
|
||||
data: {
|
||||
pan_no : $('#pan_no').val()
|
||||
gst_no : $('#gst_no').val()
|
||||
},
|
||||
success: function(response) {
|
||||
if(response){
|
||||
pan_error.html('');
|
||||
gst_error.html('');
|
||||
$('#generate_otp_id').hide();
|
||||
$('#otp_hide').show();
|
||||
$('#verify_otp_hide').show();
|
||||
$('#pan_no').attr('readonly', true);
|
||||
$('#gst_no').attr('readonly', true);
|
||||
$('#resend_reenter_otp_hide').show();
|
||||
|
||||
}else{
|
||||
pan_error.html('PAN number mismatch. Please try again.');
|
||||
pan_error.css('color','red');
|
||||
gst_error.html('GST number mismatch. Please try again.');
|
||||
gst_error.css('color','red');
|
||||
}
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
@ -187,13 +187,11 @@
|
||||
|
||||
|
||||
$('#verify_otp_id').click(function (params) {
|
||||
// console.log("verify_otp_id clicked");
|
||||
|
||||
$.ajax({
|
||||
url: '<?php echo base_url()."verify_otp_client"?>',
|
||||
method: 'POST',
|
||||
data: {
|
||||
pan_no : $('#pan_no').val(),
|
||||
gst_no : $('#gst_no').val(),
|
||||
otp : $('#otp').val()
|
||||
},
|
||||
success: function(response) {
|
||||
@ -202,7 +200,7 @@
|
||||
}else{
|
||||
|
||||
|
||||
$('#pan_error').html('OTP Mismatch. Please try again.').css('color','red');
|
||||
$('#gst_error').html('OTP Mismatch. Please try again.').css('color','red');
|
||||
$('#otp').val('');
|
||||
}
|
||||
|
||||
@ -228,11 +226,11 @@
|
||||
url: '<?php echo base_url()."generate_otp"?>',
|
||||
method: 'POST',
|
||||
data: {
|
||||
pan_no : $('#pan_no').val()
|
||||
gst_no : $('#gst_no').val()
|
||||
},
|
||||
success: function(response) {
|
||||
if(response){
|
||||
$('#pan_error').html('');
|
||||
$('#gst_error').html('');
|
||||
$('#generate_otp_id').hide();
|
||||
$('#otp_hide').show();
|
||||
$('#verify_otp_hide').show();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user