Rental Property for Rent in Cebu | PropertEase
Home For Rent Cebu Property Detail

Loading…

Cebu, Philippines

🏠
Loading property details…
×
meta document.getElementById('page-title').textContent = (l.title || 'Rental Property') + ' | PropertEase'; document.getElementById('page-desc').content = [ l.title, l.price ? 'at ' + l.price : '', l.location ? 'in ' + l.location : '', '— PropertEase' ].filter(Boolean).join(' '); // Update canonical + OG + Twitter for this specific listing const listingUrl = 'https://www.propertease.ph/rental-listing.html?id=' + (l.id || ''); const listingImg = (l.photos && l.photos[0]) ? l.photos[0] : 'https://www.propertease.ph/images/og-home.jpg'; const ogTitle = (l.title || 'Rental Property') + ' for Rent in Cebu | PropertEase'; const ogDesc = [l.title, l.price ? 'at ' + l.price : '', l.location ? 'in ' + l.location : ''].filter(Boolean).join(' ') + ' — View photos & inquire through PropertEase.'; document.getElementById('page-canon').href = listingUrl; const setMeta = (id, val) => { const el = document.getElementById(id); if (el) el.content = val; }; setMeta('og-url', listingUrl); setMeta('og-title', ogTitle); setMeta('og-desc', ogDesc); setMeta('og-image', listingImg); setMeta('tw-title', ogTitle); setMeta('tw-desc', ogDesc); setMeta('tw-image', listingImg); // Inject JSON-LD schema for this listing const schemaScript = document.createElement('script'); schemaScript.type = 'application/ld+json'; schemaScript.textContent = JSON.stringify({ "@context": "https://schema.org", "@type": "RealEstateListing", "name": l.title || "Rental Property", "description": l.description || ogDesc, "url": listingUrl, "image": (l.photos || []).filter(Boolean).slice(0, 5), "datePosted": l.date_posted || new Date().toISOString().split('T')[0], "offers": { "@type": "Offer", "price": l.price_num || 0, "priceCurrency": "PHP", "availability": "https://schema.org/InStock" }, "address": { "@type": "PostalAddress", "addressLocality": l.location || "Cebu", "addressRegion": "Central Visayas", "addressCountry": "PH" }, "broker": { "@type": "RealEstateAgent", "@id": "https://www.propertease.ph/#agent", "name": "Patrick Zumel Bitoy", "telephone": "+639175508229" } }); document.head.appendChild(schemaScript); // Breadcrumb + hero document.getElementById('crumb-title').textContent = l.title || 'Property Detail'; document.getElementById('hero-title').textContent = l.title || '—'; document.getElementById('hero-location').textContent = l.location || 'Cebu, Philippines'; // Type badge const badge = document.getElementById('rl-type-badge'); badge.textContent = l.property_type || 'For Rent'; // Core fields document.getElementById('rl-title').textContent = l.title || '—'; document.getElementById('rl-location').textContent = l.location || '—'; document.getElementById('rl-price').textContent = l.price || 'Price on request'; // Specs const specs = []; if (l.bedrooms > 0) specs.push({ icon: '🛏', val: l.bedrooms, lbl: l.bedrooms === 1 ? 'Bedroom' : 'Bedrooms' }); if (l.bathrooms > 0) specs.push({ icon: '🚿', val: l.bathrooms, lbl: l.bathrooms === 1 ? 'Toilet & Bath' : 'Toilets & Baths' }); // floor_area is the new field; fall back to legacy sqm for old records const fa = l.floor_area || l.sqm || ''; if (fa) specs.push({ icon: '📐', val: fa, lbl: 'Floor Area' }); if (l.lot_area) specs.push({ icon: '🏡', val: l.lot_area, lbl: 'Lot Area' }); const specsEl = document.getElementById('rl-specs'); if (specs.length) { specsEl.innerHTML = specs.map(s => `
${s.icon}
${esc(String(s.val))}
${s.lbl}
` ).join(''); } else { specsEl.style.display = 'none'; } // Description if (l.description) { document.getElementById('rl-desc').textContent = l.description; document.getElementById('rl-desc-section').style.display = ''; } // Date if (l.date_posted) { document.getElementById('rl-date').textContent = 'Listed: ' + l.date_posted; } // Hidden field document.getElementById('rl-lid').value = listingId; // Gallery window.allPhotos = photos; window.currentPhotoIdx = 0; renderGallery(photos); // Show content document.getElementById('rl-loading').style.display = 'none'; document.getElementById('rl-content').style.display = ''; } function renderGallery(photos) { const mainImg = document.getElementById('rl-main-img'); const thumbsEl = document.getElementById('rl-thumbs'); if (!photos.length) { mainImg.style.display = 'none'; const placeholder = document.createElement('div'); placeholder.className = 'rl-main-photo no-img'; placeholder.textContent = '🏠'; placeholder.style.display = 'flex'; document.getElementById('rl-main-img-wrap').appendChild(placeholder); return; } mainImg.src = proxyImg(photos[0]); mainImg.alt = 'Property photo 1'; if (photos.length > 1) { thumbsEl.innerHTML = photos.map((url, i) => `Photo ${i+1}` ).join(''); } } function showError() { document.getElementById('rl-loading').style.display = 'none'; document.getElementById('rl-error').style.display = ''; } function esc(s) { return String(s).replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"'); } // Expose to window for onclick handlers window.proxyImg = url => '/image-proxy.php?url=' + encodeURIComponent(url); window.allPhotos = []; window.currentPhotoIdx = 0; window.setPhoto = function(idx) { const photos = window.allPhotos; if (!photos[idx]) return; window.currentPhotoIdx = idx; const mainImg = document.getElementById('rl-main-img'); mainImg.src = proxyImg(photos[idx]); mainImg.alt = 'Property photo ' + (idx + 1); document.querySelectorAll('.rl-thumb').forEach((t, i) => t.classList.toggle('active', i === idx)); }; window.openLightbox = function(idx) { const photos = window.allPhotos; if (!photos.length) return; window.currentPhotoIdx = idx; document.getElementById('lb-img').src = proxyImg(photos[idx]); document.getElementById('lb-overlay').classList.add('open'); document.body.style.overflow = 'hidden'; }; window.closeLightbox = function() { document.getElementById('lb-overlay').classList.remove('open'); document.body.style.overflow = ''; }; window.closeLightboxOnBg = function(e) { if (e.target === document.getElementById('lb-overlay')) closeLightbox(); }; window.lightboxNav = function(dir) { const photos = window.allPhotos; if (!photos.length) return; window.currentPhotoIdx = (window.currentPhotoIdx + dir + photos.length) % photos.length; document.getElementById('lb-img').src = proxyImg(photos[window.currentPhotoIdx]); }; document.addEventListener('keydown', e => { if (!document.getElementById('lb-overlay').classList.contains('open')) return; if (e.key === 'ArrowLeft') lightboxNav(-1); if (e.key === 'ArrowRight') lightboxNav(1); if (e.key === 'Escape') closeLightbox(); }); // ── Inquiry form ───────────────────────────────────────────────────────────── // Note: window.rlPhone is set by the non-module script below that runs immediately. window.submitInquiry = async function(e) { e.preventDefault(); const btn = document.getElementById('rl-submit-btn'); const statusEl = document.getElementById('rl-form-status'); const fallback = document.getElementById('rl-form-fallback'); const name = document.getElementById('rl-name').value.trim(); const emailEl = document.getElementById('rl-email'); const bestCallEl = document.getElementById('rl-best-call'); const wantsViewingEl = document.getElementById('rl-site-viewing'); const viewingDateEl = document.getElementById('rl-viewing-date'); const viewingTimeEl = document.getElementById('rl-viewing-time'); const message = document.getElementById('rl-msg').value.trim(); const lid = document.getElementById('rl-lid').value; /* Validate name */ if (!name) { showFormStatus('Please fill in your full name.', false); document.getElementById('rl-name').focus(); return; } /* Validate email */ const emailRes = PE.form.validateEmail(emailEl.value); if (!emailRes.valid) { PE.form.setFieldError(emailEl, emailRes.msg); emailEl.focus(); return; } PE.form.setFieldError(emailEl, null); /* Validate phone */ if (!window.rlPhone || !window.rlPhone.validate()) { document.getElementById('rl-phone-wrap').querySelector('input')?.focus(); return; } const phone = window.rlPhone.getValue(); const bestTimeToCall = bestCallEl ? bestCallEl.value.trim() : ''; const wantsSiteViewing = !!(wantsViewingEl && wantsViewingEl.checked); const siteViewingDate = viewingDateEl ? viewingDateEl.value : ''; const siteViewingTime = viewingTimeEl ? viewingTimeEl.value : ''; btn.disabled = true; btn.textContent = 'Sending…'; statusEl.style.display = 'none'; try { const fd = new FormData(); const pageTitle = document.getElementById('rl-title')?.textContent?.trim() || document.title.trim() || 'Rental Listing'; const pageUrl = window.location.origin + window.location.pathname + window.location.search; fd.append('name', name); fd.append('email', emailEl.value.trim()); fd.append('contact', phone); fd.append('message', message); fd.append('listing_id', lid); fd.append('sourcePageTitle', pageTitle); fd.append('sourcePageUrl', pageUrl); fd.append('bestTimeToCall', bestTimeToCall); fd.append('wantsSiteViewing', wantsSiteViewing ? 'yes' : ''); fd.append('siteViewingDate', siteViewingDate); fd.append('siteViewingTime', siteViewingTime); const resp = await fetch('/save-inquiry.php', { method: 'POST', body: fd }); const json = await resp.json(); if (json.success) { showFormStatus('Thank you! We emailed you the property details and Patrick will be in touch shortly.', true); document.getElementById('rl-form').reset(); document.getElementById('rl-lid').value = lid; window.initRentalInquiryUi(); } else { showFormStatus(json.error || 'Something went wrong. Please try again.', false); fallback.style.display = 'block'; } } catch(err) { showFormStatus('Could not send. Please contact Patrick directly.', false); fallback.style.display = 'block'; } btn.disabled = false; btn.textContent = 'Send Inquiry →'; }; function showFormStatus(msg, ok) { const el = document.getElementById('rl-form-status'); el.textContent = ok ? '✓ ' + msg : msg; el.className = 'rl-form-status ' + (ok ? 'ok' : 'err'); el.style.display = 'block'; } loadListing();