Viewing File: D:\INETPUB\VHOSTS\officespacebangalore.com\httpdocs\admin\properties.php
<?php
$title = 'Properties';
require_once __DIR__ . '/_header.php';
$pdo = db();
$rows = $pdo->query(
'SELECT pid,title,city,state,stype,price,size,status,isFeatured,date
FROM property ORDER BY pid DESC'
)->fetchAll();
?>
<section class="admin-panel">
<div class="panel-head">
<div><h2>Property inventory</h2><p class="muted">Every record comes from your existing <code>property</code> table.</p></div>
<a class="admin-btn" href="<?=url('admin/property-edit.php')?>">+ Add property</a>
</div>
<div class="table-wrap">
<table>
<thead><tr><th>ID</th><th>Property</th><th>Location</th><th>Purpose</th><th>Area</th><th>Price</th><th>Featured</th><th>Status</th><th>Actions</th></tr></thead>
<tbody>
<?php foreach ($rows as $p): ?>
<tr>
<td>#<?=e($p['pid'])?></td>
<td><strong><?=e($p['title'])?></strong></td>
<td><?=e($p['city'])?><?=trim((string)$p['state'])!==''?', '.e($p['state']):''?></td>
<td><?=e($p['stype'])?></td>
<td><?=number_format((int)$p['size'])?> sqft</td>
<td><?=money($p['price'])?></td>
<td><?=!empty($p['isFeatured'])?'<span class="mini-badge">Yes</span>':'—'?></td>
<td><?=e($p['status'])?></td>
<td>
<a class="table-link" href="<?=url('admin/property-edit.php?id='.$p['pid'])?>">Edit</a>
<a class="danger-link" href="<?=url('admin/property-edit.php?delete='.$p['pid'].'&csrf='.urlencode(csrf()))?>" onclick="return confirm('Delete this property permanently?')">Delete</a>
</td>
</tr>
<?php endforeach; ?>
<?php if (!$rows): ?><tr><td colspan="9" class="empty">No properties found.</td></tr><?php endif; ?>
</tbody>
</table>
</div>
</section>
<?php require __DIR__ . '/_footer.php'; ?>
Back to Directory
File Manager