T.ME/BIBIL_0DAY
CasperSecurity


Server : Apache/2
System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User : gositeme ( 1004)
PHP Version : 8.2.29
Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Directory :  /home/gositeme/.cursor-server/data/User/History/-6aaf5b5f/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/gositeme/.cursor-server/data/User/History/-6aaf5b5f/HoXL.php
<?php
/**
 * Map Villages API Endpoint
 * Returns villages with their locations for the map
 */

require_once dirname(__DIR__, 2) . '/private_html/config.php';
header('Content-Type: application/json');

$db = getDBConnection();
$currentUser = getCurrentUser();

try {
    $stmt = $db->query("
        SELECT 
            v.id,
            v.name,
            v.name_fr,
            v.slug,
            v.location_lat as lat,
            v.location_lng as lng,
            v.region,
            v.status,
            v.description,
            v.description_fr,
            COUNT(DISTINCT vm.user_id) as member_count,
            " . ($currentUser ? "
            (SELECT COUNT(*) FROM village_members WHERE village_id = v.id AND user_id = " . intval($currentUser['id']) . ") as is_member
            " : "0 as is_member") . "
        FROM villages v
        LEFT JOIN village_members vm ON v.id = vm.village_id
        WHERE v.location_lat IS NOT NULL AND v.location_lng IS NOT NULL
        GROUP BY v.id
        ORDER BY v.status DESC, v.name
    ");
    
    $villages = $stmt->fetchAll(PDO::FETCH_ASSOC);
    
    echo json_encode([
        'success' => true,
        'villages' => $villages
    ]);
} catch (Exception $e) {
    http_response_code(500);
    echo json_encode([
        'success' => false,
        'error' => $e->getMessage()
    ]);
}


CasperSecurity Mini