Merge branch 'master' of https://github.com/sebathefox/skolehjem-webapp
This commit is contained in:
commit
a98b259b9b
|
@ -0,0 +1,10 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Contact extends Model
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
|
@ -0,0 +1,84 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class ContactController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for creating a new resource.
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function create()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function show($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Show the form for editing the specified resource.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function edit($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Http\Request $request
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*
|
||||||
|
* @param int $id
|
||||||
|
* @return \Illuminate\Http\Response
|
||||||
|
*/
|
||||||
|
public function destroy($id)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
|
@ -133,14 +133,16 @@ class UserController extends Controller
|
||||||
|
|
||||||
$user->save();
|
$user->save();
|
||||||
}
|
}
|
||||||
else if(Auth::user()->hasPermissionTo("user.edit")) {
|
|
||||||
$user = User::find($id);
|
|
||||||
|
|
||||||
/** @var User $user */
|
//TODO: Implement when security's ready!!!
|
||||||
$user->update($data);
|
// else if(Auth::user()->hasPermissionTo("user.edit")) {
|
||||||
|
// $user = User::find($id);
|
||||||
$user->save();
|
//
|
||||||
}
|
// /** @var User $user */
|
||||||
|
// $user->update($data);
|
||||||
|
//
|
||||||
|
// $user->save();
|
||||||
|
// }
|
||||||
|
|
||||||
return Response::detect("users.edit", [
|
return Response::detect("users.edit", [
|
||||||
"user" => $user
|
"user" => $user
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateContact extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('contact', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('contact');
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,19 +15,19 @@
|
||||||
@csrf
|
@csrf
|
||||||
@method("PUT")
|
@method("PUT")
|
||||||
<label for="mandag">Mandag:</label>
|
<label for="mandag">Mandag:</label>
|
||||||
<input type="text" name="mandag" id="mandag" value="{{ $menuplan->monday }}" required>
|
<input type="text" name="monday" id="mandag" value="{{ $menuplan->monday }}" required>
|
||||||
<label for="tirsdag">Tirsdag:</label>
|
<label for="tirsdag">Tirsdag:</label>
|
||||||
<input type="text" name="tirsdag" id="tirsdag" value="{{ $menuplan->tuesday }}" required>
|
<input type="text" name="tuesday" id="tirsdag" value="{{ $menuplan->tuesday }}" required>
|
||||||
<label for="onsdag">Onsdag:</label>
|
<label for="onsdag">Onsdag:</label>
|
||||||
<input type="text" name="onsdag" id="onsdag" value="{{ $menuplan->wednesday }}" required>
|
<input type="text" name="wednesday" id="onsdag" value="{{ $menuplan->wednesday }}" required>
|
||||||
<label for="torsdag">Torsdag:</label>
|
<label for="torsdag">Torsdag:</label>
|
||||||
<input type="text" name="torsdag" id="torsdag" value="{{ $menuplan->thursday }}" required>
|
<input type="text" name="thursday" id="torsdag" value="{{ $menuplan->thursday }}" required>
|
||||||
<label for="fredag">Fredag:</label>
|
<label for="fredag">Fredag:</label>
|
||||||
<input type="text" name="fredag" id="fredag" value="{{ $menuplan->friday }}" required>
|
<input type="text" name="friday" id="fredag" value="{{ $menuplan->friday }}" required>
|
||||||
<label for="lørdag">Lørdag:</label>
|
<label for="lørdag">Lørdag:</label>
|
||||||
<input type="text" name="lørdag" id="lørdag" value="{{ $menuplan->saturday }}" required>
|
<input type="text" name="saturday" id="lørdag" value="{{ $menuplan->saturday }}" required>
|
||||||
<label for="søndag">Søndag:</label>
|
<label for="søndag">Søndag:</label>
|
||||||
<input type="text" name="søndag" id="søndag" value="{{ $menuplan->sunday }}" required>
|
<input type="text" name="sunday" id="søndag" value="{{ $menuplan->sunday }}" required>
|
||||||
|
|
||||||
<input type="submit" class="btn btn-dark text-white" value="Opret Menuplan">
|
<input type="submit" class="btn btn-dark text-white" value="Opret Menuplan">
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -31,8 +31,15 @@
|
||||||
<td>{{$menuplan->friday}}</td>
|
<td>{{$menuplan->friday}}</td>
|
||||||
<td>{{$menuplan->saturday}}</td>
|
<td>{{$menuplan->saturday}}</td>
|
||||||
<td>{{$menuplan->sunday}}</td>
|
<td>{{$menuplan->sunday}}</td>
|
||||||
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
<td><a href="{{ route("menu-plans.edit", [ "menu_plan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
|
||||||
<td><a href="{{ route("menu-plans.destroy", [ "menu_plan" => $menuplan ]) }}"><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td>
|
<td>
|
||||||
|
<form method="post" action="{{ route("menu-plans.destroy", [ "menu_plan" => $menuplan ]) }}" class="w-100">
|
||||||
|
@csrf
|
||||||
|
@method("delete")
|
||||||
|
|
||||||
|
<button class="w-100" type="submit"><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></button>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -6,25 +6,26 @@
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("path")
|
@section("path")
|
||||||
<a href="{{ route('users.edit', ['id' => $user->id]) }}" class="text-white">Rediger Bruger</a> /
|
<a href="{{ route('users.edit', ['id' => $user]) }}" class="text-white">Rediger Bruger</a> /
|
||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section("content")
|
@section("content")
|
||||||
<h1>Rediger Bruger:</h1>
|
<h1>Rediger Bruger:</h1>
|
||||||
<form method="post" action="">
|
<form method="post" action="{{ route("users.update", ['id' => $user]) }}">
|
||||||
@csrf
|
@csrf
|
||||||
|
@method("put")
|
||||||
<label for="name_first">Fornavn:</label>
|
<label for="name_first">Fornavn:</label>
|
||||||
<input type="text" name="name_first" id="name_first" value="{Fornavn}" required>
|
<input type="text" name="name_first" id="name_first" value="{{ $user->name_first }}" required>
|
||||||
<label for="name_last">Efternavn:</label>
|
<label for="name_last">Efternavn:</label>
|
||||||
<input type="text" name="name_last" id="name_last" value="{Efternavn}" 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="{Email}" required>
|
<input type="email" name="email" id="email" value="{{ $user->name_email }}" required>
|
||||||
<label for="password1">Password:</label>
|
<label for="password1">Password:</label>
|
||||||
<input type="password" name="password" id="password1" value="{Password}" required>
|
<input type="password" name="password" id="password1" value="" required>
|
||||||
<label for="password2">Confirm Password:</label>
|
<label for="password2">Confirm Password:</label>
|
||||||
<input type="password" id="password2" value="{Password}" required>
|
<input type="password" id="password2" value="" required>
|
||||||
<label for="tel">Telefon nr:</label>
|
<label for="tel">Telefon nr:</label>
|
||||||
<input type="tel" name="phone" id="tel" value="{Telefon}" required>
|
<input type="tel" name="phone" id="tel" value="{{ $user->phone }}" required>
|
||||||
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
<input type="submit" class="btn btn-dark text-white" value="Rediger">
|
||||||
</form>
|
</form>
|
||||||
@endsection
|
@endsection
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
<td>{{ $user->name_last }}</td>
|
<td>{{ $user->name_last }}</td>
|
||||||
<td>{{ $user->email }}</td>
|
<td>{{ $user->email }}</td>
|
||||||
<td>{{ $user->phone }}</td>
|
<td>{{ $user->phone }}</td>
|
||||||
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></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><a href=""><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td>
|
<td><a href=""><img class="w-100" src="{{ asset('/images/icons/trashcan-dark.svg') }}" alt="Delete"></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|
Loading…
Reference in New Issue