Merge branch 'main' of http://192.168.1.200:3000/Stratawiz/Rapport-Laravel
Specific Folder FTP Upload / ftp-deploy (push) Successful in 38s Details

This commit is contained in:
zeeshan 2026-07-16 17:45:16 +05:30
commit f039199b6d
15 changed files with 1857 additions and 1855 deletions

View File

@ -188,7 +188,7 @@
$.ajax({
url: '/form/approverejectmultiple',
type: 'GET',
data: {action:'approve', ids:[that.attr('submission')], form_id:'1719380553-df77ae1b-7861-4e3d-a8ef-6ae1b94bf456'},
data: {action:'approve', ids:[that.attr('submission')], form_id:'1719380553-df77ae1b-7861-4e3d-a8ef-6ae1b94bf456', user_id:'{{ $formdata->user_id ?? '' }}', partition:'{{ $formdata->partition ?? '' }}'},
success: function( data ) {
$("#pageloader").fadeOut();
$('#scrollable-modal').modal('hide');
@ -207,7 +207,7 @@
$.ajax({
url: '/form/approverejectmultiple',
type: 'GET',
data: {action:'reject', ids:[that.attr('submission')], form_id:'1719380553-df77ae1b-7861-4e3d-a8ef-6ae1b94bf456'},
data: {action:'reject', ids:[that.attr('submission')], form_id:'1719380553-df77ae1b-7861-4e3d-a8ef-6ae1b94bf456', user_id:'{{ $formdata->user_id ?? '' }}', partition:'{{ $formdata->partition ?? '' }}'},
success: function( data ) {
$("#pageloader").fadeOut();
$('#scrollable-modal').modal('hide');
@ -235,7 +235,7 @@
$.ajax({
url: '/form/approverejectmultiple',
type: 'GET',
data: {action:'approve', ids:selected, form_id:'1719380553-df77ae1b-7861-4e3d-a8ef-6ae1b94bf456'},
data: {action:'approve', ids:selected, form_id:'1719380553-df77ae1b-7861-4e3d-a8ef-6ae1b94bf456', user_id:'{{ $formdata->user_id ?? '' }}', partition:'{{ $formdata->partition ?? '' }}'},
dataType: "json",
success: function(resultData) {
$("#pageloader").fadeOut();
@ -269,7 +269,7 @@
$.ajax({
url: '/form/approverejectmultiple',
type: 'GET',
data: {action:'reject', ids:selected, form_id:'1719380553-df77ae1b-7861-4e3d-a8ef-6ae1b94bf456'},
data: {action:'reject', ids:selected, form_id:'1719380553-df77ae1b-7861-4e3d-a8ef-6ae1b94bf456', user_id:'{{ $formdata->user_id ?? '' }}', partition:'{{ $formdata->partition ?? '' }}'},
dataType: "json",
success: function(resultData) {
$("#pageloader").fadeOut();

View File

@ -304,7 +304,7 @@
let that = $(this);
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + that.attr('submission') + '&form_id=' + formId,
url: '/form/approvereject?action=approve&id=' + that.attr('submission') + '&form_id=' + formId + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
processData: false,
contentType: false,
success: function() {
@ -323,7 +323,7 @@
let that = $(this);
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + that.attr('submission') + '&form_id=' + formId,
url: '/form/approvereject?action=reject&id=' + that.attr('submission') + '&form_id=' + formId + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
processData: false,
contentType: false,
success: function() {

View File

@ -177,7 +177,7 @@
$('.btn-approve').click(function(){
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
@ -190,7 +190,7 @@
$('.btn-reject').click(function(){
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,

View File

@ -179,7 +179,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
@ -195,7 +195,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,

View File

@ -1,370 +1,370 @@
<!DOCTYPE html>
<html lang="en">
<head>
@include('layouts.shared/title-meta', ['title' => 'History'])
@include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? ''])
</head>
<div id="pageloader">
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
</div>
<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/downloaddata?form_id={{ $form_id }}"
class="btn btn-info btn-xs float-end">Download.</a>
<button type="button" id="emailme" class="btn btn-warning btn-xs float-end me-2">Email</button>
</div>
<div class="col-12">
<p>Showing data for last 30 days, please use above button "Download" to download all submissions
{{-- @php echo "<pre>"; print_r($submissions) @endphp --}}
</p>
</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 id="notifications"></div>
<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>
<th data-priority="1" colspan="2">Submitted By</th>
@if (isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes')
<th data-priority="1">Workflow Status</th>
@endif
@foreach ($questions as $code => $question)
@if ($question->type == 'multitextbox')
@foreach ($question->options as $k => $v)
<th data-priority="1">{{ $v }}
({{ $question->label }})
</th>
@endforeach
@else
<th data-priority="1">{{ $question->label }}</th>
@endif
@endforeach
<th>Doctor Name 1</th>
<th>MSL Code 1</th>
<th>Speciality 1</th>
<th>Role 1</th>
<th>Doctor Name 2</th>
<th>MSL Code 2</th>
<th>Speciality 2</th>
<th>Role 2</th>
<th>Doctor Name 3</th>
<th>MSL Code 3</th>
<th>Speciality 3</th>
<th>Role 3</th>
<th>Doctor Name 4</th>
<th>MSL Code 4</th>
<th>Speciality 4</th>
<th>Role 4</th>
<th>Doctor Name 5</th>
<th>MSL Code 5</th>
<th>Speciality 5</th>
<th>Role 5</th>
<th>Doctor Name 6</th>
<th>MSL Code 6</th>
<th>Speciality 6</th>
<th>Role 6</th>
<th>Doctor Name 7</th>
<th>MSL Code 7</th>
<th>Speciality 7</th>
<th>Role 7</th>
<th>Doctor Name 8</th>
<th>MSL Code 8</th>
<th>Speciality 8</th>
<th>Role 8</th>
<th>Doctor Name 9</th>
<th>MSL Code 9</th>
<th>Speciality 9</th>
<th>Role 9</th>
<th>Doctor Name 10</th>
<th>MSL Code 10</th>
<th>Speciality 10</th>
<th>Role 10</th>
<th>Doctor Name 11</th>
<th>MSL Code 11</th>
<th>Speciality 11</th>
<th>Role 11</th>
<th>Doctor Name 12</th>
<th>MSL Code 12</th>
<th>Speciality 12</th>
<th>Role 12</th>
<th>Doctor Name 13</th>
<th>MSL Code 13</th>
<th>Speciality 13</th>
<th>Role 13</th>
<th>Doctor Name 14</th>
<th>MSL Code 14</th>
<th>Speciality 14</th>
<th>Role 14</th>
<th>Doctor Name 15</th>
<th>MSL Code 15</th>
<th>Speciality 15</th>
<th>Role 15</th>
<th>Doctor Name 16</th>
<th>MSL Code 16</th>
<th>Speciality 16</th>
<th>Role 16</th>
<th>Doctor Name 17</th>
<th>MSL Code 17</th>
<th>Speciality 17</th>
<th>Role 17</th>
<th>Doctor Name 18</th>
<th>MSL Code 18</th>
<th>Speciality 18</th>
<th>Role 18</th>
<th>Doctor Name 19</th>
<th>MSL Code 19</th>
<th>Speciality 19</th>
<th>Role 19</th>
<th>Doctor Name 20</th>
<th>MSL Code 20</th>
<th>Speciality 20</th>
<th>Role 20</th>
<th>Doctor Name 21</th>
<th>MSL Code 21</th>
<th>Speciality 21</th>
<th>Role 21</th>
<th>Doctor Name 22</th>
<th>MSL Code 22</th>
<th>Speciality 22</th>
<th>Role 22</th>
<th>Doctor Name 23</th>
<th>MSL Code 23</th>
<th>Speciality 23</th>
<th>Role 23</th>
<th>Doctor Name 24</th>
<th>MSL Code 24</th>
<th>Speciality 24</th>
<th>Role 24</th>
<th>Doctor Name 25</th>
<th>MSL Code 25</th>
<th>Speciality 25</th>
<th>Role 25</th>
<th data-priority="1">Action</th>
</tr>
</thead>
<tbody>
@foreach ($submissions as $submission)
@if (isset($submission->user_info->name))
<tr>
<th>{{ date('d M Y', strtotime(isset($submission->record_date) ? $submission->record_date : $submission->updatedAt)) }}
</th>
<th>
<img src="{{ isset($submission->user_info->avatar) ? $submission->user_info->avatar : 'https://ui-avatars.com/api/?background=random&name=' . $submission->user_info->name }}"
class="rounded-circle avatar-sm" />
</th>
<td>
<h5 class="m-0 fw-normal">
{{ $submission->user_info->name }}</h5>
<p class="mb-0 text-muted">
<small>{{ $submission->user_info->designation }}</small>
</p>
</td>
@if (isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes')
<td>{{ ucwords($submission->workflow_status) }}</td>
@endif
@foreach ($questions as $code => $question)
@if ($question->type == 'multitextbox')
@foreach ($question->options as $k => $v)
<td>{{ isset($submission->formdata->{$k}) ? (is_array($submission->formdata->{$k}) ? implode(', ', $submission->formdata->{$k}) : $submission->formdata->{$k}) : '' }}
</td>
@endforeach
@elseif($question->type == 'file')
<td><a target="_blank"
href="{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}"
download="{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}"
class="btn btn-dark btn-xs"><i
class="mdi mdi-cloud-download me-1"></i>
Download</a></td>
@else
<td>{{ isset($submission->formdata->record_date) ? $submission->formdata->record_date : '' }}
</td>
@for ($suffix = 1; $suffix <= 25; $suffix++)
<td>{{ isset($submission->formdata->{"doctor_name_$suffix"}) ? $submission->formdata->{"doctor_name_$suffix"} : '' }}</td>
<td>{{ isset($submission->formdata->{"msl_code_$suffix"}) ? $submission->formdata->{"msl_code_$suffix"} : '' }}</td>
<td>{{ isset($submission->formdata->{"speciality_$suffix"}) ? $submission->formdata->{"speciality_$suffix"} : '' }}</td>
<td>{{ isset($submission->formdata->{"role_$suffix"}) ? $submission->formdata->{"role_$suffix"} : '' }}</td>
@endfor
{{-- <td>{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}</td> --}}
@endif
@endforeach
{{-- <th>
@if (in_array('edit', $submission->actions))
<a href="/form/edit?id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</a>
@endif
@if (isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' && $submission->workflow_status == 'unapproved')
<button class="btn btn-success btn-xs btn-approve m-1" submission="{{$submission->id}}">Approve</button>
<button class="btn btn-danger btn-xs btn-reject m-1" submission="{{$submission->id}}">Reject</button>
@endif --}}
{{-- </th> --}}
</tr>
@endif
@endforeach
</tbody>
</table>
</div> <!-- end .table-responsive -->
</div> <!-- end .table-rep-plugin-->
</div> <!-- end .responsive-table-plugin-->
@if ($lastkey)
<div class="text-center d-grid mt-3">
<button class="btn btn-info" type="button" id="load-btn"> Load More ... </button>
</div>
@endif
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<!-- end row-->
</div> <!-- container -->
</div>
<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>
<!-- end page -->
@include('layouts.shared/footer-script')
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.btn-primary').click(function() {
$("#pageloader").fadeIn();
})
$('#emailme').click(function() {
$("#pageloader").fadeIn();
$.ajax({
type: "GET",
url: '/form/downloaddata?form_id={{ $form_id }}&email=1',
success: function(data) {
$('#notifications').append(
'<div class="alert alert-success">Email Sent Successfully</div>'
);
$("#pageloader").fadeOut();
},
});
})
var lastkey = '{{ $lastkey }}';
$('#load-btn').click(function() {
$("#pageloader").fadeIn();
$.get("/form/loadmore?lastkey=" + lastkey, function(data) {
$("#pageloader").fadeOut();
lastkey = data.lastkey;
$("#tech-companies-1 tbody").append(data.html);
if (!data.lastkey) {
$('#load-btn').hide()
}
});
})
$('.btn-approve').click(function() {
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission'),
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
success: function(data) {
$("#pageloader").fadeOut();
console.log(data)
},
});
})
$('.btn-reject').click(function() {
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission'),
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
success: function(data) {
$("#pageloader").fadeOut();
console.log(data)
},
});
})
})
</script>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
@include('layouts.shared/title-meta', ['title' => 'History'])
@include('layouts.shared/head-css', ['mode' => $mode ?? '', 'demo' => $demo ?? ''])
</head>
<div id="pageloader">
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
</div>
<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/downloaddata?form_id={{ $form_id }}"
class="btn btn-info btn-xs float-end">Download.</a>
<button type="button" id="emailme" class="btn btn-warning btn-xs float-end me-2">Email</button>
</div>
<div class="col-12">
<p>Showing data for last 30 days, please use above button "Download" to download all submissions
{{-- @php echo "<pre>"; print_r($submissions) @endphp --}}
</p>
</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 id="notifications"></div>
<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>
<th data-priority="1" colspan="2">Submitted By</th>
@if (isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes')
<th data-priority="1">Workflow Status</th>
@endif
@foreach ($questions as $code => $question)
@if ($question->type == 'multitextbox')
@foreach ($question->options as $k => $v)
<th data-priority="1">{{ $v }}
({{ $question->label }})
</th>
@endforeach
@else
<th data-priority="1">{{ $question->label }}</th>
@endif
@endforeach
<th>Doctor Name 1</th>
<th>MSL Code 1</th>
<th>Speciality 1</th>
<th>Role 1</th>
<th>Doctor Name 2</th>
<th>MSL Code 2</th>
<th>Speciality 2</th>
<th>Role 2</th>
<th>Doctor Name 3</th>
<th>MSL Code 3</th>
<th>Speciality 3</th>
<th>Role 3</th>
<th>Doctor Name 4</th>
<th>MSL Code 4</th>
<th>Speciality 4</th>
<th>Role 4</th>
<th>Doctor Name 5</th>
<th>MSL Code 5</th>
<th>Speciality 5</th>
<th>Role 5</th>
<th>Doctor Name 6</th>
<th>MSL Code 6</th>
<th>Speciality 6</th>
<th>Role 6</th>
<th>Doctor Name 7</th>
<th>MSL Code 7</th>
<th>Speciality 7</th>
<th>Role 7</th>
<th>Doctor Name 8</th>
<th>MSL Code 8</th>
<th>Speciality 8</th>
<th>Role 8</th>
<th>Doctor Name 9</th>
<th>MSL Code 9</th>
<th>Speciality 9</th>
<th>Role 9</th>
<th>Doctor Name 10</th>
<th>MSL Code 10</th>
<th>Speciality 10</th>
<th>Role 10</th>
<th>Doctor Name 11</th>
<th>MSL Code 11</th>
<th>Speciality 11</th>
<th>Role 11</th>
<th>Doctor Name 12</th>
<th>MSL Code 12</th>
<th>Speciality 12</th>
<th>Role 12</th>
<th>Doctor Name 13</th>
<th>MSL Code 13</th>
<th>Speciality 13</th>
<th>Role 13</th>
<th>Doctor Name 14</th>
<th>MSL Code 14</th>
<th>Speciality 14</th>
<th>Role 14</th>
<th>Doctor Name 15</th>
<th>MSL Code 15</th>
<th>Speciality 15</th>
<th>Role 15</th>
<th>Doctor Name 16</th>
<th>MSL Code 16</th>
<th>Speciality 16</th>
<th>Role 16</th>
<th>Doctor Name 17</th>
<th>MSL Code 17</th>
<th>Speciality 17</th>
<th>Role 17</th>
<th>Doctor Name 18</th>
<th>MSL Code 18</th>
<th>Speciality 18</th>
<th>Role 18</th>
<th>Doctor Name 19</th>
<th>MSL Code 19</th>
<th>Speciality 19</th>
<th>Role 19</th>
<th>Doctor Name 20</th>
<th>MSL Code 20</th>
<th>Speciality 20</th>
<th>Role 20</th>
<th>Doctor Name 21</th>
<th>MSL Code 21</th>
<th>Speciality 21</th>
<th>Role 21</th>
<th>Doctor Name 22</th>
<th>MSL Code 22</th>
<th>Speciality 22</th>
<th>Role 22</th>
<th>Doctor Name 23</th>
<th>MSL Code 23</th>
<th>Speciality 23</th>
<th>Role 23</th>
<th>Doctor Name 24</th>
<th>MSL Code 24</th>
<th>Speciality 24</th>
<th>Role 24</th>
<th>Doctor Name 25</th>
<th>MSL Code 25</th>
<th>Speciality 25</th>
<th>Role 25</th>
<th data-priority="1">Action</th>
</tr>
</thead>
<tbody>
@foreach ($submissions as $submission)
@if (isset($submission->user_info->name))
<tr>
<th>{{ date('d M Y', strtotime(isset($submission->record_date) ? $submission->record_date : $submission->updatedAt)) }}
</th>
<th>
<img src="{{ isset($submission->user_info->avatar) ? $submission->user_info->avatar : 'https://ui-avatars.com/api/?background=random&name=' . $submission->user_info->name }}"
class="rounded-circle avatar-sm" />
</th>
<td>
<h5 class="m-0 fw-normal">
{{ $submission->user_info->name }}</h5>
<p class="mb-0 text-muted">
<small>{{ $submission->user_info->designation }}</small>
</p>
</td>
@if (isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes')
<td>{{ ucwords($submission->workflow_status) }}</td>
@endif
@foreach ($questions as $code => $question)
@if ($question->type == 'multitextbox')
@foreach ($question->options as $k => $v)
<td>{{ isset($submission->formdata->{$k}) ? (is_array($submission->formdata->{$k}) ? implode(', ', $submission->formdata->{$k}) : $submission->formdata->{$k}) : '' }}
</td>
@endforeach
@elseif($question->type == 'file')
<td><a target="_blank"
href="{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}"
download="{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}"
class="btn btn-dark btn-xs"><i
class="mdi mdi-cloud-download me-1"></i>
Download</a></td>
@else
<td>{{ isset($submission->formdata->record_date) ? $submission->formdata->record_date : '' }}
</td>
@for ($suffix = 1; $suffix <= 25; $suffix++)
<td>{{ isset($submission->formdata->{"doctor_name_$suffix"}) ? $submission->formdata->{"doctor_name_$suffix"} : '' }}</td>
<td>{{ isset($submission->formdata->{"msl_code_$suffix"}) ? $submission->formdata->{"msl_code_$suffix"} : '' }}</td>
<td>{{ isset($submission->formdata->{"speciality_$suffix"}) ? $submission->formdata->{"speciality_$suffix"} : '' }}</td>
<td>{{ isset($submission->formdata->{"role_$suffix"}) ? $submission->formdata->{"role_$suffix"} : '' }}</td>
@endfor
{{-- <td>{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}</td> --}}
@endif
@endforeach
{{-- <th>
@if (in_array('edit', $submission->actions))
<a href="/form/edit?id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</a>
@endif
@if (isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' && $submission->workflow_status == 'unapproved')
<button class="btn btn-success btn-xs btn-approve m-1" submission="{{$submission->id}}">Approve</button>
<button class="btn btn-danger btn-xs btn-reject m-1" submission="{{$submission->id}}">Reject</button>
@endif --}}
{{-- </th> --}}
</tr>
@endif
@endforeach
</tbody>
</table>
</div> <!-- end .table-responsive -->
</div> <!-- end .table-rep-plugin-->
</div> <!-- end .responsive-table-plugin-->
@if ($lastkey)
<div class="text-center d-grid mt-3">
<button class="btn btn-info" type="button" id="load-btn"> Load More ... </button>
</div>
@endif
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<!-- end row-->
</div> <!-- container -->
</div>
<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>
<!-- end page -->
@include('layouts.shared/footer-script')
<script type="text/javascript">
jQuery(document).ready(function($) {
$('.btn-primary').click(function() {
$("#pageloader").fadeIn();
})
$('#emailme').click(function() {
$("#pageloader").fadeIn();
$.ajax({
type: "GET",
url: '/form/downloaddata?form_id={{ $form_id }}&email=1',
success: function(data) {
$('#notifications').append(
'<div class="alert alert-success">Email Sent Successfully</div>'
);
$("#pageloader").fadeOut();
},
});
})
var lastkey = '{{ $lastkey }}';
$('#load-btn').click(function() {
$("#pageloader").fadeIn();
$.get("/form/loadmore?lastkey=" + lastkey, function(data) {
$("#pageloader").fadeOut();
lastkey = data.lastkey;
$("#tech-companies-1 tbody").append(data.html);
if (!data.lastkey) {
$('#load-btn').hide()
}
});
})
$('.btn-approve').click(function() {
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
success: function(data) {
$("#pageloader").fadeOut();
console.log(data)
},
});
})
$('.btn-reject').click(function() {
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
success: function(data) {
$("#pageloader").fadeOut();
console.log(data)
},
});
})
})
</script>
</body>
</html>

View File

@ -209,7 +209,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
@ -225,7 +225,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,

View File

@ -706,6 +706,8 @@
url: '/form/approvereject?action=' + currentAction +
'&id=' + currentSubmission +
'&form_id={{ $form_id }}' +
'&user_id={{ $formdata->user_id ?? '' }}' +
'&partition={{ $formdata->partition ?? '' }}' +
'&reason=' + encodeURIComponent(reason),
success: function(res) {
$("#pageloader").fadeOut();

View File

@ -188,7 +188,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
@ -204,7 +204,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,

View File

@ -458,7 +458,7 @@ $is_authorised = in_array('1655449174-a39a5017-8232-4d58-a253-90d06bc733d0', $ro
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&form_id=' + '{{$form_id}}&user_id=' + user_id + '&next_approver=' + $(this).attr('next_approver') + '&countofneb=' + $(this).attr('no_of_nebulizer'),
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&form_id=' + '{{$form_id}}&user_id=' + user_id + '&partition={{ $formdata->partition ?? '' }}&next_approver=' + $(this).attr('next_approver') + '&countofneb=' + $(this).attr('no_of_nebulizer'),
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
@ -476,7 +476,7 @@ $is_authorised = in_array('1655449174-a39a5017-8232-4d58-a253-90d06bc733d0', $ro
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&form_id=' + '{{$form_id}}&user_id=' + user_id + '&next_approver=' + $(this).attr('next_approver') + '&countofneb=' + $(this).attr('no_of_nebulizer'),
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&form_id=' + '{{$form_id}}&user_id=' + user_id + '&partition={{ $formdata->partition ?? '' }}&next_approver=' + $(this).attr('next_approver') + '&countofneb=' + $(this).attr('no_of_nebulizer'),
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,

View File

@ -1,221 +1,221 @@
<!DOCTYPE html>
<html lang="en">
<head>
@include('layouts.shared/title-meta', ['title' => "History"])
@include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? ''])
</head>
<div id="pageloader">
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
</div>
<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/downloaddata?form_id={{$form_id}}" class="btn btn-info btn-xs float-end">Download</a>
<button type="button" id="emailme" class="btn btn-warning btn-xs float-end me-2">Email</button>
</div>
<div class="col-12">
<p>Showing data for last 30 days, please use above button "Download" to download all submissions</p>
</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 id="notifications"></div>
<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>
<th data-priority="1" colspan="2">Submitted By</th>
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' )
<th data-priority="1">Workflow Status</th>
@endif
@foreach($questions as $code => $question)
@if($question->type == 'hidden' || $code == 'company_name')
@continue;
@endif
@if($question->type == 'multitextbox')
@foreach( $question->options as $k => $v )
@if($question->type == 'hidden')
@continue;
@endif
<th data-priority="1">{{$v}} ({{$question->label}})</th>
@endforeach
@else
<th data-priority="1">{{$question->label}}</th>
@endif
@endforeach
<th data-priority="1">Action</th>
</tr>
</thead>
<tbody>
@foreach($submissions as $submission)
@if(isset($submission->user_info->name))
<tr>
<th>{{date("d M Y", strtotime(isset($submission->record_date) ? $submission->record_date : $submission->updatedAt))}}</th>
<th>
<img src="{{isset($submission->user_info->avatar) ? $submission->user_info->avatar : 'https://ui-avatars.com/api/?background=random&name='.$submission->user_info->name}}" class="rounded-circle avatar-sm" />
</th>
<td>
<h5 class="m-0 fw-normal">{{$submission->user_info->name}}</h5>
<p class="mb-0 text-muted"><small>{{$submission->user_info->designation}}</small></p>
</td>
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' )
<td>{{ucwords($submission->workflow_status)}}</td>
@endif
@foreach($questions as $code => $question)
@if($question->type == 'hidden' || $code == 'company_name')
@continue;
@endif
@if($question->type == 'multitextbox')
@foreach( $question->options as $k => $v )
<td>{{ isset($submission->formdata->{$k}) ? (is_array($submission->formdata->{$k}) ? implode(', ', $submission->formdata->{$k}) : $submission->formdata->{$k}) : '' }}</td>
@endforeach
@elseif($question->type == 'file')
<td><a target="_blank" href="{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}" download="{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}" class="btn btn-dark btn-xs"><i class="mdi mdi-cloud-download me-1"></i> Download</a></td>
@else
<td>{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}</td>
@endif
@endforeach
<th>
@if( in_array('edit', $submission->actions) )
<a href="/form/edit?id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</a>
@endif
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' && $submission->workflow_status == 'unapproved' )
<button class="btn btn-success btn-xs btn-approve m-1" submission="{{$submission->id}}">Approve</button>
<button class="btn btn-danger btn-xs btn-reject m-1" submission="{{$submission->id}}">Reject</button>
@endif
</th>
</tr>
@endif
@endforeach
</tbody>
</table>
</div> <!-- end .table-responsive -->
</div> <!-- end .table-rep-plugin-->
</div> <!-- end .responsive-table-plugin-->
@if($lastkey)
<div class="text-center d-grid mt-3">
<button class="btn btn-info" type="button" id="load-btn"> Load More ... </button>
</div>
@endif
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<!-- end row-->
</div> <!-- container -->
</div>
<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>
<!-- end page -->
@include('layouts.shared/footer-script')
<script type="text/javascript">
jQuery(document).ready(function($){
$('.btn-primary').click(function(){
$("#pageloader").fadeIn();
})
$('#emailme').click(function(){
$("#pageloader").fadeIn();
$.ajax({
type: "GET",
url: '/form/downloaddata?form_id={{$form_id}}&email=1',
success: function( data ) {
$('#notifications').append('<div class="alert alert-success">Email Sent Successfully</div>');
$("#pageloader").fadeOut();
},
});
})
var lastkey = '{{$lastkey}}';
$('#load-btn').click(function(){
$("#pageloader").fadeIn();
$.get( "/form/loadmore?lastkey=" + lastkey, function( data ) {
$("#pageloader").fadeOut();
lastkey = data.lastkey;
$( "#tech-companies-1 tbody" ).append( data.html );
if(!data.lastkey) {
$('#load-btn').hide()
}
});
})
$('.btn-approve').click(function(){
$("#pageloader").fadeIn();
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission'),
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
success: function( data ) {
$("#pageloader").fadeOut();
console.log(data)
that.parent().html('')
},
});
})
$('.btn-reject').click(function(){
$("#pageloader").fadeIn();
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission'),
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
success: function( data ) {
$("#pageloader").fadeOut();
console.log(data)
that.parent().html('')
},
});
})
})
</script>
</body>
<!DOCTYPE html>
<html lang="en">
<head>
@include('layouts.shared/title-meta', ['title' => "History"])
@include('layouts.shared/head-css', ["mode" => $mode ?? '', "demo" => $demo ?? ''])
</head>
<div id="pageloader">
<img src="http://cdnjs.cloudflare.com/ajax/libs/semantic-ui/0.16.1/images/loader-large.gif" alt="processing..." />
</div>
<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/downloaddata?form_id={{$form_id}}" class="btn btn-info btn-xs float-end">Download</a>
<button type="button" id="emailme" class="btn btn-warning btn-xs float-end me-2">Email</button>
</div>
<div class="col-12">
<p>Showing data for last 30 days, please use above button "Download" to download all submissions</p>
</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 id="notifications"></div>
<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>
<th data-priority="1" colspan="2">Submitted By</th>
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' )
<th data-priority="1">Workflow Status</th>
@endif
@foreach($questions as $code => $question)
@if($question->type == 'hidden' || $code == 'company_name')
@continue;
@endif
@if($question->type == 'multitextbox')
@foreach( $question->options as $k => $v )
@if($question->type == 'hidden')
@continue;
@endif
<th data-priority="1">{{$v}} ({{$question->label}})</th>
@endforeach
@else
<th data-priority="1">{{$question->label}}</th>
@endif
@endforeach
<th data-priority="1">Action</th>
</tr>
</thead>
<tbody>
@foreach($submissions as $submission)
@if(isset($submission->user_info->name))
<tr>
<th>{{date("d M Y", strtotime(isset($submission->record_date) ? $submission->record_date : $submission->updatedAt))}}</th>
<th>
<img src="{{isset($submission->user_info->avatar) ? $submission->user_info->avatar : 'https://ui-avatars.com/api/?background=random&name='.$submission->user_info->name}}" class="rounded-circle avatar-sm" />
</th>
<td>
<h5 class="m-0 fw-normal">{{$submission->user_info->name}}</h5>
<p class="mb-0 text-muted"><small>{{$submission->user_info->designation}}</small></p>
</td>
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' )
<td>{{ucwords($submission->workflow_status)}}</td>
@endif
@foreach($questions as $code => $question)
@if($question->type == 'hidden' || $code == 'company_name')
@continue;
@endif
@if($question->type == 'multitextbox')
@foreach( $question->options as $k => $v )
<td>{{ isset($submission->formdata->{$k}) ? (is_array($submission->formdata->{$k}) ? implode(', ', $submission->formdata->{$k}) : $submission->formdata->{$k}) : '' }}</td>
@endforeach
@elseif($question->type == 'file')
<td><a target="_blank" href="{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}" download="{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}" class="btn btn-dark btn-xs"><i class="mdi mdi-cloud-download me-1"></i> Download</a></td>
@else
<td>{{ isset($submission->formdata->{$code}) ? (is_array($submission->formdata->{$code}) ? implode(', ', $submission->formdata->{$code}) : $submission->formdata->{$code}) : '' }}</td>
@endif
@endforeach
<th>
@if( in_array('edit', $submission->actions) )
<a href="/form/edit?id={{$submission->id}}" class="btn btn-primary btn-xs">Edit</a>
@endif
@if(isset($formdata) && isset($formdata->workflow) && $formdata->workflow == 'yes' && $submission->workflow_status == 'unapproved' )
<button class="btn btn-success btn-xs btn-approve m-1" submission="{{$submission->id}}">Approve</button>
<button class="btn btn-danger btn-xs btn-reject m-1" submission="{{$submission->id}}">Reject</button>
@endif
</th>
</tr>
@endif
@endforeach
</tbody>
</table>
</div> <!-- end .table-responsive -->
</div> <!-- end .table-rep-plugin-->
</div> <!-- end .responsive-table-plugin-->
@if($lastkey)
<div class="text-center d-grid mt-3">
<button class="btn btn-info" type="button" id="load-btn"> Load More ... </button>
</div>
@endif
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<!-- end row-->
</div> <!-- container -->
</div>
<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>
<!-- end page -->
@include('layouts.shared/footer-script')
<script type="text/javascript">
jQuery(document).ready(function($){
$('.btn-primary').click(function(){
$("#pageloader").fadeIn();
})
$('#emailme').click(function(){
$("#pageloader").fadeIn();
$.ajax({
type: "GET",
url: '/form/downloaddata?form_id={{$form_id}}&email=1',
success: function( data ) {
$('#notifications').append('<div class="alert alert-success">Email Sent Successfully</div>');
$("#pageloader").fadeOut();
},
});
})
var lastkey = '{{$lastkey}}';
$('#load-btn').click(function(){
$("#pageloader").fadeIn();
$.get( "/form/loadmore?lastkey=" + lastkey, function( data ) {
$("#pageloader").fadeOut();
lastkey = data.lastkey;
$( "#tech-companies-1 tbody" ).append( data.html );
if(!data.lastkey) {
$('#load-btn').hide()
}
});
})
$('.btn-approve').click(function(){
$("#pageloader").fadeIn();
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
success: function( data ) {
$("#pageloader").fadeOut();
console.log(data)
that.parent().html('')
},
});
})
$('.btn-reject').click(function(){
$("#pageloader").fadeIn();
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
success: function( data ) {
$("#pageloader").fadeOut();
console.log(data)
that.parent().html('')
},
});
})
})
</script>
</body>
</html>

View File

@ -430,19 +430,19 @@
let hasValue = false;
brandFields.forEach(function(field) {
if ((parseInt($(field).val()) || 0) > 0) {
if ((parseInt($(field).val()) || 0) >= 0) {
hasValue = true;
}
});
if (!hasValue) {
/* if (!hasValue) {
Swal.fire({
icon: 'error',
title: 'Validation Error',
text: 'From all 11 brands, at least one field should be greater than 0.'
text: 'From all brands, at least one field should be greater than 0.'
});
return false;
}
} */
const formData = new FormData($('#report-form')[0]);
// Log form data to console
for (let [key, value] of formData.entries()) {

View File

@ -191,7 +191,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
@ -207,7 +207,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,

View File

@ -191,7 +191,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=approve&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,
@ -207,7 +207,7 @@
let that = $(this)
$.ajax({
type: "GET",
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission'),
url: '/form/approvereject?action=reject&id=' + $(this).attr('submission') + '&user_id={{ $formdata->user_id ?? '' }}&partition={{ $formdata->partition ?? '' }}',
//data: new FormData($('#report-form')[0]),
processData: false,
contentType: false,