hotel
This commit is contained in:
0
resources/views/admin/hotels/create.blade.php
Normal file
0
resources/views/admin/hotels/create.blade.php
Normal file
0
resources/views/admin/hotels/edit.blade.php
Normal file
0
resources/views/admin/hotels/edit.blade.php
Normal file
45
resources/views/admin/hotels/index.blade.php
Normal file
45
resources/views/admin/hotels/index.blade.php
Normal file
@@ -0,0 +1,45 @@
|
||||
@extends('admin.layout')
|
||||
|
||||
@section('content')
|
||||
<div>
|
||||
<h1>Отели</h1>
|
||||
|
||||
@if(session('success'))
|
||||
<div class="success">
|
||||
{{ session('success') }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<a href="{{ route('admin.hotels.create') }}" class="btn">Добавить отель</a>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Название</th>
|
||||
<th>Адрес</th>
|
||||
<th>Телефон</th>
|
||||
<th>Действия</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($hotels as $hotel)
|
||||
<tr>
|
||||
<td>{{ $hotel->name }}</td>
|
||||
<td>{{ $hotel->address ?? '-' }}</td>
|
||||
<td>{{ $hotel->phone ?? '-' }}</td>
|
||||
<td>
|
||||
<a href="{{ route('admin.hotels.edit', $hotel) }}" class="btn" style="background: #666;">Редактировать</a>
|
||||
<form action="{{ route('admin.hotels.destroy', $hotel) }}" method="POST" style="display: inline;">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn" style="background: #aaa;" onclick="return confirm('Удалить отель?')">
|
||||
Удалить
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@endsection
|
||||
97
resources/views/admin/layout.blade.php
Normal file
97
resources/views/admin/layout.blade.php
Normal file
@@ -0,0 +1,97 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>@yield('title', 'Админка')</title>
|
||||
<style>
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
background: #fafafa;
|
||||
color: #333;
|
||||
}
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
header {
|
||||
background: #444;
|
||||
color: white;
|
||||
padding: 15px 20px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
nav a {
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
margin-left: 20px;
|
||||
}
|
||||
main {
|
||||
margin-top: 20px;
|
||||
}
|
||||
h1 {
|
||||
color: #333;
|
||||
border-bottom: 2px solid #ddd;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.btn {
|
||||
display: inline-block;
|
||||
background: #888;
|
||||
color: white;
|
||||
padding: 8px 16px;
|
||||
text-decoration: none;
|
||||
margin-right: 10px;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.btn:hover {
|
||||
background: #777;
|
||||
}
|
||||
table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
margin: 20px 0;
|
||||
background: white;
|
||||
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
||||
}
|
||||
th, td {
|
||||
padding: 12px;
|
||||
text-align: left;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
th {
|
||||
background: #eee;
|
||||
font-weight: bold;
|
||||
}
|
||||
tr:nth-child(even) {
|
||||
background: #f9f9f9;
|
||||
}
|
||||
.success {
|
||||
background: #e0e0e0;
|
||||
padding: 10px;
|
||||
margin: 10px 0;
|
||||
border-left: 4px solid #999;
|
||||
}
|
||||
.error {
|
||||
background: #ffdddd;
|
||||
padding: 10px;
|
||||
margin: 10px 0;
|
||||
border-left: 4px solid #cc0000;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h2>Админка</h2>
|
||||
<nav>
|
||||
<a href="{{ route('admin.hotels.index') }}">Отели</a>
|
||||
<a href="{{ route('admin.logout') }}">Выйти</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="container">
|
||||
@yield('content')
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
@@ -6,7 +6,7 @@
|
||||
<style>
|
||||
body { font-family: sans-serif; max-width: 400px; margin: 50px auto; }
|
||||
input { width: 100%; padding: 8px; margin: 5px 0; }
|
||||
button { width: 100%; padding: 10px; background: #42b983; color: white; border: none; cursor: pointer; }
|
||||
button { width: 100%; padding: 10px; background: #404040; color: white; border: none; cursor: pointer; }
|
||||
.error { color: red; }
|
||||
</style>
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user