\n" . mysql_error());; while($row3=mysql_fetch_row($mysql_result3)) { $warunek .= "JOUR.ID_CNTR = '$row3[0]' OR "; } $warunek = substr($warunek, 0, -4); function cialo_tabeli($litera, $start, $skok) { global $mysql_link, $warunek; $j = 1; if ($litera == 'ALL') { $query_pub="SELECT PUBL.ID_PUBL, PUBL.PUBL_NAME, PUBL.ID_ADRS FROM JOUR INNER JOIN PUBL ON (JOUR.ID_PUBL = PUBL.ID_PUBL) WHERE ($warunek) GROUP BY PUBL.ID_PUBL ORDER BY PUBL_NAME limit $start, $skok"; } else { $query_pub="SELECT PUBL.ID_PUBL, PUBL.PUBL_NAME, PUBL.ID_ADRS FROM JOUR INNER JOIN PUBL ON (JOUR.ID_PUBL = PUBL.ID_PUBL) WHERE (PUBL_NAME LIKE '$litera%') AND ($warunek) GROUP BY PUBL.ID_PUBL ORDER BY PUBL_NAME limit $start, $skok"; } $pub_result = mysql_query($query_pub) or die ("$query_pub
\n" . mysql_error()); while($pub=mysql_fetch_row($pub_result)) { $id=$pub[0]; $publ_name=$pub[1]; $id_adrs=$pub[2]; $q_count_jour="SELECT count(*) from JOUR where ID_PUBL=$id"; $result_count_jour= mysql_query($q_count_jour, $mysql_link); $count=mysql_fetch_row($result_count_jour); $count_jour = $count[0]; if($j==0) { print(""); } else { print(""); } if($count_jour > 0) { echo "$publ_name[ $count_jour ]"; if($j == 1) $j=0; else $j=1; } } } function show($litera, $skok) { if($skok == '') $skok = 20; echo"
"); echo "
"; echo""; echo _SHOW.":
"; } function next_prev($litera, $start, $skok) { global $mysql_link, $warunek; $q="SELECT PUBL.ID_PUBL, PUBL.PUBL_NAME, PUBL.ID_ADRS FROM JOUR INNER JOIN PUBL ON (JOUR.ID_PUBL = PUBL.ID_PUBL) WHERE (PUBL_NAME LIKE '$litera%') AND ($warunek) ORDER BY PUBL_NAME"; $query_ilosc= mysql_query($q) or die ("$q
\n" . mysql_error());; $ilosc = mysql_num_rows($query_ilosc); $prev = $start - $skok; $next = $start + $skok; if($prev >= 0) echo ""._PREVIOUS." $skok"; if($prev >= 0 && $next <= $ilosc) print(" | "); if($next <= $ilosc) echo ""._NEXT." $skok"; } function lista_liter($litera, $skok) { global $warunek; print("
"); $tab = array('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'W', 'V', 'Z', 'Y'); reset ($tab); while (list ($key, $val) = each ($tab)) { $q="SELECT PUBL.ID_PUBL, PUBL.PUBL_NAME, PUBL.ID_ADRS FROM JOUR INNER JOIN PUBL ON (JOUR.ID_PUBL = PUBL.ID_PUBL) WHERE (PUBL_NAME LIKE '$val%') AND ($warunek) ORDER BY PUBL_NAME"; $query_ilosc= mysql_query($q) or die ("$q
\n" . mysql_error()); $ilosc = mysql_num_rows($query_ilosc); if ($ilosc == 0) { unset($tab[$key]); } } reset ($tab); $tab[] = "ALL"; $liczba_el = count($tab); while (list ($key, $val) = each ($tab)) { if($tab[$key] == $litera) { print("$tab[$key]   "); } else { print("$tab[$key]   "); } } print("
"); } function naglowek_tabeli() { global $currentlang, $rokIC; echo " "._NAMEPUBL." "._NOPUBL." "; } include("header.php"); if($start == "") $start = 0; if($litera == "") $litera = "ALL"; if($skok == "") $skok = 20; echo"
"; print("
"); print("
"); echo"
$nazwabiura - Publishers
"; print("
"); lista_liter($litera,$skok); print("
"); print("
"); echo"
"; next_prev($litera, $start, $skok); echo"
"; //print("
"); //show($litera, $skok); print("
"); echo"
"; print("
"); print("
"); naglowek_tabeli(); cialo_tabeli($litera, $start, $skok); print("
"); print("
"); print("
"); echo"
"; next_prev($litera, $start, $skok); echo"
"; print("
"); //show($litera, $skok); //print("
"); echo"
"; print("
"); include("stopka.php"); echo"
";