Dodanie paginacji oraz poprawienie widoków większości tabel
This commit is contained in:
parent
406605de39
commit
c69bdaf053
@ -12,7 +12,7 @@ class EquipmentController extends Controller
|
||||
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$equipment = DB::table('equipment')->where("fireStationID", '=', auth()->user()->fireStationID)
|
||||
->whereNull('deleted_at')->get();
|
||||
->whereNull('deleted_at')->paginate(10);
|
||||
return view("equipment", ["equipment" => $equipment]);
|
||||
} else{
|
||||
return view('equipment');
|
||||
@ -90,6 +90,8 @@ class EquipmentController extends Controller
|
||||
{
|
||||
equipment::where('id',$id)->delete();
|
||||
|
||||
return redirect()->to('/sprzet');
|
||||
return response()->json([
|
||||
'success' => 'Record deleted successfully!'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ class fireFightersController extends Controller
|
||||
->leftJoin('ranks', 'users.degreeID', '=', 'ranks.id')
|
||||
->leftJoin('unitFunctions', 'users.functionID', '=', 'unitFunctions.id')
|
||||
->select('users.id','users.name', 'users.surname', 'users.PESEL', 'users.email', 'users.statusID', 'ranks.rank', 'unitFunctions.unitFunction')
|
||||
->get();
|
||||
->paginate(10);
|
||||
return view("fireFighters", ["users" => $users]);
|
||||
} else{
|
||||
return view('fireFighters');
|
||||
|
@ -16,7 +16,8 @@ class trainingsController extends Controller
|
||||
|
||||
if(auth()->user() != null && auth()->user()->fireStationID != null ){
|
||||
$trainings = DB::table('trainings')->where("fireStationID", '=', auth()->user()->fireStationID)
|
||||
->whereNull('deleted_at')->get();
|
||||
->whereNull('deleted_at')
|
||||
->paginate(10);
|
||||
|
||||
$fireFighters = array();
|
||||
foreach($trainings as $training) {
|
||||
@ -66,7 +67,7 @@ class trainingsController extends Controller
|
||||
$join->where('trainingsFirefighters.trainingID', '=', $id);
|
||||
})
|
||||
->select('trainingsFirefighters.*', 'users.name', 'users.surname', 'users.id as userID')
|
||||
->get();
|
||||
->paginate(10);
|
||||
|
||||
$training = DB::table('trainings')->where("id", '=', $id)
|
||||
->whereNull('deleted_at')->first();
|
||||
@ -158,9 +159,11 @@ class trainingsController extends Controller
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
trainings::where('id',$id)->delete();
|
||||
trainings::find($id)->delete($id);
|
||||
|
||||
return redirect()->to('/szkolenia');
|
||||
return response()->json([
|
||||
'success' => 'Record deleted successfully!'
|
||||
]);
|
||||
}
|
||||
|
||||
public function trainingsRename(Request $request){
|
||||
|
@ -15,13 +15,17 @@
|
||||
@else
|
||||
@if(count($awardedDecorations) > 0)
|
||||
<p align='center'>
|
||||
<table class='firefighterViewTable'>
|
||||
<tr class='table-header'>
|
||||
<th colspan="2" scope="colgroup" style="text-align:center">{{ $firefighter->name }} {{ $firefighter->surname }} - odznaczenia</th>
|
||||
<table class='table'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="3" scope="colgroup" style="text-align:center">{{ $firefighter->name }} {{ $firefighter->surname }} - odznaczenia</th>
|
||||
</tr>
|
||||
<tr class='table-header'>
|
||||
<td>Odznaczenie</td>
|
||||
<td>Data przyznania</td>
|
||||
|
||||
</thead>
|
||||
<tbody>
|
||||
<th>Odznaczenie</th>
|
||||
<th>Data przyznania</th>
|
||||
<th>Operacja</th>
|
||||
@foreach($awardedDecorations as $awardedDecoration)
|
||||
<tr>
|
||||
<form action="{{ route('decorations.destroy', $awardedDecoration->decorationsFirefightersID)}}" method="post">
|
||||
@ -35,6 +39,7 @@
|
||||
</form>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</p>
|
||||
@else
|
||||
|
@ -1,5 +1,6 @@
|
||||
@extends('layout.app')
|
||||
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
@section('left-menu')
|
||||
@parent
|
||||
<ul>
|
||||
@ -10,6 +11,7 @@
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
@parent
|
||||
|
||||
@if( auth()->check())
|
||||
@ -17,26 +19,38 @@
|
||||
Jednostka nie istnieje
|
||||
@else
|
||||
<p align='center'>
|
||||
<table class='firefighterViewTable'>
|
||||
<tr class='table-header'>
|
||||
<td>Nazwa</td>
|
||||
<td>Ilość</td>
|
||||
<td>Param. charakterystyczny</td>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Nazwa</th>
|
||||
<th>Ilość</th>
|
||||
<th>Param. charakterystyczny</th>
|
||||
<th>Operacja</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@php
|
||||
$i=1;
|
||||
@endphp
|
||||
@foreach($equipment as $item)
|
||||
<tr>
|
||||
<form action="{{ route('equipment.destroy', $item->id)}}" method="post">
|
||||
<th>{{$i}}</th>
|
||||
<td id="name{{ $item->id }}">{{ $item->name }}</td>
|
||||
<td id="amount{{ $item->id }}">{{ $item->amount }}</td>
|
||||
<td id="parameter{{ $item->id }}">{{ $item->parameter }}</td>
|
||||
<td><a href="{{ URL::asset('sprzet/edit/'.$item->id) }}"><input type="button" onclick="" value="Edytuj"> </a></td>
|
||||
<td>
|
||||
{{ csrf_field() }}
|
||||
@method('DELETE')
|
||||
<button class="btn btn-danger" type="submit">Usuń</button>
|
||||
</form></td>
|
||||
<a href="{{ URL::asset('sprzet/edit/'.$item->id) }}" class="btn btn-secondary" role="button">Edytuj</a>
|
||||
<button class="btn btn-danger" type="submit" id="{{$item->id}}" onclick="deleteButton('{{$item->id}}')">Usuń</button>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@php
|
||||
$i++;
|
||||
@endphp
|
||||
@endforeach
|
||||
</table>
|
||||
{{ $equipment->links() }}
|
||||
</p>
|
||||
|
||||
@endif
|
||||
@ -45,3 +59,39 @@
|
||||
@endif
|
||||
|
||||
@stop
|
||||
|
||||
<script>
|
||||
|
||||
function deleteButton(itemID){
|
||||
swal.fire({
|
||||
title: "Czy chcesz usunąć sprzęt?",
|
||||
width: 'auto',
|
||||
confirmButtonText: 'Tak',
|
||||
cancelButtonText: 'Nie',
|
||||
showCancelButton: true,
|
||||
}).then((result) => {
|
||||
if(result.value){
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "sprzet/"+itemID,
|
||||
type: 'DELETE',
|
||||
data: {
|
||||
"id": itemID,
|
||||
},
|
||||
success: function (){
|
||||
console.log("it Works");
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
|
@ -66,19 +66,28 @@
|
||||
Jednostka nie istnieje
|
||||
@else
|
||||
|
||||
<table class='firefighterViewTable'>
|
||||
<tr class='table-header'>
|
||||
<td>Imie</td>
|
||||
<td>Nazwisko</td>
|
||||
<td>PESEL</td>
|
||||
<td>E-mail</td>
|
||||
<td>Funkcja</td>
|
||||
<td>Stopień</td>
|
||||
<td>Status</td>
|
||||
<table class='table'>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Imie</th>
|
||||
<th>Nazwisko</th>
|
||||
<th>PESEL</th>
|
||||
<th>E-mail</th>
|
||||
<th>Funkcja</th>
|
||||
<th>Stopień</th>
|
||||
<th>Status</th>
|
||||
<th>Operacje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach($users as $user)
|
||||
<tr>
|
||||
<th>{{$i}}</th>
|
||||
<td id="userName{{ $user->id }}">{{ $user->name }}</td>
|
||||
<td id="userSurname{{ $user->id }}">{{ $user->surname }}</td>
|
||||
<td id="userPESEL{{ $user->id }}">{{ $user->PESEL }}</td>
|
||||
@ -86,22 +95,27 @@
|
||||
<td id="userFunction{{ $user->id }}"> {{$user->unitFunction}} </td>
|
||||
<td id="userDegree{{ $user->id }}"> {{$user->rank}}</td>
|
||||
<td id="userStatus{{ $user->id }}">@if( $user->statusID == 0) Czynny @else Wyłączony @endif</td>
|
||||
<td><a href="{{ URL::asset('strazacy/edit/'.$user->id) }}"><input type="button" onclick="" value="Edytuj"> </a></td>
|
||||
<td><a href="{{ URL::asset('strazacy/odznaczenia/'.$user->id) }}"><input type="button" onclick="" value="Odznaczenia"> </a></td>
|
||||
|
||||
<td>
|
||||
<a href="{{ URL::asset('strazacy/edit/'.$user->id) }}" class="btn btn-secondary" role="button">Edytuj</a>
|
||||
<a href="{{ URL::asset('strazacy/odznaczenia/'.$user->id) }}" class="btn btn-success" role="button">Odznaczenia</a>
|
||||
</td>
|
||||
</tr>
|
||||
{{-- <tr>--}}
|
||||
{{-- <form id="editForm{{$user->id}}" method="POST" action="/strazacy">--}}
|
||||
{{-- {{ csrf_field() }}--}}
|
||||
{{-- <div class="form-group">--}}
|
||||
{{-- <label for="name">Imię:</label>--}}
|
||||
{{-- <input type="text" class="form-control" id="name" name="name" value="{{ old('name') }} ">--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </form>--}}
|
||||
{{-- </tr>--}}
|
||||
{{-- <tr>--}}
|
||||
{{-- <form id="editForm{{$user->id}}" method="POST" action="/strazacy">--}}
|
||||
{{-- {{ csrf_field() }}--}}
|
||||
{{-- <div class="form-group">--}}
|
||||
{{-- <label for="name">Imię:</label>--}}
|
||||
{{-- <input type="text" class="form-control" id="name" name="name" value="{{ old('name') }} ">--}}
|
||||
{{-- </div>--}}
|
||||
{{-- </form>--}}
|
||||
{{-- </tr>--}}
|
||||
@php
|
||||
$i++;
|
||||
@endphp
|
||||
@endforeach
|
||||
</table>"
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $users->links() }}
|
||||
@endif
|
||||
@else
|
||||
Brak autoryzacji
|
||||
@ -112,4 +126,3 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -25,11 +25,11 @@
|
||||
<th>Rodzaj zagrożenia</th>
|
||||
<th>Dowódca</th>
|
||||
<th>Operacja</th>
|
||||
<th>Szczegóły</th>
|
||||
<th>Szczegóły</th> <tbody>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@php
|
||||
$i=1;
|
||||
@endphp
|
||||
@ -42,11 +42,11 @@
|
||||
<td id="operationDangerType{{ $operation->id }}">{{ $operation->dangerType }}</td>
|
||||
<td id="operationCommander{{ $operation->id }}">{{$operation->name}} {{$operation->surname}}</td>
|
||||
<td>
|
||||
<a href="{{ URL::asset('wyjazdy/edit/'.$operation->id) }}"><input type="button" onclick="" value="Edytuj"> </a>
|
||||
<button class="btn btn-danger btn-delete" type="submit" id="{{$operation->id}}" onclick="deleteButton('{{$operation->id}}')">Usuń</button>
|
||||
<a href="{{ URL::asset('wyjazdy/edit/'.$operation->id) }}" class="btn btn-secondary" role="button">Edytuj</a>
|
||||
<button class="btn btn-danger" type="submit" id="{{$operation->id}}" onclick="deleteButton('{{$operation->id}}')">Usuń</button>
|
||||
</td>
|
||||
<td>
|
||||
<input type="button" onclick="showMoreInformation('{{$operation->id}}')" id="more{{$operation->id}}" value="Więcej">
|
||||
<button class="btn btn-info" type="button" id="more{{$operation->id}}" onclick="showMoreInformation('{{$operation->id}}')">Więcej</button>
|
||||
</td>
|
||||
</tr>
|
||||
<tr id="moreInformation{{$operation->id}}" style="visibility:collapse;">
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Miejsce akcji:</label>
|
||||
<input type="text" class="form-control" id="operationLocation" name="operationLocation" value="{{ $operation->location}}">
|
||||
<input type="text" class="form-control is-valid" id="operationLocation" name="operationLocation" value="{{ $operation->location}}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
@ -33,7 +33,7 @@
|
||||
|
||||
<div class="form-group">
|
||||
<label for="location">Rodzaj zagrożenia:</label>
|
||||
<input type="text" class="form-control" id="operationDangerType" name="operationDangerType" value="{{ $operation->dangerType }}">
|
||||
<input type="text" class="form-control is-valid" id="operationDangerType" name="operationDangerType" value="{{ $operation->dangerType }}">
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
@ -15,8 +15,8 @@
|
||||
@stop
|
||||
|
||||
@section('center-area')
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
@parent
|
||||
|
||||
@if( auth()->check())
|
||||
@if( auth()->user()->fireStationID == NULL)
|
||||
Jednostka nie istnieje
|
||||
@ -34,37 +34,45 @@
|
||||
</div>
|
||||
@include('inc.formerrors')
|
||||
</form>
|
||||
<table class='firefighterViewTable'>
|
||||
<table class='table'>
|
||||
<tr class='table-header'>
|
||||
<td>Nazwa Szkolenia</td>
|
||||
<td>Ilość z ukończonym</td>
|
||||
<td>Akcje</td>
|
||||
<thead>
|
||||
<th>#</th>
|
||||
<th>Nazwa Szkolenia</th>
|
||||
<th>Ilość z ukończonym</th>
|
||||
<th>Operacja</th>
|
||||
<th>Szczegóły</th>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@php
|
||||
$i=1;
|
||||
@endphp
|
||||
@foreach($trainings as $training)
|
||||
<tr id="{{$training->id}}">
|
||||
|
||||
<th>{{$i}}</th>
|
||||
<td id="name{{ $training->id }}">{{ $training->trainingName }}</td>
|
||||
<td id="amount{{ $training->id }}">5</td>
|
||||
<td><input type="button" onclick="showMoreInformation('{{$training->id}}')" id="more{{$training->id}}" value="Więcej">
|
||||
<button class="btn btn-info" type="submit" onclick="renameTraining('{{$training->id}}')" id="{{$training->id}}">Zmień nazwę</button>
|
||||
<a href="{{ URL::asset('szkolenia/addTrainingsFireFighters/'.$training->id) }}"><input type="button" onclick="" value="Zarządzaj"></a>
|
||||
<td>
|
||||
<button class="btn btn-success " type="submit" onclick="renameTraining('{{$training->id}}')" id="{{$training->id}}">Zmień nazwę</button>
|
||||
<a href="{{ URL::asset('szkolenia/addTrainingsFireFighters/'.$training->id) }}" class="btn btn-secondary" role="button">Zarządzaj</a>
|
||||
<button class="btn btn-danger" type="submit" id="{{$training->id}}" onclick="deleteButton('{{$training->id}}')">Usuń</button>
|
||||
</td>
|
||||
<td>
|
||||
<form action="{{ route('trainings.destroy', $training->id)}}" method="post">
|
||||
{{ csrf_field() }}
|
||||
@method('DELETE')
|
||||
<button class="btn btn-danger" type="submit">Usuń</button>
|
||||
</form>
|
||||
<button class="btn btn-info" onclick="showMoreInformation('{{$training->id}}')" id="more{{$training->id}}">Więcej</button>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr id="moreInformation{{$training->id}}" style="visibility:collapse;" bgcolor="#C0C0C0">
|
||||
<td colspan="3">
|
||||
<table>
|
||||
|
||||
<tr id="moreInformation{{$training->id}}" style="visibility:collapse;" >
|
||||
<td colspan="5">
|
||||
<table class="table table-dark">
|
||||
<thead>
|
||||
<td>Imię i Nazwisko</td>
|
||||
<td>Ważne od:</td>
|
||||
<td>Ważne do:</td>
|
||||
<tr>
|
||||
<th>Imię i Nazwisko</th>
|
||||
<th>Ważne od:</th>
|
||||
<th>Ważne do:</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@ -81,8 +89,13 @@
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@php
|
||||
$i++;
|
||||
@endphp
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $trainings->links() }}
|
||||
</p>
|
||||
|
||||
@endif
|
||||
@ -141,4 +154,36 @@
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
function deleteButton(trainingID){
|
||||
swal.fire({
|
||||
title: "Czy chcesz usunąć wyjazd?",
|
||||
width: 'auto',
|
||||
confirmButtonText: 'Tak',
|
||||
cancelButtonText: 'Nie',
|
||||
showCancelButton: true,
|
||||
}).then((result) => {
|
||||
if(result.value){
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "szkolenia/"+trainingID,
|
||||
type: 'DELETE',
|
||||
data: {
|
||||
"id": trainingID,
|
||||
},
|
||||
success: function (){
|
||||
console.log("it Works");
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
</script>
|
||||
|
@ -22,13 +22,13 @@
|
||||
Jednostka nie istnieje
|
||||
@else
|
||||
<center><h1>{{$training->trainingName}}</h1></center>
|
||||
<table id="editableTable" class='table table-bordered'>
|
||||
<table id="editableTable" class='table'>
|
||||
|
||||
<thead>
|
||||
<td>Imię i Nazwisko</td>
|
||||
<td>Ważne od:</td>
|
||||
<td>Ważne do:</td>
|
||||
<td>Akcje</td>
|
||||
<th>Imię i Nazwisko</th>
|
||||
<th>Ważne od:</th>
|
||||
<th>Ważne do:</th>
|
||||
<th>Akcje</th>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@ -37,12 +37,16 @@
|
||||
<td>{{$fireFighter->name}} {{$fireFighter->surname}}</td>
|
||||
<td>{{$fireFighter->dateOfComplete}}</td>
|
||||
<td>{{$fireFighter->dateOfExpiry}}</td>
|
||||
<td><button class="btn btn-warning" type="submit" style="display:none" id="{{$fireFighter->userID}}" onclick="cancelButton('{{$fireFighter->userID}}', '{{$fireFighter->dateOfComplete}}', '{{$fireFighter->dateOfExpiry}}')">Anuluj</button> <button class="btn btn-success" type="submit" style="display:none" id="{{$fireFighter->userID}}" onclick="updateButton('{{$fireFighter->userID}}', '{{$fireFighter->dateOfComplete}}', '{{$fireFighter->dateOfExpiry}}')">Zapisz</button> <button class="btn btn-info" type="submit" id="{{$fireFighter->userID}}" onclick="editButton('{{$fireFighter->userID}}')">Edytuj</button> <button class="btn btn-danger btn-delete" type="submit" id="{{$fireFighter->userID}}" onclick="deleteButton('{{$fireFighter->userID}}')">Usuń</button></td>
|
||||
<td>
|
||||
<button class="btn btn-warning" type="submit" style="display:none" id="{{$fireFighter->userID}}" onclick="cancelButton('{{$fireFighter->userID}}', '{{$fireFighter->dateOfComplete}}', '{{$fireFighter->dateOfExpiry}}')">Anuluj</button>
|
||||
<button class="btn btn-success" type="submit" style="display:none" id="{{$fireFighter->userID}}" onclick="updateButton('{{$fireFighter->userID}}', '{{$fireFighter->dateOfComplete}}', '{{$fireFighter->dateOfExpiry}}')">Zapisz</button>
|
||||
<button class="btn btn-secondary" type="submit" id="{{$fireFighter->userID}}" onclick="editButton('{{$fireFighter->userID}}')">Edytuj</button>
|
||||
<button class="btn btn-danger btn-delete" type="submit" id="{{$fireFighter->userID}}" onclick="deleteButton('{{$fireFighter->userID}}')">Usuń</button></td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{ $fireFighters->links() }}
|
||||
|
||||
@endif
|
||||
@else
|
||||
@ -54,21 +58,21 @@
|
||||
<script type="text/javascript">
|
||||
|
||||
function editButton(firefighterID){
|
||||
$('.btn-info', '#'+firefighterID).css('display', 'none');
|
||||
$('.btn-secondary', '#'+firefighterID).css('display', 'none');
|
||||
$('.btn-warning', '#'+firefighterID).css('display', 'inline');
|
||||
$('.btn-success', '#'+firefighterID).css('display', 'inline');
|
||||
$('.btn-info', '#'+firefighterID).parents("tr").find("td:eq(1)").html('<input type="date" name="dateOfComplete">');
|
||||
$('.btn-info', '#'+firefighterID).parents("tr").find("td:eq(2)").html('<input type="date" name="dateOfExpiry">');
|
||||
$('.btn-secondary', '#'+firefighterID).parents("tr").find("td:eq(1)").html('<input type="date" name="dateOfComplete">');
|
||||
$('.btn-secondary', '#'+firefighterID).parents("tr").find("td:eq(2)").html('<input type="date" name="dateOfExpiry">');
|
||||
}
|
||||
|
||||
|
||||
function cancelButton(firefighterID, dateOfComplete, dateOfExpiry){
|
||||
$('.btn-info', '#'+firefighterID).css('display', 'inline');
|
||||
$('.btn-secondary', '#'+firefighterID).css('display', 'inline');
|
||||
$('.btn-warning', '#'+firefighterID).css('display', 'none');
|
||||
$('.btn-success', '#'+firefighterID).css('display', 'none');
|
||||
|
||||
$('.btn-info', '#'+firefighterID).parents("tr").find("td:eq(1)").html(dateOfComplete);
|
||||
$('.btn-info', '#'+firefighterID).parents("tr").find("td:eq(2)").html(dateOfExpiry);
|
||||
$('.btn-secondary', '#'+firefighterID).parents("tr").find("td:eq(1)").html(dateOfComplete);
|
||||
$('.btn-secondary', '#'+firefighterID).parents("tr").find("td:eq(2)").html(dateOfExpiry);
|
||||
}
|
||||
|
||||
function updateButton(firefighterID, dateOfComplete, dateOfExpiry){
|
||||
@ -89,10 +93,10 @@
|
||||
'dateOfExpiry': $('input[name=dateOfExpiry]').val()
|
||||
},
|
||||
success: function(data) {
|
||||
$('.btn-info', '#'+firefighterID).parents("tr").find("td:eq(1)").html($('input[name=dateOfComplete]').val());
|
||||
$('.btn-info', '#'+firefighterID).parents("tr").find("td:eq(2)").html($('input[name=dateOfExpiry]').val());
|
||||
$('.btn-secondary', '#'+firefighterID).parents("tr").find("td:eq(1)").html($('input[name=dateOfComplete]').val());
|
||||
$('.btn-secondary', '#'+firefighterID).parents("tr").find("td:eq(2)").html($('input[name=dateOfExpiry]').val());
|
||||
|
||||
$('.btn-info', '#'+firefighterID).css('display', 'inline');
|
||||
$('.btn-secondary', '#'+firefighterID).css('display', 'inline');
|
||||
$('.btn-warning', '#'+firefighterID).css('display', 'none');
|
||||
$('.btn-success', '#'+firefighterID).css('display', 'none');
|
||||
console.log('sukces')
|
||||
@ -151,8 +155,13 @@
|
||||
'trainingID': '{{$training->id}}',
|
||||
},
|
||||
success: function(data) {
|
||||
$('.btn-info', '#'+firefighterID).parents("tr").find("td:eq(1)").html('');
|
||||
$('.btn-info', '#'+firefighterID).parents("tr").find("td:eq(2)").html('');
|
||||
$('.btn-secondary', '#'+firefighterID).parents("tr").find("td:eq(1)").html('');
|
||||
$('.btn-secondary', '#'+firefighterID).parents("tr").find("td:eq(2)").html('');
|
||||
$('.btn-secondary', '#'+firefighterID).css('display', 'inline');
|
||||
$('.btn-warning', '#'+firefighterID).css('display', 'none');
|
||||
$('.btn-success', '#'+firefighterID).css('display', 'none');
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ Route::post('/sprzet', 'EquipmentController@store');
|
||||
Route::get('/sprzet/edit/{id}', 'EquipmentController@editForm');
|
||||
Route::post('/sprzet/edit', 'EquipmentController@update');
|
||||
Route::resource('equipment', 'EquipmentController');
|
||||
|
||||
Route::delete('sprzet/{id}', 'EquipmentController@destroy')->name('EquipmentController.destroy');
|
||||
|
||||
Route::get('/szkolenia', 'trainingsController@create');
|
||||
Route::post('/szkolenia', 'trainingsController@store');
|
||||
@ -90,6 +90,7 @@ Route::post('/szkolenia/rename', 'trainingsController@trainingsRename');
|
||||
Route::get('/szkolenia/addTrainingsFireFighters/{id}', 'trainingsController@addTrainingsFireFighters');
|
||||
Route::post('/szkolenia/addTrainingsFireFighters/', 'trainingsController@ajaxRequest');
|
||||
Route::post('/szkolenia/addTrainingsFireFighters/delete', 'trainingsController@deleteFireFighterTrainings');
|
||||
Route::delete('szkolenia/{id}', 'trainingsController@destroy')->name('trainingsController.destroy');
|
||||
Route::resource('trainings', 'trainingsController');
|
||||
|
||||
Route::get('/userprofile', 'userProfileController@create');
|
||||
|
Loading…
Reference in New Issue
Block a user