$when=$_REQUEST['when'];
$which=$_REQUEST['which'];
$order=$_REQUEST['order'];
require("include/top.php");
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;
}
$pattern = chr(rand(ord('a'),ord('z')));
if (isset($_GET["pattern"]))
$pattern = substr($_GET["pattern"],0,1);
$query = "SELECT parties.name as name,prods.party as id,prods.party_year ".
"as year,count(0) as count,COUNT(prods.party) as cprods,parties.web, ".
"partylinks.csdb, partylinks.slengpung, partylinks.zxdemo, ".
"partylinks.download FROM prods JOIN parties LEFT JOIN partylinks ON ".
"(prods.party_year=partylinks.year AND parties.id=partylinks.party) WHERE parties.id=prods.party ";
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%')";
$query.="and (parties.name REGEXP '^[^a-zA-Z]')";
} else {
$query.="and parties.name LIKE '".$pattern."%'";
}
$query .=" GROUP BY prods.party, prods.party_year ";
if ($order=="year") {
$query .= "ORDER BY prods.party_year DESC,parties.name ASC";
} else {
$query .= "ORDER BY parties.name ASC,prods.party_year DESC";
}
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result)) {
$parties[] = $row;
}
function lettermenu($pattern) {
print("[ ");
if($pattern=="#") {
print("#");
} else {
print("#");
}
for($i=1;$i<=26;$i++) {
print(" | ");
if($pattern==chr(96+$i)) {
print("".chr(96+$i)."");
} else {
print("".chr(96+$i)."");
}
}
print(" ]
\n");
}
?>
lettermenu($pattern); ?>
|
|
|
releases
|
download
|
for($i=0,$j=0;$i | ".$parties[$i]["year"]."
| | | ");
$j++;
if($j%2) {
print("");
} else {
print(" | ");
}
print("".$parties[$i]['name']."\n");
if($parties[$i]["web"])
{
print(" [web]");
} ?>
else:
if($j%2) {
print(" |
| ");
} else {
print("
| ");
}
endif; ?>
print("".$parties[$i]['year']."\n"); ?>
if($parties[$i]["slengpung"]): ?>
[">slengpung]
endif; ?>
if($parties[$i]["csdb"]): ?>
[">csdb]
endif; ?>
if($parties[$i]["zxdemo"]): ?>
[">zxdemo]
endif; ?>
|
print($parties[$i]['cprods']); ?>
|
if($parties[$i]["download"]): ?>
[">prods]
endif; ?>
if(file_exists("results/".$parties[$i]["id"]."_".substr($parties[$i]["year"],-2).".txt")): ?>
[&when==substr($parties[$i]["year"],-2)?>">results]
endif; ?>
|
endif; ?>
endfor; ?>
|
lettermenu($pattern); ?>
|
require("include/bottom.php"); ?>