Skip to content
This repository was archived by the owner on May 10, 2022. It is now read-only.

Commit 7f33e3f

Browse files
committed
sending for columns for use in pdf generation
1 parent bc024c6 commit 7f33e3f

File tree

5 files changed

+81
-6
lines changed

5 files changed

+81
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
3+
namespace Modules\ReportGenerator\Http\Controllers;
4+
5+
use Illuminate\Http\Request;
6+
use Illuminate\Http\Response;
7+
use Illuminate\Routing\Controller;
8+
9+
class PdfController extends Controller
10+
{
11+
/**
12+
* Display a listing of the resource.
13+
* @return Response
14+
*/
15+
public function index(Request $request)
16+
{
17+
dd($request->column_names);
18+
return view('reportgenerator::index');
19+
}
20+
21+
/**
22+
* Show the form for creating a new resource.
23+
* @return Response
24+
*/
25+
public function create()
26+
{
27+
return view('reportgenerator::create');
28+
}
29+
30+
/**
31+
* Store a newly created resource in storage.
32+
* @param Request $request
33+
* @return Response
34+
*/
35+
public function store(Request $request)
36+
{
37+
}
38+
39+
/**
40+
* Show the specified resource.
41+
* @return Response
42+
*/
43+
public function show()
44+
{
45+
return view('reportgenerator::show');
46+
}
47+
48+
/**
49+
* Show the form for editing the specified resource.
50+
* @return Response
51+
*/
52+
public function edit()
53+
{
54+
return view('reportgenerator::edit');
55+
}
56+
57+
/**
58+
* Update the specified resource in storage.
59+
* @param Request $request
60+
* @return Response
61+
*/
62+
public function update(Request $request)
63+
{
64+
}
65+
66+
/**
67+
* Remove the specified resource from storage.
68+
* @return Response
69+
*/
70+
public function destroy()
71+
{
72+
}
73+
}

Modules/ReportGenerator/Http/Controllers/ReportGeneratorController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function showReport($option_ids, $hide = False)
8686
}
8787

8888
$data = []; // store the retrieved data
89-
$column_names = []; // st
89+
$column_names = []; // store the column_names
9090
foreach ($column_list as $columns) { // $columns has the list of columns for each component.
9191
$table_name = $columns[0]; // get table name to which each column list points to.
9292
for($i = 1; $i < count($columns); $i++) { // foreach list of columns

Modules/ReportGenerator/Http/routes.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
Route::group(['middleware' => 'web', 'prefix' => 'reportgenerator', 'namespace' => 'Modules\ReportGenerator\Http\Controllers'], function()
44
{
5-
Route::get('pdf_report', function(){
6-
return view('');
7-
});
5+
Route::get('/pdf_report', 'PdfController@index');
86

97
Route::get('/', 'ReportGeneratorController@index');
108

Modules/ReportGenerator/Resources/views/report.blade.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#add-report-format">Save report as</button>&nbsp;
1717
@endif
1818
<button type="button" class="btn btn-info" onclick="printReport('report_div')">Print</button>&nbsp;
19-
<a type="button" class="btn btn-info" href="{{ asset('pdf_report.php') }}">PDF</a>&nbsp;
19+
<form method="get" action="{{ url('reportgenerator/pdf_report') }}">
20+
@foreach($column_names as $key => $column_name)
21+
<input name="column_names[]" class="column_names" id="column_names[]" type="hidden" value="{{ $column_name }}" align="absmiddle" />
22+
@endforeach
23+
<button type="submit" class="btn btn-info" id="pdf-button">PDF</button>
24+
</form>&nbsp;
2025
<button type="button" class="btn btn-info">TXT</button>&nbsp;
2126
<button type="button" class="btn btn-info">CSV</button>&nbsp;
2227
<button type="button" class="btn btn-info">ODT</button>

public/pdf_report.php

-1
This file was deleted.

0 commit comments

Comments
 (0)