Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update bug pada user admin #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 45 additions & 55 deletions resources/views/dashboard/booking.blade.php
Original file line number Diff line number Diff line change
@@ -1,64 +1,54 @@
@extends('layouts._app')
@extends('layouts._dashboard')

@section('title')
Perizinan Akses Gedung
@endsection
@section('header', 'Approval booking ruangan')

@section('css')
<link rel="stylesheet" type="text/css" href="assets/libs/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css">
@endsection
@section('content')

@section('header')
Perizinan Akses Gedung
@endsection
<div class="row bg-white">
<table class="table w-100">
<tr>
<th>No</th>
<th>Gedung</th>
<th>Ruangan</th>
<th>Tanggal</th>
<th>Jam Masuk</th>
<th>Jam Keluar</th>
<th>Deskripsi</th>
<th>status</th>
<th>Action</th>
</tr>
@foreach($bookings as $booking)
<tr>
<td>{{ $loop->iteration }}</td>
<td>{{ $booking->room->building->name }}</td>
<td>{{ $booking->room->name }}</td>
<td>{{ $booking->date }}</td>
<td>{{ $booking->in }}</td>
<td>{{ $booking->out }}</td>
<td>{{ $booking->description }}</td>
<td>{{ $booking->status }}</td>
<td>
@if ($booking->status == "booking")
<form action="{{ route('dashboard.approve', $booking->id) }}" class="my-2" method="post">
@csrf
<button class="btn btn-primary w-100">Approve</button>
</form>
<form action="{{ route('dashboard.decline', $booking->id) }}" class="my-2" method="post">
@csrf
<button class="btn btn-danger w-100">Decline</button>
</form>
@endif
</td>
</tr>
@endforeach
</table>

</div>

@section('content')
<div class="row">
<div class="col-12 col-lg-6">
<p>Untuk Menjaga Keamanan dan Kenyamanan, Dimohon untuk melakukan perizinan terlebih dahulu dengan mengisi form sebagai berikut : </p>
<form method="post" action="{{ route('booking.process', [$building_id, $room_id]) }}" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="reason">Alasan Penggunaan Akses</label>
<textarea class="form-control" name="reason" id="reason" cols="30" rows="2"></textarea>
</div>
<div class="form-group">
<label for="date-format">Hari Digunakan</label>
<input name="date" type="date" class="form-control">
</div>
<div class="form-group">
<label for="date-format">Jadwal Selesai</label>
<div class="row">
<div class="col-6">
<input name="in" type="time" class="form-control">
</div>
<div class="col-6">
<input name="out" type="time" class="form-control">
</div>
</div>
</div>
<div class="form-group">
<label for="reason">Surat Keterangan Sehat COVID-19</label>
<p class="mt-0">* *Dikarenakan sedang terjadi pandemi COVID-19, Dimohon untuk memberi surat Rapid/Swab/Antigen.</p>
<input name="covid" type="file" class="form-control">
</div>
<button type="submit" class="btn btn-info btn-block mt-5">
Buat Izin
</button>
</form>
</div>
<div class="col-12 col-lg-6 d-none d-sm-block">
<img src="vector/permission.svg" width="100%">
<div class="mx-auto">
{{ $bookings->links('pagination::bootstrap-4') }}
</div>
</div>
@endsection

@section('js')
<script src="assets/libs/moment/moment.js"></script>
<script src="assets/libs/bootstrap-material-datetimepicker/js/bootstrap-material-datetimepicker-custom.js"></script>
<script>
$('.date-format').bootstrapMaterialDatePicker({
format: 'dddd DD MMMM YYYY - HH:mm'
});
</script>
@endsection
110 changes: 3 additions & 107 deletions resources/views/dashboard/index.blade.php
Original file line number Diff line number Diff line change
@@ -1,111 +1,7 @@
@extends('layouts._app')
@extends('layouts._dashboard')

@section('title')
Pesan gedung dan ruangan sesuai kebutuhan anda
@endsection

@section('css')

@endsection

@section('header')
Pilihlah Gedung yang Anda Inginkan
@endsection
@section('header', 'Dashboard')

@section('content')
<div class="row">
<div class="col-6 col-lg-4">
<form action="{{ route('index') }}" method="get" class="input-group">
<label>Sort by date : </label>
<input type="date" name="date" class="form-control" placeholder="Cari ..." aria-label="Cari ..." aria-describedby="basic-addon1" value="{{ request()->query('date') }}">
<div class="input-group-append">
<button class="btn btn-info" type="submit">
<i class="ti-search"></i>
</button>
</div>
</form>
</div>
<div class="col-6 col-lg-4 offset-lg-4">
<form action="{{ route('index') }}" method="get" class="input-group">
<input type="text" name="title" class="form-control" placeholder="Cari ..." aria-label="Cari ..." aria-describedby="basic-addon1" value="{{ request()->query('title') }}">
<div class="input-group-append">
<button class="btn btn-info" type="submit">
<i class="ti-search"></i>
</button>
</div>
</form>
</div>
</div>

<hr>

<div class="row">
@foreach($buildings as $building)
<div class="col-12 col-lg-4 col-md-6">
<div class="card">
@if($building->images->count() > 0)
<img class="card-img-top img-responsive" src="{{ Storage::url($building->images[0]->image) }}" alt="Card image cap">
@else
<img class="card-img-top img-responsive" src="assets/images/big/img1.jpg" alt="Card image cap">
@endif
<div class="card-body">
<div class="text-center">
<h4 class="card-title">{{ $building->name }}</h4>
</div>
<hr>
<div class="mb-2">
<p class="mb-0 font-weight-bold">Alamat :</p>
<p class="mb-0">{{ $building->address }}</p>
</div>
<div class="d-flex mb-2">
<div class="mr-2 font-weight-bold align-items-center">
<p class="mb-0">Jumlah Ruangan</p>
</div>
<div class="ml-auto align-items-center">
<span class="badge badge-pill badge-warning">{{ $building->rooms->count() }}</span>
</div>
</div>
@if ($date !== "" && !empty($date))
@php
$value = 0;
@endphp
@foreach ($building->rooms as $room)
@foreach ($room->bookings as $booking)
@if ($date == $booking->date)
@php
$value++;
@endphp
@endif
@endforeach
@endforeach
<div class="d-flex mb-2">
<div class="mr-2 font-weight-bold align-items-center">
<p class="mb-0">Jumlah Terpakai</p>
</div>
<div class="ml-auto align-items-center">
<span class="badge badge-pill badge-danger">{{$value}}</span>
</div>
</div>
@endif
<hr>
<a href="{{ route('detail', $building->id) }}" class="btn btn-info btn-block">
Cek Ruangan
</a>
</div>
</div>
</div>
@endforeach

</div>

<div class="row">
<div class="mx-auto">
{{ $buildings->links('pagination::bootstrap-4') }}
</div>
</div>


@endsection

@section('js')
<h1>Welcome Admin</h1>
@endsection