<?php

/**
 *
 *  Api to load matchs of a container, with special color such as
 *  red if the match is not prognosticate
 *  green if the match was already prognosticate
 *
 * @author flabadens
 * @version 1.0
 * @see MyBets.functions
 * @todo
 * @example post parameter : ContainerId
 * 
 *
 */

if ($versionmobile){
    include_once("../config.php3");
    $RACINE_DIR="../";
    $CORE = "";
}
else {
    include_once("config.php3");
    $RACINE_DIR="";
}

//include_once($RACINE_DIR.$MOBILE_DIR."configMobile.php3");
include_once($RACINE_DIR.$BIB_DIR_FROM_RACINE."bib_db.php3");
include_once($RACINE_DIR.$BIB_DIR_FROM_RACINE."bib_generic.php3");
include_once($RACINE_DIR.$BIB_DIR_FROM_RACINE."bib_check_members.php3");
include_once($RACINE_DIR.$BIB_DIR_FROM_RACINE."LOC_bib_check_members_vip.php3");
include_once($RACINE_DIR.$BIB_DIR_FROM_RACINE."bib_exploitation.php3");
include_once($CORE."MyBets.functions.php");
include_once $CORE.'Players.functions.php';

// get session infos
$sess = open_page($sessid);
$mobile = isOnMobile();


if ($sess->memberid == -1){

    if (!$versionmobile){
        $sess->redirect($REGISTRATION_PAGE, "");
    }
    else {
        echo "ErrorSESSID";
        exit();
    }
}

    $member = getmember($sess->memberid);
    $player = getplayer($sess->memberid);

    
    //$results = loadResultsByContainer($containerId, $current_european_date, $nbMatchsToShow, $player[Id]);
    $matchs = loadGamesToPronoByContainer(0, $player[Id], $tabAllBets, $tabAllAmounts);
    
    $nbResults = count($matchs);

    $current_european_date = date("d/m/Y H:i:s", my_local_time());
    $current_european_date = substr($current_european_date,0,10);
    $date = date("Y-m-d H:i:s", my_local_time());
    
    //var_dump($results);
    include $VIEW.'MyBetsList.web.view.php';


?>
