예제 #1
0
function sugerencia($clave)
{
    $select = "SELECT DISTINCT SUBSTRING_INDEX(SUBSTRING_INDEX(codigo_de_referencia,'-',-2), '-', 1) as decadas FROM area_de_identificacion ORDER BY decadas ASC";
    try {
        $stmt = $GLOBALS['conn']->prepare($select);
        $stmt->execute();
        if ($stmt->rowCount() == 0) {
            // error
        } else {
            $data = $stmt->fetchAll(PDO::FETCH_COLUMN, 0);
            // Todas las claves de décadas existentes en la base de datos
            if (in_array(explode("-", $clave)[3], $data)) {
                // Si la clave de década se encuentra en $data
                getIndice(substr($clave, 0, strrpos($clave, '-')));
                // Sugerir próximo indice consecutivo
            } else {
                print_r(json_encode(1));
                // Indicar que se trata de una nueva década
            }
        }
    } catch (PDOException $e) {
        echo $e->getMessage();
    }
    $GLOBALS['conn'] = null;
}
예제 #2
0
    echo "<td></td></tr>";
}
// Indices
echo "<tr><td>";
echo "<a class='btn btn-primary' role='button' data-toggle='collapse' href='#collapseExplicationIndice' aria-expanded='false' aria-controls='collapseExplicationIndice'>";
echo "Indice de gain</a></td>";
for ($j = 0; $j < sizeof($listeJoueurs); $j++) {
    $joueur_id = $listeJoueurs[$j]["joueur_id"];
    // Pronostic de ce joueur
    $prono = null;
    if ($listePronostics) {
        $prono = getPronoJoueur($listePronostics, $joueur_id);
    }
    $valeurIndice = "";
    if ($prono && isset($prono)) {
        $valeurIndice = getIndice($prono);
    }
    echo "<td class='text-center'>{$valeurIndice}</td>";
}
echo "<td></td></tr>";
?>

                                </tbody>
                            </table>
                                    <div class="collapse" id="collapseExplicationIndice">
                                      <div class="row">

                                        <div class="col-lg-6">
                                            <h4>Indice de gain - Jeu à 7</h4>
                                            <table class="table table-condensed">
                                            <thead><tr><td>Indice</td>