Commit fafd808f by Juliper

all have been done without sms gateway

parent 5252f4d5
......@@ -171,7 +171,7 @@ class CustomerController extends Controller
public function booking(Request $request){
if(Auth::guest()){
dd("you must have account");
return view('adminlte::errors.Account');
}
$lb = new ListBook();
......@@ -211,7 +211,7 @@ class CustomerController extends Controller
dd('nggak boleh');
}
}else{
dd('masuk aja gan');
//dd('masuk aja gan');
}
}
......@@ -227,9 +227,41 @@ class CustomerController extends Controller
//dd($dataHomestay,$dataPelanggan);
$time = explode('-', $request['tanggal']);
$time[2] +=$request['jumlah_hari'];
//dd($time[1]+2);
if ($time[1]==2){
$time[2] += $request['jumlah_hari'];
if ($time[2]>28){
$time[2] = 0;
$time[2] += $request['jumlah_hari'];
$time[2] -=1;
$time[1] +=1;
if($time[1]>12){
$time[1] = 1;
}
}
}else{
if($time[1]%2==1){
$time[2] += $request['jumlah_hari'];
if($time[2]>31){
$time[2] = 0;
$time[2] += $request['jumlah_hari'];
$time[1] +=1;
}
$time[2] -=1;
}else{
$time[2] += $request['jumlah_hari'];
if($time[2]>30){
$time[2] = 0;
$time[2] += $request['jumlah_hari'];
$time[1] +=1;
}
$time[2] -=1;
}
}
$baru = join('-',$time);
//dd($request['tanggal'],$baru,$request['jumlah_hari']);
//Insert Table Transaksi
$trans = new Transaksi();
......@@ -240,6 +272,7 @@ class CustomerController extends Controller
$trans->jumlah_kamar =$request['jumlah_kamar'];
$trans->lama_menginap = $request['jumlah_hari'];
$trans->total_pembayaran = $request['jumlah_kamar'] * $dataHomestay[0]->harga;
$trans->status = 0;
//Insert Table Daftar Booking
$lb->homestay = $request['id'];
......
......@@ -6,6 +6,7 @@ use App\ListBook;
use App\RequestFasilitas;
use App\RequestHomestay;
use App\Room;
use App\Transaksi;
use Illuminate\Http\Request;
use App\User;
use App\Owner;
......@@ -21,6 +22,23 @@ class OwnerController extends Controller
}
public function konfirmasiPemesanan(Request $request,$id){
$data = Transaksi::find($id);
if($request['konfirmasi']==1){
$data->status = $request['konfirmasi'];
}else{
DB::table('daftar_book')->where('tanggal_mulai', '=', $data->tanggal_mulai)->delete();
$data->status=$request['konfirmasi'];
}
$data->update();
return redirect('pesanan');
}
public function listOfBook(){
......
@extends('adminlte::layouts.errors')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.serviceunavailable') }}
@endsection
@section('main-content')
<div class="error-page">
<h2 class="headline text-red"><i class="fa fa-warning text-red"></i></h2>
<div class="error-content">
<h3> Oops! Kamu HARUS Punya Akun</h3>
<p>
Jika Kamu ingin melakukan pembookingan kamu terlebih dahulu harus LOGIN!! di sitem kami
<a href="{{url('login')}}">Login </a> <a href="{{url('')}}">Kembali</a>
</p>
</div>
</div><!-- /.error-page -->
@endsection
......@@ -10,6 +10,7 @@
<th> Atas Nama </th>
<th> Total Pembayaran </th>
<th> Bukti Pembayaran </th>
<th> Status Pemesanan</th>
<th> Unggah Pembayaran </th>
</tr>
</thead>
......@@ -27,6 +28,12 @@
@endif
</td>
<td>
@if($a->status==0) Belum Dikonfirmasi
@elseif($a->status==1) Di Terima
@elseif($a->status==2) Di Tolak
@endif
</td>
<td>
<a href="{{url('buktipembayaran/'.$a->id)}}">Upload Bukti</a>
</td>
</tr>
......
......@@ -48,7 +48,7 @@
<th>Lama Menginap</th>
<th>Jumlah Kamar</th>
<th>Bukti Pembayaran</th>
<th>Status</th>
<th colspan="3" style="position: center;">Status</th>
</tr>
@foreach($data as $a)
<tr>
......@@ -60,7 +60,27 @@
<td>{{$a->lama_menginap}} Hari</td>
<td>{{$a->jumlah_kamar}}</td>
<td><img src="/img/{{ $a->bukti_pembayaran }}" style="width: 100px" alt="User Image" /></td>
<td>{{"belum bang"}}</td>
<td>
@if($a->status==0)
<td>
<form action="{{url('konfirmasiPemesanan/'.$a->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<input type="hidden" name="konfirmasi" value="1">
<button type="submit" class="btn btn-info"><i class="glyphicon glyphicon-apple"> Terima</i></button>
</form>
<td>
<form action="{{url('konfirmasiPemesanan/'.$a->id)}}" method="post">
{{csrf_field()}}
<input type="hidden" name="_method" value="PUT">
<input type="hidden" name="konfirmasi" value="2">
<button type="submit" class="btn btn-danger"><i class="glyphicon glyphicon-trash"> Tolak</i></button>
</form>
</td>
@elseif($a->status==1) Diterima
@elseif($a->status==2) Ditolak
@endif
</td>
</tr>
@endforeach
</table>
......
......@@ -59,6 +59,7 @@ Route::get('listPemesanan','AdminController@listPesanan');
Route::put('editRoom/{id}','OwnerController@updateRoom');
Route::post('addManual','OwnerController@addBookManual');
Route::put('konfirmasiPemesanan/{id}','OwnerController@konfirmasiPemesanan');
Route::get('editRoom/{id}','OwnerController@editRoom') ;
Route::get('daftarBooking','OwnerController@listOfBook');
Route::get('daftarKamar','OwnerController@daftarKamar');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment