184 lines
4.7 KiB
PHP
184 lines
4.7 KiB
PHP
@php
|
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
$about = DB::select("SELECT * FROM setting WHERE kode = 'about-set' ");
|
|
$about = $about[0]->setting;
|
|
$about = json_decode(MyForm::binaryToString($about));
|
|
$about = json_decode($about)->kontent;
|
|
|
|
$laman = DB::select("SELECT * FROM laman WHERE judul = '$about' ");
|
|
|
|
$kode = $laman[0]->kode;
|
|
|
|
$myfile = fopen("assets/upload/laman/$kode.json", "r") or die("Unable to open file!");
|
|
$data = fgets($myfile);
|
|
fclose($myfile);
|
|
$data = json_decode($data);
|
|
|
|
@endphp
|
|
|
|
@extends('layout.front')
|
|
|
|
@section('container')
|
|
|
|
<style type="text/css">
|
|
.none{
|
|
display: none;
|
|
}
|
|
|
|
.shown{
|
|
display: block;
|
|
}
|
|
|
|
blockquote{
|
|
position: relative;
|
|
margin-left: 15px;
|
|
}
|
|
blockquote::before{
|
|
content: "";
|
|
position: absolute;
|
|
display: block;
|
|
height: 100%;
|
|
width: 5px;
|
|
background: #d8941e;
|
|
left: -15px;
|
|
}
|
|
|
|
@media screen and (max-width: 991px){
|
|
.none{
|
|
display: block;
|
|
}
|
|
.shown{
|
|
display: none;
|
|
}
|
|
}
|
|
{!!$data->css!!}
|
|
</style>
|
|
|
|
<div class="container">
|
|
<div class="row mt-5 mb-5">
|
|
<div class="col-sm-12 mb-3 text-center">
|
|
</div>
|
|
<div class="col-lg-8">
|
|
{!!$data->html!!}
|
|
</div>
|
|
<div class="col-lg-4">
|
|
<div class="card">
|
|
<div class="card-body">
|
|
<h5>Advance Search</h5>
|
|
<select id="kategori" class="form-control">
|
|
<option value="">Categories</option>
|
|
@php
|
|
$kategori = DB::select("SELECT DISTINCT(kategori) as kategori FROM properti WHERE kategori <> ''");
|
|
@endphp
|
|
@foreach($kategori as $kategori)
|
|
<option value="{{$kategori->kategori}}">{{$kategori->kategori}}</option>
|
|
@endforeach
|
|
</select>
|
|
<select id="city_name" class="form-control mt-3">
|
|
<option value="">Cities</option>
|
|
@php
|
|
$kategori = DB::select("SELECT DISTINCT(city_name) as kategori FROM properti WHERE city_name <> '' ");
|
|
@endphp
|
|
@foreach($kategori as $kategori)
|
|
<option value="{{$kategori->kategori}}">{{$kategori->kategori}}</option>
|
|
@endforeach
|
|
</select>
|
|
<select id="jum_kt" class="form-control mt-3">
|
|
<option value="">Min Kamar Tidur</option>
|
|
@for($x = 1; $x <= 10; $x++)
|
|
<option value="{{$x}}">{{$x}}</option>
|
|
@endfor
|
|
</select>
|
|
<input id="lt" type="number" class="form-control mt-3">
|
|
<button id="search-properti" class="btn btn-success mt-3 w-100">Search Properties</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- list by kategori -->
|
|
<h5>List By Categories</h5>
|
|
@php
|
|
$kategori = DB::select("SELECT DISTINCT(kategori) as kategori FROM properti WHERE kategori <> ''");
|
|
@endphp
|
|
<ul class="list-group">
|
|
@foreach($kategori as $kategori)
|
|
@php
|
|
$tot = DB::select("SELECT count(*) as tot FROM properti WHERE kategori = '$kategori->kategori' ");
|
|
$tot = $tot[0]->tot;
|
|
@endphp
|
|
<a class="list-group-item d-flex justify-content-between align-items-cente" href="/qr/kategori={{str_replace(" ", "-", $kategori->kategori)}}">{{$kategori->kategori}} <span class="badge badge-primary badge-pill">{{$tot}}</span></a>
|
|
@endforeach
|
|
</ul>
|
|
|
|
<!-- list by city -->
|
|
<br>
|
|
<h5>List By Categories</h5>
|
|
@php
|
|
$kategori = DB::select("SELECT DISTINCT(city_name) as kategori FROM properti WHERE city_name <> ''");
|
|
@endphp
|
|
<ul class="list-group">
|
|
@foreach($kategori as $kategori)
|
|
@php
|
|
$tot = DB::select("SELECT count(*) as tot FROM properti WHERE city_name = '$kategori->kategori' ");
|
|
$tot = $tot[0]->tot;
|
|
@endphp
|
|
<a class="list-group-item d-flex justify-content-between align-items-cente" href="/qr/city_name={{str_replace(" ", "-", $kategori->kategori)}}">{{$kategori->kategori}} <span class="badge badge-primary badge-pill">{{$tot}}</span></a>
|
|
@endforeach
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
@endsection
|
|
|
|
@section('js')
|
|
<script src="{{asset('assets/bt4')}}/apibaru.js?v=<?= date('Ymdh')?>"></script>
|
|
<script type="text/javascript">
|
|
document.getElementById('search-properti').addEventListener('click', function(){
|
|
var kategori = getId('kategori').value;
|
|
var city_name = getId('city_name').value;
|
|
var jum_kt = getId('jum_kt').value;
|
|
var lt = getId('lt').value;
|
|
|
|
|
|
var link = '';
|
|
|
|
if (kategori != '') {
|
|
if (link != '') {
|
|
link += `&`;
|
|
}
|
|
link += `kategori=`+kategori.replace(/ /g, '-');
|
|
}
|
|
|
|
if (city_name != '') {
|
|
if (link != '') {
|
|
link += `&`;
|
|
}
|
|
link += `city_name=`+city_name.replace(/ /g, '-');
|
|
}
|
|
|
|
if (jum_kt != '') {
|
|
if (link != '') {
|
|
link += `&`;
|
|
}
|
|
link += `jum_kt=`+jum_kt.replace(/ /g, '-');
|
|
}
|
|
|
|
if (lt != '') {
|
|
if (link != '') {
|
|
link += `&`;
|
|
}
|
|
link += `lt=`+lt.replace(/ /g, '-');
|
|
}
|
|
|
|
location.href = '/qr/'+link;
|
|
|
|
}, false)
|
|
window.scrollTo(0, 0);
|
|
</script>
|
|
|
|
@endsection
|