Compare commits

...

2 Commits

Author SHA1 Message Date
zeeshan d6aef8e354 Merge branch 'main' of http://192.168.1.200:3000/Stratawiz/Rapport-Laravel
Specific Folder FTP Upload / ftp-deploy (push) Successful in 46s Details
2026-07-06 14:53:00 +05:30
zeeshan 3c6cecafb5 Team 3 (Phone Validation) 2026-07-06 14:47:00 +05:30
2 changed files with 25 additions and 36 deletions

View File

@ -168,7 +168,7 @@
</div>
@if($question->code == 'phone_no_staff')
<h5>
<h5 class="text-center">
Enter No. of Units per Respule for the Brand Order Received
</h5>
@endif
@ -224,14 +224,27 @@
$(this).val($(this).val().replace(/[^a-zA-Z\s]/g, ''));
});
$('#field-phone_no_staff').on('input', function () {
/* $('#field-phone_no_staff').on('input', function () {
this.value = this.value.replace(/\D/g, '').slice(0, 10);
// First digit must be 6,7,8,9
if (this.value.length > 0 && !/^[6-9]/.test(this.value)) {
this.value = '';
}
}); */
$('#field-phone_no_staff').on('input', function () {
// Allow only digits and max 10 digits
this.value = this.value.replace(/\D/g, '').slice(0, 10);
// First digit must be 6, 7, 8, or 9
if (this.value.length > 0 && !/^[6-9]/.test(this.value)) {
alert("Phone number must start with 6, 7, 8, or 9.");
this.value = '';
$(this).focus();
}
});
$('#field-budecort_respule, #field-duolin_respule, #field-levolin_respule, #field-input_given_count, #field-hyperneb_respule, #field-budesal_respule').on('input', function () {
this.value = this.value.replace(/[^0-9]/g, '');
});
@ -291,6 +304,12 @@
}
});
/* $('#field-input_name,#field-input_given_count').on('change',function(){
$('#report-form input.dynamic-hidden').remove();
$('#report-form').append('<input type="hidden" class="dynamic-hidden" name="'+ $('#field-input_name').val() +'" value="1">')
}) */
$('#field-user_id').change(function(){
let hierarchy = $('option:selected', this).attr('hierarchy');
$('#field-hierarchy_id').val(hierarchy)
@ -316,7 +335,7 @@
$('#report-form').on('submit', function(event){
event.preventDefault();
let mobile = $('#field-phone_no_staff').val().trim();
$('#report-form').append('<input type="hidden" name="'+ $('#field-input_name').val() +'_pob_units" value="'+ $("#field-input_given_count").val() +'">')
if (!/^[6-9]\d{9}$/.test(mobile)) {
Swal.fire({
icon: 'error',

View File

@ -36,41 +36,11 @@
@if(isset($form->user_info))
<div class="col-12">
<h6>Submitted By: {{$form->user_info->name}}</h6>
@if(isset($form->is_approval) && $form->is_approval == 'yes')
@if(isset($submitted_formdata->genareted_image[0]))
@php
$imageUrl = asset('storage/personalized/'.$submitted_formdata->form_id.'/'.$submitted_formdata->genareted_image[0]);
@endphp
<div class="col-12 mb-3">
<label class="form-label">
<strong>Generated Invitation Preview</strong>
</label>
<div class="mt-2">
<img src="{{ $imageUrl }}"
class="img-fluid img-thumbnail"
style="max-width:100%;">
</div>
{{-- <div class="mt-3">
<a href="{{ $imageUrl }}"
download="{{ $submitted_formdata->genareted_image[0] }}"
class="btn btn-success">
<i class="mdi mdi-download"></i> Download Invitation
</a>
</div> --}}
</div>
@endif
@endif
</div>
@endif
@php
/* echo "<pre>";
/* echo "<pre>";
print_r($submitted_formdata);
echo "</pre>"; */
$skuData = [];
@ -107,7 +77,7 @@
</div>
@endif
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
@foreach($questions as $question)
@if (in_array($question->code, ['execution_date','executed_as_per_plan' ,'revised_start_time','patient_screened','patients_diagnosed','rxn_of_montair_lc_adult','rxn_of_montair_lc_kid_tab','rxn_of_montair_lc_kid_syrup','rxn_of_furamist','rxn_of_furamist_az','total_rxns']))
@continue
@ -207,7 +177,7 @@
@endswitch
</div>
@endforeach
{{-- @if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) ) --}}
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes' ) )
<div class="text-center d-grid mt-3">
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit </button>
</div>