66 lines
1.8 KiB
JavaScript
66 lines
1.8 KiB
JavaScript
|
function __id(a){
|
||
|
return document.getElementById(a);
|
||
|
}
|
||
|
|
||
|
$(document).ready(function(){
|
||
|
var ids = location.pathname.replaceAll("/kpr-detail/", "");
|
||
|
|
||
|
db()
|
||
|
.table('properti')
|
||
|
.condition([
|
||
|
{opsi:'', data: ['idprop', '=', '"'+ids+'"']}
|
||
|
])
|
||
|
.get(function(s){
|
||
|
var properti = s[0]
|
||
|
console.log(properti)
|
||
|
__id("nama-produk").innerText = properti.judulproperti;
|
||
|
__id("alamat").innerText = properti.alamat
|
||
|
__id("lokasi").innerText = properti.alamatkoord
|
||
|
__id("tipe").innerText = properti.kategori
|
||
|
__id("transaksi").innerText = properti.transaksi
|
||
|
__id("sertifikasi").innerText = properti.sertifikat
|
||
|
__id("lblt").innerHTML = properti.lt+' m<sup>2</sup>/ '+properti.lb+' m<sup>2</sup>'
|
||
|
__id("ktkm").innerHTML = properti.jum_kt+' / '+properti.jum_km
|
||
|
__id("orientasi").innerHTML = properti.hadap
|
||
|
__id("listrik").innerHTML = properti.listrik+' WATT'
|
||
|
__id("dimensi").innerHTML = properti.ltanah
|
||
|
__id("harga").innerHTML = formatRupiah(Number(properti.harga).toFixed(2))
|
||
|
|
||
|
db()
|
||
|
.table('foto')
|
||
|
.condition([
|
||
|
{opsi:'', data: ['idprop', '=', '"'+ids+'"']}
|
||
|
])
|
||
|
.get(function(e){
|
||
|
var ids = 'foto-kpr';
|
||
|
__id(ids).innerHTML = `
|
||
|
<div class="owl-carousel owl-theme galeri-container ">
|
||
|
`+e.map(function(c){
|
||
|
return `
|
||
|
<div class="foto galeri" style="
|
||
|
width: 350px;
|
||
|
min-height : '250px';
|
||
|
--foto: url('https://masuksini.com/sistem-api/androapi/upload/foto/${c.id}.jpg');
|
||
|
"></div>
|
||
|
`;
|
||
|
}).join("")+`
|
||
|
</div>
|
||
|
`;
|
||
|
|
||
|
setTimeout(function(){
|
||
|
$(".owl-carousel").owlCarousel({
|
||
|
margin:30,
|
||
|
loop: true,
|
||
|
autoWidth:true,
|
||
|
items:4,
|
||
|
autoHeight:true
|
||
|
})
|
||
|
}, 0)
|
||
|
|
||
|
document.getElementById('loader').style.display = 'none';
|
||
|
document.getElementById('load-data').style.display = 'block';
|
||
|
|
||
|
})
|
||
|
|
||
|
})
|
||
|
})
|