v0.10.11a - Made hide filter, filter washing machine search semi done, and texts fixs
This commit is contained in:
@@ -250,6 +250,7 @@ class EventController extends Controller
|
||||
"</tr>";
|
||||
$events = DB::table('events')->orderBY('date' , 'asc')->where('name', 'LIKE',$request->search.'%')
|
||||
->orWhere('date','LIKE', $request->search.'%')
|
||||
->orWhere('accountable','LIKE', $request->search.'%')
|
||||
->get();//Job is here dude :9
|
||||
|
||||
if(count($events) !== 0){
|
||||
|
||||
@@ -163,4 +163,54 @@ class LocationController extends Controller
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function search(Request $request){
|
||||
if($request->ajax()){
|
||||
$output = "<tr>".
|
||||
"<th>Navn</th>".
|
||||
"<th>Lokation</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>";
|
||||
|
||||
if($request) {
|
||||
$locations = Location::query()->orderBy('created_at', 'desc')->where('name', '=', $request->option)->get();
|
||||
//$machines = WashingMachine::query()->where('created_at', '=', $locations->created_at)->get();
|
||||
}
|
||||
elseif($request->option == "all"){
|
||||
$locations = Location::all();
|
||||
}
|
||||
|
||||
|
||||
if(count($locations) !== 0){
|
||||
foreach ($locations as $key => $location){
|
||||
$output.='<tr>'.
|
||||
//'<td>' . $location->name . '</td>'.
|
||||
'<td><p>Test data</p></td>'.
|
||||
'<td>' . $location->name . '</td>'.
|
||||
'<td><form method="post" action="' .route("locations.destroy", [ "location" => $location ]). '" class="w-100 nostyle">'.
|
||||
'<td><form method="post" action="' .route("locations.edit", [ "location" => $location ]). '" 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>Det er ikke blivet oprettet nogen vaskmaskine på denne lokation i nu</td>'.
|
||||
'<td></td>'.
|
||||
'<td></td>'.
|
||||
'<td></td>'.
|
||||
'</tr>';
|
||||
}
|
||||
return Response($output);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user