Commit 7d6169c2 authored by Shafwan Eksa Jayadi's avatar Shafwan Eksa Jayadi
Browse files

Main Project

parent 0492fb43
No related merge requests found
Showing with 139 additions and 85 deletions
+139 -85
......@@ -313,7 +313,7 @@ public function prosesTambahAdmin(Request $request)
'phone' => $request->phone,
'role_id' => $request->role_id,
'edit_admin_desa' => '0',
'approve_wisata' => '1',
'approve_wisata' => '0',
'tambah_edit_admin_destinasi' => '1',
'mengajukan_destinasi' => '1',
'konfirmasi_tiket' => '0',
......
......@@ -218,6 +218,10 @@ public function prosesPesanDestinasi(Request $request, $id_destinasi, $id_user)
$destinasi = Destinasi::where('id', $id_destinasi)->first();
$total = $request->jumlah * $destinasi['htm_destinasi'];
$this->validate($request, [
'tanggal' => 'required|after:yesterday'
]);
$tiket = Tiket::create([
'nama_pemesan' => $user['name'],
'jumlah_tiket' => $request->jumlah,
......@@ -264,6 +268,10 @@ public function prosesPesanPaket(Request $request, $id_paket, $id_user)
$paket = Paket::where('id', $id_paket)->first();
$total = $request->jumlah * $paket['harga_paket'];
$this->validate($request, [
'tanggal' => 'required|after:yesterday'
]);
$tiket = Tiket::create([
'nama_pemesan' => $user['name'],
'jumlah_tiket' => $request->jumlah,
......
......@@ -4,6 +4,7 @@
use Illuminate\Support\ServiceProvider;
use Illuminate\Pagination\Paginator;
use Illuminate\Support\Facades\Blade;
class AppServiceProvider extends ServiceProvider
{
......@@ -25,5 +26,9 @@ public function register()
public function boot()
{
Paginator::useBootstrap();
Blade::directive('currency', function ($expression) {
return "Rp. <?php echo number_format($expression,0,',','.'); ?>";
});
}
}
This diff is collapsed.
......@@ -141,13 +141,13 @@
@if ($ticket['paket_id'] != null)
@foreach ($paket as $item)
@if ($ticket->paket_id == $item->id)
<td>{{ $item->harga_paket * $ticket->jumlah_tiket }}</td>
<td>@currency($item->harga_paket * $ticket->jumlah_tiket)</td>
@endif
@endforeach
@else
@foreach ($destinasi as $item)
@if ($ticket->destinasi_id == $item->id)
<td>{{ $item->htm_destinasi * $ticket->jumlah_tiket }}</td>
<td>@currency($item->htm_destinasi * $ticket->jumlah_tiket)</td>
@endif
@endforeach
@endif
......
......@@ -203,9 +203,9 @@ class="d-block w-100">
<div class="deskripsiPaketDesti">
<h3>
{{ str_replace('|', ' + ', $pak['destinasi']) }}</h3>
<p style="text-decoration: line-through white;">Rp{{ $pak['harga_normal'] }}
<p style="text-decoration: line-through white;">@currency($pak['harga_normal'])
</p>
<p style="font-size: 25px;">Rp{{ $pak['harga_paket'] }}</p>
<p style="font-size: 25px;">@currency($pak['harga_paket'])</p>
<span>Limited</span>
</div>
</div>
......
......@@ -158,7 +158,7 @@
@endforeach
<h3>HTM</h3>
<p style="font-size: 20px;">Rp {{ $destinasi['htm_destinasi'] }}</p>
<p style="font-size: 20px;">@currency($destinasi['htm_destinasi'])</p>
<a href="{{ url('pesan/destinasi', $destinasi['id']) }}" class="btn_5 btn-info">Pesan
Tiket</a>
......@@ -205,7 +205,7 @@ class="d-block w-100">
@if ($w->htm_wahana == 0)
<p>Gratis</p>
@else
<p>Rp {!! $w->htm_wahana !!}</p>
<p>@currency($w->htm_wahana)</p>
@endif
</div>
</div>
......@@ -240,9 +240,9 @@ class="d-block w-100">
</div>
<div class="deskripsiPaketDesti">
<h3>{{ str_replace('|', ' + ', $pak['wahana']) }}</h3>
<p style="text-decoration: line-through white;">Rp{{ $pak['harga_normal'] }}
<p style="text-decoration: line-through white;">@currency($pak['harga_normal'])
</p>
<p style="font-size: 25px;">Rp{{ $pak['harga_paket'] }}</p>
<p style="font-size: 25px;">@currency($pak['harga_paket'])</p>
<span>Limited</span>
</div>
</div>
......
......@@ -333,7 +333,7 @@
style="margin-right: 5px;"></i>{{ $reg->nama_kabupaten }}</p>
@endif
@endforeach
<p class="post-date">Rp {{ $dest['htm_destinasi'] }}</p>
<p class="post-date">@currency($dest['htm_destinasi'])</p>
</div>
</div>
</article>
......
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