<?php

/**
 *
 *  View relative to MyBetsResults.core
 *  Display bets results 
 *
 * @author flabadens
 * @version 1.0
 * @see MyBetsResults.core.php
 * @see for colors go to configMobile.php3
 * @todo display iphone like maybe
 * 
 *
 */

include_once($RACINE_DIR.$MOBILE_DIR."configMobile.php3");

?>

<font color="<?php echo $PERFECT_BET ?>"><b>Perfect </b></font>
<font color="<?php echo $CORRECT_BET ?>"><b>Correct </b></font>
<font color="<?php echo $ECHEC_BET ?>"><b>Echec </b></font>
<br /><br />
<ul class="edgetoedge">
<?php

if ( $results == 0){
    echo "aucun résultat dans cette rubrique";
    exit();
}

foreach ( $results as $bet )
{

    if ($bet[Bet] != "0")
        $pari = $bet[Bet];
    
    if ($bet[Result]!="0")
    {
        $gain = $bet[gain];
        $gain_points = $bet[gain_points]." pts";

        if ($gain_points > 0)
                $gain_points = "+".$gain_points;

        $gain_suffixe = "</font>";
        if ( $gain == $bet['Rate1'])
        {
                $gain_points_prefixe = "<font color=".$PERFECT_BET."><b>";
                $gain_prefixe = $gain_points_prefixe;
                $gain_suffixe = "</b>".$gain_suffixe;
        }
        elseif ($gain == $bet['Rate2'])
        {
                $gain_points_prefixe = "<font color=".$CORRECT_BET.">";
                $gain_prefixe = $gain_points_prefixe;
        }
        else
        {
                $gain_points_prefixe = "<font color=".$ECHEC_BET.">";
                $gain_prefixe = $gain_points_prefixe;
        }

        $gain = $gain_prefixe."&nbsp;(".$pari.")</font>";
        $gain_points = $gain_points_prefixe.$gain_points."</font>";
    }	
    else
    {
        $gain_points_prefixe = "<font color="."#9F9F9F".">";
        $gain_prefixe = $gain_points_prefixe;
        $gain = $gain_prefixe."-".$gain_suffixe;
        $gain_points = $gain_prefixe.$gain_suffixe;
    }


?>
<li class="arrow" >
<table>
<tr>

        <td  width=250 >
                <?php
                        $the_bet = formatString($bet[Team1])." - ".formatString($bet[Team2]);
                        //echo $the_bet;
                        echo $the_bet;
                ?>
        </td>
        <td  width=30>
                <?php
                        if ($bet[Result]=="0")
                                echo "?";
                        else
                                echo "&nbsp;&nbsp;".$bet[Result];
                ?>
        </td>
</tr>
<tr>
        <td width=100>
                <?php
                echo $gain_points;
                ?>
        </td>
        <td width=100>
                <?php
                echo $gain;
                ?>&nbsp;
        </td>
        
        
</tr>
<tr></tr><tr></tr>
</table>
</li>

<?php
}
?>

</ul>
