CHANGE_CLIENT_FILE_UPLOAD : AADHAVAN
This commit is contained in:
parent
d25bacfcad
commit
a41a3f5c11
@ -421,7 +421,7 @@ class ClientController extends BaseController
|
||||
|
||||
foreach ($groupedData as $key => $value) {
|
||||
$created_by = $this->session->get('is_staff_logged_in');
|
||||
// $branch_id = $this->session->get('logged_in_staff_branch_id');
|
||||
$business_id = $this->session->get('logged_in_staff_business_id');
|
||||
// $business= $this->BranchModel->select('*')
|
||||
// ->join('business' , 'branches.business_id = business.business_id', 'left')
|
||||
// ->where('branches.branch_id ',$branch_id)
|
||||
@ -433,8 +433,8 @@ class ClientController extends BaseController
|
||||
"email" => $value['email'],
|
||||
"mobile_no" => $value['mobile_no'],
|
||||
"created_by" => $created_by,
|
||||
"business_id" => $business_id,
|
||||
];
|
||||
// print_r($insertData);die;
|
||||
|
||||
$client = $this->ClientModel->insert($insertData);
|
||||
if($client){
|
||||
@ -465,7 +465,6 @@ class ClientController extends BaseController
|
||||
} else {
|
||||
echo "No file uploaded.";
|
||||
}
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -190,6 +190,8 @@ class StaffController extends BaseController
|
||||
public function client_list()
|
||||
{
|
||||
if(!$this->session->has('is_staff_logged_in')){ return redirect()->to(base_url().'staff'); }
|
||||
$business_id = $this->session->get('logged_in_staff_business_id');
|
||||
$data['clientListForList'] = $this->ClientModel->where('business_id',$business_id)->findAll();
|
||||
$data['clientList'] = $this->ClientModel->select('client.*, service_group.business_id')
|
||||
->join('client_branch', 'client_branch.client_id = client.client_id')
|
||||
->join('client_docs', 'client_docs.client_branch_id = client_branch.id')
|
||||
@ -200,7 +202,6 @@ class StaffController extends BaseController
|
||||
->get()
|
||||
->getRow();
|
||||
$data['business_list'] = $this->BusinessModel->findAll();
|
||||
$business_id = $this->session->get('logged_in_staff_business_id');
|
||||
$business_id_check = 0;
|
||||
foreach ($data['clientList'] as $index => $value) {
|
||||
foreach (json_decode($value['business_id']) as $key => $values) {
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<div class="container-fluid">
|
||||
<div class="loader-mask modal-loader-mask" style="display:none;">
|
||||
<div class="loader modal-loader" style="display:none;">
|
||||
Please Wait <img src="<?= base_url() . "public" ?>/assets/images/simple_loader.gif" height="30" width="30" alt="Loading...">
|
||||
Please Wait <img style="height: 60px !important;width: 60px !important;" src="<?= base_url() . "public" ?>/assets/images/upload_file.gif" height="30" width="30" alt="Loading...">
|
||||
</div>
|
||||
</div>
|
||||
<!-- start page title -->
|
||||
@ -59,7 +59,7 @@
|
||||
|
||||
<tbody>
|
||||
|
||||
<?php foreach ($clientList as $key => $value) { ?>
|
||||
<?php foreach ($clientListForList as $key => $value) { ?>
|
||||
|
||||
<tr>
|
||||
<td> <?php echo $value['name']; ?></td>
|
||||
@ -490,8 +490,8 @@
|
||||
if (fileInput) {
|
||||
fileInput.addEventListener('change', function(event) {
|
||||
console.log('File input change event triggered');
|
||||
// $('.loader').fadeIn();
|
||||
// $('.loader-mask').fadeIn();
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
const file = event.target.files[0];
|
||||
if (file) {
|
||||
var url = '<?= base_url("client_upload"); ?>';
|
||||
@ -505,16 +505,18 @@
|
||||
processData: false,
|
||||
contentType: false,
|
||||
success: function(response) {
|
||||
// $('.loader').fadeOut();
|
||||
// $('.loader-mask').fadeOut('slow');
|
||||
|
||||
console.log(response);
|
||||
if(response == true){
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
toastr.success( 'Clients and Branches Added SuccessFully');
|
||||
}
|
||||
window.location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
// Handle error response here
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
@ -527,6 +529,7 @@
|
||||
} else {
|
||||
console.error('File input not found');
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
BIN
public/assets/images/upload_file.gif
Normal file
BIN
public/assets/images/upload_file.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.5 KiB |
BIN
public/assets/images/upload_file_1.gif
Normal file
BIN
public/assets/images/upload_file_1.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 254 KiB |
Loading…
Reference in New Issue
Block a user