Commit 52d6b173 by Palti Sinaga

Merge branch 'master' of https://gitlab.del.ac.id/juliper19/pa2d4ti06

# Conflicts: # resources/views/vendor/adminlte/layouts/partialweb/mainheader.blade.php
parents 802b242c 97bbeff7
......@@ -9,7 +9,7 @@ class Homestay extends Model
protected $table = "homestay";
protected $fillable = [
'idPemilik', 'nama', 'owner','alamat','jumlahKamar','harga','status',
'idPemilik', 'namaHomestay', 'owner','alamat','jumlahKamar','harga','status',
];
}
......@@ -127,7 +127,7 @@ class AdminController extends Controller
$hs = new Homestay();
$hs->idPemilik = $RH->idPemilikHomestay;
$hs->nama = $RH->namaHomestay;
$hs->namaHomestay = $RH->namaHomestay;
$hs->owner = $data[0]->nama ;
$hs->alamat = $data[0]->alamat;
$hs->jumlahKamar = $RH->jumlahKamar;
......
......@@ -19,9 +19,39 @@ use Psy\Command\ListCommand\ConstantEnumerator;
class CustomerController extends Controller
{
public function hitory($id){
return view('adminlte::layouts.customers.History');
public function upload(Request $request,$id){
$data = Transaksi::find($id);
return redirect()->action(
'CustomerController@detailhomestay', ['id' => $request['id']]
);
}
public function bukti($id){
$data = Transaksi::find($id);
return view('adminlte::layouts.customers.Upload')->with('data',$data);
}
public function history(){
$data = DB::table('pelanggan')
->select('pelanggan.*')
->where('pelanggan.id_Akun','=',Auth::user()->id)
->get();
$dataTrans = DB::table('homestay')
->join('transaksi','homestay.id','=','transaksi.id_homestay')
->join('pemilikhomestay','homestay.idPemilik','=','pemilikhomestay.id')
->select('transaksi.*','pemilikhomestay.nama','pemilikhomestay.noRekening')
->where('transaksi.id_pelanggan','=',$data[0]->id)
->get();
//dd("masuk agan",Auth::user()->id,$data[0]->id,$dataTrans);
return view('adminlte::layouts.customers.History')->with('data',$dataTrans);
}
public function profile(){
......@@ -146,6 +176,7 @@ class CustomerController extends Controller
$trans = new Transaksi();
$trans->id_pelanggan = $data2[0]->id;
$trans->id_homestay = $request['id'];
$trans->tanggal_mulai = $request['tanggal'];
$trans->tanggal_berakhir = $baru;
$trans->jumlah_kamar =$request['jumlah_kamar'];
......
......@@ -5,26 +5,32 @@
<div class="container">
<table class="table table-striped">
<thead>
<tr>
<th> No. </th>
<tr>
<th> No. Rekening </th>
<th> Atas Nama </th>
<th> Total Pembayaran </th>
<th> Bukti Pembayaran </th>
<th> Unggah Pembayaran </th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>456141923</td>
<td>Palti Sinaga</td>
<td>2.400.000</td>
</tr>
<tr class="success">
<td>2</td>
<td>09179287213</td>
<td>Lestari Siregar</td>
<td>2.123.091</td>
</tr>
@foreach($data as $a)
<tr class="success">
<td>{{$a->noRekening}}</td>
<td>{{$a->nama}}</td>
<td>{{$a->total_pembayaran}}</td>
<td>
@if($a->bukti_pembayaran==null)
<img alt="Buku Transfer Tidak Ada" class="img-circle img-responsive">
@else
<img alt="User Pic" src="img/{{$data->gambar}}" class="img-circle img-responsive">
@endif
</td>
<td>
<a href="{{url('buktipembayaran/'.$a->id)}}">Upload Bukti</a>
</td>
</tr>
@endforeach
</tbody>
</table>
......
@extends('adminlte::layouts.master')
@section('main-content')
<div class="cuisines agileits w3layouts" style="padding-top: 50px; margin-top: 80px; margin-bottom: 100px;">
<div class="container">
<form class="form-horizontal" action="{{url('')}}" method="post" enctype="multipart/form-data">
<input type="hidden" name="_method" value="PUT">
{{csrf_field()}}
<label>Tanggal Mulai</label>
<input type="text" name="tanggal_mulai" value="{{$data->tanggal_mulai}}" id="noTelepon" class="form-control">
<label>Tanggal Berakhir</label>
<input type="text" name="tanggal_berakhir" value="{{$data->tanggal_berakhir}}" class="form-control">
<label>Jumlah Kamar</label>
<input type="text" name="jumlah_kamar" value="{{$data->jumlah_kamar}}" class="form-control">
<label>Bukti Pembayaran</label>
<input type="file" name="picture" id="picture" class="form-control"><br>
<div class="form-group" align="right">
<input type="submit" class="btn btn-primary" value="simpan">
</div>
</form>
</div>
</div>
@endsection
\ No newline at end of file
......@@ -42,9 +42,11 @@
<input type="submit" class="btn btn-primary">
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
\ No newline at end of file
......@@ -43,8 +43,13 @@
<li class="user-header">
{{--<img src="{{ Gravatar::get($user->email) }}" class="img-circle" alt="User Image" />--}}
<p>
<<<<<<< HEAD
<img src="img/{{ Auth::user()->foto }}" class="img-circle" alt="User Image" />
=======
<img src="/img/{{ Auth::user()->foto }}" class="img-circle" alt="User Image" />
>>>>>>> 97bbeff761f5f7a38a7c0e5eea39fa7bce170bdc
</p>
</li>
<!-- Menu Body -->
......@@ -55,6 +60,10 @@
<a href="{{ url('customerProfile') }}" class="btn btn-default btn-flat">{{ trans('adminlte_lang::message.profile') }}</a>
</div>
<div class="pull-left" style="margin-left: 20px">
<a href="{{ url('customerHistory') }}" class="btn btn-default btn-flat">History</a>
</div>
<div class="pull-right">
<a href="{{ url('/logout') }}" class="btn btn-default btn-flat"
onclick="event.preventDefault();
......
......@@ -45,13 +45,13 @@ Route::group(['middleware' => 'auth'], function () {
//Please do not remove this if you want adminlte:route and adminlte:link commands to works correctly.
#adminlte_routes
});
Route::put('upload/{id}','CustomerController@upload');
Route::get('detailhomestay/{id}','CustomerController@detailhomestay');
Route::get('history/{id}','CustomerController@hitory');
Route::get('customerHistory','CustomerController@history');
Route::get('daftar','CustomerController@register');
Route::post('daftar','CustomerController@registerStore');
Route::post('book','CustomerController@booking');
//Route::post('editProfileCustomer/{id}','CustomerController@update');
//Route::put('editProfile/{id}','CustomerController@updateProfile');
Route::get('buktipembayaran/{id}','CustomerController@bukti');
Route::get('editProfileCustomer/{id}','CustomerController@editProfile');
Route::put('editProfileCustomer/{id}','CustomerController@updateProfile');
Route::resource('admin', 'AdminController');
......
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