This commit is contained in:
frederikpyt 2020-08-10 11:47:07 +02:00
commit 6cabc6250c
3 changed files with 3 additions and 55 deletions

View File

@ -221,7 +221,7 @@ class EventController extends Controller
if($request->ajax()){
$output = "<tr>".
"<th>Event Navn</th>".
"<th>Event Beskrivelse</th>".
"<th>Event Ansvarlig</th>".
"<th>Event Dato</th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/eye.svg\" alt=\"Update\"></th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
@ -235,8 +235,8 @@ class EventController extends Controller
foreach ($events as $key => $event){
$output.='<tr>'.
'<td>' . $event->name . '</td>'.
'<td>' . $event->description .'</td>'.
'<td>' . $event->date .'</td>'.
'<td>' . $event->accountable .'</td>'.
'<td>' . \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($event->date))->format('d/m/Y \k\l\. H:i') .'</td>'.
'<td><a href="'. route("events.signups", [ "event" => $event->id ]).'"><img class="w-100" src="'. asset('/images/icons/eye-dark.svg') .'" alt="Update"></a></td>'.
'<td><a href="'. route("events.edit", [ "event" => $event->id ]) . '"><img class="w-100" src="'. asset('/images/icons/pencil-dark.svg') . '" alt="Update"></a></td>'.
'<td><form method="post" action="' .route("events.destroy", [ "event" => $event->id ]). '" class="w-100 nostyle">'.

View File

@ -162,51 +162,4 @@ class MenuPlanController extends Controller
}
public function search(Request $request){
if($request->ajax()){
$output = "<tr>".
"<th>Uge</th>".
"<th>Mandag</th>".
"<th>Tirsdag</th>".
"<th>Onsdag</th>".
"<th>Torsdag</th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/pencil.svg\" alt=\"Update\"></th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=\"http://127.0.0.1:8000/images/icons/trashcan.svg\" alt=\"Delete\"></th>".
"</tr>";
$menuplans = DB::table('menu_plans')->where('week', 'LIKE',$request->search.'%')->get();
if(count($menuplans) !== 0){
foreach ($menuplans as $key => $menuplan){
$output.='<tr>'.
'<td>' . $menuplan->week . '</td>'.
'<td>' . $menuplan->monday . '</td>'.
'<td>' . $menuplan->tuesday . '</td>'.
'<td>' . $menuplan->wednesday .'</td>'.
'<td>' . $menuplan->thursday .'</td>'.
'<td><a href="'. route("menu-plans.edit", [ "menu_plan" => $menuplan->id ]) . '"><img class="w-100" src="'. asset('/images/icons/pencil-dark.svg') . '" alt="Update"></a></td>'.
'<td><form method="post" action="' .route("menu-plans.destroy", [ "menu_plan" => $menuplan->id ]). '" class="w-100 nostyle">'.
csrf_field().
method_field("delete").
'<button class="w-100 nostyle" onclick="return confirm(\'Are you sure you want to delete?\');" type="submit"><img class="w-100 cursor-pointer" src="'. asset('/images/icons/trashcan-dark.svg') . '" alt="Delete"></button>'.
'</form>'.
'</td>'.
'</tr>';
}
}else{
$output.='<tr>'.
'<td>Intet match</td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'<td></td>'.
'</tr>';
}
return Response($output);
}
}
}

View File

@ -13,11 +13,6 @@
<script src="http://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
<div class="row align-items-center">
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('menu-plans.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Menuplan</a>
<form method="post" action="{{ route("menu-plans.store") }}">
@csrf
<input type="number" class="form-controller" id="search" name="search" pattern="[0-9]{2}" placeholder="Søg efter ugenummer"></input>
</form>
</div>
{!! session()->get('WeekExists') !!}