pulmocare - User Mapping form changes (2/07/2026)
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m37s Details

This commit is contained in:
Farhan Pathan 2026-07-02 11:36:24 +05:30
parent 3d112b01ef
commit a6c3b41975
2 changed files with 181 additions and 5 deletions

View File

@ -0,0 +1,106 @@
<!DOCTYPE html>
<html lang="en">
<head>
@include('layouts.shared/title-meta', ['title' => "History"])
@include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? ''])
</head>
<body class="loading">
<div class="account-pages">
<div class="container">
<!-- start page title -->`
<div class="row">
<div class="col-8 p-2">
<h4 class="page-title">{{$formname}}</h4>
</div>
<div class="col-4 p-2">
<a href="/form/show" class="float-end pt-1">New Submission</a>
</div>
</div>
<!-- end page title -->
@if(session()->has('message'))
<div class="alert alert-success">
{{ session()->get('message') }}
</div>
@endif
@if(session()->has('error'))
<div class="alert alert-danger">
{{ session()->get('error') }}
</div>
@endif
<div class="row">
<div class="col-12 p-0">
<div class="card">
<div class="card-body">
<div class="responsive-table-plugin">
<div class="table-rep-plugin">
<div class="table-responsive" data-pattern="priority-columns">
<table id="tech-companies-1" class="table table-striped">
<thead>
<tr>
<th data-priority="1">Submission Date</th>
@foreach($questions as $code => $question)
@if($question->type == 'hidden')
@continue;
@endif
<th data-priority="1">{{$question->label}}</th>
@endforeach
<th data-priority="1">Action</th>
</tr>
</thead>
<tbody>
@foreach($submissions as $submission)
<tr>
<th>{{date("d M Y", strtotime($submission->updatedAt))}}</th>
@foreach($questions as $code => $question)
@if($question->type == 'hidden')
@continue;
@endif
@if($question->type == 'file')
<td><a target="_blank" href="{{ isset($submission->formdata->{$code}) ? is_array($submission->formdata->{$code})? implode(', ', $submission->formdata->{$code}) :(is_string($submission->formdata->{$code}) ? $submission->formdata->{$code} : '' ) : $code }}" download="{{ isset($submission->formdata->{$code}) ? is_array($submission->formdata->{$code})? implode(', ', $submission->formdata->{$code}) : (is_string($submission->formdata->{$code}) ? $submission->formdata->{$code} : '' ) : $code }}" class="btn btn-dark btn-xs"><i class="mdi mdi-cloud-download me-1"></i> Download</a></td>
@elseif($question->type == 'radiometrix' && isset($submission->formdata->{$code}) && is_object($submission->formdata->{$code}))
<td>
{{ collect((array)$submission->formdata->{$code})->map(function($val, $key){ return "$key: $val"; })->implode(', ') }}
</td>
@elseif(count((array)$question->options) > 0 && 1==2 )
<td>{{ $question->options->{ $submission->formdata->{$code} } }}</td>
@else
<td>{{ isset($submission->formdata->{$code}) ? is_array($submission->formdata->{$code})? implode(', ', $submission->formdata->{$code}) :$submission->formdata->{$code} : $code }}</td>
@endif
@endforeach
<th>
@if($question->can_edit == 'yes' || sizeof($submission->workflow_approvals) == 0 )
@if($submission->workflow == 'yes' && $submission->workflow_status == 'approved' )
<p>Approved</p>
@else
{{-- <a href="/form/show?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</button> --}}
@if(isset($form->allow_delete_by_user) && $form->allow_delete_by_user == 'yes')
<a href="/form/delete?form_id={{$submission->formdata->form_id}}&id={{$submission->id}}" onclick="return confirm('Are you sure you want to delete this submission? This is not recoverable!');" class="btn btn-danger btn-xs mt-1">Delete</button>
@endif
@endif
@endif
</th>
</tr>
@endforeach
</tbody>
</table>
</div> <!-- end .table-responsive -->
</div> <!-- end .table-rep-plugin-->
</div> <!-- end .responsive-table-plugin-->
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<!-- end row-->
</div> <!-- container -->
</div>
<!-- end page -->
@include('layouts.shared/footer-script')
</body>
</html>

View File

@ -60,6 +60,9 @@
@foreach($questions as $question) @foreach($questions as $question)
<div class="col-md-12 mb-2"> <div class="col-md-12 mb-2">
<label for="field-{{$question->code}}" class="form-label">{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!} </label> <label for="field-{{$question->code}}" class="form-label">{{$question->question}} {!!$question->required == 'yes' ? '<span class="text-danger">*</span>':''!!} </label>
@if($question->code == 'mobile_number')
<h6>10-digit mobile number (starting with 6, 7, 8, or 9)</h6>
@endif
@switch($question->type) @switch($question->type)
@case('hidden') @case('hidden')
<input type="{{$question->type}}" id="field-{{$question->code}}" name="{{$question->code}}" value="{{isset($question->value)?$question->value:''}}"> <input type="{{$question->type}}" id="field-{{$question->code}}" name="{{$question->code}}" value="{{isset($question->value)?$question->value:''}}">
@ -212,6 +215,7 @@
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script> <script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
<script type="text/javascript"> <script type="text/javascript">
jQuery(document).ready(function($){ jQuery(document).ready(function($){
$(document).ready(function () { $(document).ready(function () {
const states = [ const states = [
@ -265,7 +269,43 @@
}); });
}); });
function validateDuplicateEmpCode(currentField) {
let empCode = $('#field-employee_code_01').val().trim();
let l1Code = $('#field-l1_managers_emp_code').val().trim();
let l2Code = $('#field-l2_managers_emp_code').val().trim();
let currentValue = $(currentField).val().trim();
if (currentValue === '') return;
let duplicate = false;
if (currentField.id === 'field-employee_code_01') {
duplicate = (currentValue === l1Code || currentValue === l2Code);
} else if (currentField.id === 'field-l1_managers_emp_code') {
duplicate = (currentValue === empCode || currentValue === l2Code);
} else if (currentField.id === 'field-l2_managers_emp_code') {
duplicate = (currentValue === empCode || currentValue === l1Code);
}
if (duplicate) {
$(currentField).val('');
Swal.fire({
icon: 'error',
title: 'Duplicate Employee Code',
text: 'Employee Code, L1 Manager Employee Code, and L2 Manager Employee Code must all be different.'
}).then(() => {
$(currentField).focus();
});
}
}
$('#field-employee_code_01, #field-l1_managers_emp_code, #field-l2_managers_emp_code')
.on('blur', function () {
validateDuplicateEmpCode(this);
});
$('#field-employee_code_01, #field-emp_code_previous_employee, #field-l1_managers_emp_code, #field-l2_managers_emp_code').on('input', function () { $('#field-employee_code_01, #field-emp_code_previous_employee, #field-l1_managers_emp_code, #field-l2_managers_emp_code').on('input', function () {
this.value = this.value.replace(/[^0-9]/g, ''); this.value = this.value.replace(/[^0-9]/g, '');
}); });
@ -274,20 +314,50 @@
this.value = this.value.replace(/[^a-zA-Z\s]/g, ''); this.value = this.value.replace(/[^a-zA-Z\s]/g, '');
}); });
$('#field-email_01').on('blur', function () { $('#field-email_01').on('blur', function () {
let email = $(this).val().trim();
let $this = $(this);
let email = $this.val().trim().toLowerCase();
let designation = $('#field-designation_01').val();
if (email === '') return;
// General email format validation
let emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; let emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (email !== '' && !emailPattern.test(email)) { if (!emailPattern.test(email)) {
$this.val('');
Swal.fire({ Swal.fire({
icon: 'error', icon: 'error',
title: 'Invalid Email', title: 'Invalid Email',
text: 'Please enter a valid email address.' text: 'Please enter a valid email address.'
}).then(() => {
$this.focus();
}); });
$(this).val(''); return;
$(this).focus();
} }
// For non-Physical Educators, only @alkem.com is allowed
if (
designation !== 'Physical Educator' &&
designation !== 'Physical Educator Part Time' &&
!email.endsWith('@alkem.com')
) {
$this.val('');
Swal.fire({
icon: 'error',
title: 'Invalid Email',
text: 'Please enter a valid Alkem email address (e.g., username@alkem.com). Personal email IDs are not allowed.'
}).then(() => {
$this.focus();
});
return;
}
}); });
$('#field-mobile_number').on('input', function () { $('#field-mobile_number').on('input', function () {