Merge branch 'dev' of bitbucket.org:jubilian/nhance-enrollment into dev

This commit is contained in:
venba-Inspriron-3558 2025-10-10 18:59:05 +05:30
commit b029ff3115
3 changed files with 25 additions and 5 deletions

View File

@ -923,7 +923,7 @@ class ClientController extends AdminController
return $this->respond([
'status' => false,
'code' => 409,
'message' => 'The pre branch id '.$data['post_branch_id'].' is already mapped with another branch. Please check.',
'message' => 'The branch is already mapped with another branch. Please check.',
], 409);
}
}
@ -1068,7 +1068,7 @@ class ClientController extends AdminController
return $this->respond([
'status' => false,
'code' => 409,
'message' => 'The pre branch id '.$data['pre_branch_id'].' is already mapped with another branch. Please check.',
'message' => 'The branch is already mapped with another branch. Please check.',
], 409);
}
}

View File

@ -312,7 +312,9 @@ $('#btnBranchAdd').click(function() {
$('#district').val('');
$('#branch_city').val('');
$('#branch_form')[0].reset();
$('#branch_form').parsley().reset();
$('.ac').css('display', 'block');
$('#post_branch_id').val('');
contactCount = 1
var addButton = document.getElementById('add');
@ -402,6 +404,7 @@ $("#branch_form").submit(function(event) {
var formData = new FormData($('#branch_form')[0]);
const jsonString = JSON.stringify(selectedValues);
const level_contect_data_json_string = JSON.stringify(level_contect_data);
console.log('jsonString', jsonString);
@ -492,7 +495,7 @@ $("#branch_form").submit(function(event) {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.log('Something Wrong!', 'warning');
if(xhr.status == 409){
if(xhr.status === 409){
alert('The Current Branch is Already Existing..!!');
}

View File

@ -126,7 +126,7 @@ body {
<div class="col-md-6">
<div class="form-group col-md-12">
<label for="auto_fetch_client">Client List<span class="text-danger">*</span></label>
<select class="form-control" id="auto_fetch_client" name="auto_fetch_client" required>
<select class="form-control select2" id="auto_fetch_client" name="auto_fetch_client" required>
<option value="">Select Client</option>
<?php if (!empty($auto_fetch_client_list)): ?>
<?php foreach ($auto_fetch_client_list as $client_list): ?>
@ -142,7 +142,7 @@ body {
<div class="col-md-6">
<div class="form-group col-md-12">
<label for="auto_fetch_branch">Branch List<span class="text-danger">*</span></label>
<select class="form-control" id="auto_fetch_branch" name="auto_fetch_branch" required>
<select class="form-control select2" id="auto_fetch_branch" name="auto_fetch_branch" required>
<option value="">Select Branch</option>
</select>
@ -313,10 +313,19 @@ body {
</script>
<script>
$(document).ready(function() {
$('#auto_fetch_client').select2();
$('#auto_fetch_branch').select2();
$('#auto_fetch_client').change(function() {
$('#auto_fetch_branch').html(`<option value="">Select Branch</option>`);
$('.loader').fadeIn();
$('.loader-mask').fadeIn();
$.ajax({
url: "<?php echo base_url('client/branch/auto_fetch_branch'); ?>",
type: "POST",
@ -341,10 +350,18 @@ body {
console.error("Error occurred:", status, error);
},
complete: function() {
$('.loader').fadeOut();
$('.loader-mask').delay(350).fadeOut('slow');
console.log("auto_fetch_client call is completed..!!");
}
});
});
});
</script>
<script>