Changes
This commit is contained in:
parent
e27a725915
commit
1f1cf18619
|
|
@ -32,6 +32,7 @@ class Controller extends BaseController
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getlambda($type, $service, $module, $url, $data = []) {
|
protected function getlambda($type, $service, $module, $url, $data = []) {
|
||||||
|
return LambdaRequest::signedrequest($type, $service, $module.'/'.$url, $data);
|
||||||
if($url == 'dropdown' && $this->_request->session()->has($service.'-'.$module.'-'.$url) ) {
|
if($url == 'dropdown' && $this->_request->session()->has($service.'-'.$module.'-'.$url) ) {
|
||||||
return $this->_request->session()->get($service.'-'.$module.'-'.$url);
|
return $this->_request->session()->get($service.'-'.$module.'-'.$url);
|
||||||
} elseif($url == 'dropdown'){
|
} elseif($url == 'dropdown'){
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class FormsubmissionController extends Controller
|
||||||
if(isset($post['startdate']))
|
if(isset($post['startdate']))
|
||||||
$startdate = $post['startdate'];
|
$startdate = $post['startdate'];
|
||||||
else
|
else
|
||||||
$startdate = date("Y/m/d", strtotime("-1 month") );
|
$startdate = date("Y/m/d", strtotime("-1 day") );
|
||||||
|
|
||||||
if(isset($post['enddate']))
|
if(isset($post['enddate']))
|
||||||
$enddate = $post['enddate'];
|
$enddate = $post['enddate'];
|
||||||
|
|
@ -79,8 +79,9 @@ class FormsubmissionController extends Controller
|
||||||
|
|
||||||
public function export(Request $request) {
|
public function export(Request $request) {
|
||||||
$reqdata = $request->session()->get('formdata_request');
|
$reqdata = $request->session()->get('formdata_request');
|
||||||
|
//$reqdata = ["partition" => 'rapport-vitalis1', "form_id" => '1650365457-c86bd7f2-a33c-49a5-9671-3c2511b57f3b', "alldata" => true, "date_range" => '2022/_'.$enddate ];
|
||||||
$response = LambdaRequest::signedrequest('post', $this->_service, $this->_module.'/getformhistory', $reqdata);
|
$response = LambdaRequest::signedrequest('post', $this->_service, $this->_module.'/getformhistory', $reqdata);
|
||||||
$fields = ['Submitted By', 'Record Date', 'Submitted On'];
|
$fields = ['Submitted By', 'User identification', 'Record Date', 'Submitted On'];
|
||||||
foreach($response->data->questions as $qid => $question){
|
foreach($response->data->questions as $qid => $question){
|
||||||
$fields[] = $question->label;
|
$fields[] = $question->label;
|
||||||
}
|
}
|
||||||
|
|
@ -93,7 +94,7 @@ class FormsubmissionController extends Controller
|
||||||
$exceldata[] = $fields;
|
$exceldata[] = $fields;
|
||||||
|
|
||||||
foreach($response->data->submissions as $submission) {
|
foreach($response->data->submissions as $submission) {
|
||||||
$item = [$submission->user_info->name, date("d M Y", strtotime($submission->record_date)), date("d M Y", strtotime($submission->createdAt))];
|
$item = [$submission->user_info->name, $submission->user_info->id, date("d M Y", strtotime($submission->record_date)), date("d M Y", strtotime($submission->createdAt))];
|
||||||
foreach($response->data->questions as $qid => $question){
|
foreach($response->data->questions as $qid => $question){
|
||||||
$item[] = $submission->formdata->{$qid};
|
$item[] = $submission->formdata->{$qid};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>{{date("d M Y", strtotime($submission->updatedAt))}}</th>
|
<th>{{date("d M Y", strtotime($submission->updatedAt))}}</th>
|
||||||
@foreach($questions as $code => $question)
|
@foreach($questions as $code => $question)
|
||||||
@if(count((array)$question->options) > 0)
|
@if(count((array)$question->options) > 0 && 1==2 )
|
||||||
<td>{{ $question->options->{ $submission->formdata->{$code} } }}</td>
|
<td>{{ $question->options->{ $submission->formdata->{$code} } }}</td>
|
||||||
@else
|
@else
|
||||||
<td>{{ isset($submission->formdata->{$code}) ? $submission->formdata->{$code} : $code }}</td>
|
<td>{{ isset($submission->formdata->{$code}) ? $submission->formdata->{$code} : $code }}</td>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue