v1.3.1 - Removed search functions

This commit is contained in:
frederikpyt
2020-09-18 10:30:44 +02:00
parent 9096f64569
commit 7b99cd7f4e
6 changed files with 1 additions and 444 deletions
@@ -245,56 +245,6 @@ class EventController extends Controller
}
}
public function search(Request $request){
if($request->ajax()){
$output = "<tr>".
"<th>Aktivitet Navn</th>".
"<th>Aktivitet Ansvarlig</th>".
"<th>Aktivitet Dato</th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=".asset('/images/icons/eye.svg')." alt=\"see\"></th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=".asset('/images/icons/pencil.svg')." alt=\"Update\"></th>".
"<th style=\"width: 1em;\"><img class=\"w-100\" src=".asset('/images/icons/trashcan.svg')." alt=\"Delete\"></th>".
"</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){
foreach ($events as $event){
if(date('Y-m-d H:i', strtotime('-1 day')) < date('Y-m-d H:i', strtotime($event->date))) {
$output .= '<tr>' .
'<td>' . $event->name . '</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">' .
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>'.
'</tr>';
}
return Response($output);
}
}
public function closetags($html) {
preg_match_all('#<(?!meta|img|br|hr|input\b)\b([a-z]+)(?: .*)?(?<![/|/ ])>#iU', $html, $result);
$openedtags = $result[1];