Je bent hier: Home - Freerolls Overzicht


0) { foreach(array_keys($array) as $key) $temp[$key]=$array[$key][$index]; if(!$natsort) ($order=='asc')? asort($temp) : arsort($temp); else { ($case_sensitive)? natsort($temp) : natcasesort($temp); if($order!='asc') $temp=array_reverse($temp,TRUE); } foreach(array_keys($temp) as $key) (is_numeric($key))? $sorted[]=$array[$key] : $sorted[$key]=$array[$key]; return $sorted; } return $array; } #End of sorting function //Parameter to show only freerolls starting in 'plustime' hours $plustime = $_GET["plustime"]; // Grab the language parameter from the link $language=$_GET['language']; # .php?language=nl -> English # everything else -> Dutch if ($language != "EN") { $language = "NL"; } //If specials YES, only show freerolls with a flags value != 0. $specials=$_GET['specials']; //Pokerroom, if set, only show freerolls from pokerroom x $selectpokerroom=$_GET['pokerroom']; //Pokerroom, if set, only show freerolls from pokerroom x $selectflag=$_GET['flags']; $link = mysql_connect($host,$username,$password); if (!$link) { die('Could not connect: ' . mysql_error()); } $db_selected = mysql_select_db($db, $link); if (!$db_selected) { die ("Can't use $db : " . mysql_error()); } if ($plustime == "") { $plustime = 24; } if ($plustime < 10) { $timerange = strtotime("0".$plustime.":00:00"); } else if ($plustime < 24){ $timerange = strtotime($plustime.":00:00"); } else { $timerange = strtotime("23:59:59"); } $tijdnow = date("Hi"); #Current time. $dagnow = date("w"); #Current day of the week #Day of the week is modulo 7 (runs from 0 Sunday to 6 Saturday) $dagtomorrow = $dagnow+1; if ($dagtomorrow > 6) { $dagtomorrow = $dagtomorrow - 7; } include("../admin/lib.php"); # Only select weekly freerolls for today that have a time LATER # than now and select weekly freerolls for tomorrow that have a time # EARLIER than now... # Make sure to use LIKE instead of exact string: freerolls can occur more than one # day of the week. if ($language == "EN") { $query= "SELECT id, starttijd, speltype, uitbetaling, waar, prerequisites_EN AS voorwaarden, euro, flags from freeroll_wekelijks AS fw INNER JOIN pokerroom_info AS pi ON fw.waar = pi.pokerroomID WHERE pi.countries LIKE '%EN%' AND ( (fw.weekdag LIKE '%".$dagnow."%' AND (fw.starttijd > NOW() )) OR (fw.weekdag LIKE '%".$dagtomorrow."%' AND fw.starttijd < NOW() ) )"; } else { $query= "SELECT id, starttijd, speltype, uitbetaling, waar, voorwaarden, euro, flags from freeroll_wekelijks AS fw INNER JOIN pokerroom_info AS pi ON fw.waar = pi.pokerroomID WHERE pi.countries LIKE '%NL%' AND ( (fw.weekdag LIKE '%".$dagnow."%' AND (fw.starttijd > NOW() )) OR (fw.weekdag LIKE '%".$dagtomorrow."%' AND fw.starttijd < NOW() ) )"; } #Now add the unique freeroll table # Only select unique freerolls for date=today that have a time LATER # than now and select weekly freerolls for date=tomorrow that have a time # EARLIER than now... if ($language == "EN") { $query.="UNION ALL SELECT id, starttijd, speltype, uitbetaling, waar, prerequisites_EN AS voorwaarden, euro, flags from freeroll_uniek AS fu INNER JOIN pokerroom_info AS pi ON fu.waar = pi.pokerroomID WHERE pi.countries LIKE '%EN%' AND ( (datum = CURDATE() AND fu.starttijd > NOW() ) OR (datum = DATE_ADD(CURDATE(),INTERVAL 1 DAY) AND fu.starttijd < NOW() ) ) "; } else { $query.="UNION ALL SELECT id, starttijd, speltype, uitbetaling, waar, voorwaarden, euro, flags from freeroll_uniek AS fu INNER JOIN pokerroom_info AS pi ON fu.waar = pi.pokerroomID WHERE pi.countries LIKE '%NL%' AND ( (datum = CURDATE() AND fu.starttijd > NOW() ) OR (datum = DATE_ADD(CURDATE(),INTERVAL 1 DAY) AND fu.starttijd < NOW() ) )"; } #Finally add all the freerolls from the daily table if ($language == "EN") { $query.="UNION ALL SELECT id, starttijd, speltype, uitbetaling, waar, prerequisites_EN AS voorwaarden, euro, flags from freeroll AS fr INNER JOIN pokerroom_info as pi ON fr.waar = pi.pokerroomID WHERE pi.countries LIKE '%EN%';"; } else { $query.="UNION ALL SELECT id, starttijd, speltype, uitbetaling, waar, voorwaarden, euro, flags from freeroll AS fr INNER JOIN pokerroom_info as pi ON fr.waar = pi.pokerroomID WHERE pi.countries LIKE '%NL%';"; } $result=mysql_query($query); $num=mysql_numrows($result); # echo "REULTS TOTAL IS".$num; # Turn result into array. $myMultiArray = Array(); #Here we will add each mysql result to a multidimensional #array AND misuse the id value to contain the 'time to start' #value $i=0; $rangedrecords = 0; while ($myresultarray = mysql_fetch_array($result) ) { $verschil = strtotime($myresultarray['starttijd']) - strtotime( $tijdnow); $verschil2 = strtotime('-1 hour', $verschil); $tegaan = strftime("%H:%M:00",$verschil2) ; $myresultarray['id'] = $tegaan; $timerangeS = strftime("%H:%M:00",$timerange) ; //First make sure that tegaan < plustime if ($tegaan < $timerangeS) { $toggleadd=1; //If specials selected and tournament does not have flags //value (!= special), break out and dont add to final array //echo "Flags =".$myresultarray['flags']; if ($specials == "YES" && $myresultarray['flags'] == "0") { //echo "ADDED Flags =".$myresultarray['flags']."\n"; $toggleadd=0; } //If single pokerroom selected and current room is not that room //break out. if ($selectpokerroom != "" && $myresultarray['waar'] != $selectpokerroom) { $toggleadd=0; } //If single pokerroom selected and current room is not that room //break out. if ($selectflag != "" && $myresultarray['flags'] != $selectflag) { $toggleadd=0; } if($toggleadd==1) { $myMultiArray[$i] = $myresultarray; $rangedrecords++; } } $i++; } #Sort the array on our id = timetostart value $mySorted = sort2d($myMultiArray, 'id'); ?>
Freeroll Starttijd:
<? echo $alt; ?>
Bonus
        % Rake Back

© freerollsoftware.nl