\n" . mysql_error());; while($row=mysql_fetch_row($mysql_result)) { $rokIC=$row[0]; } function checkICyear() { global $mysql_link; $query="Select MAX(YEAR) FROM IC_YEAR"; $res=mysql_query($query,$mysql_link); $row=mysql_fetch_row($res); return $row[0]; } $m_year=checkICyear(); //print("max rok:$m_year
"); $warunek = ""; $query3= "SELECT CNTR.ID_CNTR FROM CONTRACTS_CNTR INNER JOIN CNTR ON (CONTRACTS_CNTR.CNTR_ISO = CNTR.ISO) WHERE (CONTRACTS_CNTR.ID_CONTRACT = $ID_CONTR) AND (CNTR.ID_LANG = 3)"; $mysql_result3 = mysql_query($query3, $mysql_link) or die ("$query3
\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() { global $mysql_link,$m_year,$currentlang,$rok_biezacy, $warunek, $orderby; if ($orderby == 3) { $orderby = "ORDER BY `Sredni_IC` DESC"; } elseif ($orderby == 1) { $orderby = "ORDER BY `Nazwa Wydawcy` "; } elseif ($orderby == 2) { $orderby = "ORDER BY `Ilosc_czasopism` DESC"; } elseif ($orderby == 4) { $orderby = "ORDER BY `Maksymalny_IC` DESC"; } elseif ($orderby == 5 or $orderby == "") { $orderby = "ORDER BY `Suma_IC` DESC"; } $sql = "SELECT PUBL.ID_PUBL, PUBL.PUBL_NAME AS `Nazwa Wydawcy` , SUM( IC_YEAR.IC_AMOUNT ) AS `Suma_IC` , COUNT( * ) AS `Ilosc_czasopism` , SUM( IC_YEAR.IC_AMOUNT ) / COUNT( * ) AS `Sredni_IC` , MAX( IC_AMOUNT ) AS `Maksymalny_IC` FROM JOUR INNER JOIN IC_YEAR ON (JOUR.ID_JOUR = IC_YEAR.ID_JOUR) INNER JOIN PUBL ON (PUBL.ID_PUBL = JOUR.ID_PUBL) INNER JOIN ADRS ON (PUBL.ID_ADRS = ADRS.ID_ADRS) WHERE ($warunek) AND `YEAR` = $rok_biezacy AND PUBL.ID_PUBL <> 27 GROUP BY PUBL.ID_PUBL $orderby limit 20"; //echo "$sql\n"; $q = mysql_query($sql) or die ("$sql
\n" . mysql_error()); while($row = mysql_fetch_array($q)) { echo" $row[1]$row[3]$row[4]$row[5]$row[2] "; } } function naglowek_tabeli() { global $currentlang, $rokIC; echo " "._NAMEPUBL." Journals Mid IC Max IC Total IC "; } function title_modules() { echo "

:: "._MENU_TOPLIST." ::

"; } include("header.php"); echo"

"; print("
"); print(""); print(""); print("
"); echo"
$nazwabiura - Top 20 Publishers
"; print("
 "); print("
"); naglowek_tabeli(); cialo_tabeli(); print("
"); echo" "; include("stopka.php"); echo"
"; echo"
";