1
0
forked from s421507/eOSP2
# Conflicts:
#	routes/web.php
This commit is contained in:
Krzysztof Strzelecki 2019-10-02 18:59:57 +02:00
commit 23262247e5
5 changed files with 53 additions and 33 deletions

View File

@ -7,13 +7,22 @@ use Illuminate\Http\Request;
use App\User;
use App\fireStation;
use App\Rules\Pesel;
use Illuminate\Support\Facades\DB;
class fireFightersController extends Controller
{
public function create(){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
// $users = DB::table('Users')->where("fireStationID", auth()->user()->fireStationID);
$users = user::where("fireStationID", auth()->user()->fireStationID);
return view("fireFighters", ["users" => $users]);
} else{
return view('fireFighters');
}
}
public function addForm(){
if(auth()->user() != null && auth()->user()->fireStationID != null ){
$fireStation = fireStation::find(auth()->user()->fireStationID);
@ -63,5 +72,9 @@ class fireFightersController extends Controller
return view('fireFighters');
}
public function editFireFighter(){
}
}

View File

@ -35,7 +35,7 @@ class fireStationController extends Controller
'KRS' => 'required|digits:10',
'NIP' => 'required|digits:10',
'phoneNumber' => 'required|digits:9',
'email' => 'required|email|unique:firestations',
'email' => 'required|email|unique:fireStations',
],
[
'required' => ':attribute jest wymagany(e).',

View File

@ -13,8 +13,12 @@
@section('center-area')
@parent
<?php
echo "<table class='firefighterViewTable'>
@if( auth()->check())
@if( auth()->user()->fireStationID == NULL)
Jednostka nie istnieje
@else
<table class='firefighterViewTable'>
<tr class='table-header'>
<td>Imie i nazwisko</td>
<td>PESEL</td>
@ -22,17 +26,24 @@
<td>Funkcja</td>
<td>Stopień</td>
<td>Status</td>
</tr>";
for ($i = 1; $i <= 25; $i++){
echo "<tr>
<td>name surname</td>
</tr>
<tr>
@foreach($users as $user)
<td>{{ $user->name }} surname</td>
<td>???????????</td>
<td>przykladowymail@domena.com</td>
<td>Zast. Naczelnika</td>
<td>Dowódca</td>
<td>Czynny</td>
</tr>";
}
echo "</table>";
?>
@endforeach
</tr>"
</table>"
@endif
@else
Brak autoryzacji
@endif
@stop

View File

@ -43,21 +43,17 @@ Route::get('/login', 'SessionsController@create');
Route::post('/login', 'SessionsController@store');
Route::get('/logout', 'SessionsController@destroy');
Route::get('/jednostka', 'fireStationController@create');
Route::post('/jednostka', 'fireStationController@store');
Route::get('/strazacy', 'fireFightersController@create');
Route::get('/strazacy/add', 'fireFightersController@addForm');
Route::post('/strazacy', 'fireFightersController@store');
Route::get('/jednostka', 'fireStationController@create');
Route::post('/jednostka', 'fireStationController@store');
Route::get('/jednostka/getcounties/{id}','DataController@getCounties');
Route::get('/jednostka/getcommunities/{id}','DataController@getCommunities');
Route::get('register/verify/{confirmationCode}', [
'as' => 'confirmation_path',
'uses' => 'RegistrationController@confirm'
]);
//Auth::routes();
//
//Route::get('/home', 'HomeController@index')->name('home');