<html>

<head>



<meta http-equiv="Content-Type" content="text/html; charset=windows-1251" />



</head>



<title></title>

<body bgcolor=#EFF0E2 alink=#FFFFFF vlink=FFFFFF link=FFFFFF>

<br> <br>

<font size=-1 face=verdana>

<table width="100%" height="160"  border="0" cellpadding="0" cellspacing="0">

  <tr>

    <td><div align="center">

      <table width="80%"  border="1" cellpadding="0" cellspacing="0" bordercolor="#9AFF01">

        <tr>

          <td height="10" bgcolor="#FF6600"><div align="left"><a href=javascript:history.back();> <font face=verdana size=-1 color=#000000>назад</font></a></div>

		  

		  </td>

		  

          </tr>

            <tr>

          <td height=10 bgcolor=#CCCCCC><table width=100% height=100% border=0 cellpadding=0 cellspacing=0>

	

		  

            <tr>

			

              <td width=85%><div align=left><font size=-1 color=#000000 face=verdana>Файл</font></td>

              <td width=15%><div align=right><font size=-1 color=#000000 face=verdana>Размер</font></td>

              

            </tr>

          </table></td>

        </tr>



<?php















#variabeln



$dir = getcwd ();

$parent_path = $dir;

$upurl = $PHP_SELF;

$vinfo="1.01 bug mit ordner draussen";





if(isset($info)){

    echo"$vinfo";

}





create_tree ($dir, $parent_path);





function filesi($URL){    # daten groesse

    $groesse = filesize($URL);

    if($groesse < 1000){

        return number_format($groesse, 0, ",", ".")." Bytes";

    }else if($groesse < 1000000){

        return number_format($groesse/1024, 0, ",", ".")." kB";

    }else{

        return number_format($groesse/1048576, 0, ",", ".")." MB";

    }

}



function

urlFromPath ($path)

{

  global $PHP_SELF;

  global $DOCUMENT_ROOT;

  $prefix = "";

  if (substr ($path, 0, 1) != "/")

   $prefix = "/";

  

  return $url;

}



function

create_tree ($dir, $parent_path)

{

  if ($handle = opendir ($dir))

   {

     $i = 0;

     while (false !== ($file = @readdir ($handle)))

   {

     if ($file != "." && $file != "..")

       {

         $list[$i] = $file;

         $i++;

       }

   }

     $dir_length = count ($list);



     for ($i = 0; $i < $dir_length; $i++)

   {

     global $PHP_SELF;

     global $DOCUMENT_ROOT;

     $label = $list[$i];

     $test = $dir."/".$label;

     $alink = $dir."/".ereg_replace(" ","%20",$label);

     if (!strstr ($PHP_SELF, $label))

       {

         if (is_dir ($test))



   {

         $tmp = $PHP_SELF. "?dir=".$alink."&parent_path=".$dir;

         $url = ereg_replace(" ", "%20", $tmp);

         $iconserver="http://www.bethanysbc.org/sheet_music/images";

         $timeda="". date("d.m.Y", fileatime($label));

         $label2=eregi_replace(" ", "%20", $label);

         echo "

           <tr>

          <td height=5 bgcolor=#EFF0E2><table width=100% height=100% border=0 cellpadding=0 cellspacing=0>

            <tr>

              <td width=5%><div align=left><img src=$iconserver/folder.png></td>

              <td width=82%><div align=left><a href=$label2/index.php><font size=-1 color=#000000 face=verdana>$label</font></a></div></td>

              

            </tr>

         </table> </td>

        </tr>";     #### brauch ordner

         

       }



         else

       {

         $link = urlFromPath ($alink);



         $label = $list[$i];

         $iconserver="http://www.bethanysbc.org/sheet_music/images/";

         $groess= filesi($label);

         $timed="". date("d.m.Y", fileatime($label));

         

         if (substr($label,-4)==".jpg"){

          $pic="image";          

		  }else if((substr($label,-4)==".pdf")){

          $pic="pdf";

		  }else if((substr($label,-4)==".txt")){

          $pic="txt";

          }else if((substr($label,-3)==".7z")){

          $pic="7z";

		  }else if((substr($label,-4)==".rar")){

          $pic="7z";

		  }else if((substr($label,-4)==".zip")){

          $pic="7z";

          }else if((substr($label,-4)==".sib")){

          $pic="sib";

          }else if((substr($label,-4)==".xls")){

          $pic="xls";

          }else if((substr($label,-3)==".sif")){

          $pic="sif";          

          }else if((substr($label,-4)==".MUS")){

          $pic="MUS";

          }else if((substr($label,-4)==".ETF")){

          $pic="ETF"; 

		  }else if((substr($label,-4)==".mid")){

          $pic="mid";

          }else if((substr($label,-4)==".htm")){

          $pic="htm";

          }else if((substr($label,-4)==".html")){

          $pic="htm";

		  }else if((substr($label,-4)==".enc")){

          $pic="enc";

		  }else if((substr($label,-4)==".mp3")){

          $pic="audio";

		  }else if((substr($label,-4)==".MP3")){

          $pic="audio";



          

         }else{

          $pic="file";

         }

         

         if($pic=="file"){

             $pica="files%2Epng";

         }else if($pic=="image"){

             $pica="image.png";

         }else if($pic=="app"){

             $pica="exe.png";

         }else if($pic=="arch"){

             $pica="zip.jpeg";

         }else if($pic=="text"){

             $pica="txt.png";

         }else if($pic=="video"){

             $pica="video.png"; 

         }else if($pic=="audio"){

             $pica="audio.png";

			 

		 }else if($pic=="pdf"){

             $pica="pdf.png";

    		}else if($pic=="txt"){

             $pica="txt.png"; 

         }else if($pic=="sib"){

             $pica="sib.png";

		}else if($pic=="enc"){

             $pica="enc.png";	 

         }else if($pic=="7z"){

             $pica="7z.png";

         }else if($pic=="mid"){

             $pica="mid.png";

         }else if($pic=="xls"){

             $pica="xls.png";

		 }else if($pic=="sif"){

             $pica="sif.png";

         }else if($pic=="htm"){

             $pica="htm.png";

         }else if($pic=="MUS"){

             $pica="MUS.png";

         }else if($pic=="ETF"){

             $pica="ETF.png";		 

			 

			 



         }else{

             $pica="files%2Epng";

         }



         $label2=eregi_replace(" ", "%20", $label);

         if (eregi("index.php", $label)) {      # index.php soll nicht angezeigt werden.

       echo"";

      }     else {



         echo

           "

           <tr>

          <td height=5 bgcolor=#EFF0E2><table width=100% height=100% border=0 cellpadding=0 cellspacing=0>

            <tr>

              <td width=5%><div align=left><img src=$iconserver/$pica></td>

              <td width=40%><div align=left><a href=$label2><font size=-1 color=#000000 face=verdana>".$label." </font></a></div></td>

              <td width=32%><div align=right><font size=-1 color=#000000 face=verdana>$groess</font></div></td>

              

            </tr>

          </table></td>

        </tr>";

   }          #daten

       }

       }

   }

     echo "</ul>";

     closedir ($handle);

   }

}



?>



       <tr>



          <td height="10" bgcolor="#999999">

          

          

          <table width="100%"  border="0" cellspacing="0" cellpadding="0"height="10" bgcolor="#9AFF01">

  <tr>

    <td><div align="left"><a href=javascript:history.back();> <font face=verdana size=-1 color=#000000>назад</font></a></div></td>

    <td><div align="right"> <a href=http://www.noty.bratstvo.org target=_blank><font face=verdana size=-1 color=#000000>Главная</font></div></td>

  </tr>

</table>

          

          

          



          

          </td>









          </tr>

       </font>

      </table>

    </div></td>

  </tr>

</table>

