323 lines
15 KiB
PHP
323 lines
15 KiB
PHP
@extends('layouts.vertical', ["page_title"=> "Dashboard", "mode" => $mode ?? "", "demo" => $demo ?? ""])
|
|
|
|
@section('css')
|
|
<!-- third party css -->
|
|
<link href="{{ URL::asset('assets/libs/datatables/datatables.min.css')}}" rel="stylesheet" type="text/css" />
|
|
<link href="{{asset('assets/libs/sweetalert2/sweetalert2.min.css')}}" rel="stylesheet" type="text/css" />
|
|
<!-- third party css end -->
|
|
@endsection
|
|
|
|
@section('content')
|
|
<div id="pageloader">
|
|
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
|
|
</div>
|
|
|
|
<!-- Start Content-->
|
|
<div class="container-fluid">
|
|
|
|
<!-- start page title -->
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="page-title-box">
|
|
<div class="page-title-right">
|
|
<a class="btn btn-dark waves-effect waves-light" href="{{Request::url()}}&download=1">Export</a>
|
|
</div>
|
|
<h4 class="page-title">All Submissions</h4>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end page title -->
|
|
@if(session()->has('message'))
|
|
<div class="alert alert-success">
|
|
{{ session()->get('message') }}
|
|
</div>
|
|
@endif
|
|
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<div class="card-box">
|
|
<div class="responsive-table-plugin">
|
|
<div class="table-rep-plugin">
|
|
<div class="table-responsive" data-pattern="priority-columns">
|
|
<table id="basic-datatable" class="table dt-responsive nowrap">
|
|
<thead>
|
|
<tr>
|
|
<!-- <th>#</th> -->
|
|
<th data-priority="1">Submitted By</th>
|
|
<th>Submitted On</th>
|
|
<th data-priority="1">Verification Status</th>
|
|
<th>Date</th>
|
|
<th>Doctor Name</th>
|
|
<th>Hospital Name</th>
|
|
<th>Total Value</th>
|
|
<th>Total Units</th>
|
|
<th>Current Business</th>
|
|
<th>Potential Business</th>
|
|
<th>UIN Code</th>
|
|
<th data-priority="1">Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
</tbody>
|
|
</table>
|
|
</div> <!-- end .table-responsive -->
|
|
|
|
</div> <!-- end .table-rep-plugin-->
|
|
</div> <!-- end .responsive-table-plugin-->
|
|
</div> <!-- end card-box -->
|
|
</div> <!-- end col -->
|
|
</div>
|
|
<!-- end row -->
|
|
|
|
</div> <!-- container -->
|
|
|
|
<div class="modal fade" id="scrollable-modal" tabindex="-1" role="dialog" aria-labelledby="scrollableModalTitle" aria-hidden="true">
|
|
<div class="modal-dialog modal-full-width" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="scrollableModalTitle">Update link</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
|
|
</div>
|
|
</div><!-- /.modal-content -->
|
|
</div><!-- /.modal-dialog -->
|
|
</div><!-- /.modal -->
|
|
|
|
<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%;
|
|
}
|
|
.doctor-wrapper {
|
|
border: 1px solid #ccc;
|
|
border-radius: 15px;
|
|
padding: 15px;
|
|
position: relative;
|
|
}
|
|
</style>
|
|
|
|
@endsection
|
|
|
|
@section('script')
|
|
|
|
<!-- third party js -->
|
|
<script src="{{ URL::asset('assets/libs/datatables/datatables.min.js')}}"></script>
|
|
<script src="{{asset('assets/libs/sweetalert2/sweetalert2.min.js')}}"></script>
|
|
<!-- third party js ends -->
|
|
<script type="text/javascript">
|
|
$(document).ready(function () {
|
|
// Default Datatable
|
|
$.fn.dataTable.ext.errMode = 'none';
|
|
let table = $('#basic-datatable').DataTable({
|
|
"order": [[ 0, "desc" ]],
|
|
"language": {
|
|
"paginate": {
|
|
"previous": "<i class='mdi mdi-chevron-left'>",
|
|
"next": "<i class='mdi mdi-chevron-right'>"
|
|
}
|
|
},
|
|
"drawCallback": function drawCallback() {
|
|
//$('.dataTables_paginate > .pagination').addStaff('pagination-rounded');
|
|
},
|
|
|
|
fixedHeader: true,
|
|
"pageLength": 50,
|
|
"lengthMenu": [[50, 100, 250, 500], [50, 100, 250, 500]],
|
|
'processing': false,
|
|
'serverSide': false,
|
|
'serverMethod': 'get',
|
|
//searchDelay: 2000,
|
|
"order": [[ 1, "desc" ]],
|
|
'searching': true,
|
|
'info': true,
|
|
|
|
"ajax": {
|
|
url: '{{$submission_json}}',
|
|
data:{
|
|
//'listfilters': listfilters
|
|
},
|
|
dataSrc: ''
|
|
},
|
|
columns: [
|
|
// { "data": "id" },
|
|
{ "data": "submitted_by" },
|
|
{ "data": "submitted_on" },
|
|
{ "data": "submission_status", defaultContent: '' },
|
|
{ "data": "record_date", defaultContent: '' },
|
|
{ "data": "contact_id", defaultContent: '' },
|
|
{ "data": "hospital_name", defaultContent: '' },
|
|
{ "data": "total_value", defaultContent: '' },
|
|
{ "data": "total_units", defaultContent: '' },
|
|
{ "data": "current_business", defaultContent: '' },
|
|
{ "data": "potential_business", defaultContent: '' },
|
|
{ "data": "msl_code", defaultContent: '' },
|
|
{ data: null,
|
|
render: function ( data, type, row ) {
|
|
return '<button title="View" class="btn btn-info btn-xs waves-effect waves-light"><i class="mdi mdi-eye-outline"></i></button>'
|
|
}
|
|
}
|
|
],
|
|
"initComplete": function(settings, json) {
|
|
var api = this.api();
|
|
var textBox = $('.dataTables_filter label input');
|
|
textBox.unbind();
|
|
textBox.bind('keyup input', function(e) {
|
|
if(e.keyCode == 8 && !textBox.val() || e.keyCode == 46 && !textBox.val()) {
|
|
// do nothing ¯\_(ツ)_/¯
|
|
} else if(e.keyCode == 13 || !textBox.val()) {
|
|
api.search(this.value).draw();
|
|
}
|
|
});
|
|
}
|
|
}); //Buttons examples
|
|
|
|
let questions = {!! json_encode($questions) !!}
|
|
console.log(questions)
|
|
|
|
$('#basic-datatable tbody').on( 'click', 'button', function () {
|
|
var submission_formdata = table.row( $(this).parents('tr') ).data();
|
|
let html = `
|
|
<div class="row">
|
|
<div class="col-12">
|
|
<table class="table table-borderless table-nowrap table-hover table-centered m-0">
|
|
<tbody>
|
|
<tr><td><h5 class="m-0 fw-normal">Submitted By</h5></td><td>${submission_formdata.submitted_by}</td><td><h5 class="m-0 fw-normal">Date</h5></td><td>${submission_formdata.record_date}</td></tr>
|
|
<tr><td><h5 class="m-0 fw-normal">Email</h5></td><td>${submission_formdata.user_email}</td><td><h5 class="m-0 fw-normal">Doctor Name</h5></td><td>${submission_formdata.contact_id}</td></tr>
|
|
<tr><td><h5 class="m-0 fw-normal">Phone</h5></td><td>${submission_formdata.user_phone}</td><td><h5 class="m-0 fw-normal">UIN Code</h5></td><td>${submission_formdata.msl_code}</td></tr>
|
|
<tr><td><h5 class="m-0 fw-normal">Submittion Date</h5></td><td>${submission_formdata.submitted_on}</td><td><h5 class="m-0 fw-normal">Hospital Name</h5></td><td>${submission_formdata.hospital_name}</td></tr>
|
|
|
|
<tr><td><h5 class="m-0 fw-normal">Current Business</h5></td><td>${submission_formdata.current_business}</td><td><h5 class="m-0 fw-normal">Potential Business</h5></td><td>${submission_formdata.potential_business}</td></tr>
|
|
<tr><td><h5 class="m-0 fw-normal">Total Units</h5></td><td>${submission_formdata.total_units}</td><td><h5 class="m-0 fw-normal">Total Value</h5></td><td>${submission_formdata.total_value}</td></tr>`
|
|
html += `
|
|
</tbody>
|
|
</table>
|
|
<hr >
|
|
<table class="table table-borderless table-nowrap table-hover table-centered m-0">
|
|
<thead>
|
|
<tr>
|
|
<th>SKU</th>
|
|
<th>Pack Size</th>
|
|
<th>MRP</th>
|
|
<th>PTR</th>
|
|
<th>PTS</th>
|
|
<th>Units</th>
|
|
<th>Price Slab</th>
|
|
<th>Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>`
|
|
for(let opt of questions.find(q => q.code == 'brands').options ) {
|
|
if(submission_formdata[opt.value] && submission_formdata[opt.value] > 0) {
|
|
html += `<tr>
|
|
<th>${opt.display}</th>
|
|
<td>${submission_formdata[opt.value+'_pack_size']}</td>
|
|
<td>${submission_formdata[opt.value+'_mrp']}</td>
|
|
<td>${submission_formdata[opt.value+'_ptr']}</td>
|
|
<td>${submission_formdata[opt.value+'_pts']}</td>
|
|
<td>${submission_formdata[opt.value]}</td>
|
|
<td>${submission_formdata[opt.value+'_discount']}</td>
|
|
<td>${submission_formdata[opt.value+'_value']}</td>
|
|
</tr>`
|
|
}
|
|
}
|
|
html += `
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<hr >
|
|
<div id="form-wrapper">
|
|
<form method="POST" action="/form/submit" id="report-form" enctype="multipart/form-data">
|
|
<input type="hidden" name="form_id" value="1745393615-b4248b7a-b416-42ce-bf7a-9e76fae07cad">
|
|
<input type="hidden" name="id" value="${submission_formdata.id}">
|
|
<input type="hidden" name="user_id" value="${submission_formdata.user_id}">
|
|
<input type="hidden" name="contact_id" value="${submission_formdata.id_contact_id}">
|
|
<input type="hidden" name="partition" value="rapport-maxterneo">
|
|
@csrf
|
|
<div class="col-12 mb-2 p-2">
|
|
<div class="row mb-3">
|
|
<label for="inputEmail3" class="col-6 col-form-label">Update Status</label>
|
|
<div class="col-6">
|
|
<select class="form-control" name="submission_status" required>
|
|
<option value="">-- Select Status --</option>
|
|
<option value="Approved" ${submission_formdata.submission_status == 'Approved' ? 'selected' : ''}>Approved</option>
|
|
<option value="Rejected" ${submission_formdata.submission_status == 'Rejected' ? 'selected' : ''}>Rejected</option>
|
|
</select>
|
|
</div>
|
|
<label for="inputEmail3" class="col-6 col-form-label mt-2">Remarks / Rejection reason</label>
|
|
<div class="col-6 mt-2">
|
|
<textarea class="form-control" name="remarks_rejection_reason" required>${submission_formdata.remarks_rejection_reason??''}</textarea>
|
|
</div>
|
|
<div class="col-12 mt-3">
|
|
<div class="form-check mb-2 form-check-primary">
|
|
<input class="form-check-input" type="checkbox" name="disclaimer" value="Yes" id="disclaimer" required>
|
|
<label class="form-check-label" for="disclaimer">Disclaimer- Above order is personally checked and verified by me</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="text-center col-12 mt-3">
|
|
<button class="btn btn-primary" type="submit" id="submit-btn"> Submit </button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</form>
|
|
</div>`
|
|
|
|
$('#scrollable-modal .modal-body').html(html)
|
|
$('#scrollable-modal').modal('show');
|
|
|
|
console.log(submission_formdata)
|
|
|
|
$('#submit-btn').unbind()
|
|
$('#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'
|
|
})
|
|
$('#scrollable-modal').modal('hide');
|
|
//window.location.reload()
|
|
//$('#report-form').trigger("reset");
|
|
} else {
|
|
Swal.fire({
|
|
icon: 'error',
|
|
title: 'Data not submitted',
|
|
text: 'Something went wrong, please try again after some time!'
|
|
})
|
|
}
|
|
},
|
|
});
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
</script>
|
|
|
|
@endsection |