jablonka.czprosek.czf

czf4bfu

Subversion Repositories:
[/] [index.php] - Diff between revs 1 and 2

Show entire file Ignore whitespace

Rev 1 Rev 2
Line 156... Line 156...
"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 264... Line 264...
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 301...
} }
} }
} }
} }
} }
   
   
$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 364... Line 361...
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 381...
   
   
// ------- 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 462...
   
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 497...
   
show_groups($sorted4); show_groups($sorted4);
   
} else { } else {
   
$sorted0 = arfsort( $items, $order_arr, 0); $sorted0 = arfsort( $items, 1);
show_groups($sorted0); show_groups($sorted0);
   
} }
   
   

Powered by WebSVN 2.2.1