Viewing File: /people/testlab/www/testlab.com.pl/panel/zarzadzaj_obrazkami.php

<?
include('../config.php');
if (!islogin()) die();
include('../inc/db.php');
$db = new DBConnect();

?>


<table><tr><td><img src=img/images.png></td><td><h3>Zarządzaj plikami</h3></td></tr></table>

<form action=panel/upload_file.php target=ramka method=post ENCTYPE=multipart/form-data name=upload_form id=upload_form>
<table >
<tr>
  <td >
  Wczytaj plik 
  </td>
</tr>
<tr>
  <td >
  <input type=file name=plik id=plik style="width:370px" onchange=submit()>
  <iframe name=ramka id=ramka style='display:none'></iframe>  
  
  </td>
</tr>
<tr><td id=file_loader></td></tr>
<tr>
  <td id=lista_obrazkow>
  Wczytane pliki znajdują się w podkatalogu "pliki".<br><br>
  <table>
  <?
  	$directory_handler = opendir("../pliki");
										$pattern = "([0-9a-zA-Z]{1,})";
										while (($filename = readdir($directory_handler)) != false)
										{
											if (preg_match($pattern,$filename))
												$files[]=basename($filename);
											
										}
										
										$quantity = count($files);
										if ($quantity>0) sort($files);

										for ($i=0; $i<$quantity;$i++)
										{
										echo "<tr>";
										$j=$i+1;
											$dest_file = "pliki/".$files[$i];
		 									$size=round(filesize("../".$dest_file)/1024);
											if ($size==0)
											{
											 $size=filesize("../".$dest_file);
											 $kb="B";
											}
											else 
											$kb = "kB";
		 
											if ($files[$i]!='index.php') 
											if ($files[$i]!='upload.php') 
											if ($files[$i]!='.htaccess') 
											
											{
											$z++;
											echo "<td>$z.</td><td >";
											echo "<a href=\"".$dest_file."\" target=blank>".$files[$i]."</a></td><td>(".$size." ".$kb.")</td>
 											<td>[<a href=# onclick=\"if (confirm('Na pewno usunąć ".$files[$i]."?')) usun_plik('$dest_file')\" ><img src=img/remove.png style='vertical-align:middle' border=0> usuń </a>] </td>
								
											
											";
											/*
														<td>[
											<object class='clippy' height='18' width='18' align='absmiddle' id=clippy> 
                      <param value='../files/clippy.swf' name='movie'/> 
                      <param value='always' name='allowScriptAccess'/> 
                      <param value='high' name='quality'/> 
                     
                      <param value='text=<a href=\"".$dest_file."\" target=blank>".$files[$i]."</a>' name='FlashVars'/> 
                      <param value='#F0F0F0' name='bgcolor'/> 
                      <param value='opaque' name='wmode'/> 
                      <embed height='18' width='18' wmode='opaque' bgcolor='#F0F0F0' flashvars='text=<a href=\"".$dest_file."\" target=blank>".$files[$i]."</a>' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' allowscriptaccess='always' quality='high' src='../files/clippy.swf'/> 
                      </object> kopiuj link do schowka
											
											] </td>
											*/
											}
											echo "</tr>";
										}			
  
  ?>
  </table>
  </td>
</tr>
</table>
</form>

Back to Directory File Manager