Commit 0c3bf67b by Juliper

no message

parent 63c10513
......@@ -289,9 +289,42 @@ class AdminController extends Controller
$owner->no_rekening = '--';
$owner->foto = 'gravatar.png';
$owner->save();
return redirect(url('admin/create'))->with('info', 'User berhasil ditambah ');
$dataOnwer = DB::table('pemilikhomestay')
->select('pemilikhomestay.id')
->where('pemilikhomestay.id_akun','=',$dataPemilik[0]->id)
->get();
$homestay = new Homestay();
$homestay->id_pemilik = $dataOnwer[0]->id;
$homestay->nama_homestay = $data['nama_homestay'];
$homestay->owner = $data['name'];
$homestay->alamat = "---";
$homestay->jumlah_kamar = $data['jumlah_kamar'];
$homestay->harga = 150000;
$homestay->fasilitas = "---";
$homestay->gambar = "---";
$homestay->status = "---";
$homestay->save();
$idHts = DB::table('homestay')
->select('homestay.*')
->where('homestay.id_pemilik','=',$dataOnwer[0]->id)
->get();
for ($i = 1;$i<=$data['jumlah_kamar'];$i++){
$km = new Room();
$km->id_homestay = $idHts[0]->id;
$km->nomor_kamar = $i;
$km->jumlah_bed = 2;
$km->save();
}
return view('adminlte::layouts.admin.addOwner')->with('message', 'User berhasil ditambah');
}
//Menampilkan Daftar RequestHomestay
......
......@@ -79,6 +79,14 @@ class OwnerController extends Controller
return view('adminlte::layouts.owner.Report')->with('data',$data);
}
public function Asread(Request $request,$id){
$req = RequestFasilitas::find($id);
$req->notif = 2;
$req->update();
return redirect('listPengajuanFasilitas');
}
public function pesanan($id){
$dataTrans = DB::table('transaksi')
->join('pelanggan','transaksi.id_pelanggan','=','pelanggan.id')
......
@extends('adminlte::layouts.app')
@section('htmlheader_title')
{{ trans('adminlte_lang::message.home') }}
@endsection
@section('main-content')
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">HOMESTAY </h3>
@if (count($errors) > 0)
<div class="alert alert-danger">
<strong>Whoops!</strong> {{ trans('adminlte_lang::message.someproblems') }}<br><br>
<ul>
@foreach ($errors->all() as $error)
<li>{{ $error }}</li>
@endforeach
</ul>
</div>
@endif
</div>
@if(Session::has('message'))
<div class="alert alert-danger">
{{ Session::get('message') }}
</div>
@endif
<div class="box-body">
<form action="{{ url('pengajuanHomestay') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group">
<label> Nama Homestay </label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-bookmark"></i>
</div>
<input type="text" class="form-control" placeholder="Nama Homestay" name="namaHomestay"/>
</div>
</div>
<div class="form-group">
<label>Jumlah Kamar </label>
<div class="input-group">
<div class="input-group-addon">
<i class="fa fa-bed"></i>
</div>
<input type="Number" class="form-control" placeholder="Jumlah Kamar" name="jumlahKamar" >
</div>
</div>
<br>
<div class="form-group" align="right" style="color: black;">
<button type="submit" class="btn btn-primary ">Ajukan</button>
</div>
</form>
</div>
</div>
@endsection
......@@ -20,6 +20,13 @@
@endforeach
</ul>
</div>
@if(session()->has('message'))
<div class="alert alert-info">
{{session()->get('message')}}
</div>
@endif
@endif
<div class="register-box-body ">
<form action="{{ url('admin') }}" method="post">
......@@ -45,7 +52,15 @@
<span class="glyphicon glyphicon-log-in form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input value="Owner" type="text" class="form-control" placeholder="{{ trans('adminlte_lang::message.role') }}" name="role" disabled/>
<input value="Owner" hidden type="text" placeholder="{{ trans('adminlte_lang::message.role') }}" name="role"/>
<span class="glyphicon glyphicon-wrench form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input class="form-control" type="text" placeholder="Nama Homestay" name="nama_homestay"/>
<span class="glyphicon glyphicon-wrench form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input value="Owner" class="form-control" type="number" placeholder="Jumlah Kamar" name="jumlah_kamar"/>
<span class="glyphicon glyphicon-wrench form-control-feedback"></span>
</div>
<div class="row">
......
......@@ -60,7 +60,7 @@
<button type="submit" class="btn btn-info"><i class="fa fa-check"> Sudah Dibaca</i></button>
</form>
@else Sudah Dibaca
@elseif($a->notif == 2) Sudah Dibaca
@endif
</td>
</tr>
......
......@@ -135,7 +135,7 @@ Route::group(['middleware' => 'dinaspariwisata'], function () {
Route::get('requestFasilitas','AdminController@RequestFasilitas');
Route::put('requestFasilitas/{id}','AdminController@UpdateRequestFasilitas');
Route::put('requestFasilitass/{id}','AdminController@UpdateRequestFasilitass');
Route::put('listPengajuanHomestay/{id}','AdminController@AccPengajuanHomestay');
Route::put('PengajuanHomestay','AdminController@PengajuanHomestay');
Route::put('listPengajuanHmsty/{id}','AdminController@RejectPengajuanHomestay');
Route::get('ownerprofil/{id}','AdminController@profileowner');
Route::get('Allfeedback','AdminController@Allfeedback');
......@@ -146,4 +146,7 @@ Route::group(['middleware' => 'dinaspariwisata'], function () {
Route::get('resultlistpesanan','AdminController@listhomestay');
Route::get('printFasilitas/{id}','AdminController@printFasilitas');
Route::post('/cancelrequest', 'AdminController@cancelrequest');
Route::get('admin/create','AdminController@create');
});
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