czf4bfu |
Subversion Repositories: |
Rev 3 | Rev 4 | |
---|---|---|
Line 1... | Line 1... | |
<?php |
<?php | |
// Nastavime, aby se nam zbytecne nelogovaly chyby |
// Nastavime, aby se nam zbytecne nelogovaly chyby | |
ini_set('log_errors',FALSE); |
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)) | |
Line 158... | Line 158... | |
"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"); | |
|
| |
// 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"); | |
$order[0][0] = "TYP"; | ||
$order[1][0] = "NAZEV"; | ||
$sort_cz = 0; | ||
|
| |
function arfsort( $a, $y ){ |
function arfsort( $a, $yes ) { | |
$GLOBALS['__ARFSORT_YES__'] = $y; |
global $sort_cz; | |
$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 $trans_cz; |
global $trans_cz,$order,$sort_cz; | |
$order[0][0] = "TYP"; |
||
$order[1][0] = "NAZEV"; |
||
foreach($order as $f) { |
foreach($order as $f) { | |
if($GLOBALS['__ARFSORT_YES__']=="1") { |
if($sort_cz=="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 ) { | |
Line 184... | Line 186... | |
return 0; |
return 0; | |
} |
} | |
|
| |
function show_small($test) { |
function show_small($test) { | |
foreach ($test as $key=>$row) { |
foreach ($test as $key=>$row) { | |
|
if($row["OBLAST"]=="") { $row["OBLAST"]="10.0.0.0/8"; } | |
if($row['OBLAST']=="") { $row['OBLAST']="10.0.0.0/8"; } |
$ikonka = $row["TYP"]; | |
$ikonka = $row['TYP']; |
||
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } |
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } | |
echo "<div class=\"smallicon\"><a title=\"".$row['NAZEV']."\" href=\"?id=".$row['ID']."&oblast=".$row['OBLAST']."#".$row['OBLAST']."\"><img width=\"16\" title=\"".$row['NAZEV']."\" border=\"0\" src=\"ikony/$ikonka.png\"></a> <a title=\"".$row['NAZEV']."\" href=\"?id=".$row['ID']."&oblast=".$row['OBLAST']."#".$row['OBLAST']."\">".$row['NAZEV']."</a></div>\n"; |
echo "<div class=\"smallicon\"><a title=\"".$row["NAZEV"]."\" href=\"?id=".$row["ID"]."&oblast=".$row["OBLAST"]."#".$row["OBLAST"]."\"><img width=\"16\" title=\"".$row["NAZEV"]."\" border=\"0\" src=\"ikony/$ikonka.png\"></a> <a title=\"".$row["NAZEV"]."\" href=\"?id=".$row["ID"]."&oblast=".$row["OBLAST"]."#".$row["OBLAST"]."\">".$row["NAZEV"]."</a></div>\n"; | |
} |
} | |
} |
} | |
|
| |
function show_big($test) { |
function show_big($test) { | |
foreach ($test as $key=>$row) { |
foreach ($test as $row) { | |
|
| |
if($row['OBLAST']=="") { $row['OBLAST']="10.0.0.0/8"; } |
if($row["OBLAST"]=="") { $row["OBLAST"]="10.0.0.0/8"; } | |
$ikonka = $row['TYP']; |
$ikonka = $row["TYP"]; | |
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } |
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } | |
|
| |
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 = ""; |
$pamatuj = ""; | |
foreach ($test as $key=>$row) { |
foreach ($test as $row) { | |
| ||
if($row['OBLAST']=="") { $row['OBLAST']="10.0.0.0/8"; } | ||
$ikonka = $row['TYP']; | ||
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } | ||
|
| |
if ($row['TYP']==$pamatuj) { |
if ($row['TYP']==$pamatuj) { | |
|
||
if($row['OBLAST']=="") { $row['OBLAST']="10.0.0.0/8"; } |
||
$ikonka = $row['TYP']; |
||
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } |
||
|
| |
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"; | |
} else { |
} else { | |
echo "<div class=\"sizer\"></div><a name=\"".$row['TYP']."\" href=\"#".$row['TYP']."\" class=\"title\">".$row['TYP']."</a>\n"; |
echo "<div class=\"sizer\"></div><a name=\"".$row['TYP']."\" href=\"#".$row['TYP']."\" class=\"title\">".$row['TYP']."</a>\n"; | |
if($row['OBLAST']=="") { $row['OBLAST']="10.0.0.0/8"; } |
||
$ikonka = $row['TYP']; |
||
if(!file_exists("ikony/".$ikonka.".png")) { $ikonka = "none"; } |
||
|
||
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"; | |
} |
} | |
$pamatuj = $row['TYP']; |
$pamatuj = $row['TYP']; | |
} |
} | |
} |
} | |
|
| |
function show_clouds($test) { |
function show_clouds($test) { | |
global $jmena_cloudu; |
global $jmena_cloudu; | |
foreach ($test as $key=>$row) { |
foreach ($test as $row) { | |
if($row!="") { |
if($row!="") { | |
$cl_popis = $jmena_cloudu[$row]; |
$cl_popis = $jmena_cloudu["$row"]; | |
$cl_naz = $row; |
$cl_naz = $row; | |
$cl_nazev = $row."<br>".$cl_popis; |
$cl_nazev = $row."<br>".$cl_popis; | |
|
| |
echo "<div class=\"icon2\"><a title=\"".$cl_popis."\" href=\"?oblast=".$cl_naz."#".$cl_naz."\"><img title=\"".$cl_popis."\" border=\"0\" width=\"50\" src=\"img/cloud.png\"><br>".$cl_nazev."</a></div>\n"; |
echo "<div class=\"icon2\"><a title=\"".$cl_popis."\" href=\"?oblast=".$cl_naz."#".$cl_naz."\"><img title=\"".$cl_popis."\" border=\"0\" width=\"50\" src=\"img/cloud.png\"><br>".$cl_nazev."</a></div>\n"; | |
} |
} | |
} |
} | |
} |
} | |
|
| |
function show_details($test) { |
function show_details($test) { | |
$ikonka_det = $test['TYP']; |
$ikonka_det = $test["TYP"]; | |
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") { | |
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 274... | Line 271... | |
$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)))) { | |
if (strtoupper(substr("$data[$j]", 0, 4))=="TYP:") { $polozka++; } |
if (strtoupper(substr($data[$j], 0, 4))=="TYP:") { $polozka++; } | |
$item[$polozka]=$item[$polozka].$data[$j]."<br>"; |
$item[$polozka]=$item[$polozka].$data[$j]."<br>"; | |
} |
} | |
$trans = array(" \\\\<br>" => "", " <br>" => "<br>", (chr(13)) => "", ": " => ":", "OBLAST:<br>" => "OBLAST:10.0.0.0/8<br>", (chr(9)) => ""); |
$trans = array(" \\\\<br>" => "", " <br>" => "<br>", (chr(13)) => "", ": " => ":", "OBLAST:<br>" => "OBLAST:10.0.0.0/8<br>", (chr(9)) => ""); | |
$item[$polozka]=strtr($item[$polozka], $trans); |
$item[$polozka]=strtr($item[$polozka], $trans); | |
|
| |
Line 307... | Line 304... | |
} |
} | |
} |
} | |
} |
} | |
|
| |
// -- zjisteni a serazeni oblasti |
// -- zjisteni a serazeni oblasti | |
|
$cloudy = ""; | |
|
| |
for ($k=0; $k<=$polozka; $k++) { |
for ($k=0; $k<=$polozka; $k++) { | |
if ((eregi("OBLAST:", $item[$k])) and (!eregi("OBLAST:<br>", $item[$k]))){ |
if ((eregi("OBLAST:", $item[$k])) and (!eregi("OBLAST:<br>", $item[$k]))){ | |
$vyskyt = strpos($item[$k], "OBLAST:"); |
preg_match('%OBLAST:(.*?)(<br)%s', $item[$k], $cloud); | |
$cloud = substr($item[$k], $vyskyt+7, 16); |
if (!eregi($cloud[1], $cloudy)) { | |
$cloud = substr($cloud, 0, strpos($cloud, "/")+3); |
$cloudy .= $cloud[1].";"; | |
if ($cloud[strlen($cloud)-1]=="<") { |
||
$cloud = substr($cloud, 0, strpos($cloud, "/")+2); |
||
} |
||
if (!eregi($cloud, $cloudy)) { |
||
$cloudy=$cloudy.$cloud.";"; |
||
} |
} | |
} |
} | |
} |
} | |
$oblast = explode(";", $cloudy); |
$oblast = explode(";", $cloudy); | |
$pocet_oblasti = count($oblast)-2; |
$pocet_oblasti = count($oblast)-2; | |
Line 339... | Line 331... | |
|
| |
|
| |
// ------- zapiseme hodnoty do cloudovskych poli ------- |
// ------- zapiseme hodnoty do cloudovskych poli ------- | |
|
| |
for ($o=0; $o<=$pocet_oblasti; $o++) { |
for ($o=0; $o<=$pocet_oblasti; $o++) { | |
foreach ($items as $key=>$row) { |
foreach ($items as $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 358... | Line 350... | |
|
| |
// ------- 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(strlen($jmena_cloudu["$oblast[$o]"])>=1) { | |
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); |