require("include/misc.php");
conn_db();
function cmp_year($a, $b)
{
if ($a["year"] == $b["year"])
{
return ($a["name"] < $b["name"]) ? -1 : 1;
}
return ($a["year"] > $b["year"]) ? -1 : 1;
}
function cmp_name($a, $b)
{
if (strtolower($a["name"]) == strtolower($b["name"]))
{
return (strtolower($a["year"]) > strtolower($b["year"])) ? -1 : 1;
}
return (strtolower($a["name"]) < strtolower($b["name"])) ? -1 : 1;
}
function goodfleche($wanted,$current) {
if($wanted==$current) {
$fleche="fleche1a";
} else {
$fleche="fleche1b";
}
return $fleche;
}
function lettermenu($pattern) {
print("[ ");
if($pattern=="#") {
print("#");
} else {
printf("#",$_GET["form"],$_GET["field"]);
}
for($i=1;$i<=26;$i++) {
if ($i==13) {
print(" ]
\n");
print("[ ");
} else
print(" | ");
if($pattern==chr(96+$i)) {
print("".chr(96+$i)."");
} else {
printf("%s",chr(96+$i),$_GET["form"],$_GET["field"],chr(96+$i));
}
}
print(" ]
\n");
}
if(!$pattern&&!$which) {
$pattern=chr(mt_rand(96,122));
if($pattern==chr(96)) {
$pattern="#";
}
}
if($pattern=="#") {
// $sqlwhere="(name LIKE '0%')||(name LIKE '1%')||(name LIKE '2%')||(name LIKE '3%')||(name LIKE '4%')||(name LIKE '5%')||(name LIKE '6%')||(name LIKE '7%')||(name LIKE '8%')||(name LIKE '9%')";
$sqlwhere="(name REGEXP '^[^a-zA-Z]')";
} else {
$sqlwhere="name LIKE '".$pattern."%'";
}
$query = "SELECT * FROM parties ";
$query .= " WHERE ".$sqlwhere;
$query .= " ORDER BY parties.name ASC";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)) {
$parties[] = $row;
}
?>
pouet.net parties