<?php
/* vérifie si il a un CS */
function hasCS($cs, $cs_pari)
{
 return(($cs_pari['CS'] & $cs) == $cs);
}

function checkBetIsClosed($currentDate, $matchDate, &$pari)
{
	if (hasCS(1, $pari))
		$time = $pari['TempsPari']*60;
	else
		$time = 0;
	return (time_diff($currentDate , $matchDate) <= (-1)*$time);
}

function checkMatchIsClosed($currentDate, $matchDate, &$pari)
{
 global $TEMPS_PARI;
 
 if ($pari['TempsPari'] != "")
	return (time_diff($currentDate , $matchDate) <= (-60)*$pari['TempsPari']);
 return (time_diff($currentDate , $matchDate) <= (-60)*$TEMPS_PARI);
}
?>