Titans (Report Novel Meet)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 44s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 44s
Details
This commit is contained in:
parent
8410626146
commit
db21799944
|
|
@ -117,6 +117,19 @@
|
||||||
@if ($id)
|
@if ($id)
|
||||||
<input type="hidden" name="id" value="{{ $id }}">
|
<input type="hidden" name="id" value="{{ $id }}">
|
||||||
@endif
|
@endif
|
||||||
|
@if(isset($form->manager_can_submit) && $form->manager_can_submit == true)
|
||||||
|
<div class="col-md-12 mb-2">
|
||||||
|
<label for="field-user_id" class="form-label"> Select User / Territory <span class="text-danger">*</span> </label>
|
||||||
|
<select class="form-control" id="field-user_id" name="manager_id" required>
|
||||||
|
<option value=""> -- Select -- </option>
|
||||||
|
@foreach($form->users as $option)
|
||||||
|
<option value="{{$option->value}}" hierarchy="{{$option->hierarchy_id}}" {{isset($question->value) && $question->value == $option->value ? 'selected':''}}>{{$option->display}}</option>
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
<input type="hidden" id="field-hierarchy_id" name="hierarchy_id" value="">
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
@foreach ($questions as $question)
|
@foreach ($questions as $question)
|
||||||
@if (in_array($question->code, ['execution_date','actual_no_of_attendees' ,'hcp_name','pcode_of_wrapper_doctor','speaker_name','venue','time','eas_id']))
|
@if (in_array($question->code, ['execution_date','actual_no_of_attendees' ,'hcp_name','pcode_of_wrapper_doctor','speaker_name','venue','time','eas_id']))
|
||||||
@continue
|
@continue
|
||||||
|
|
@ -401,6 +414,53 @@
|
||||||
$('#field-eas_amt').on('input', function () {
|
$('#field-eas_amt').on('input', function () {
|
||||||
this.value = this.value.replace(/\D/g, '');
|
this.value = this.value.replace(/\D/g, '');
|
||||||
});
|
});
|
||||||
|
$('#field-user_id').change(function(){
|
||||||
|
let hierarchy = $('option:selected', this).attr('hierarchy');
|
||||||
|
$('#field-hierarchy_id').val(hierarchy)
|
||||||
|
event.preventDefault();
|
||||||
|
$("#pageloader").fadeIn();
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy='+hierarchy,
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function( data ) {
|
||||||
|
$("#pageloader").fadeOut();
|
||||||
|
$('#field-contact_id').html('')
|
||||||
|
$('#field-contact_id').append($("<option></option>").attr("value",'').text('-- Select --'));
|
||||||
|
for (let itm of data) {
|
||||||
|
$('#field-contact_id').append($("<option></option>").attr("value",itm.value).text(itm.display).attr("msl_code", itm.contact.msl_code).attr('speciality',itm.contact.speciality));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* New Code */
|
||||||
|
let $doctorSelects = $('[id^="field-hcp_name"]');
|
||||||
|
$doctorSelects.each(function() {
|
||||||
|
let $select = $(this);
|
||||||
|
$select.empty().append($("<option></option>").attr("value", "").text("-- Select --"));
|
||||||
|
for (let itm of data) {
|
||||||
|
$select.append(
|
||||||
|
$("<option></option>")
|
||||||
|
.attr("value", itm.value)
|
||||||
|
.text(itm.display)
|
||||||
|
.attr("msl_code", itm.contact ? itm.contact.msl_code : "")
|
||||||
|
.attr("speciality", itm.contact ? itm.contact.speciality : "")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
/* End of New Code */
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
||||||
|
})
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(hierarchy)
|
||||||
|
})
|
||||||
$('#form-wrapper').hide()
|
$('#form-wrapper').hide()
|
||||||
$('#execution-form-wrapper').hide()
|
$('#execution-form-wrapper').hide()
|
||||||
var count = 1
|
var count = 1
|
||||||
|
|
@ -648,6 +708,9 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('.edit-btn').click(function() {
|
$('.edit-btn').click(function() {
|
||||||
$('#execution-form-wrapper').show(100, () => {
|
$('#execution-form-wrapper').show(100, () => {
|
||||||
$('#add-camp-btn').hide(0);
|
$('#add-camp-btn').hide(0);
|
||||||
|
|
@ -720,10 +783,109 @@
|
||||||
el.readOnly = true;
|
el.readOnly = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let hierarchy = selected['hierarchy_id'] || $('#field-hierarchy_id').val();
|
||||||
|
|
||||||
|
console.log("Execution Hierarchy:", hierarchy);
|
||||||
|
console.log("Selected Doctor:", selected['contact_id']);
|
||||||
|
|
||||||
|
if (hierarchy) {
|
||||||
|
|
||||||
|
$("#pageloader").fadeIn();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "GET",
|
||||||
|
url: '/form/getdoctorlist?partition={{$form->partition}}&hierarchy=' + hierarchy,
|
||||||
|
|
||||||
|
success: function(data) {
|
||||||
|
|
||||||
|
$("#pageloader").fadeOut();
|
||||||
|
|
||||||
|
let $executionContact = $('#execution-contact_id');
|
||||||
|
|
||||||
|
$executionContact.empty();
|
||||||
|
|
||||||
|
$executionContact.append(
|
||||||
|
$("<option></option>")
|
||||||
|
.attr("value", "")
|
||||||
|
.text("-- Select --")
|
||||||
|
);
|
||||||
|
|
||||||
|
for (let itm of data) {
|
||||||
|
|
||||||
|
$executionContact.append(
|
||||||
|
$("<option></option>")
|
||||||
|
.attr("value", itm.value)
|
||||||
|
.text(itm.display)
|
||||||
|
.attr("msl_code", itm.contact ? itm.contact.msl_code : "")
|
||||||
|
.attr("speciality", itm.contact ? itm.contact.speciality : "")
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// =========================================================
|
||||||
|
// NEW CODE START: Populate Add Attendee / Speaker dropdowns for Manager Execution
|
||||||
|
// =========================================================
|
||||||
|
let $doctorSelects = $('[id^="field-hcp_name"]');
|
||||||
|
$doctorSelects.each(function() {
|
||||||
|
let $select = $(this);
|
||||||
|
let currentVal = $select.val();
|
||||||
|
$select.empty().append($("<option></option>").attr("value", "").text("-- Select --"));
|
||||||
|
for (let itm of data) {
|
||||||
|
$select.append(
|
||||||
|
$("<option></option>")
|
||||||
|
.attr("value", itm.value)
|
||||||
|
.text(itm.display)
|
||||||
|
.attr("msl_code", itm.contact ? itm.contact.msl_code : "")
|
||||||
|
.attr("speciality", itm.contact ? itm.contact.speciality : "")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (currentVal) {
|
||||||
|
$select.val(currentVal);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// =========================================================
|
||||||
|
// NEW CODE END
|
||||||
|
// =========================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Selected doctor select करा
|
||||||
|
if (selected['contact_id']) {
|
||||||
|
|
||||||
|
let contactId = selected['contact_id'].trim();
|
||||||
|
|
||||||
|
let $option = $executionContact.find('option').filter(function() {
|
||||||
|
return $(this).text().trim() === contactId ||
|
||||||
|
$(this).val() === contactId;
|
||||||
|
}).first();
|
||||||
|
|
||||||
|
if ($option.length) {
|
||||||
|
$executionContact.val($option.val()).trigger('change');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
error: function(xhr) {
|
||||||
|
|
||||||
|
$("#pageloader").fadeOut();
|
||||||
|
|
||||||
|
console.error(
|
||||||
|
"Doctor loading failed:",
|
||||||
|
xhr.responseText
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#report-form').on('submit', function(event) {
|
$('#report-form').on('submit', function(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue