예제 #1
0
파일: function.php 프로젝트: kazakSite/KTV1
function statAnnee($prix2, $course2, $dateCr, $lieu, $alloc, $type, $base)
{
    echo "<table id='box-table-a' summary='Entraineur stats'><H5>" . $prix2 . "</h5><h6>Entraineurs <i>(année)</i></H6>\r\n\t<tr>\r\n\t<th scope='col'>N°</th>\r\n\t<th scope='col'>Cheval</th>\r\n\t<th scope='col'>" . $type . "</th>\r\n\t<th scope='col'>2011</th>\r\n\t<th scope='col'>2012</th>\r\n\t<th scope='col'>2013</th>\r\n\t<th scope='col'>2014</th>\r\n\t<th scope='col'>2015</th>\r\n\t</tr>";
    $sql = "select * from kazak_reunion where course={$course2} and dateReunion='{$dateCr}' and lieu='{$lieu}' order by id asc";
    //echo $sql;
    //echo "<br>";
    $res = mysql_query($sql);
    $t = 1;
    while ($data = mysql_fetch_array($res)) {
        echo "<tr>";
        $cheval = $data['cheval'];
        //echo "<h2>".$cheval."</h2>";
        //echo "<br>";
        echo "<td>" . $t . "</td>";
        echo "<td>" . $cheval . "</td>";
        $nom = $data['$type'];
        //$valeur = array(1,2);
        echo "<td><a class='info' href='#'>" . $nom . "<span>";
        /////////Calcul la reussite//////////
        echo "<table class='info'><tr>\r\n\t<td>";
        reussite(2015, $entraineur);
        echo "</td><td>";
        //reussite(2014,$entraineur);
        echo "</td><td>";
        //reussite(2013,$entraineur);
        echo "</td><td>";
        //reussite(2012,$entraineur);
        echo "</td></tr></table>";
        for ($i = 2011; $i <= 2015; $i++) {
            $sqlCount = "select {$alloc} from {$base} where annee = '{$i}' and {$type}='{$nom}'";
            //echo $sqlCount;
            //echo "<br>";
            $resCount = mysql_query($sqlCount) or exit('Erreur SQL ligne ' . __LINE__ . ' : ' . mysql_error());
            $result = mysql_result($resCount, 0);
            echo "<td>" . $result . "</td>";
        }
        $t = $t + 1;
    }
    echo "</tr><table></div>";
}
예제 #2
0
파일: index.php 프로젝트: kazakSite/KTV1
//echo "<br>";
$res = mysql_query($sql);
$t = 1;
while ($data = mysql_fetch_array($res)) {
    echo "<tr>";
    $cheval = $data['cheval'];
    //echo "<h2>".$cheval."</h2>";
    //echo "<br>";
    echo "<td>" . $t . "</td>";
    echo "<td>" . $cheval . "</td>";
    $entraineur = $data['entraineur'];
    //$valeur = array(1,2);
    echo "<td><a class='info' href='#'>" . $entraineur . "<span>";
    /////////Calcul la reussite//////////
    echo "<table class='info'><tr>\r\n\t<td>";
    reussite(2015, $entraineur);
    echo "</td><td>";
    //reussite(2014,$entraineur);
    echo "</td><td>";
    //reussite(2013,$entraineur);
    echo "</td><td>";
    //reussite(2012,$entraineur);
    echo "</td></tr></table>";
    for ($i = 2011; $i <= 2015; $i++) {
        $sqlCount = "select allocEntraineur from kazak_alloc where annee = '{$i}' and entraineur='{$entraineur}'";
        //echo $sqlCount;
        //echo "<br>";
        $resCount = mysql_query($sqlCount) or exit('Erreur SQL ligne ' . __LINE__ . ' : ' . mysql_error());
        $result = mysql_result($resCount, 0);
        echo "<td>" . $result . "</td>";
    }