Zenova : 1st New Form POB
Specific Folder FTP Upload / ftp-deploy (push) Successful in 38s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 38s
Details
This commit is contained in:
parent
7a0b2cd6b9
commit
66fe857e7f
|
|
@ -0,0 +1,538 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
@include('layouts.shared/title-meta', ['title' => "Form"])
|
||||||
|
@include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? ''])
|
||||||
|
<link href="{{asset('assets/libs/sweetalert2/sweetalert2.min.css')}}" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="{{ asset('assets/libs/select2/select2.min.css') }}" rel="stylesheet" type="text/css" />
|
||||||
|
</head>
|
||||||
|
<div id="pageloader">
|
||||||
|
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
|
||||||
|
</div>
|
||||||
|
@php
|
||||||
|
$brandData = [
|
||||||
|
|
||||||
|
['brand'=>'SKU 1', 'slug'=>'sku_1_unit','pseudoId'=>'sku_1_value'],
|
||||||
|
['brand'=>'SKU 2', 'slug'=>'sku_2_unit','pseudoId'=>'sku_2_value'],
|
||||||
|
['brand'=>'SKU 3', 'slug'=>'sku_3_unit','pseudoId'=>'sku_3_value'],
|
||||||
|
['brand'=>'SKU 4', 'slug'=>'sku_4_unit','pseudoId'=>'sku_4_value'],
|
||||||
|
['brand'=>'SKU 5', 'slug'=>'sku_5_unit','pseudoId'=>'sku_5_value'],
|
||||||
|
['brand'=>'SKU 6', 'slug'=>'sku_6_unit','pseudoId'=>'sku_6_value'],
|
||||||
|
/* ['brand'=>'SKU 7', 'slug'=>'sku_7_unit','pseudoId'=>'sku_7_value'],
|
||||||
|
['brand'=>'SKU 8', 'slug'=>'sku_8_unit','pseudoId'=>'sku_8_value'],
|
||||||
|
['brand'=>'SKU 9', 'slug'=>'sku_9_unit','pseudoId'=>'sku_9_value'],
|
||||||
|
['brand'=>'SKU 10', 'slug'=>'sku_10_unit','pseudoId'=>'sku_10_value'],
|
||||||
|
['brand'=>'SKU 11', 'slug'=>'sku_11_unit','pseudoId'=>'sku_11_value'],
|
||||||
|
['brand'=>'SKU 12', 'slug'=>'sku_12_unit','pseudoId'=>'sku_12_value'],
|
||||||
|
['brand'=>'SKU 13', 'slug'=>'sku_13_unit','pseudoId'=>'sku_13_value'],
|
||||||
|
['brand'=>'SKU 14', 'slug'=>'sku_14_unit','pseudoId'=>'sku_14_value'],
|
||||||
|
['brand'=>'SKU 15', 'slug'=>'sku_15_unit','pseudoId'=>'sku_15_value'],
|
||||||
|
['brand'=>'SKU 16', 'slug'=>'sku_16_unit','pseudoId'=>'sku_16_value'],
|
||||||
|
['brand'=>'SKU 17', 'slug'=>'sku_17_unit','pseudoId'=>'sku_17_value'],
|
||||||
|
['brand'=>'SKU 18', 'slug'=>'sku_18_unit','pseudoId'=>'sku_18_value'],
|
||||||
|
['brand'=>'SKU 19', 'slug'=>'sku_19_unit','pseudoId'=>'sku_19_value'],
|
||||||
|
['brand'=>'SKU 20', 'slug'=>'sku_20_unit','pseudoId'=>'sku_20_value'],
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@php
|
||||||
|
$submissions = Formhelper::getMultiformData($form->partition, $form_id, $form->user_id);
|
||||||
|
$submission = null;
|
||||||
|
if(isset($submissions->data->submissions) && count($submissions->data->submissions) > 0) {
|
||||||
|
$submission = $submissions->data->submissions[0];
|
||||||
|
$formdata = $submission->formdata ?? (object)[];
|
||||||
|
} else {
|
||||||
|
$formdata = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
// echo "<pre>";
|
||||||
|
// print_r($formdata);
|
||||||
|
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
|
||||||
|
<body class="loading">
|
||||||
|
<div class="account-pages">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row justify-content-center">
|
||||||
|
<div class="col-md-8 col-lg-6 col-xl-5 p-0">
|
||||||
|
<div class="card bg-pattern">
|
||||||
|
<div class="card-body p-3 row">
|
||||||
|
|
||||||
|
@if(Session::has('error'))<div class="alert alert-danger">{{Session::get('error')}}</div>
|
||||||
|
<br>@endif
|
||||||
|
@if(session('success'))<div class=" alert alert-success">{{ session('success') }}
|
||||||
|
</div>
|
||||||
|
<br>@endif
|
||||||
|
<div class="col-8">
|
||||||
|
<h4 class="page-title">{{$form->title}}</h4>
|
||||||
|
</div>
|
||||||
|
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval != 'yes'
|
||||||
|
) )
|
||||||
|
<div class="col-4">
|
||||||
|
@if($form->link_type == 'form')
|
||||||
|
<a href="/form/history" class="float-end pt-1">View History</a>
|
||||||
|
@else
|
||||||
|
<a href="{{url()->previous()}}" class="float-end pt-1">Back</a>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@if(isset($form->user_info))
|
||||||
|
<div class="col-12">
|
||||||
|
<h6>Submitted By: {{$form->user_info->name}}</h6>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
<form method="POST" action="/form/submit" id="report-form" enctype="multipart/form-data">
|
||||||
|
<input type="hidden" name="form_id" value="{{$form_id}}">
|
||||||
|
<input type="hidden" name="record_date" value="" id="field-record_date">
|
||||||
|
@csrf
|
||||||
|
@if($id)
|
||||||
|
<input type="hidden" name="id" value="{{$id}}">
|
||||||
|
@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="user_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)
|
||||||
|
<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>
|
||||||
|
@switch($question->type)
|
||||||
|
@case('hidden')
|
||||||
|
<input type="{{$question->type}}" id="field-{{$question->code}}"
|
||||||
|
name="{{$question->code}}"
|
||||||
|
value="{{isset($question->value)?$question->value:''}}">
|
||||||
|
@break
|
||||||
|
@case('text')
|
||||||
|
@case('email')
|
||||||
|
@case('tel')
|
||||||
|
@case('date')
|
||||||
|
<input type="{{$question->type}}" id="field-{{$question->code}}"
|
||||||
|
name="{{$question->code}}" class="form-control"
|
||||||
|
{{$question->required == 'yes'?'required':'' }}
|
||||||
|
value="{{isset($question->value)?$question->value:''}}">
|
||||||
|
@break
|
||||||
|
@case('number')
|
||||||
|
<input type="{{$question->type}}" min="0" max="9999999999" step="1"
|
||||||
|
id="field-{{$question->code}}" name="{{$question->code}}" class="form-control"
|
||||||
|
{{$question->required == 'yes'?'required':'' }}
|
||||||
|
value="{{isset($question->value)?$question->value:0}}">
|
||||||
|
@break
|
||||||
|
@case('textarea')
|
||||||
|
<textarea id="field-{{$question->code}}" name="{{$question->code}}"
|
||||||
|
class="form-control"
|
||||||
|
{{$question->required == 'yes'?'required':'' }}>{{isset($question->value)?$question->value:''}}</textarea>
|
||||||
|
@break
|
||||||
|
@case('dropdown')
|
||||||
|
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||||||
|
<option value=""> -- Select -- </option>
|
||||||
|
@foreach ($question->options as $option)
|
||||||
|
@php $spec = $option->contact->speciality ?? ''; @endphp
|
||||||
|
<option value="{{ $option->value }}"
|
||||||
|
{{ isset($question->value) && $question->value == $option->value ? 'selected' : '' }}
|
||||||
|
msl_code="{{ $option->contact->msl_code ?? '' }}"
|
||||||
|
speciality="{{ $spec }}">
|
||||||
|
{{ $option->display }}
|
||||||
|
</option>
|
||||||
|
|
||||||
|
|
||||||
|
@endforeach
|
||||||
|
</select>
|
||||||
|
@break
|
||||||
|
@case('checkbox')
|
||||||
|
@foreach($question->options as $option)
|
||||||
|
<div class="form-check mb-2 form-check-primary">
|
||||||
|
<input class="form-check-input" type="checkbox"
|
||||||
|
id="field-{{$question->code}}-{{$option->value}}"
|
||||||
|
name="{{$question->code}}[]" value="{{$option->value}}"
|
||||||
|
{{isset($question->value) && $question->value != '' && in_array($option->value, $question->value) ? 'checked':''}}>
|
||||||
|
<label class="form-check-label"
|
||||||
|
for="field-{{$question->code}}-{{$option->value}}">{{$option->display}}</label>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@break
|
||||||
|
@case('file')
|
||||||
|
@if(!isset($form->is_approval) || (isset($form->is_approval) && $form->is_approval
|
||||||
|
!= 'yes' ) )
|
||||||
|
<input type="file" id="field-{{$question->code}}" name="{{$question->code}}"
|
||||||
|
class="form-control" value="" {{$question->required == 'yes'?'required':'' }}>
|
||||||
|
@elseif(isset($question->value))
|
||||||
|
<img src="{{$question->value}}" class="img-fluid">
|
||||||
|
@endif
|
||||||
|
|
||||||
|
@break
|
||||||
|
@case('multitextbox')
|
||||||
|
<div class="row">
|
||||||
|
<div style="width: auto; overflow-y: auto; overflow-x: auto;">
|
||||||
|
<table class="table tableclass">
|
||||||
|
<thead id="heading">
|
||||||
|
<tr>
|
||||||
|
<th>Brand</th>
|
||||||
|
<th>Units</th>
|
||||||
|
<th>Value</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach($brandData as $brand)
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<td>{{ $brand['brand'] }}</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" id="field-{{ $brand['slug'] }}"
|
||||||
|
name="{{ $brand['slug'] }}"
|
||||||
|
class="form-control form-control-large" value="{{ $id && isset($formdata) && isset($formdata->{$brand['slug']}) ? $formdata->{$brand['slug']} : 0 }}" >
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<input type="number" id="field-{{ $brand['pseudoId'] }}"
|
||||||
|
name="{{ $brand['pseudoId'] }}"
|
||||||
|
class="form-control form-control-large" readonly="true" value="{{ $id && isset($formdata) && isset($formdata->{$brand['pseudoId']}) ? $formdata->{$brand['pseudoId']} : 0 }}">
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- @foreach($question->options as $option)
|
||||||
|
<div class="col-6">{{$option->display}}</div>
|
||||||
|
<div class="col-6 mb-1">
|
||||||
|
<input type="number" id="field-{{$option->value}}" name="{{$option->value}}" class="form-control" required value="{{isset($option->val)?$option->val:0}}">
|
||||||
|
</div>
|
||||||
|
@endforeach -->
|
||||||
|
</div>
|
||||||
|
@break
|
||||||
|
@endswitch
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
@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>
|
||||||
|
@endif
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div> <!-- end card-body -->
|
||||||
|
</div>
|
||||||
|
<!-- end card -->
|
||||||
|
|
||||||
|
<!-- end row -->
|
||||||
|
|
||||||
|
</div> <!-- end col -->
|
||||||
|
</div>
|
||||||
|
<!-- end row -->
|
||||||
|
</div>
|
||||||
|
<!-- end container -->
|
||||||
|
</div>
|
||||||
|
<!-- end page -->
|
||||||
|
<style type="text/css">
|
||||||
|
#pageloader {
|
||||||
|
background: rgba(255, 255, 255, 0.8);
|
||||||
|
display: none;
|
||||||
|
height: 100%;
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
z-index: 9999;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pageloader img {
|
||||||
|
left: 50%;
|
||||||
|
margin-left: -32px;
|
||||||
|
margin-top: -32px;
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
@include('layouts.shared/footer-script')
|
||||||
|
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
||||||
|
<script src="{{ asset('assets/libs/select2/select2.min.js') }}"></script>
|
||||||
|
<script type="text/javascript">
|
||||||
|
jQuery(document).ready(function($) {
|
||||||
|
$('[data-toggle="select2"]').select2();
|
||||||
|
let selected_user_id = ''
|
||||||
|
$('#field-user_id').change(function() {
|
||||||
|
$("#pageloader").fadeIn();
|
||||||
|
selected_user_id = $(this).val()
|
||||||
|
hierarchy = $('option:selected', this).attr('hierarchy');
|
||||||
|
$('#field-hierarchy_id').val(hierarchy)
|
||||||
|
event.preventDefault();
|
||||||
|
$.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) {
|
||||||
|
if(itm.contact.c2c == 'Yes') {
|
||||||
|
$('#field-contact_id').append($("<option></option>").attr("value",
|
||||||
|
itm.value).text(itm.display).attr("speciality", itm
|
||||||
|
.contact.speciality));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-speciality').val($('option:selected', this).attr(
|
||||||
|
'speciality'))
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(hierarchy)
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-speciality').val($('option:selected', this).attr('speciality'))
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#field-contact_id').change(function() {
|
||||||
|
$('#field-msl_code').val($('option:selected', this).attr('msl_code'))
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#field-enter_chemist_name,#field-contact_id,#field-msl_code,#field-speciality').parent().hide();
|
||||||
|
$('#field-enter_chemist_name,#field-contact_id,#field-msl_code,#field-speciality').attr('required',false);
|
||||||
|
|
||||||
|
$('#field-speciality,#field-msl_code').attr('readonly',true);
|
||||||
|
|
||||||
|
$('#field-pob_type').on('change',function(){
|
||||||
|
let value=$(this).val();
|
||||||
|
console.log("Value is : ",value);
|
||||||
|
if(value==='Doctor'){
|
||||||
|
$('#field-enter_chemist_name').parent().hide();
|
||||||
|
$('#field-enter_chemist_name').attr('required',false);
|
||||||
|
$('#field-contact_id,#field-msl_code,#field-speciality').parent().show();
|
||||||
|
$('#field-contact_id,#field-msl_code,#field-speciality').attr('required',true);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if(value==='Chemist'){
|
||||||
|
$('#field-contact_id,#field-msl_code,#field-speciality').parent().hide();
|
||||||
|
$('#field-contact_id,#field-msl_code,#field-speciality').attr('required',false);
|
||||||
|
$('#field-enter_chemist_name').parent().show();
|
||||||
|
$('#field-enter_chemist_name').attr('required',true);
|
||||||
|
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$('#field-enter_chemist_name,#field-contact_id,#field-msl_code,#field-speciality').parent().hide();
|
||||||
|
$('#field-enter_chemist_name,#field-contact_id,#field-msl_code,#field-speciality').attr('required',false);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
$('#field-sku_1_unit,#field-sku_2_unit,#field-sku_3_unit,#field-sku_4_unit,#field-sku_5_unit,#field-sku_6_unit,#field-sku_7_unit,#field-sku_8_unit,#field-sku_9_unit,#field-sku_10_unit,#field-sku_11_unit,#field-sku_12_unit,#field-sku_13_unit,#field-sku_14_unit,#field-sku_15_unit,#field-sku_16_unit,#field-sku_17_unit,#field-sku_18_unit,#field-sku_19_unit,#field-sku_20_unit').on('change',function(){
|
||||||
|
|
||||||
|
let a=parseInt($('#field-sku_1_unit').val())||0;
|
||||||
|
let b=parseInt($('#field-sku_2_unit').val())||0;
|
||||||
|
let c=parseInt($('#field-sku_3_unit').val())||0;
|
||||||
|
let d=parseInt($('#field-sku_4_unit').val())||0;
|
||||||
|
let e=parseInt($('#field-sku_5_unit').val())||0;
|
||||||
|
let f=parseInt($('#field-sku_6_unit').val())||0;
|
||||||
|
/* let g=parseInt($('#field-sku_7_unit').val())||0;
|
||||||
|
let h=parseInt($('#field-sku_8_unit').val())||0;
|
||||||
|
let i=parseInt($('#field-sku_9_unit').val())||0;
|
||||||
|
let j=parseInt($('#field-sku_10_unit').val())||0;
|
||||||
|
let k=parseInt($('#field-sku_11_unit').val())||0;
|
||||||
|
let l=parseInt($('#field-sku_12_unit').val())||0;
|
||||||
|
let m=parseInt($('#field-sku_13_unit').val())||0;
|
||||||
|
let n=parseInt($('#field-sku_14_unit').val())||0;
|
||||||
|
let o=parseInt($('#field-sku_15_unit').val())||0;
|
||||||
|
let p=parseInt($('#field-sku_16_unit').val())||0;
|
||||||
|
let q=parseInt($('#field-sku_17_unit').val())||0;
|
||||||
|
let r=parseInt($('#field-sku_18_unit').val())||0;
|
||||||
|
let s=parseInt($('#field-sku_19_unit').val())||0;
|
||||||
|
let t=parseInt($('#field-sku_20_unit').val())||0; */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let priceofA=10;
|
||||||
|
let productOfA=(a*priceofA);
|
||||||
|
let priceOfB=20;
|
||||||
|
let productOfB=(b*priceOfB);
|
||||||
|
let priceOfC=30;
|
||||||
|
let productOfC=(c*priceOfC);
|
||||||
|
let priceOfD=40;
|
||||||
|
let productOfD=(d*priceOfD);
|
||||||
|
let priceOfE=50;
|
||||||
|
let productOfE=(e*priceOfE);
|
||||||
|
let priceOfF=60;
|
||||||
|
let productOfF=f*priceOfF;
|
||||||
|
/* let priceOfG=70;
|
||||||
|
let productOfG=(g*priceOfG);
|
||||||
|
let priceOfH=80;
|
||||||
|
let productOfH=(h*priceOfH);
|
||||||
|
let priceOfI=90;
|
||||||
|
let productOfI=(i*priceOfI);
|
||||||
|
let priceOfJ=100;
|
||||||
|
let productOfJ=(j*priceOfJ);
|
||||||
|
let priceOfK=110;
|
||||||
|
let productOfK=(k*priceOfK);
|
||||||
|
let priceOfL=120;
|
||||||
|
let productOfL=(l*priceOfL);
|
||||||
|
let priceOfM=130;
|
||||||
|
let productOfM=(m*priceOfM);
|
||||||
|
let priceOfN=140;
|
||||||
|
let productOfN=(n*priceOfN);
|
||||||
|
let priceOfO=150;
|
||||||
|
let productOfO=(o*priceOfO);
|
||||||
|
let priceOfP=160;
|
||||||
|
let productOfP=(p*priceOfP);
|
||||||
|
let priceOfQ=170;
|
||||||
|
let productOfQ=(q*priceOfQ);
|
||||||
|
let priceOfR=180;
|
||||||
|
let productOfR=(r*priceOfR);
|
||||||
|
let priceOfS=190;
|
||||||
|
let productOfS=(s*priceOfS);
|
||||||
|
let priceOfT=200;
|
||||||
|
let productOfT=(t*priceOfT); */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#field-sku_1_value').val(productOfA);
|
||||||
|
$('#field-sku_2_value').val(productOfB);
|
||||||
|
$('#field-sku_3_value').val(productOfC);
|
||||||
|
$('#field-sku_4_value').val(productOfD);
|
||||||
|
$('#field-sku_5_value').val(productOfE);
|
||||||
|
$('#field-sku_6_value').val(productOfF);
|
||||||
|
/* $('#field-sku_7_value').val(productOfG);
|
||||||
|
$('#field-sku_8_value').val(productOfH);
|
||||||
|
$('#field-sku_9_value').val(productOfI);
|
||||||
|
$('#field-sku_10_value').val(productOfJ);
|
||||||
|
$('#field-sku_11_value').val(productOfK);
|
||||||
|
$('#field-sku_12_value').val(productOfL);
|
||||||
|
$('#field-sku_13_value').val(productOfM);
|
||||||
|
$('#field-sku_14_value').val(productOfN);
|
||||||
|
$('#field-sku_15_value').val(productOfO);
|
||||||
|
$('#field-sku_16_value').val(productOfP);
|
||||||
|
$('#field-sku_17_value').val(productOfQ);
|
||||||
|
$('#field-sku_18_value').val(productOfR);
|
||||||
|
$('#field-sku_19_value').val(productOfS);
|
||||||
|
$('#field-sku_20_value').val(productOfT); */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let total=(a+b+c+d+e+f);
|
||||||
|
$('#field-total_pob_units').val(total);
|
||||||
|
})
|
||||||
|
|
||||||
|
$('#field-sku_1_unit,#field-sku_2_unit,#field-sku_3_unit,#field-sku_4_unit,#field-sku_5_unit,#field-sku_6_unit,#field-sku_7_unit,#field-sku_8_unit,#field-sku_9_unit,#field-sku_10_unit,#field-sku_11_unit,#field-sku_12_unit,#field-sku_13_unit,#field-sku_14_unit,#field-sku_15_unit,#field-sku_16_unit,#field-sku_17_unit,#field-sku_18_unit,#field-sku_19_unit,#field-sku_20_unit').on('change',function(){
|
||||||
|
|
||||||
|
let a=parseInt($('#field-sku_1_value').val())||0;
|
||||||
|
let b=parseInt($('#field-sku_2_value').val())||0;
|
||||||
|
let c=parseInt($('#field-sku_3_value').val())||0;
|
||||||
|
let d=parseInt($('#field-sku_4_value').val())||0;
|
||||||
|
let e=parseInt($('#field-sku_5_value').val())||0;
|
||||||
|
let f=parseInt($('#field-sku_6_value').val())||0;
|
||||||
|
let g=parseInt($('#field-sku_7_value').val())||0;
|
||||||
|
let h=parseInt($('#field-sku_8_value').val())||0;
|
||||||
|
let i=parseInt($('#field-sku_9_value').val())||0;
|
||||||
|
let j=parseInt($('#field-sku_10_value').val())||0;
|
||||||
|
let k=parseInt($('#field-sku_11_value').val())||0;
|
||||||
|
let l=parseInt($('#field-sku_12_value').val())||0;
|
||||||
|
let m=parseInt($('#field-sku_13_value').val())||0;
|
||||||
|
let n=parseInt($('#field-sku_14_value').val())||0;
|
||||||
|
let o=parseInt($('#field-sku_15_value').val())||0;
|
||||||
|
let p=parseInt($('#field-sku_16_value').val())||0;
|
||||||
|
let q=parseInt($('#field-sku_17_value').val())||0;
|
||||||
|
let r=parseInt($('#field-sku_18_value').val())||0;
|
||||||
|
let s=parseInt($('#field-sku_19_value').val())||0;
|
||||||
|
let t=parseInt($('#field-sku_20_value').val())||0;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let total=(a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t);
|
||||||
|
$('#field-total_pob_value').val(total);
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$('#report-form').on('submit', function(event) {
|
||||||
|
event.preventDefault();
|
||||||
|
$("#pageloader").fadeIn();
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: '/form/ajaxsubmit',
|
||||||
|
data: new FormData($('#report-form')[0]),
|
||||||
|
processData: false,
|
||||||
|
contentType: false,
|
||||||
|
success: function(data) {
|
||||||
|
$("#pageloader").fadeOut();
|
||||||
|
if (data.status == 'success') {
|
||||||
|
Swal.fire({
|
||||||
|
title: 'Great!',
|
||||||
|
text: 'Your data is successfully submitted!',
|
||||||
|
icon: 'success'
|
||||||
|
})
|
||||||
|
$('#report-form').trigger("reset");
|
||||||
|
$('#field-user_id').val(selected_user_id)
|
||||||
|
$('#field-user_id').trigger("change");
|
||||||
|
} else {
|
||||||
|
Swal.fire({
|
||||||
|
icon: 'error',
|
||||||
|
title: 'Data not submitted',
|
||||||
|
text: 'Something went wrong, please try again after some time!'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
var today = new Date();
|
||||||
|
var dd = String(today.getDate()).padStart(2, '0');
|
||||||
|
var mm = String(today.getMonth() + 1).padStart(2, '0');
|
||||||
|
var yyyy = today.getFullYear();
|
||||||
|
today = yyyy + '-' + mm + '-' + dd;
|
||||||
|
|
||||||
|
var plandateField = document.getElementById('field-record_date');
|
||||||
|
|
||||||
|
plandateField.setAttribute('max', today);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue