CHANGE_LOADER_MULTIPLE_SUBMIT : AADHAVAN
This commit is contained in:
parent
54e76f485b
commit
59433fac20
5
.env
5
.env
@ -72,6 +72,5 @@ database.default.port = 3306
|
||||
|
||||
|
||||
|
||||
WAAI_INSTANCE = '66712908EB75A'
|
||||
WAAI_TOKEN = '667128c844c48'
|
||||
SEND_WAAI_URL = SEND_WAAI_URL
|
||||
WAAI_INSTANCE = '666FEE6738696'
|
||||
WAAI_TOKEN = '666fd862df687'
|
||||
|
||||
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,2 +1,4 @@
|
||||
/writable
|
||||
/public/uploads
|
||||
/public/uploads
|
||||
|
||||
/.env
|
||||
|
||||
@ -5,7 +5,7 @@ class BranchModel extends Model
|
||||
{
|
||||
protected $table = 'branches';
|
||||
protected $primaryKey = 'branch_id';
|
||||
protected $allowedFields = ['business_id','branch_id','branch_name','gstno','email','contact','address','city','state','country','postal_code','state_code','isactive'];
|
||||
protected $allowedFields = ['business_id','branch_id','branch_name','gstno','email','contact','address','city','state','country','pin_code','state_code','isactive'];
|
||||
|
||||
public function getBranchesByBusinessId($business_id)
|
||||
{
|
||||
|
||||
@ -187,7 +187,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right">
|
||||
<button class="btn btn-info waves-effect waves-light" type="submit" onclick="submitBranch(this)">Submit</button>
|
||||
<button class="btn btn-info waves-effect waves-light" type="submit" id="business_branch_submit" onclick="submitBranch(this)">Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -215,7 +215,12 @@
|
||||
}else{
|
||||
var url = '<?= base_url("add_branch"); ?>';
|
||||
}
|
||||
|
||||
var formDataValidate = $('#model_form_data').serialize(); // Serialize form data
|
||||
|
||||
if(!formDataValidate){
|
||||
return ;
|
||||
}
|
||||
|
||||
var formData = {
|
||||
business_id: $('#business').val(),
|
||||
gstno: $('#gst_no').val(),
|
||||
@ -246,6 +251,7 @@
|
||||
var business_id = $('#business_id').val();
|
||||
// console.log(formData);
|
||||
|
||||
$('#business_branch_submit').attr('disabled','true');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
@ -253,6 +259,8 @@
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$('#business_branch_submit').removeAttr('disabled');
|
||||
|
||||
$('#bike_model_login-modal').modal('hide');
|
||||
|
||||
window.location.reload();
|
||||
|
||||
@ -103,7 +103,7 @@
|
||||
<div class="modal-body" style="margin-top: -29px;">
|
||||
<div class="text-center mt-2 mb-4">
|
||||
</div>
|
||||
<form id="model_form_data" class="px-4">
|
||||
<form id="client_branch_model_form_data" class="px-4">
|
||||
|
||||
<input type="text" id="id" hidden>
|
||||
|
||||
@ -123,7 +123,7 @@
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="branchname">Branch Name</label>
|
||||
<input class="form-control" name="branch_name" type="text" id="branch_name" required="" placeholder="Branch Name">
|
||||
<input class="form-control" name="branch_name" type="text" id="branch_name" required="true" placeholder="Branch Name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -181,7 +181,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right">
|
||||
<button class="btn btn-info waves-effect waves-light" type="submit" onclick="submitBranch(event,this)">Submit</button>
|
||||
<button class="btn btn-info waves-effect waves-light" type="submit" id="client_branch_submit" onclick="submitBranch(event,this)">Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -235,9 +235,8 @@
|
||||
})
|
||||
|
||||
function submitBranch(event,params) {
|
||||
event.preventDefault();
|
||||
// event.preventDefault();
|
||||
|
||||
console.log($('#client').val());
|
||||
if ($('#client').val() == 0) {
|
||||
toastr.warning('Select Client');
|
||||
return;
|
||||
@ -265,6 +264,11 @@
|
||||
var url = '<?= base_url("add_client_branch"); ?>';
|
||||
}
|
||||
|
||||
var formDataValidate = $('#client_branch_model_form_data').serialize(); // Serialize form data
|
||||
|
||||
if(!formDataValidate){
|
||||
return ;
|
||||
}
|
||||
|
||||
var form = $(params).parent().parent();
|
||||
var isValid = true;
|
||||
@ -277,7 +281,7 @@
|
||||
if (!isValid) {
|
||||
return;
|
||||
}
|
||||
|
||||
$('#client_branch_submit').attr('disabled','true');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
@ -285,6 +289,7 @@
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
$('#client_branch_submit').removeAttr('disabled');
|
||||
if(response == true){
|
||||
toastr.success('Branch Added Successfully');
|
||||
$('#client_branch_modal').modal('hide');
|
||||
|
||||
@ -12,6 +12,23 @@
|
||||
padding-top: 3px;
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
|
||||
.row > .col-2 {
|
||||
flex: 0 0 0%;
|
||||
max-width: 0%;
|
||||
}
|
||||
.row > .col-8 {
|
||||
flex: 0 0 100%;
|
||||
max-width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 767.98px) {
|
||||
.pro-user-name {
|
||||
display: block !important;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -19,6 +36,11 @@
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
||||
|
||||
<div class="content-page">
|
||||
<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...">
|
||||
</div>
|
||||
</div>
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
@ -41,7 +63,7 @@
|
||||
|
||||
<?php if(isset($_SESSION['is_staff_logged_in']) && $_SESSION['is_staff_logged_in']) {
|
||||
if( $docData->is_active == 1 && $docData->is_approved == 0){ ?>
|
||||
<a data-id="<?php echo $docData->doc_id; ?>" data-isactive="<?php echo $docData->is_active; ?>" title="Share" onclick="statusChange(this)" class="btn btn-warning waves-effect waves-light"> Revert </a>
|
||||
<a data-id="<?php echo $docData->doc_id; ?>" data-isactive="<?php echo $docData->is_active; ?>" title="revert" onclick="statusChange(this)" class="btn btn-warning waves-effect waves-light"> Revert </a>
|
||||
<?php } else if( $docData->is_active == 0 ) { ?>
|
||||
<a data-id="<?php echo $docData->doc_id; ?>" data-isactive="<?php echo $docData->is_active; ?>" title="Share" onclick="statusChange(this)" class="btn btn-info waves-effect waves-light"> Share </a>
|
||||
<?php } } ?>
|
||||
@ -67,30 +89,30 @@
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-2"> </div>
|
||||
<div class="col-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-2"></div>
|
||||
<div class="col-8">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="template-header">
|
||||
<?php echo $header_html; ?>
|
||||
</div>
|
||||
|
||||
<div class="template-body">
|
||||
<?php echo $body_html; ?>
|
||||
<div>
|
||||
<?php if($docData->is_approved == 1){ echo ' <div class="file_approved"> Approved at '.date('d-m-Y H:i:s', strtotime($docData->updated_at)).' through OTP sent to '.$clientData->mobile_no.' from ip address '.$docData->ip_address.'</div>'; } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="template-footer">
|
||||
<?php echo $footer_html; ?>
|
||||
</div>
|
||||
|
||||
<div class="template-header">
|
||||
<?php echo $header_html; ?>
|
||||
</div>
|
||||
|
||||
<div class="template-body">
|
||||
<?php echo $body_html; ?>
|
||||
<div>
|
||||
<?php if($docData->is_approved == 1){ echo ' <div class="file_approved"> Approved at '.date('d-m-Y H:i:s', strtotime($docData->updated_at)).' through OTP sent to '.$clientData->mobile_no.' from ip address '.$docData->ip_address.'</div>'; } ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="template-footer">
|
||||
<?php echo $footer_html; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div><!-- end col-->
|
||||
<div class="col-2 centered-div">
|
||||
</div>
|
||||
</div><!-- end col-->
|
||||
<div class="col-2 centered-div"></div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -333,7 +355,8 @@
|
||||
|
||||
// Get the HTML content of the element as a string
|
||||
var htmlContent = element.innerHTML;
|
||||
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
$.ajax({
|
||||
url: '<?php echo base_url()."download_doc"?>',
|
||||
method: 'POST',
|
||||
@ -368,17 +391,22 @@
|
||||
}
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
error: function(xhr, status, error) {
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
console.error('Error : ' + error);
|
||||
}
|
||||
});
|
||||
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
function statusChange(params) {
|
||||
console.log(params);
|
||||
// console.log(params);
|
||||
var status = params.getAttribute('data-isactive');
|
||||
var doc_id = params.getAttribute('data-id');
|
||||
if(status == 1){
|
||||
@ -387,6 +415,11 @@
|
||||
var is_active= 1;
|
||||
}
|
||||
|
||||
if($(params).attr('title') == 'Share'){
|
||||
$('.loader').fadeIn();
|
||||
$('.loader-mask').fadeIn();
|
||||
}
|
||||
|
||||
var formData = {
|
||||
doc_id: doc_id,
|
||||
is_active: is_active
|
||||
@ -397,11 +430,15 @@
|
||||
data: formData,
|
||||
dataType: 'json',
|
||||
success: function(response) {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
if (response.data) {
|
||||
window.location.reload();
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
$('.loader').fadeOut();
|
||||
$('.loader-mask').fadeOut('slow');
|
||||
// Handle error response here
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
|
||||
@ -151,7 +151,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group text-right">
|
||||
<button class="btn btn-info waves-effect waves-light" type="submit" onclick="submitBranch(this)">Submit</button>
|
||||
<button class="btn btn-info waves-effect waves-light" type="submit" id="client_submit_button" onclick="submitBranch(this)">Submit</button>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@ -215,6 +215,7 @@
|
||||
if (!isValid) {
|
||||
return;
|
||||
}
|
||||
$('#client_submit_button').attr('disabled','true')
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: url,
|
||||
|
||||
@ -145,7 +145,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group text-right m-b-0">
|
||||
<button class="btn btn-primary waves-effect waves-light mr-1" type="button">
|
||||
<button class="btn btn-primary waves-effect waves-light mr-1" type="button">
|
||||
Submit
|
||||
</button>
|
||||
<?php } ?>
|
||||
@ -182,7 +182,6 @@ $(document).ready(function() {
|
||||
|
||||
var staffData = <?php echo isset($staffData) ? json_encode($staffData) : '0'; ?>;
|
||||
var action = staffData ? '<?php echo base_url("staff_edit"); ?>' : '<?php echo base_url("staff_create"); ?>';
|
||||
console.log(action);
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
|
||||
@ -6,37 +6,9 @@
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-xl-4">
|
||||
<div class="card text-center">
|
||||
<div class="card-body">
|
||||
<h4 class="mt-3 mb-0"><?php echo $staff->name; ?></h4>
|
||||
<p class="text-muted">@<?php echo $staff->role; ?></p>
|
||||
<div class="text-left mt-3" style=" margin-bottom: 16px;">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless table-sm">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">Full Name :</th>
|
||||
<td class="text-muted"><?php echo $staff->name; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Mobile :</th>
|
||||
<td class="text-muted"><?php echo $staff->mobile_no; ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">Email :</th>
|
||||
<td class="text-muted"><?php echo $staff->email; ?></td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- end card -->
|
||||
</div>
|
||||
|
||||
<div class="col-lg-8 col-xl-8">
|
||||
|
||||
<div class="col-lg-12 col-xl-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="tab-pane show active" id="settings">
|
||||
@ -44,28 +16,28 @@
|
||||
<h5 class="mb-3 text-uppercase bg-light p-2"><i class="mdi mdi-account-circle mr-1"></i> Personal Info</h5>
|
||||
<input type="text" class="form-control" id="staff_id" name="staff_id" value="<?php echo $staff->staff_id; ?>" hidden>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" value="<?php echo $staff->name; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="mobile_no">Mobile Number</label>
|
||||
<input type="text" class="form-control" id="mobile_no" name="mobile_no" value="<?php echo $staff->mobile_no; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<!-- <div class="row"> -->
|
||||
<div class="col-md-4">
|
||||
<div class="form-group">
|
||||
<label for="useremail">Email Address</label>
|
||||
<input type="email" class="form-control" id="email" name="email" value="<?php echo $staff->email; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group" style="margin-top: 28px;">
|
||||
<button type="submit" class="btn btn-primary" style="float: inline-end;" >Update</button>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user