/
home
/
wellcas2
/
public_html
/
Upload File
HOME
<?php $activePage = "regions"; require_once 'config/helpers.php'; $regions = db_all($pdo, 'portfolio', 'port_title ASC'); $flagMap = [ 'zambia' => 'zm', 'rwanda' => 'rw', 'zimbabwe' => 'zw', 'tanzania' => 'tz', 'mozambique' => 'mz', 'kenya' => 'ke', 'uganda' => 'ug', 'malawi' => 'mw', 'south africa' => 'za', ]; if (!function_exists('region_flag_class')) { function region_flag_class(string $title, array $flagMap): string { $lower = strtolower($title); foreach ($flagMap as $name => $code) { if (strpos($lower, $name) !== false) return 'fi fi-' . $code; } return 'fa-solid fa-location-dot'; } } function region_label(string $title): string { return preg_replace('/^Our Office in\s+/i', '', preg_replace('/^Head Office\s*-\s*/i', '', $title)); } // Find the requested region by slug (?region=zambia), if any. $requestedSlug = isset($_GET['region']) ? strtolower(trim($_GET['region'])) : ''; $activeRegion = null; foreach ($regions as $region) { if (slugify_region($region['port_title']) === $requestedSlug) { $activeRegion = $region; break; } } if ($requestedSlug !== '' && $activeRegion) { $pageTitle = "Wellcash " . region_label($activeRegion['port_title']) . " | Regional Debt Recovery Services"; } else { $pageTitle = "Our Regional Offices | Wellcash Debt Collectors"; } include 'template/header.php'; ?> <style> /* -- Regions page styling -- */ .region-flag-banner { width: 100%; height: 220px; border-radius: 10px; overflow: hidden; background: linear-gradient(135deg, var(--brand-black) 0%, #2A2A2A 100%); display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 30px rgba(0,0,0,0.12); margin-bottom: 10px; } .region-flag-banner img { width: 100%; height: 100%; object-fit: cover; } .region-flag-banner .fallback-flag { font-size: 90px; color: rgba(255,255,255,0.85); } /* --- Responsive CSS Grid for Uniform Cards --- */ .cards-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 30px; margin-bottom: 30px; } .cards-grid > div { display: flex; } .cards-grid > div > a { display: flex; flex-direction: column; width: 100%; text-decoration: none; } .region-directory-card { background: #fff; border-radius: 12px; overflow: hidden; border: 1px solid var(--brand-border); box-shadow: 0 4px 15px rgba(0,0,0,0.04); transition: transform 0.25s ease, box-shadow 0.25s ease; height: 100%; width: 100%; display: flex; flex-direction: column; } .region-directory-card:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(0,0,0,0.10); } .region-card-flag { height: 110px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--brand-black) 0%, #2A2A2A 100%); position: relative; flex-shrink: 0; } .region-card-flag .fi, .region-card-flag .fa-solid { font-size: 42px; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.25); border-radius: 6px; } .region-card-badge { position: absolute; top: 10px; right: 10px; background: var(--brand-red); color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding: 4px 10px; border-radius: 20px; } .region-card-body { padding: 22px 22px 24px; flex: 1 1 auto; display: flex; flex-direction: column; } .region-card-body h3 { font-size: 18px; margin: 0 0 8px 0; color: var(--brand-black); } /* Clamps long titles & body paragraphs so heights match evenly */ .region-card-body p { font-size: 13.5px; color: #777; line-height: 1.6; margin: 0 0 14px 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; } .region-card-link { font-size: 13px; font-weight: 700; color: var(--brand-red); display: inline-flex; align-items: center; gap: 6px; margin-top: auto; } .stat-strip { display: flex; gap: 40px; justify-content: center; flex-wrap: wrap; margin: 10px 0 45px; } .stat-strip .stat-item { text-align: center; } .stat-strip .stat-item .num { font-size: 32px; font-weight: 800; color: var(--brand-red); line-height: 1; } .stat-strip .stat-item .lbl { font-size: 12.5px; color: #888; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 4px; } .fact-item { display: flex; gap: 15px; margin-bottom: 20px; align-items: flex-start; } .fact-icon { width: 40px; height: 40px; min-width: 40px; border-radius: 50%; background: rgba(227,28,35,0.08); color: var(--brand-red); display: flex; align-items: center; justify-content: center; font-size: 16px; } </style> <?php if ($requestedSlug !== '' && $activeRegion): $label = region_label($activeRegion['port_title']); $flagClass = region_flag_class($activeRegion['port_title'], $flagMap); $badge = trim($activeRegion['badge'] ?? '') !== '' ? $activeRegion['badge'] : 'Regional Operations'; $flagImg = upload_path($activeRegion['ufile'] ?? ''); // Pull out "Country Manager / Email / Phone" lines from the free-text // detail field so they can be shown as quick facts. $detail = $activeRegion['port_detail']; $manager = null; $email = null; $phone = null; if (preg_match('/Country Manager:\s*(.+)/i', $detail, $m)) $manager = trim($m[1]); if (preg_match('/Email:\s*([^\s]+@[^\s]+)/i', $detail, $m)) $email = trim($m[1]); if (preg_match('/Phone:\s*(.+)/i', $detail, $m)) $phone = trim(strtok($m[1], "\r\n")); ?> <!-- Hero Section --> <section class="page-hero"> <div class="container"> <div class="breadcrumb"> <a href="index.php">Home</a> <span>→</span> <a href="branch.php">Regions</a> <span>→</span> <span><?php echo htmlspecialchars($label); ?> Branch</span> </div> <span class="location-badge"> <span class="<?php echo htmlspecialchars($flagClass); ?>" style="margin-right: 6px; border-radius: 2px;"></span> <?php echo htmlspecialchars($badge); ?> </span> <h1>Wellcash <span class="text-red"><?php echo htmlspecialchars($label); ?></span></h1> <p><?php echo htmlspecialchars($activeRegion['port_desc']); ?></p> </div> </section> <!-- Main Branch Info --> <section class="section"> <div class="container"> <div class="region-flag-banner reveal"> <?php if (!empty($activeRegion['ufile'])): ?> <img src="<?php echo htmlspecialchars($flagImg); ?>" alt="<?php echo htmlspecialchars($label); ?>" onerror="this.style.display='none'; this.parentElement.querySelector('.fallback-flag').style.display='block';"> <span class="fallback-flag <?php echo htmlspecialchars($flagClass); ?>" style="display:none;"></span> <?php else: ?> <span class="fallback-flag <?php echo htmlspecialchars($flagClass); ?>"></span> <?php endif; ?> </div> <div class="row-table" style="margin-top: 40px; margin-bottom: 50px;"> <div class="col-table-2 reveal delay-1" style="padding-right: 30px;"> <h2 style="font-size: 28px; margin-bottom: 20px;">Wellcash Debt Collectors in <span class="text-red"><?php echo htmlspecialchars($label); ?></span></h2> <div style="color: #555; line-height: 1.7;"> <?php // port_detail is a long free-text field (paragraphs separated // by \r\n\r\n) - render it as proper paragraphs, keeping the // exact wording entered in the admin panel. $paragraphs = preg_split('/\r?\n\r?\n/', trim($detail)); foreach ($paragraphs as $para) { $para = trim($para); if ($para === '') continue; echo '<p style="margin-bottom: 15px;">' . nl2br(htmlspecialchars($para)) . '</p>'; } ?> </div> <a href="contact.php" class="btn btn-red btn-pill" style="display: inline-flex; align-items: center; gap: 8px; margin-top: 10px;"> Request <?php echo htmlspecialchars($label); ?> Assessment <i class="fa-solid fa-arrow-right"></i> </a> </div> <!-- Quick Branch Facts --> <div class="col-table-2 reveal delay-2" style="padding-left: 30px; vertical-align: middle;"> <div style="background-color: #f9f9f9; padding: 40px; border-radius: 10px; border-left: 4px solid var(--brand-red); box-shadow: 0 4px 15px rgba(0,0,0,0.05);"> <h3 style="margin-top: 0; margin-bottom: 22px; font-size: 20px; color: var(--brand-black);">Branch Contact Details</h3> <div class="fact-item"> <div class="fact-icon"><i class="fa-solid fa-location-dot"></i></div> <div> <strong style="color: var(--brand-black); display: block;">Address</strong> <span style="font-size: 14px; color: #666; white-space: pre-line;"><?php echo htmlspecialchars($activeRegion['port_desc']); ?></span> </div> </div> <?php if ($manager): ?> <div class="fact-item"> <div class="fact-icon"><i class="fa-solid fa-user-tie"></i></div> <div> <strong style="color: var(--brand-black); display: block;">Country Manager</strong> <span style="font-size: 14px; color: #666;"><?php echo htmlspecialchars($manager); ?></span> </div> </div> <?php endif; ?> <?php if ($phone): ?> <div class="fact-item"> <div class="fact-icon"><i class="fa-solid fa-phone-volume"></i></div> <div> <strong style="color: var(--brand-black); display: block;">Phone</strong> <span style="font-size: 14px; color: #666;"><a href="tel:<?php echo htmlspecialchars(preg_replace('/[^0-9+]/', '', $phone)); ?>" style="color:#666; text-decoration:none;"><?php echo htmlspecialchars($phone); ?></a></span> </div> </div> <?php endif; ?> <?php if ($email): ?> <div class="fact-item" style="margin-bottom: 0;"> <div class="fact-icon"><i class="fa-solid fa-envelope-open-text"></i></div> <div> <strong style="color: var(--brand-black); display: block;">Email</strong> <span style="font-size: 14px;"><a href="mailto:<?php echo htmlspecialchars($email); ?>" style="color: var(--brand-red); text-decoration: none; font-weight: 600;"><?php echo htmlspecialchars($email); ?></a></span> </div> </div> <?php endif; ?> </div> </div> </div> </div> </section> <!-- Other Regions --> <section class="section bg-light"> <div class="container"> <div class="section-title-wrap"> <h2>Explore Our Other Regions</h2> <div class="title-underline"></div> </div> <div class="cards-grid"> <?php foreach ($regions as $other): if ($other['id'] == $activeRegion['id']) continue; $otherLabel = region_label($other['port_title']); $otherFlag = region_flag_class($other['port_title'], $flagMap); $otherBadge = trim($other['badge'] ?? '') !== '' ? $other['badge'] : ''; ?> <div class="reveal"> <a href="branch.php?region=<?php echo urlencode(slugify_region($other['port_title'])); ?>"> <div class="region-directory-card"> <div class="region-card-flag"> <span class="<?php echo htmlspecialchars($otherFlag); ?>"></span> <?php if ($otherBadge): ?><span class="region-card-badge"><?php echo htmlspecialchars($otherBadge); ?></span><?php endif; ?> </div> <div class="region-card-body" style="text-align:center;"> <h3><?php echo htmlspecialchars($otherLabel); ?></h3> </div> </div> </a> </div> <?php endforeach; ?> </div> </div> </section> <?php else: ?> <!-- Region Directory (no specific region requested) --> <section class="page-hero"> <div class="container"> <span class="location-badge">Pan-African Presence</span> <h1>Our Regional <span class="text-red">Offices</span></h1> <p>Wellcash Debt Collectors operates across Africa. Choose a region below for local contact details and services.</p> </div> </section> <section class="section"> <div class="container"> <?php if (!empty($regions)): ?> <div class="stat-strip reveal"> <div class="stat-item"> <div class="num"><?php echo count($regions); ?></div> <div class="lbl">Active Regions</div> </div> <div class="stat-item"> <div class="num">24/7</div> <div class="lbl">Case Intake</div> </div> <div class="stat-item"> <div class="num">100%</div> <div class="lbl">Compliance Driven</div> </div> </div> <div class="cards-grid"> <?php foreach ($regions as $region): $label = region_label($region['port_title']); $flagClass = region_flag_class($region['port_title'], $flagMap); $badge = trim($region['badge'] ?? '') !== '' ? $region['badge'] : ''; ?> <div class="reveal"> <a href="branch.php?region=<?php echo urlencode(slugify_region($region['port_title'])); ?>"> <div class="region-directory-card"> <div class="region-card-flag"> <span class="<?php echo htmlspecialchars($flagClass); ?>"></span> <?php if ($badge): ?><span class="region-card-badge"><?php echo htmlspecialchars($badge); ?></span><?php endif; ?> </div> <div class="region-card-body"> <h3><?php echo htmlspecialchars($label); ?></h3> <p><?php echo htmlspecialchars($region['port_desc']); ?></p> <span class="region-card-link">View Branch Details <i class="fa-solid fa-arrow-right"></i></span> </div> </div> </a> </div> <?php endforeach; ?> </div> <?php else: ?> <p style="text-align:center; color:#666;">Regional office information is not available at the moment. Please check back soon.</p> <?php endif; ?> </div> </section> <?php endif; ?> <?php include 'template/footer.php'; ?>