czf4bfu.prosek.czf |
Subversion Repositories: |
Rev 8 | Rev 9 | |
---|---|---|
Line 1... | Line 1... | |
<?php |
<?php | |
// Nastavime, aby se nam zbytecne nelogovaly chyby | ||
ini_set('log_errors',FALSE); | ||
| ||
if ($dir = @opendir(".")) { |
if ($dir = @opendir(".")) { | |
echo("<!--CZF4BFU "); |
echo("<!--CZF4BFU "); | |
while (($file = readdir($dir)) !== false) |
while (($file = readdir($dir)) !== false) | |
if (preg_match('/^(global|local)-.*.txt/',$file)) |
if (preg_match('/^(global|local)-.*.txt/',$file)) | |
echo $file." "; |
echo $file." "; | |
Line 156... | Line 159... | |
"10.254.0.0/16" => "NCX Labyrint"); |
"10.254.0.0/16" => "NCX Labyrint"); | |
|
| |
// prasarna, ale dokaze to radit cesky retezce :-) |
// prasarna, ale dokaze to radit cesky retezce :-) | |
$trans_cz = array("Á" => "azzz", "É" => "ezzz", "Ě" => "ezzzz", "Í" => "izzz", "Ó" => "ozzz", "Ú" => "uzzz", "Ý" => "yzzz", "Ž" => "zzzz", "Š" => "szzz", "Č" => "czzz", "Ř" => "rzzz", "Ď" => "dzzz", "Ť" => "tzzz", "Ň" => "nzzz"); |
$trans_cz = array("Á" => "azzz", "É" => "ezzz", "Ě" => "ezzzz", "Í" => "izzz", "Ó" => "ozzz", "Ú" => "uzzz", "Ý" => "yzzz", "Ž" => "zzzz", "Š" => "szzz", "Č" => "czzz", "Ř" => "rzzz", "Ď" => "dzzz", "Ť" => "tzzz", "Ň" => "nzzz"); | |
|
| |
function arfsort( $a, $fl, $y ){ |
function arfsort( $a, $y ){ | |
$GLOBALS['__ARFSORT_LIST__'] = $fl; |
||
$GLOBALS['__ARFSORT_YES__'] = $y; |
$GLOBALS['__ARFSORT_YES__'] = $y; | |
usort( $a, 'arfsort_func' ); |
usort( $a, 'arfsort_func' ); | |
return $a; |
return $a; | |
} |
} | |
|
| |
function arfsort_func( $a, $b ){ |
function arfsort_func( $a, $b ){ | |
global $trans_cz; |
global $trans_cz; | |
foreach( $GLOBALS['__ARFSORT_LIST__'] as $f ) { |
$order[0][0] = "TYP"; | |
$order[1][0] = "NAZEV"; | ||
foreach($order as $f) { | ||
if($GLOBALS['__ARFSORT_YES__']=="1") { |
if($GLOBALS['__ARFSORT_YES__']=="1") { | |
$a[$f[0]]=strtr($a[$f[0]], $trans_cz); |
$a[$f[0]]=strtr($a[$f[0]], $trans_cz); | |
$b[$f[0]]=strtr($b[$f[0]], $trans_cz); |
$b[$f[0]]=strtr($b[$f[0]], $trans_cz); | |
} |
} | |
$strc = strcmp( strtolower($a[$f[0]]), strtolower($b[$f[0]]) ); |
$strc = strcmp( strtolower($a[$f[0]]), strtolower($b[$f[0]]) ); | |
if ( $strc != 0 ) { |
if ( $strc != 0 ) { | |
return $strc; |
return $strc; | |
} else { |
||
return 0; |
||
} |
} | |
} |
} | |
return 0; | ||
} |
} | |
|
| |
function show_small($test) { |
function show_small($test) { | |
foreach ($test as $key=>$row) { |
foreach ($test as $key=>$row) { | |
|
| |
Line 201... | Line 204... | |
echo "<div class=\"icon\"><a title=\"".@$row['POPIS']."\" href=\"?id=".$row['ID']."&oblast=".$row['OBLAST']."#".$row['OBLAST']."\"><img title=\"".@$row['POPIS']."\" border=\"0\" width=\"32\" src=\"ikony/$ikonka.png\"><br>".$row['NAZEV']."</a></div>\n"; |
echo "<div class=\"icon\"><a title=\"".@$row['POPIS']."\" href=\"?id=".$row['ID']."&oblast=".$row['OBLAST']."#".$row['OBLAST']."\"><img title=\"".@$row['POPIS']."\" border=\"0\" width=\"32\" src=\"ikony/$ikonka.png\"><br>".$row['NAZEV']."</a></div>\n"; | |
} |
} | |
} |
} | |
|
| |
function show_groups($test) { |
function show_groups($test) { | |
$pamatuj = ""; | ||
foreach ($test as $key=>$row) { |
foreach ($test as $key=>$row) { | |
|
| |
if ($row['TYP']==@$pamatuj) { |
if ($row['TYP']==@$pamatuj) { | |
|
| |
if($row['OBLAST']=="") { $row['OBLAST']="10.0.0.0/8"; } |
if($row['OBLAST']=="") { $row['OBLAST']="10.0.0.0/8"; } | |
Line 264... | Line 268... | |
for ($g=0; $g<$pocet_globalu; $g++) { |
for ($g=0; $g<$pocet_globalu; $g++) { | |
|
| |
$file = "./".$seznam[$g]; // $g |
$file = "./".$seznam[$g]; // $g | |
$fp = Fopen($file, "r"); |
$fp = Fopen($file, "r"); | |
$dat = Fread($fp, filesize($file)); |
$dat = Fread($fp, filesize($file)); | |
// $dat = file_get_contents($file); | ||
$data = explode("\n", $dat); |
$data = explode("\n", $dat); | |
$soucet = count($data); |
$soucet = count($data); | |
|
| |
for ($j=0; $j<=$soucet; $j++) { |
for ($j=0; $j<=$soucet; $j++) { | |
if (((@$data[$j]!="") and (@$data[$j]!=" ")) and (@$data[$j][0]!=(chr(13)))) { |
if (((@$data[$j]!="") and (@$data[$j]!=" ")) and (@$data[$j][0]!=(chr(13)))) { | |
Line 300... | Line 305... | |
} |
} | |
} |
} | |
} |
} | |
} |
} | |
} |
} | |
|
||
|
||
$order_arr = array( array('TYP','a'), array('NAZEV','a') ); // pravidlo razeni |
||
|
||
|
| |
// -- zjisteni a serazeni oblasti |
// -- zjisteni a serazeni oblasti | |
|
| |
|
| |
for ($k=0; $k<=$polozka; $k++) { |
for ($k=0; $k<=$polozka; $k++) { | |
Line 341... | Line 342... | |
|
| |
for ($o=0; $o<=$pocet_oblasti; $o++) { |
for ($o=0; $o<=$pocet_oblasti; $o++) { | |
foreach ($items as $key=>$row) { |
foreach ($items as $key=>$row) { | |
if(@$row['OBLAST']=="") { $row['OBLAST']="10.0.0.0/8"; } |
if(@$row['OBLAST']=="") { $row['OBLAST']="10.0.0.0/8"; } | |
if($row['OBLAST']==$oblast[$o]) { |
if($row['OBLAST']==$oblast[$o]) { | |
|
||
$obl[$oblast[$o]][]=$row; |
$obl[$oblast[$o]][]=$row; | |
} |
} | |
} |
} | |
} |
} | |
|
| |
// ------- prekodujem nazvy cloudu, aby nam nedelaly bordel pri spatnym kodovani ------- |
// ------- prekodujem nazvy cloudu, aby nam nedelaly bordel pri spatnym kodovani ------- | |
|
| |
Line 364... | Line 364... | |
echo "<br>".$jmena_cloudu[$oblast[$o]]."</a>"; |
echo "<br>".$jmena_cloudu[$oblast[$o]]."</a>"; | |
} else { |
} else { | |
echo "</a>"; |
echo "</a>"; | |
} |
} | |
|
| |
$sorted["$oblast[$o]"] = arfsort( $obl["$oblast[$o]"], $order_arr, 0); |
$sorted["$oblast[$o]"] = arfsort( $obl["$oblast[$o]"], 0); | |
show_small($sorted["$oblast[$o]"]); |
show_small($sorted["$oblast[$o]"]); | |
|
| |
} |
} | |
|
| |
?> |
?> | |
Line 384... | Line 384... | |
|
| |
|
| |
// ------- pokud neni uvedena oblast ani id ani groupa ------- |
// ------- pokud neni uvedena oblast ani id ani groupa ------- | |
|
| |
if (((@$_GET["oblast"]=="") and (@$_GET["id"]=="")) and (@$_GET["group"]=="")) { |
if (((@$_GET["oblast"]=="") and (@$_GET["id"]=="")) and (@$_GET["group"]=="")) { | |
$sorted0 = arfsort( $items, $order_arr, 1); |
$sorted0 = arfsort( $items, 1); | |
show_big($sorted0); |
show_big($sorted0); | |
|
| |
echo "<div class=\"sizer\"></div></div>"; |
echo "<div class=\"sizer\"></div></div>"; | |
} |
} | |
|
| |
// ------- pokud neni uvedena oblast ani id ale groupa ano ------- |
// ------- pokud neni uvedena oblast ani id ale groupa ano ------- | |
|
| |
if (((@$_GET["oblast"]=="") and (@$_GET["id"]=="")) and (@$_GET["group"]=="1")) { |
if (((@$_GET["oblast"]=="") and (@$_GET["id"]=="")) and (@$_GET["group"]=="1")) { | |
$sorted0 = arfsort( $items, $order_arr, 1); |
$sorted0 = arfsort( $items, 1); | |
show_groups($sorted0); |
show_groups($sorted0); | |
|
| |
echo "<div class=\"sizer\"></div></div>"; |
echo "<div class=\"sizer\"></div></div>"; | |
} |
} | |
|
| |
Line 465... | Line 465... | |
|
| |
show_big($sorted4); |
show_big($sorted4); | |
|
| |
} else { |
} else { | |
|
| |
$sorted0 = arfsort( $items, $order_arr, 0); |
$sorted0 = arfsort( $items, 1); | |
show_big($sorted0); |
show_big($sorted0); | |
|
| |
} |
} | |
|
| |
|
| |
Line 500... | Line 500... | |
|
| |
show_groups($sorted4); |
show_groups($sorted4); | |
|
| |
} else { |
} else { | |
|
| |
$sorted0 = arfsort( $items, $order_arr, 0); |
$sorted0 = arfsort( $items, 1); | |
show_groups($sorted0); |
show_groups($sorted0); | |
|
| |
} |
} | |
|
| |
|
|