Commit 30feb5bd by Palti Sinaga

h-1

parents 9f287095 1606b1ac
...@@ -89,7 +89,7 @@ class OwnerController extends Controller ...@@ -89,7 +89,7 @@ class OwnerController extends Controller
public function updateProfil(Request $request,$id){ public function updateProfil(Request $request,$id){
$owner = Owner::where('id',$id)->first(); $owner = Owner::where('id',$id)->first();
$user = User::where('name',$owner->nama)->first(); $user = User::where('name',$owner->nama)->first();
//dd($owner->id_akun);
if($request['nama']==""){ if($request['nama']==""){
$user->name = $owner->nama; $user->name = $owner->nama;
}else{ }else{
...@@ -104,11 +104,13 @@ class OwnerController extends Controller ...@@ -104,11 +104,13 @@ class OwnerController extends Controller
if($request->file('picture')==null){ if($request->file('picture')==null){
$owner->foto = $owner->foto; $owner->foto = $owner->foto;
$user->foto = $user->foto;
}else{ }else{
$file = $request->file('picture'); $file = $request->file('picture');
$fileName = $file->getClientOriginalName(); $fileName = $file->getClientOriginalName();
$request->file('picture')->move("img/",$fileName); $request->file('picture')->move("img/",$fileName);
$owner->foto = $fileName; $owner->foto = $fileName;
$user->foto = $fileName;
} }
$user->update(); $user->update();
......
...@@ -3,17 +3,17 @@ ...@@ -3,17 +3,17 @@
@section('main-content') @section('main-content')
<div class="cuisines agileits w3layouts" style="padding-top: 50px; margin-top: 80px; margin-bottom: 100px;"> <div class="cuisines agileits w3layouts" style="padding-top: 50px; margin-top: 80px; margin-bottom: 100px;">
<div class="container"> <div class="container">
<form class="form-horizontal" action="{{url('upload/'.$data->id)}}" method="post" enctype="multipart/form-data"> <form class="form-horizontal" action="{{url('perbaharui/'.$data->id)}}" method="post">
<input type="hidden" name="_method" value="PUT"> <input type="hidden" name="_method" value="PUT">
{{csrf_field()}} {{csrf_field()}}
<label>Tanggal Mulai</label> <label>Tanggal Mulai</label>
<input type="text" name="tanggal_mulai" value="{{$data->tanggal_mulai}}" id="noTelepon" class="form-control"> <input type="text" name="tanggal" value="{{$data->tanggal_mulai}}" id="noTelepon" class="form-control">
<label>Tanggal Berakhir</label> <label>Lama Menginap</label>
<input type="text" name="tanggal_berakhir" value="{{$data->tanggal_berakhir}}" class="form-control" > <input type="text" name="lama_menginap" value="{{$lama_menginap}}" class="form-control" >
<label>Jumlah Kamar</label> <label>Jumlah Kamar</label>
<input type="text" name="jumlah_kamar" value="{{$data->jumlah_kamar}}" class="form-control"> <input type="text" name="jumlah_kamar" value="{{$data->jumlah_kamar}}" class="form-control">
<div class="form-group" align="right"> <div class="form-group" align="right">
<input type="submit" class="btn btn-primary" value="simpan"> <input type="submit" class="btn btn-primary" value="Simpan">
</div> </div>
</form> </form>
</div> </div>
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
<img src="/img/{{ $a->bukti_pembayaran }}" style="width: 100px" alt="User Image" onclick="document.getElementById('modal').style.display='block'"/> <img src="/img/{{ $a->bukti_pembayaran }}" style="width: 100px" alt="User Image" onclick="document.getElementById('modal').style.display='block'"/>
@endif @endif
<img src="/img/{{ $a->bukti_pembayaran }}" style="width: 100px" alt="Tidak Ada Gambar" onclick="document.getElementById('modal').style.display='block'"/>
</td> </td>
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-dollar"></i> <i class="fa fa-dollar"></i>
</div> </div>
<input type="text" class="form-control" value="{{$data->pekerjaan}}" placeholder="pekerjaan" name=""/> <input type="text" class="form-control" value="{{$data->pekerjaan}}" name="pekerjaan"/>
</div> </div>
</div> </div>
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-dollar"></i> <i class="fa fa-dollar"></i>
</div> </div>
<input type="Number" class="form-control" value="{{$data->no_telepon}}" placeholder="noTelepon" name=""/> <input type="Number" class="form-control" value="{{$data->no_telepon}}" placeholder="noTelepon" name="noTelepon"/>
</div> </div>
</div> </div>
...@@ -75,14 +75,14 @@ ...@@ -75,14 +75,14 @@
<div class="input-group-addon"> <div class="input-group-addon">
<i class="fa fa-dollar"></i> <i class="fa fa-dollar"></i>
</div> </div>
<input type="Number" class="form-control" value="{{$data->no_rekening}}" placeholder="noRekening" name=""/> <input type="Number" class="form-control" value="{{$data->no_rekening}}" placeholder="noRekening" name="noRekening"/>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label>Foto </label> <label>Foto </label>
<div class="input-group"> <div class="input-group">
<input type="file" value="Browse" name="foto" id="picture" > <input type="file" value="Browse" name="picture" id="picture" >
</div> </div>
</div> </div>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<span class="logo-lg" style="font-size: 17px;"><b>SI </b>Pemesanan Homestay </span> <span class="logo-lg" style="font-size: 17px;"><b>SI </b>Pemesanan Homestay </span>
</a> </a>
@elseif(Auth::user()->role=="Owner") @elseif(Auth::user()->role=="Owner")
<a href="{{ url('/pesanan') }}" class="logo"> <a href="{{ url('/') }}" class="logo">
<!-- mini logo for sidebar mini 50x50 pixels --> <!-- mini logo for sidebar mini 50x50 pixels -->
<span class="logo-mini"><b>SI</b>PH</span> <span class="logo-mini"><b>SI</b>PH</span>
<!-- logo for regular state and mobile devices --> <!-- logo for regular state and mobile devices -->
......
...@@ -88,6 +88,7 @@ Route::post('daftar','GuestController@registerStore'); ...@@ -88,6 +88,7 @@ Route::post('daftar','GuestController@registerStore');
Route::group(['middleware' => 'customer'], function () { Route::group(['middleware' => 'customer'], function () {
Route::get('updatepesanan/{id}','CustomerController@updatePesanan'); Route::get('updatepesanan/{id}','CustomerController@updatePesanan');
Route::put('perbaharui/{id}','CustomerController@perbaharui');
Route::put('batalkan/{id}','CustomerController@cancelPemesanan'); Route::put('batalkan/{id}','CustomerController@cancelPemesanan');
Route::put('upload/{id}','CustomerController@upload'); Route::put('upload/{id}','CustomerController@upload');
Route::get('customerHistory','CustomerController@history'); Route::get('customerHistory','CustomerController@history');
......
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