czf4bfu |
Subversion Repositories: |
Rev 8 | Rev 9 | |
---|---|---|
Line 2... | Line 2... | |
error_reporting(0); |
error_reporting(0); | |
// Nastavime, aby se nam zbytecne nelogovaly chyby |
// Nastavime, aby se nam zbytecne nelogovaly chyby | |
ini_set('log_errors',false); |
ini_set('log_errors',false); | |
|
| |
$i=0; |
$i=0; | |
$seznam = array(); |
||
$oblast = array(); |
||
$item = array(); |
||
$items = array(); |
||
echo "<!--CZF4BFU "; |
echo "<!--CZF4BFU "; | |
if ($dir = opendir(".")) { |
if ($dir = opendir(".")) { | |
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 149... | Line 145... | |
"10.155.0.0/16" => "Ostrava - okres", |
"10.155.0.0/16" => "Ostrava - okres", | |
"10.161.0.0/16" => "Evkanet - Ostrava", |
"10.161.0.0/16" => "Evkanet - Ostrava", | |
"10.253.0.0/16" => "NCX - Zápy", |
"10.253.0.0/16" => "NCX - Zápy", | |
"10.254.0.0/16" => "NCX Labyrint"); |
"10.254.0.0/16" => "NCX Labyrint"); | |
|
| |
$order[0][0] = "TYP"; |
||
$order[1][0] = "NAZEV"; |
||
$sort_cz = 0; |
$sort_cz = 0; | |
|
| |
function arfsort( $a, $yes ) { |
function arfsort( $a, $yes ) { | |
global $sort_cz; |
global $sort_cz; | |
$sort_cz = $yes; |
$sort_cz = $yes; | |
usort( $a, 'arfsort_func' ); |
usort( $a, 'arfsort_func' ); | |
return $a; |
return $a; | |
} |
} | |
|
| |
function arfsort_func( $a, $b ){ |
function arfsort_func( $a, $b ){ | |
global $order,$sort_cz; |
global $sort_cz; | |
$order[0][0] = "TYP"; | ||
$order[1][0] = "NAZEV"; | ||
foreach($order as $f) { |
foreach($order as $f) { | |
if($sort_cz=="1") { |
if($sort_cz=="1") { | |
$a[$f[0]]=strtr($a[$f[0]], array("Á" => "azzz", "É" => "ezzz", "Í" => "izzz", "Ó" => "ozzz", "Ú" => "uzzz", "Ý" => "yzzz", "Ž" => "zzzz", "Š" => "szzz", "Č" => "czzz", "Ř" => "rzzz")); |
$a[$f[0]]=strtr($a[$f[0]], array("Á" => "azzz", "É" => "ezzz", "Í" => "izzz", "Ó" => "ozzz", "Ú" => "uzzz", "Ý" => "yzzz", "Ž" => "zzzz", "Š" => "szzz", "Č" => "czzz", "Ř" => "rzzz")); | |
$b[$f[0]]=strtr($b[$f[0]], array("Á" => "azzz", "É" => "ezzz", "Í" => "izzz", "Ó" => "ozzz", "Ú" => "uzzz", "Ý" => "yzzz", "Ž" => "zzzz", "Š" => "szzz", "Č" => "czzz", "Ř" => "rzzz")); |
$b[$f[0]]=strtr($b[$f[0]], array("Á" => "azzz", "É" => "ezzz", "Í" => "izzz", "Ó" => "ozzz", "Ú" => "uzzz", "Ý" => "yzzz", "Ž" => "zzzz", "Š" => "szzz", "Č" => "czzz", "Ř" => "rzzz")); | |
} |
} | |
Line 189... | Line 185... | |
foreach ($test as $key=>$row) { |
foreach ($test as $key=>$row) { | |
$oblastx = $row["OBLAST"]; |
$oblastx = $row["OBLAST"]; | |
$typ = $row["TYP"]; |
$typ = $row["TYP"]; | |
$nazev = $row["NAZEV"]; |
$nazev = $row["NAZEV"]; | |
$id = $row["ID"]; |
$id = $row["ID"]; | |
if($oblastx=="") { $oblastx="10.0.0.0/8"; } |
||
$ikonka = $typ; |
$ikonka = $typ; | |
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } |
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } | |
echo "<div class=\"smallicon\"><a title=\"$nazev\" href=\"?id=$id&oblast=$oblastx#$oblastx\"><img width=\"16\" title=\"$nazev\" border=\"0\" src=\"ikony/$ikonka.png\"></a> <a title=\"$nazev\" href=\"?id=$id&oblast=$oblastx#$oblastx\">$nazev</a></div>\n"; |
echo "<div class=\"smallicon\"><a title=\"$nazev\" href=\"?id=$id&oblast=$oblastx#$oblastx\"><img width=\"16\" title=\"$nazev\" border=\"0\" src=\"ikony/$ikonka.png\"></a> <a title=\"$nazev\" href=\"?id=$id&oblast=$oblastx#$oblastx\">$nazev</a></div>\n"; | |
} |
} | |
} |
} | |
Line 203... | Line 198... | |
$oblastx = $row["OBLAST"]; |
$oblastx = $row["OBLAST"]; | |
$typ = $row["TYP"]; |
$typ = $row["TYP"]; | |
$nazev = $row["NAZEV"]; |
$nazev = $row["NAZEV"]; | |
$popis = $row["POPIS"]; |
$popis = $row["POPIS"]; | |
$id = $row["ID"]; |
$id = $row["ID"]; | |
if($oblastx=="") { $oblastx="10.0.0.0/8"; } |
||
$ikonka = $typ; |
$ikonka = $typ; | |
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } |
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } | |
|
| |
echo "<div class=\"icon\"><a title=\"".$popis."\" href=\"?id=".$id."&oblast=".$oblastx."#".$oblastx."\"><img title=\"".$popis."\" border=\"0\" width=\"32\" src=\"ikony/$ikonka.png\"><br>".$nazev."</a></div>\n"; |
echo "<div class=\"icon\"><a title=\"".$popis."\" href=\"?id=".$id."&oblast=".$oblastx."#".$oblastx."\"><img title=\"".$popis."\" border=\"0\" width=\"32\" src=\"ikony/$ikonka.png\"><br>".$nazev."</a></div>\n"; | |
} |
} | |
Line 219... | Line 213... | |
$oblastx = $row["OBLAST"]; |
$oblastx = $row["OBLAST"]; | |
$typ = $row["TYP"]; |
$typ = $row["TYP"]; | |
$nazev = $row["NAZEV"]; |
$nazev = $row["NAZEV"]; | |
$popis = $row["POPIS"]; |
$popis = $row["POPIS"]; | |
$id = $row["ID"]; |
$id = $row["ID"]; | |
if($oblastx=="") { $oblastx="10.0.0.0/8"; } |
||
$ikonka = $typ; |
$ikonka = $typ; | |
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } |
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } | |
|
| |
if ($typ===$pamatuj) { |
if ($typ===$pamatuj) { | |
echo "<div class=\"icon\"><a title=\"".$popis."\" href=\"?id=".$id."&oblast=".$oblastx."#".$oblastx."\"><img title=\"".$popis."\" border=\"0\" width=\"32\" src=\"ikony/$ikonka.png\"><br>".$nazev."</a></div>\n"; |
echo "<div class=\"icon\"><a title=\"".$popis."\" href=\"?id=".$id."&oblast=".$oblastx."#".$oblastx."\"><img title=\"".$popis."\" border=\"0\" width=\"32\" src=\"ikony/$ikonka.png\"><br>".$nazev."</a></div>\n"; | |
Line 253... | Line 246... | |
if(!file_exists("ikony/".$ikonka_det.".png")) { $ikonka_det = "none"; } |
if(!file_exists("ikony/".$ikonka_det.".png")) { $ikonka_det = "none"; } | |
echo "<div class=\"det\">"; |
echo "<div class=\"det\">"; | |
echo "<div class=\"icon_det\"><img alt=\"$ikonka_det\" src=\"ikony/$ikonka_det.png\"></div>"; |
echo "<div class=\"icon_det\"><img alt=\"$ikonka_det\" src=\"ikony/$ikonka_det.png\"></div>"; | |
echo "<div class=\"info_det\">"; |
echo "<div class=\"info_det\">"; | |
foreach ($test as $key=>$row) { |
foreach ($test as $key=>$row) { | |
if($key!="HESLOEDIT") { |
if(($key!="HESLOEDIT") and (substr($key, 0, 1)!="#")) { | |
echo "<strong>".$key."</strong>: ".$test["$key"]."<br>"; |
echo "<strong>".$key."</strong>: ".$test["$key"]."<br>"; | |
} |
} | |
} |
} | |
echo "</div><div class=\"info_cut\"></div></div>"; |
echo "</div><div class=\"info_cut\"></div></div>"; | |
} |
} | |
Line 291... | Line 284... | |
} |
} | |
|
| |
// ------- naladujem data do 3-rozmernyho pole ------- |
// ------- naladujem data do 3-rozmernyho pole ------- | |
|
| |
for ($k=0; $k<=$polozka; ++$k) { |
for ($k=0; $k<=$polozka; ++$k) { | |
if ((preg_match("/OBLAST:/i", $item[$k])) and (!preg_match("/OBLAST:<br>/i", $item[$k]))) { | ||
preg_match('%OBLAST:(.*?)(<br)%s', $item[$k], $cloud); | ||
if (!($obl["$cloud[1]"])) { | ||
$oblast[] = $cloud[1]; | ||
$jmena_cloudu["$cloud[1]"]=strtr($jmena_cloudu["$cloud[1]"], array("á" => "á", "é" => "é", "ě" => "ě", "í" => "í", "ó" => "ó", "ú" => "ú", "ů" => "ů", "ý" => "ý", "" => "ž", "" => "š", "č" => "č", "ř" => "ř", "ď" => "ď", "" => "ť", "ň" => "ň", "Á" => "Á", "É" => "É", "Ě" => "Ě", "Í" => "Í", "Ó" => "Ó", "Ú" => "Ú", "Ů" => "Ů", "Ý" => "Ý", "" => "Ž", "" => "Š", "Č" => "Č", "Ř" => "Ř", "Ď" => "Ď", "" => "Ť", "Ň" => "Ň")); | ||
} | ||
} else { | ||
$cloud[1] = "10.0.0.0/8"; | ||
} | ||
$ic = explode("<br>", $item[$k]); |
$ic = explode("<br>", $item[$k]); | |
$cnt_ic = (count($ic)); |
$cnt_ic = (count($ic)); | |
for ($b=0; $b<=$cnt_ic; ++$b) { |
for ($b=0; $b<=$cnt_ic; ++$b) { | |
if($b==$cnt_ic) { |
if($b===$cnt_ic) { | |
$items[$k]['ID']=$k; |
$items[$k]['ID']=$k; | |
} else { |
} else { | |
if(($ic[$b])!="") { |
if(($ic[$b])!="") { | |
$pole = strpos($ic[$b], ":"); |
$pole = strpos($ic[$b], ":"); | |
if((((substr($ic[$b], 0, $pole))=="URL") or ((substr($ic[$b], 0, $pole))=="URLIP")) or ((substr($ic[$b], 0, $pole))=="URLINET")) { |
if((((substr($ic[$b], 0, $pole))=="URL") or ((substr($ic[$b], 0, $pole))=="URLIP")) or ((substr($ic[$b], 0, $pole))=="URLINET")) { | |
Line 307... | Line 309... | |
$items[$k][(strtoupper(substr($ic[$b], 0, $pole)))]=(substr($ic[$b], $pole+1)); |
$items[$k][(strtoupper(substr($ic[$b], 0, $pole)))]=(substr($ic[$b], $pole+1)); | |
} |
} | |
} |
} | |
} |
} | |
} |
} | |
$obl["$cloud[1]"][] = $items[$k]; | ||
} |
} | |
|
| |
// -- zjisteni a serazeni oblasti |
unset($item); | |
$cloudy = ""; |
||
|
| |
for ($k=0; $k<=$polozka; ++$k) { |
//$oblast = explode(";", substr($cloudy, 0, -1)); | |
if ((preg_match("/OBLAST:/i", $item[$k])) and (!preg_match("/OBLAST:<br>/i", $item[$k]))) { |
||
preg_match('%OBLAST:(.*?)(<br)%s', $item[$k], $cloud); |
||
if (!ereg($cloud[1], $cloudy)) { |
||
$cloudy .= $cloud[1].";"; |
||
} |
||
} |
||
} |
||
$cloudy = substr($cloudy, 0, -1); |
||
$oblast = explode(";", $cloudy); |
||
$pocet_oblasti = count($oblast)-1; |
$pocet_oblasti = count($oblast)-1; | |
|
| |
// -- seradime oblasti (bublinkovy razeni je silene pomaly) |
// -- seradime oblasti (bublinkovy razeni je silene pomaly) | |
usort( $oblast, 'natsort_func' ); |
usort( $oblast, 'natsort_func' ); | |
|
| |
|
||
// ------- zapiseme hodnoty do cloudovskych poli ------- |
||
|
||
for ($o=0; $o<=$pocet_oblasti; ++$o) { |
||
foreach ($items as $row) { |
||
$rowoblast = $row["OBLAST"]; |
||
if($rowoblast=="") { $rowoblast="10.0.0.0/8"; } |
||
if($rowoblast==$oblast[$o]) { |
||
$obl["$oblast[$o]"][]=$row; |
||
} |
||
} |
||
} |
||
|
||
// ------- prekodujem nazvy cloudu, aby nam nedelaly bordel pri spatnym kodovani ------- |
||
|
||
for ($o=0; $o<=$pocet_oblasti; $o++) { |
||
$trans_code = array("á" => "á", "é" => "é", "ě" => "ě", "í" => "í", "ó" => "ó", "ú" => "ú", "ů" => "ů", "ý" => "ý", "" => "ž", "" => "š", "č" => "č", "ř" => "ř", "ď" => "ď", "" => "ť", "ň" => "ň", "Á" => "Á", "É" => "É", "Ě" => "Ě", "Í" => "Í", "Ó" => "Ó", "Ú" => "Ú", "Ů" => "Ů", "Ý" => "Ý", "" => "Ž", "" => "Š", "Č" => "Č", "Ř" => "Ř", "Ď" => "Ď", "" => "Ť", "Ň" => "Ň"); |
||
$jmena_cloudu["$oblast[$o]"]=strtr($jmena_cloudu["$oblast[$o]"], $trans_code); |
||
} |
||
|
| |
// ------- vypis ve sloupecku vlevo ------- |
// ------- vypis ve sloupecku vlevo ------- | |
|
| |
for ($o=0; $o<=$pocet_oblasti; $o++) { |
for ($o=0; $o<=$pocet_oblasti; $o++) { | |
echo "<a class=\"title\" name=\"".$oblast[$o]."\" href=\"?oblast=".$oblast[$o]."#".$oblast[$o]."\"><span class=\"cloudip\">".$oblast[$o]."</span>\n"; |
echo "<a class=\"title\" name=\"".$oblast[$o]."\" href=\"?oblast=".$oblast[$o]."#".$oblast[$o]."\"><span class=\"cloudip\">".$oblast[$o]."</span>\n"; | |
if(strlen($jmena_cloudu["$oblast[$o]"])>=1) { |
if(isset($jmena_cloudu["$oblast[$o]"])) { | |
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]"], 0); |
$sorted["$oblast[$o]"] = arfsort( $obl["$oblast[$o]"], 0); | |
show_small($sorted["$oblast[$o]"]); |
show_small($sorted["$oblast[$o]"]); | |
|
| |
} |
} | |
|
| |
?> |
?> | |
|
| |
Line 532... | Line 506... | |
show_groups($sorted["$czf_oblast"]); |
show_groups($sorted["$czf_oblast"]); | |
|
| |
echo "<div class=\"sizer\"></div></div>\n"; |
echo "<div class=\"sizer\"></div></div>\n"; | |
|
| |
} |
} | |
|
||
unset($oblast); |
||
unset($item); |
||
unset($items); |
||
|
| |
} // end |
} // end | |
|
||
unset($seznam); |
||
|
| |
?> |
?> | |
|
| |
<div id="copy">czf4bfu v1.3 - made <a href="http://www.jklir.net">Unreal][</a> </div> |
<div id="copy">czf4bfu v1.3 - made <a href="http://www.jklir.net">Unreal][</a> </div> | |
</body> |
</body> |