BLACKSITE
:
216.73.216.62
:
147.93.18.13 / vinyasaweddings.com
:
Linux srv667811 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
:
/
var
/
www
/
vkraft
/
views
/
Upload File:
files >> /var/www/vkraft/views/sitemap.php
<?php require_once 'config/config.php'; // Fetch active states for the left column $stmt = $db->query("SELECT id, title FROM states WHERE status = 'active' ORDER BY id DESC"); $states = $stmt->fetchAll(PDO::FETCH_ASSOC); // Fetch cities (assumes cities table contains a state_name column as in your admin table) $stmt = $db->query("SELECT id, title AS city_title, state_name, status FROM cities ORDER BY state_name ASC, city_title ASC"); $cities = $stmt->fetchAll(PDO::FETCH_ASSOC); // Group cities by state_name $citiesByState = []; foreach ($cities as $c) { $stateKey = trim($c['state_name']) !== '' ? $c['state_name'] : 'Not specified'; $citiesByState[$stateKey][] = $c; } // slugify helper function slugify($text) { $text = preg_replace('~[^\pL\d]+~u', '-', $text); $text = iconv('utf-8', 'us-ascii//TRANSLIT', $text); $text = preg_replace('~[^-\w]+~', '', $text); $text = trim($text, '-'); $text = preg_replace('~-+~', '-', $text); $text = strtolower($text); return $text ?: 'n-a'; } ?> <?php require 'views/layout/header.php'; ?> <section class="process-section py-5" style="min-height:50vh"> <div class="container"> <div class="row"> <!-- Left: Active States --> <div class="col-md-6"> <h2>State</h2> <ul class="list-unstyled"> <?php foreach ($states as $state): ?> <?php $sSlug = slugify($state['title']); ?> <li class="mb-1"> <a href="<?= BASE_URL ?>/<?php echo $sSlug; ?>"> <?php echo htmlspecialchars($state['title']); ?> </a> </li> <?php endforeach; ?> </ul> </div> <!-- Right: Cities grouped by state_name (uses cities table's state_name field) --> <div class="col-md-6"> <h2>City</h2> <?php if (!empty($citiesByState)): ?> <?php foreach ($citiesByState as $stateName => $cityList): ?> <?php $stateSlug = slugify($stateName); ?> <div class="mb-3"> <h5 class="mb-2"><?php echo htmlspecialchars($stateName); ?></h5> <ul class="list-unstyled ms-3"> <?php foreach ($cityList as $city): ?> <?php $citySlug = slugify($city['city_title']); ?> <li class="mb-1"> <a href="<?= BASE_URL ?>/<?php echo $stateSlug; ?>/<?php echo $citySlug; ?>"> <?php echo htmlspecialchars($city['city_title']); ?> </a> <small class="text-muted ms-2">(<?php echo htmlspecialchars($city['status']); ?>)</small> </li> <?php endforeach; ?> </ul> </div> <?php endforeach; ?> <?php else: ?> <p class="text-muted">No cities available.</p> <?php endif; ?> </div> </div> </div> </section> <?php require 'views/layout/footer.php'; ?>