prepare("SELECT COUNT(*) as count FROM users WHERE status = 0"); } elseif ($user_type_id == 1) { // user_type_id = 1 → เห็นทุกอำเภอในจังหวัดตัวเอง $stmt_count = $pdo->prepare("SELECT COUNT(*) as count FROM users WHERE leader = ? AND user_type_id = 2 AND status = 0"); $stmt_count->execute([$leader]); } elseif ($user_type_id == 2) { // user_type_id = 2 → เห็นทุกตำบลในอำเภอตัวเอง $stmt_count = $pdo->prepare("SELECT COUNT(*) as count FROM users WHERE leader = ? AND user_type_id = 4 AND status = 0"); $stmt_count->execute([$schoolID]); } if (isset($stmt_count)) { $result = $stmt_count->fetch(PDO::FETCH_ASSOC); $unapproved_count = $result['count'] ?? 0; } ?>