commit
1169aedeea
|
@ -82,6 +82,43 @@
|
|||
<path value="$PROJECT_DIR$/skolehjem/vendor/jaybizzle/crawler-detect" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/jenssegers/agent" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/mobiledetect/mobiledetectlib" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/scrivo/highlight.php" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/filp/whoops" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/facade/ignition-contracts" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/facade/flare-client-php" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/mockery/mockery" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/theseer/tokenizer" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/webmozart/assert" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/fzaninotto/faker" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/facade/ignition" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-timer" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-code-coverage" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-file-iterator" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-text-template" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/php-token-stream" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/version" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/hamcrest/hamcrest-php" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/environment" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/comparator" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/diff" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/type" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/global-state" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/object-enumerator" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/object-reflector" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/recursion-context" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/resource-operations" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/sebastian/exporter" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/nunomaduro/collision" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/doctrine/instantiator" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpdocumentor/reflection-common" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpdocumentor/reflection-docblock" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpdocumentor/type-resolver" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phar-io/version" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpspec/prophecy" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phpunit/phpunit" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/myclabs/deep-copy" />
|
||||
<path value="$PROJECT_DIR$/skolehjem/vendor/phar-io/manifest" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />
|
||||
|
|
|
@ -12,15 +12,22 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/defuse/php-encryption" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dnoegel/php-xdg-base-dir" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/inflector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/instantiator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/doctrine/lexer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dragonmantank/cron-expression" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/egulias/email-validator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/facade/flare-client-php" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/facade/ignition" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/facade/ignition-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/fideloper/proxy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/filp/whoops" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/firebase/php-jwt" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/fruitcake/laravel-cors" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/fzaninotto/faker" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/guzzlehttp/guzzle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/guzzlehttp/promises" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/guzzlehttp/psr7" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/hamcrest/hamcrest-php" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jaybizzle/crawler-detect" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jenssegers/agent" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laminas/laminas-diactoros" />
|
||||
|
@ -35,15 +42,30 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/flysystem" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/oauth2-server" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/mobiledetect/mobiledetectlib" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/mockery/mockery" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/monolog/monolog" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/myclabs/deep-copy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/nesbot/carbon" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/nikic/php-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/nunomaduro/collision" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/nyholm/psr7" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/opis/closure" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/paragonie/random_compat" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phar-io/manifest" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phar-io/version" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/php-http/message-factory" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/reflection-common" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/reflection-docblock" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpdocumentor/type-resolver" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpoption/phpoption" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpseclib/phpseclib" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpspec/prophecy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpunit/php-code-coverage" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpunit/php-file-iterator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpunit/php-text-template" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpunit/php-timer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpunit/php-token-stream" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpunit/phpunit" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/container" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/event-dispatcher" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/http-factory" />
|
||||
|
@ -54,6 +76,19 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ralouphie/getallheaders" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ramsey/collection" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ramsey/uuid" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/scrivo/highlight.php" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/comparator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/diff" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/environment" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/exporter" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/global-state" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/object-enumerator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/object-reflector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/recursion-context" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/resource-operations" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/type" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/sebastian/version" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/spatie/laravel-permission" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/swiftmailer/swiftmailer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/console" />
|
||||
|
@ -83,9 +118,11 @@
|
|||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/translation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/translation-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/var-dumper" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/theseer/tokenizer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/tijsverkoyen/css-to-inline-styles" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/vlucas/phpdotenv" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/voku/portable-ascii" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/webmozart/assert" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
|
|
@ -6,7 +6,7 @@ APP_URL=http://localhost
|
|||
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_CONNECTION=sqlite
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=laravel
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use App\Contact;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use phpDocumentor\Reflection\Types\Context;
|
||||
//hello
|
||||
class ContactController extends Controller
|
||||
|
@ -132,4 +133,48 @@ class ContactController extends Controller
|
|||
$contact->delete();
|
||||
return redirect()->route("contacts.index");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function search(Request $request){
|
||||
if($request->ajax()){
|
||||
$output = "<tr>".
|
||||
"<th>Kontakt Navn</th>".
|
||||
"<th>Titel</th>".
|
||||
"<th>E-mail</th>".
|
||||
"<th>Tlf</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>";
|
||||
$users = DB::table('contacts')->where('name_first', 'LIKE',$request->search.'%')
|
||||
->orWhere('name_last','LIKE', $request->search.'%')
|
||||
->orWhere('phone','LIKE', $request->search.'%')
|
||||
->orWhere('email','LIKE',$request->search. '%')->get();
|
||||
|
||||
if(count($users) !== 0){
|
||||
foreach ($users as $key => $user){
|
||||
$output.='<tr>'.
|
||||
'<td>' . $user->name_first . '</td>'.
|
||||
'<td>' . $user->name_last . '</td>'.
|
||||
'<td>' . $user->email . '</td>'.
|
||||
'<td>' . $user->phone .'</td>'.
|
||||
'<td><a href="'. route("contacts.edit", [ "contact" => $user->id ]) . '"><img class="w-100" src="'. asset('/images/icons/pencil-dark.svg') . '" alt="Update"></a></td>'.
|
||||
'<td><form method="post" action="' .route("contacts.destroy", [ "contact" => $user->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>';
|
||||
}
|
||||
}
|
||||
return Response($output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ use App\Event;
|
|||
use App\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
||||
class EventController extends Controller
|
||||
|
@ -135,4 +136,44 @@ class EventController extends Controller
|
|||
$event->delete();
|
||||
return redirect()->route("events.index");
|
||||
}
|
||||
|
||||
|
||||
public function search(Request $request){
|
||||
if($request->ajax()){
|
||||
$output = "<tr>".
|
||||
"<th>Event Navn</th>".
|
||||
"<th>Event Beskrivelse</th>".
|
||||
"<th>Event Dato</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>";
|
||||
$events = DB::table('events')->where('name', 'LIKE',$request->search.'%')
|
||||
->orWhere('date','LIKE', $request->search.'%')
|
||||
->get();
|
||||
|
||||
if(count($events) !== 0){
|
||||
foreach ($events as $key => $event){
|
||||
$output.='<tr>'.
|
||||
'<td>' . $event->name . '</td>'.
|
||||
'<td>' . $event->description .'</td>'.
|
||||
'<td>' . $event->date .'</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>';
|
||||
}
|
||||
}
|
||||
return Response($output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ use App\ExternalLink;
|
|||
use App\MenuPlan;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
|
||||
class MenuPlanController extends Controller
|
||||
|
@ -120,7 +121,7 @@ class MenuPlanController extends Controller
|
|||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* Test delete return index function.
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
|
@ -130,4 +131,43 @@ class MenuPlanController extends Controller
|
|||
$menuplan->delete();
|
||||
return redirect()->route("menu-plans.index");
|
||||
}
|
||||
|
||||
|
||||
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>';
|
||||
}
|
||||
}
|
||||
return Response($output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers;
|
|||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
||||
class rolesController extends Controller
|
||||
|
@ -115,4 +116,38 @@ class rolesController extends Controller
|
|||
$role->delete();
|
||||
return redirect()->route("roles.index");
|
||||
}
|
||||
|
||||
|
||||
public function search(Request $request){
|
||||
if($request->ajax()){
|
||||
$output = "<tr>".
|
||||
"<th>Navn</th>".
|
||||
"<th>Beskrivelse</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>";
|
||||
$roles = DB::table('roles')->where('name', 'LIKE',$request->search.'%')->get();
|
||||
|
||||
if(count($roles) !== 0){
|
||||
foreach ($roles as $key => $role){
|
||||
$output.='<tr>'.
|
||||
'<td>' . $role->name . '</td>'.
|
||||
'<td>' . $role->description . '</td>'.
|
||||
'<td><a href="'. route("roles.edit", [ "role" => $role->id ]) . '"><img class="w-100" src="'. asset('/images/icons/pencil-dark.svg') . '" alt="Update"></a></td>'.
|
||||
'<td><form method="post" action="' .route("roles.destroy", [ "role" => $role->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>';
|
||||
}
|
||||
}
|
||||
return Response($output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@ use Illuminate\Http\Request;
|
|||
use Illuminate\Http\Response;
|
||||
use App\User;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Spatie\Permission\Models\Role;
|
||||
|
@ -272,4 +273,60 @@ class UserController extends Controller
|
|||
{
|
||||
return Response::detect("users.editpass");
|
||||
}
|
||||
|
||||
|
||||
public function search(Request $request){
|
||||
if($request->ajax()){
|
||||
$output = "<tr>".
|
||||
"<th>Fornavn</th>".
|
||||
"<th>Efternavn</th>".
|
||||
"<th>Email</th>".
|
||||
"<th>Tlf nr</th>".
|
||||
"<th>Rolle(r)</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>";
|
||||
$users = DB::table('users')->where('name_first', 'LIKE',$request->search.'%')
|
||||
->orWhere('name_last','LIKE', $request->search.'%')
|
||||
->orWhere('phone','LIKE', $request->search.'%')
|
||||
->orWhere('email','LIKE',$request->search. '%')->get();
|
||||
|
||||
if(count($users) !== 0){
|
||||
foreach ($users as $key => $user){
|
||||
$roles = null;
|
||||
$rolesString = null;
|
||||
|
||||
foreach (User::all() as $usr) {
|
||||
if($usr->id == $user->id)
|
||||
$roles = $usr->roles;
|
||||
}
|
||||
|
||||
for($i = 0; $i < count($roles); $i++) {
|
||||
if(count($roles)-1 != $i) {
|
||||
$rolesString .= $roles[$i]->name.",";
|
||||
}else {
|
||||
$rolesString = $roles[$i]->name;
|
||||
}
|
||||
}
|
||||
|
||||
$output.='<tr>'.
|
||||
'<td>' . $user->name_first . '</td>'.
|
||||
'<td>' . $user->name_last . '</td>'.
|
||||
'<td>' . $user->email . '</td>'.
|
||||
'<td>' . $user->phone .'</td>'.
|
||||
'<td>' . $rolesString .'</td>'.
|
||||
'<td><a href="'. route("users.edit", [ "user" => $user->id ]) . '"><img class="w-100" src="'. asset('/images/icons/pencil-dark.svg') . '" alt="Update"></a></td>'.
|
||||
'<td><form method="post" action="' .route("users.destroy", [ "user" => $user->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>';
|
||||
}
|
||||
}
|
||||
return Response($output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ class UserSeeder extends Seeder
|
|||
}*/
|
||||
|
||||
|
||||
|
||||
Log::debug("OPRET");
|
||||
$user = new \App\User();
|
||||
|
||||
|
|
|
@ -5070,6 +5070,12 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"jquery": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
|
||||
"integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg==",
|
||||
"dev": true
|
||||
},
|
||||
"js-tokens": {
|
||||
"version": "4.0.0",
|
||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
"devDependencies": {
|
||||
"axios": "^0.19",
|
||||
"cross-env": "^7.0",
|
||||
"jquery": "^3.5.1",
|
||||
"laravel-mix": "^5.0.1",
|
||||
"lodash": "^4.17.13",
|
||||
"resolve-url-loader": "^2.3.1",
|
||||
|
|
|
@ -6628,6 +6628,11 @@ main {
|
|||
margin-right: 4px;
|
||||
}
|
||||
|
||||
#search {
|
||||
margin-bottom: 0;
|
||||
line-height: 2.3rem;
|
||||
}
|
||||
|
||||
.directorypath {
|
||||
border-radius: 2px;
|
||||
background-color: #333333;
|
||||
|
|
|
@ -47,3 +47,8 @@
|
|||
height: 1em;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
#search {
|
||||
margin-bottom: 0;
|
||||
line-height: 2.3rem;
|
||||
}
|
||||
|
|
|
@ -10,8 +10,16 @@
|
|||
@endsection
|
||||
|
||||
@section("content")
|
||||
<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('contacts.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Kontakt</a>
|
||||
|
||||
<form method="post" action="{{ route("users.store") }}">
|
||||
@csrf
|
||||
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg på Navn, Email, Telefon"></input>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
|
@ -39,4 +47,24 @@
|
|||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
<script>
|
||||
$('#search').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('contacts.search')}}',
|
||||
data: {'search':$value},
|
||||
success:function (data) {
|
||||
$('tbody').html(data);
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
|
|
@ -10,8 +10,15 @@
|
|||
@endsection
|
||||
|
||||
@section("content")
|
||||
<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('events.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Event</a>
|
||||
|
||||
<form method="post" action="{{ route("events.store") }}">
|
||||
@csrf
|
||||
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg på Evt Navn, Evt Dato"></input>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
|
@ -40,4 +47,24 @@
|
|||
|
||||
|
||||
{{ $events->links() }}
|
||||
|
||||
|
||||
<script>
|
||||
$('#search').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('events.search')}}',
|
||||
data: {'search':$value},
|
||||
success:function (data) {
|
||||
$('tbody').html(data);
|
||||
console.log(data);
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
|
|
|
@ -10,8 +10,15 @@
|
|||
@endsection
|
||||
|
||||
@section("content")
|
||||
<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>
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
|
@ -43,4 +50,24 @@
|
|||
</table>
|
||||
|
||||
{{ $menuPlans->links() }}
|
||||
|
||||
|
||||
<script>
|
||||
$('#search').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('menu-plans.search')}}',
|
||||
data: {'search':$value},
|
||||
success:function (data) {
|
||||
$('tbody').html(data);
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
@endsection
|
||||
|
|
|
@ -10,8 +10,16 @@
|
|||
@endsection
|
||||
|
||||
@section("content")
|
||||
<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('roles.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Rolle</a>
|
||||
|
||||
<form method="post" action="{{ route("roles.store") }}">
|
||||
@csrf
|
||||
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg efter navn"></input>
|
||||
</form>
|
||||
|
||||
|
||||
</div>
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
|
@ -35,4 +43,26 @@
|
|||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
|
||||
<script>
|
||||
$('#search').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('roles.search')}}',
|
||||
data: {'search':$value},
|
||||
success:function (data) {
|
||||
$('tbody').html(data);
|
||||
console.log(data);
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
|
|
@ -10,8 +10,17 @@
|
|||
@endsection
|
||||
|
||||
@section("content")
|
||||
<div class="row align-items-center">
|
||||
<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('users.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Bruger</a>
|
||||
|
||||
<form method="post" action="{{ route("users.store") }}">
|
||||
@csrf
|
||||
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg efter navn"></input>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
|
@ -30,6 +39,7 @@
|
|||
<td>{{ $user->email }}</td>
|
||||
<td>{{ $user->phone }}</td>
|
||||
<td>
|
||||
|
||||
@for($i = 0; $i < count($user->roles); $i++)
|
||||
@if(count($user->roles)-1 != $i)
|
||||
{{$user->roles[$i]->name}},
|
||||
|
@ -49,6 +59,27 @@
|
|||
</tr>
|
||||
@endforeach
|
||||
</table>
|
||||
|
||||
{{ $users->links() }}
|
||||
|
||||
|
||||
<script>
|
||||
$('#search').on('keyup', function () {
|
||||
$value = $(this).val();
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: '{{route('users.search')}}',
|
||||
data: {'search':$value},
|
||||
success:function (data) {
|
||||
$('tbody').html(data);
|
||||
console.log(data);
|
||||
},
|
||||
error:function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
@endsection
|
||||
|
|
|
@ -12,6 +12,12 @@
|
|||
@section("content")
|
||||
<div class="row align-items-center">
|
||||
<a class="btn btn-inline btn-sde-blue mb-0" href="{{ route('washing-reservations.create') }}"><img src="{{ asset('/images/icons/plus.svg') }}" alt="Create">Opret Reservation</a>
|
||||
|
||||
<form method="post" action="{{ route("users.store") }}">
|
||||
@csrf
|
||||
<input type="text" class="form-controller" id="search" name="search" placeholder="Søg på Navn, Telefon"></input>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
<table class="tbl mt-2">
|
||||
<tr>
|
||||
|
|
|
@ -30,6 +30,13 @@ Route::get("/account/edit", "UserController@accountedit")->name("users.accounted
|
|||
Route::get("/account/editpass", "UserController@accounteditpass")->name("users.accounteditpass");
|
||||
Route::post("/account/update", "UserController@update")->name("users.accountupdate");
|
||||
Route::get("phones", "PhoneController@index")->name("phones.index");
|
||||
Route::get("/contactsapi", "ContactController@search")->name("contacts.search");
|
||||
Route::get("/eventsapi", "EventController@search")->name("events.search");
|
||||
Route::get("/menuplansapi", "MenuPlanController@search")->name("menu-plans.search");
|
||||
Route::get("/rolesapi", "RolesController@search")->name("roles.search");
|
||||
Route::get("/userapi", "UserController@search")->name("users.search");
|
||||
|
||||
|
||||
|
||||
|
||||
Route::resource("contacts", "ContactController");
|
||||
|
|
Loading…
Reference in New Issue