function main() { if (!isset($_GET['latitude']) || !isset($_GET['longitude'])) { echo get_error_response('パラメーターが設定されていません'); exit; } $lat = doubleval($_GET['latitude']); $lng = doubleval($_GET['longitude']); $candidate = get_candidate($lat, $lng); if ($candidate === false) { echo get_error_response('候補地が見つかりませんでした。'); exit; } $response = get_success_response($candidate); echo $response; exit; }
<th>Setorial</th> <th>Estado</th> <th>Situação</th> <th>Votos</th> </tr> </thead> <tbody> <?php if (!empty($candidates)) { ?> <?php foreach ($candidates as $pid) { ?> <?php $candidate = get_candidate($pid); // $number_votes = get_number_of_votes_by_project($pid); // var_dump($candidate); $number_votes = get_number_of_votes_by_project_transient($pid); ?> <tr class=""> <td class="subscription__title"> <?php if (current_user_can('curate')) { ?> <a href="<?php echo site_url("inscricoes/" . $candidate['subscription_number']); ?> "><?php echo $candidate['user_name'];