CHANGE_STAFF_CREATE : AADHAVAN

This commit is contained in:
unknown 2024-06-18 12:13:35 +05:30
parent d193c45397
commit 5bb3ef7735

View File

@ -180,13 +180,11 @@
var formData = $(this).serialize(); // Serialize form data
var staffData = <?php isset($staffData) ?>;
var staffData = <?php echo isset($staffData) ? json_encode($staffData) : '0'; ?>;
console.log(staffData);
if(staffData){
var action = <?= base_url()."staff_edit"; ?>;
}else{
var action = <?= base_url()."staff_create"; ?>;
}
var action = staffData ? '<?php echo base_url("staff_edit"); ?>' : '<?php echo base_url("staff_create"); ?>';
$.ajax({
type: 'POST',
url: action, // Submit to dynamically set action URL
@ -205,6 +203,7 @@
});
$('#staff_data_form_submit').click(function (event) {
event.preventDefault();
if($('#business_id').val() == 0){
@ -227,7 +226,6 @@
var business_id = $(this).val();
if (business_id) {
var branch_list = <?php echo json_encode($branch); ?>;
// Filter branch_list based on business_id
var filteredBranches = branch_list.filter(function(element) {
return element.business_id == business_id;