Próbwa naprawy web

This commit is contained in:
czup 2020-02-01 02:04:44 +01:00
parent b85769b644
commit 8c028d7b20
4 changed files with 33 additions and 3 deletions

View File

@ -386,4 +386,24 @@ class documentCreators extends Fpdf
$pdf->Output(); $pdf->Output();
exit; exit;
} }
public function CreateAllFireFightersPDF($fireStationID){
$pdf = new AlphaPDF();
$fill = false;
$pdf->AddPage();
$pdf->AddFont('arialpl', '', 'arialpl.php');
$pdf->AddFont('arialpl', 'B', 'arialplb.php');
$pdf->SetFont('arialpl','B',20);
$pdf->Cell(190,10, $this->textConvert("Lista strażaków"),0,0,'C');
$pdf->Ln();
$pdf->Ln();
$pdf->Ln();
$pdf->Output();
exit;
}
} }

View File

@ -151,7 +151,7 @@ class fireFightersController extends Controller
if (auth()->user() != null && auth()->user()->fireStationID != null) { if (auth()->user() != null && auth()->user()->fireStationID != null) {
$request = request(); $request = request();
$test = new documentCreators(); $test = new documentCreators();
$test->createSingleFireFighterPDF($request->userID); $test->CreateAllFireFightersPDF($request->fireStationID);
} }
} }

View File

@ -70,6 +70,15 @@
Jednostka nie istnieje Jednostka nie istnieje
@else @else
@if(auth()->user()->accessLevel() == 50)
<form action="strazacy/pdf/all/" method="post" style="display:inline;">
{{ csrf_field() }}
<input type="hidden" class="form-control" name="fireStationID" value="{{auth()->user()->fireStationID}}">
<button class="btn btn-dark" type="submit">Drukuj wszystkich</button>
</form>
@endif
<table class='table'> <table class='table'>
<thead> <thead>
<tr> <tr>
@ -123,7 +132,7 @@
<form method="POST" action="/strazacy/activate" style="display:inline;" > <form method="POST" action="/strazacy/activate" style="display:inline;" >
{{ csrf_field() }} {{ csrf_field() }}
<input type="hidden" class="form-control" name="userID" value="{{ $user->id }}"> <input type="hidden" class="form-control" name="userID" value="{{ $user->id }}">
<button style="cursor:pointer" type="submit" class="btn btn-primary">Przywróć do służby</button> <button style="cursor:pointer" type="submit" class="btn btn-primary">Przywróć</button>
</form> </form>
@endif @endif
@endif @endif

View File

@ -57,6 +57,7 @@ Route::post('/strazacy', 'fireFightersController@store');
Route::get('/strazacy/edit/{id}', 'fireFightersController@editForm'); Route::get('/strazacy/edit/{id}', 'fireFightersController@editForm');
Route::post('/strazacy/edit', 'fireFightersController@update'); Route::post('/strazacy/edit', 'fireFightersController@update');
Route::post('/strazacy/pdf/single/', 'fireFightersController@createSingleFireFighterPDF'); Route::post('/strazacy/pdf/single/', 'fireFightersController@createSingleFireFighterPDF');
Route::post('/strazacy/pdf/all/', 'fireFightersController@CreateAllFireFightersPDF');
Route::post('strazacy/activate', 'fireFightersController@activate'); Route::post('strazacy/activate', 'fireFightersController@activate');
Route::post('strazacy/deactivate', 'fireFightersController@deactivate'); Route::post('strazacy/deactivate', 'fireFightersController@deactivate');
@ -70,7 +71,7 @@ Route::get('/jednostka', 'fireStationController@create');
Route::post('/jednostka', 'fireStationController@store'); Route::post('/jednostka', 'fireStationController@store');
Route::get('/jednostka/edit', 'fireStationController@editForm'); Route::get('/jednostka/edit', 'fireStationController@editForm');
Route::post('/jednostka/edit', 'fireStationController@update'); Route::post('/jednostka/edit', 'fireStationController@update');
Route::post('jednostka/pdf/single/', 'fireStationController@createSingleUnitPDF'); Route::post('/sjednostka/pdf/single/', 'fireStationController@createSingleUnitPDF');
Route::get('/jednostka/getcounties/{id}','DataController@getCounties'); Route::get('/jednostka/getcounties/{id}','DataController@getCounties');
Route::get('/jednostka/getcommunities/{id}','DataController@getCommunities'); Route::get('/jednostka/getcommunities/{id}','DataController@getCommunities');