<?php

/**
 *
 *  View of bet
 *
 * @author flabadens
 * @version 1.0
 * @see MyBetsChoice.core
 * @todo
 * 
 *
 */

//var_dump($once);

include_once($RACINE_DIR.$MOBILE_DIR."configMobile.php3");
?>
            <div id="error_bet" style="color:red" ><?php if ($betIsClosed || $matchIsClosed) echo "Le match est fermé. <br />"; ?><?php echo $error; ?></div>
            <form>
                <input type=hidden name=MatchId value="<?php echo $MatchId ?>">
                <input type=hidden name=validate>
                <ul class="edgetoedge">
                    <li class="arrow"><?php echo formatString($match[Team1]); ?></li>
                </ul>
                <ul class="rounded">
                    <li>
                        <select <?php if ($betIsClosed || $matchIsClosed) echo "DISABLED"; ?> id="Team1" >
                            <?php
                            for ($i=0; $i<=8; $i++){
                                if ($Team1 == $i)
                                    echo '<option selected value ="'.$i.'">'.$i.'</option>';
                                else
                                    echo '<option value ="'.$i.'">'.$i.'</option>';
                            }
                            ?>
                        </select>
                    </li>
                </ul>
                <ul class="edgetoedge">
                    <li class="arrow"><?php echo formatString($match[Team2]); ?></li>
                </ul>
                <ul class="rounded">
                    <li>
                        <select <?php if ($betIsClosed || $matchIsClosed) echo "DISABLED"; ?> id="Team2" >
                            <?php
                            for ($i=0; $i<=8; $i++){
                                if ($Team2 == $i)
                                    echo '<option selected value ="'.$i.'">'.$i.'</option>';
                                else
                                    echo '<option value ="'.$i.'">'.$i.'</option>';
                            }
                            ?>
                        </select>
                    </li>
                </ul>
                <ul class="edgetoedge">
                    <li class="arrow">Mise (max : <?php echo number_format(min($BET_MAX, $remaining_points) ,0,""," ")." pts"; ?>)</li>
                </ul>
                <ul class="rounded">
                    <li>
                        <input <?php if ($betIsClosed || $matchIsClosed) echo "DISABLED"; ?> id="case_mise" type="text" size="10" name="amount" maxlength="15" value="<?php echo $amount ?>">
                    </li>
                </ul>
                <a style="margin:0 10px;color:rgba(0,0,0,.9)" onclick="validateBet($('#validate').val(), $('#case_mise').val(), $('#Team1').val(), $('#Team2').val(), <?php echo $MatchId ?>, <?php echo $ContainerId ; ?> );" class="submit whiteButton">Valider</a>
            </form>
            <br />
            <center><?php echo formatString(C_DEJAMISE); ?> <?php echo number_format($consumed_points,0,""," "); ?> <br /><?php echo formatString(C_RESTE); ?> <?php echo number_format($remaining_points,0,""," "); ?></center>
