Merge branch 'master' of https://github.com/sebathefox/skolehjem-webapp
This commit is contained in:
commit
a51517036d
|
@ -82,6 +82,43 @@
|
||||||
<path value="$PROJECT_DIR$/skolehjem/vendor/jaybizzle/crawler-detect" />
|
<path value="$PROJECT_DIR$/skolehjem/vendor/jaybizzle/crawler-detect" />
|
||||||
<path value="$PROJECT_DIR$/skolehjem/vendor/jenssegers/agent" />
|
<path value="$PROJECT_DIR$/skolehjem/vendor/jenssegers/agent" />
|
||||||
<path value="$PROJECT_DIR$/skolehjem/vendor/mobiledetect/mobiledetectlib" />
|
<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>
|
</include_path>
|
||||||
</component>
|
</component>
|
||||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />
|
<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/defuse/php-encryption" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dnoegel/php-xdg-base-dir" />
|
<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/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/doctrine/lexer" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/dragonmantank/cron-expression" />
|
<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/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/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/firebase/php-jwt" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/fruitcake/laravel-cors" />
|
<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/guzzle" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/guzzlehttp/promises" />
|
<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/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/jaybizzle/crawler-detect" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jenssegers/agent" />
|
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/jenssegers/agent" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/laminas/laminas-diactoros" />
|
<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/flysystem" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/league/oauth2-server" />
|
<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/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/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/nesbot/carbon" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/nikic/php-parser" />
|
<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/nyholm/psr7" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/opis/closure" />
|
<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/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/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/phpoption/phpoption" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/phpseclib/phpseclib" />
|
<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/container" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/event-dispatcher" />
|
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/event-dispatcher" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/psr/http-factory" />
|
<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/ralouphie/getallheaders" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/ramsey/collection" />
|
<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/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/spatie/laravel-permission" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/swiftmailer/swiftmailer" />
|
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/swiftmailer/swiftmailer" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/console" />
|
<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" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/symfony/translation-contracts" />
|
<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/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/tijsverkoyen/css-to-inline-styles" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/vlucas/phpdotenv" />
|
<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/voku/portable-ascii" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/skolehjem/vendor/webmozart/assert" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
|
|
@ -6,7 +6,7 @@ APP_URL=http://localhost
|
||||||
|
|
||||||
LOG_CHANNEL=stack
|
LOG_CHANNEL=stack
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
DB_CONNECTION=sqlite
|
||||||
DB_HOST=127.0.0.1
|
DB_HOST=127.0.0.1
|
||||||
DB_PORT=3306
|
DB_PORT=3306
|
||||||
DB_DATABASE=laravel
|
DB_DATABASE=laravel
|
||||||
|
|
|
@ -15,6 +15,6 @@ class Contact extends Model
|
||||||
{
|
{
|
||||||
//protected variable which contains name of database field(s) to be filled.
|
//protected variable which contains name of database field(s) to be filled.
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'name_first', "name_last", 'email', 'phone'
|
'contactname', "title", 'email', 'phone'
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace App\Http\Controllers;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use App\Contact;
|
use App\Contact;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use phpDocumentor\Reflection\Types\Context;
|
use phpDocumentor\Reflection\Types\Context;
|
||||||
|
|
||||||
class ContactController extends Controller
|
class ContactController extends Controller
|
||||||
|
@ -53,8 +54,8 @@ class ContactController extends Controller
|
||||||
public function store(Request $request)
|
public function store(Request $request)
|
||||||
{
|
{
|
||||||
$requestContact = $request->validate([
|
$requestContact = $request->validate([
|
||||||
"name_first" => "required|max:255",
|
"contactname" => "required|max:255",
|
||||||
"name_last" => "required|max:255",
|
"title" => "required|max:255",
|
||||||
"email" => "required|max:255",
|
"email" => "required|max:255",
|
||||||
"phone" => "required|max:255",
|
"phone" => "required|max:255",
|
||||||
]);
|
]);
|
||||||
|
@ -132,4 +133,48 @@ class ContactController extends Controller
|
||||||
$contact->delete();
|
$contact->delete();
|
||||||
return redirect()->route("contacts.index");
|
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 App\User;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|
||||||
class EventController extends Controller
|
class EventController extends Controller
|
||||||
|
@ -135,4 +136,44 @@ class EventController extends Controller
|
||||||
$event->delete();
|
$event->delete();
|
||||||
return redirect()->route("events.index");
|
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 App\MenuPlan;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
|
|
||||||
class MenuPlanController extends Controller
|
class MenuPlanController extends Controller
|
||||||
|
@ -120,7 +121,7 @@ class MenuPlanController extends Controller
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the specified resource from storage.
|
* Remove the specified resource from storage.
|
||||||
*
|
* Test delete return index function.
|
||||||
* @param int $id
|
* @param int $id
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
*/
|
*/
|
||||||
|
@ -130,4 +131,43 @@ class MenuPlanController extends Controller
|
||||||
$menuplan->delete();
|
$menuplan->delete();
|
||||||
return redirect()->route("menu-plans.index");
|
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\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Spatie\Permission\Models\Role;
|
use Spatie\Permission\Models\Role;
|
||||||
|
|
||||||
class rolesController extends Controller
|
class rolesController extends Controller
|
||||||
|
@ -115,4 +116,38 @@ class rolesController extends Controller
|
||||||
$role->delete();
|
$role->delete();
|
||||||
return redirect()->route("roles.index");
|
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 Illuminate\Http\Response;
|
||||||
use App\User;
|
use App\User;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Spatie\Permission\Models\Role;
|
use Spatie\Permission\Models\Role;
|
||||||
|
@ -152,7 +153,7 @@ class UserController extends Controller
|
||||||
// else if(Auth::user()->hasPermissionTo("user.edit")) {
|
// else if(Auth::user()->hasPermissionTo("user.edit")) {
|
||||||
$user = User::find($id);
|
$user = User::find($id);
|
||||||
|
|
||||||
if ($request->roles != null) {
|
if ($request->roles != null) { //You can only edit roles on the admin site, so if there is an input roles, then update user info and edit roles
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user->update($data);
|
$user->update($data);
|
||||||
$user->roles()->detach();
|
$user->roles()->detach();
|
||||||
|
@ -163,20 +164,20 @@ class UserController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
//$user->save();
|
//$user->save();
|
||||||
} else {
|
} else { // Else if you're not on the admin site (user site)
|
||||||
if ($request->input('password') != null) {
|
if ($request->input('password') != null) { // If you're editing the password
|
||||||
if ($request->input('password') != $request->input('confirmpassword')) {
|
if ($request->input('password') != $request->input('confirmpassword')) { // If new password and new password confirm is not the same, go back.
|
||||||
return Response::detect("users.editpass");
|
return Response::detect("users.editpass");
|
||||||
} elseif (!Hash::check($request->input('oldpassword'), $user->password)) {
|
} elseif (!Hash::check($request->input('oldpassword'), $user->password)) { // If the written current password and current password in DB is not the same, go back.
|
||||||
return Response::detect("users.editpass");
|
return Response::detect("users.editpass");
|
||||||
} else {
|
} else { // If new password and current password is the same AND current written and current DB password is the same. Then update and logout.
|
||||||
/** @var User $user */
|
/** @var User $user */
|
||||||
$user->update($data);
|
$user->update($data);
|
||||||
Auth::logout();
|
Auth::logout();
|
||||||
|
|
||||||
return redirect()->route("users.login");
|
return redirect()->route("users.login");
|
||||||
}
|
}
|
||||||
} else {
|
} else { // Else if you're not editing the password but anything else (Email, Phone Number). Then update user.
|
||||||
$user->update($data);
|
$user->update($data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -272,4 +273,60 @@ class UserController extends Controller
|
||||||
{
|
{
|
||||||
return Response::detect("users.editpass");
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,8 +16,8 @@ class CreateContact extends Migration
|
||||||
Schema::create('contacts', function (Blueprint $table) {
|
Schema::create('contacts', function (Blueprint $table) {
|
||||||
$table->id();
|
$table->id();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
$table->string('name_first', 255);
|
$table->string('contactname', 255);
|
||||||
$table->string('name_last', 255);
|
$table->string('title', 255);
|
||||||
$table->string('email', 255);
|
$table->string('email', 255);
|
||||||
$table->integer('phone');
|
$table->integer('phone');
|
||||||
//$table->unique('email');
|
//$table->unique('email');
|
||||||
|
|
|
@ -28,6 +28,7 @@ class UserSeeder extends Seeder
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Log::debug("OPRET");
|
Log::debug("OPRET");
|
||||||
$user = new \App\User();
|
$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": {
|
"js-tokens": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"axios": "^0.19",
|
"axios": "^0.19",
|
||||||
"cross-env": "^7.0",
|
"cross-env": "^7.0",
|
||||||
|
"jquery": "^3.5.1",
|
||||||
"laravel-mix": "^5.0.1",
|
"laravel-mix": "^5.0.1",
|
||||||
"lodash": "^4.17.13",
|
"lodash": "^4.17.13",
|
||||||
"resolve-url-loader": "^2.3.1",
|
"resolve-url-loader": "^2.3.1",
|
||||||
|
|
|
@ -6628,6 +6628,11 @@ main {
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search {
|
||||||
|
margin-bottom: 0;
|
||||||
|
line-height: 2.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
.directorypath {
|
.directorypath {
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
background-color: #333333;
|
background-color: #333333;
|
||||||
|
|
|
@ -47,3 +47,8 @@
|
||||||
height: 1em;
|
height: 1em;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#search {
|
||||||
|
margin-bottom: 0;
|
||||||
|
line-height: 2.3rem;
|
||||||
|
}
|
||||||
|
|
|
@ -13,10 +13,10 @@
|
||||||
<h1>Opret Kontakt:</h1>
|
<h1>Opret Kontakt:</h1>
|
||||||
<form method="post" action="{{ route("contacts.store") }}">
|
<form method="post" action="{{ route("contacts.store") }}">
|
||||||
@csrf
|
@csrf
|
||||||
<label for="name_first">Fornavn:</label>
|
<label for="contactname">Kontakt Navn:</label>
|
||||||
<input type="text" name="name_first" id="name_first" placeholder="Fornavn" required>
|
<input type="text" name="contactname" id="contactname" placeholder="Navn" required>
|
||||||
<label for="name_last">Efternavn:</label>
|
<label for="title">Titel:</label>
|
||||||
<input type="text" name="name_last" id="name_last" placeholder="Efternavn" required>
|
<input type="text" name="title" id="title" placeholder="Titel" required>
|
||||||
<label for="email">Email:</label>
|
<label for="email">Email:</label>
|
||||||
<input type="email" name="email" id="email" placeholder="x@y.z" required>
|
<input type="email" name="email" id="email" placeholder="x@y.z" required>
|
||||||
<label for="tel">Telefon nr:</label>
|
<label for="tel">Telefon nr:</label>
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
<form method="post" action="{{ route("contacts.update", ['contact' => $contact]) }}">
|
<form method="post" action="{{ route("contacts.update", ['contact' => $contact]) }}">
|
||||||
@csrf
|
@csrf
|
||||||
@method("put")
|
@method("put")
|
||||||
<label for="name_first">Fornavn:</label>
|
<label for="contactname">Kontakt Navn:</label>
|
||||||
<input type="text" name="name_first" id="name_first" placeholder="Fornavn" value="{{ $contact->name_first }}" required>
|
<input type="text" name="contactname" id="contactname" placeholder="Navn" value="{{ $contact->contactname }}" required>
|
||||||
<label for="name_last">Efternavn:</label>
|
<label for="title">Titel:</label>
|
||||||
<input type="text" name="name_last" id="name_last" placeholder="Efternavn" value="{{ $contact->name_last }}" required>
|
<input type="text" name="title" id="title" placeholder="Titel" value="{{ $contact->title }}" required>
|
||||||
<label for="email">Email:</label>
|
<label for="email">Email:</label>
|
||||||
<input type="email" name="email" id="email" placeholder="x@y.z" value="{{ $contact->email }}" required>
|
<input type="email" name="email" id="email" placeholder="x@y.z" value="{{ $contact->email }}" required>
|
||||||
<label for="tel">Telefon nr:</label>
|
<label for="tel">Telefon nr:</label>
|
||||||
|
|
|
@ -10,8 +10,16 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@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">
|
<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>
|
<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>
|
</div>
|
||||||
<table class="tbl mt-2">
|
<table class="tbl mt-2">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -24,8 +32,8 @@
|
||||||
</tr>
|
</tr>
|
||||||
@foreach($contacts as $contact)
|
@foreach($contacts as $contact)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $contact->name_first }}</td>
|
<td>{{ $contact->contactname }}</td>
|
||||||
<td>{{ $contact->name_last }}</td>
|
<td>{{ $contact->title }}</td>
|
||||||
<td>{{ $contact->email }}</td>
|
<td>{{ $contact->email }}</td>
|
||||||
<td>{{ $contact->phone }}</td>
|
<td>{{ $contact->phone }}</td>
|
||||||
<td><a href="{{ route("contacts.edit", [ "contact" => $contact ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
<td><a href="{{ route("contacts.edit", [ "contact" => $contact ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||||
|
@ -39,4 +47,24 @@
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</table>
|
</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
|
@endsection
|
||||||
|
|
|
@ -10,8 +10,15 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@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">
|
<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>
|
<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>
|
</div>
|
||||||
<table class="tbl mt-2">
|
<table class="tbl mt-2">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -40,4 +47,24 @@
|
||||||
|
|
||||||
|
|
||||||
{{ $events->links() }}
|
{{ $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
|
@endsection
|
||||||
|
|
|
@ -10,8 +10,15 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@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">
|
<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>
|
<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>
|
</div>
|
||||||
<table class="tbl mt-2">
|
<table class="tbl mt-2">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -43,4 +50,24 @@
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{{ $menuPlans->links() }}
|
{{ $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
|
@endsection
|
||||||
|
|
|
@ -10,8 +10,16 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@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">
|
<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>
|
<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>
|
</div>
|
||||||
<table class="tbl mt-2">
|
<table class="tbl mt-2">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -35,4 +43,26 @@
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</table>
|
</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
|
@endsection
|
||||||
|
|
|
@ -20,19 +20,34 @@
|
||||||
<input type="text" name="name_last" id="name_last" value="{{ $user->name_last }}" required>
|
<input type="text" name="name_last" id="name_last" value="{{ $user->name_last }}" required>
|
||||||
<label for="email">Email:</label>
|
<label for="email">Email:</label>
|
||||||
<input type="email" name="email" id="email" value="{{ $user->email }}" required>
|
<input type="email" name="email" id="email" value="{{ $user->email }}" required>
|
||||||
<label for="password1">Password:</label>
|
<label for="password1">Password: (Forblives blank, hvis password ikke skal ændres)</label>
|
||||||
<input type="password" name="password" id="password1" value="" required>
|
<input type="password" name="password" id="password1" value="">
|
||||||
<label for="password2">Confirm Password:</label>
|
<label for="password2">Confirm Password: (Forblives blank, hvis password ikke skal ændres)</label>
|
||||||
<input type="password" id="password2" value="" required>
|
<input type="password" id="password2" value="">
|
||||||
<label for="tel">Telefon nr:</label>
|
<label for="tel">Telefon nr:</label>
|
||||||
<input type="tel" name="phone" id="tel" value="{{ $user->phone }}" required>
|
<input type="tel" name="phone" id="tel" value="{{ $user->phone }}" required>
|
||||||
<label for="role">Rolle:</label>
|
<label for="role">Rolle: (Brug ctrl og shift til at vælge flere)</label>
|
||||||
<select name="roles[]" id="roles" class="mb-2" multiple="multiple" required>
|
<select name="roles[]" id="roles" class="mb-2" multiple="multiple" required>
|
||||||
<option disabled selected value> -- Vælg Rolle(r) -- </option>
|
@if(count($user->roles) == 0)
|
||||||
|
<option disabled selected> -- Vælg Rolle(r) -- </option>
|
||||||
<option value>Ingen Rolle</option>
|
<option value>Ingen Rolle</option>
|
||||||
@foreach($roles as $role)
|
@foreach($roles as $role)
|
||||||
<option value="{{ $role->name }}">{{ $role->name }}</option>
|
<option value="{{ $role->name }}">{{ $role->name }}</option>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
@else
|
||||||
|
<option disabled> -- Vælg Rolle(r) -- </option>
|
||||||
|
<option value>Ingen Rolle</option>
|
||||||
|
@foreach($roles as $role)
|
||||||
|
{{ $selected = "" }}
|
||||||
|
@foreach($user->roles as $userRole)
|
||||||
|
@if($userRole->id == $role->id)
|
||||||
|
{{ $selected = "selected" }}
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
<option {{ $selected }} value="{{ $role->name }}">{{ $role->name }}</option>
|
||||||
|
@endforeach
|
||||||
|
@endif
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -10,8 +10,17 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@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">
|
<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>
|
<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>
|
</div>
|
||||||
<table class="tbl mt-2">
|
<table class="tbl mt-2">
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -30,6 +39,7 @@
|
||||||
<td>{{ $user->email }}</td>
|
<td>{{ $user->email }}</td>
|
||||||
<td>{{ $user->phone }}</td>
|
<td>{{ $user->phone }}</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
@for($i = 0; $i < count($user->roles); $i++)
|
@for($i = 0; $i < count($user->roles); $i++)
|
||||||
@if(count($user->roles)-1 != $i)
|
@if(count($user->roles)-1 != $i)
|
||||||
{{$user->roles[$i]->name}},
|
{{$user->roles[$i]->name}},
|
||||||
|
@ -49,6 +59,27 @@
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
{{ $users->links() }}
|
{{ $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
|
@endsection
|
||||||
|
|
|
@ -12,6 +12,12 @@
|
||||||
@section("content")
|
@section("content")
|
||||||
<div class="row align-items-center">
|
<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>
|
<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>
|
</div>
|
||||||
<table class="tbl mt-2">
|
<table class="tbl mt-2">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -30,6 +30,13 @@ Route::get("/account/edit", "UserController@accountedit")->name("users.accounted
|
||||||
Route::get("/account/editpass", "UserController@accounteditpass")->name("users.accounteditpass");
|
Route::get("/account/editpass", "UserController@accounteditpass")->name("users.accounteditpass");
|
||||||
Route::post("/account/update", "UserController@update")->name("users.accountupdate");
|
Route::post("/account/update", "UserController@update")->name("users.accountupdate");
|
||||||
Route::get("phones", "PhoneController@index")->name("phones.index");
|
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");
|
Route::resource("contacts", "ContactController");
|
||||||
|
|
Loading…
Reference in New Issue