Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/admin/tablice.php
<?php

if(isset($_GET['usuna'])){
    unlink("../img/mini/naklejki/".$_GET['usuna']);
    unlink("../img/dodatki/naklejki/".$_GET['usuna']);
}

if(isset($_GET['submit'])){
// Count # of uploaded files in array
$total = count($_FILES['upload']['name']);

// Loop through each file
for($i=0; $i<$total; $i++) {
  //Get the temp file path
  $tmpFilePath = $_FILES['upload']['tmp_name'][$i];

  //Make sure we have a filepath
  if ($tmpFilePath != ""){
    //Setup our new file path
    $newFilePath = "../img/dodatki/naklejki/" . $_FILES['upload']['name'][$i];
    if(move_uploaded_file($tmpFilePath, $newFilePath)) {
      make_thumb("http://www.etykietyweselne.pl/img/dodatki/naklejki/" .$_FILES['upload']['name'][$i], '../img/mini/naklejki/'.$_FILES['upload']['name'][$i], 120);
      echo "<p>Pliki wgrany</p>";
    }
  }
}
}
    function katalog($kat){
    $files = array();
                $iterator = new DirectoryIterator('../../tablice/img/mini/makiety/'.$kat);
                    foreach ($iterator as $fileinfo) {
                        if ($fileinfo->isFile()) {
                            $files[] = array($fileinfo->getFilename());
                        }
                    }
                    sort($files);
                        foreach($files as $fileinfo){                                                       
                            echo '<a href="http://www.tablice.etykietyweselne.pl/edycja.php?wzor='.$fileinfo[0].'&plik" class="but"><img src="http://tablice.etykietyweselne.pl/img/mini/makiety/'.$fileinfo[0].'" style="width:220px;margin:10px;"></a>';
                        }
    }


function make_thumb($src, $dest, $desired_width) {

	/* read the source image */
	$source_image = imagecreatefrompng($src);
	$width = imagesx($source_image);
	$height = imagesy($source_image);
         //echo $width;
	
	/* find the "desired height" of this thumbnail, relative to the desired width  */
	$desired_height = floor($height * ($desired_width / $width));
	
	/* create a new, "virtual" image */
	$virtual_image = imagecreatetruecolor($desired_width, $desired_height);        
        imagealphablending($virtual_image, FALSE);
        imagesavealpha($virtual_image, TRUE);
	
	/* copy source image at a resized size */
	imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height);
	
	/* create the physical thumbnail image to its destination */
	@imagepng($virtual_image, $dest);
}

include('header.php');
include('menu.php');?>

       <div style="text-align:center">   
            <a href="http://www.tablice.etykietyweselne.pl/skladka.php" style="display:inline-block;background:#4D94AD;color:#fff;padding:20px 100px" target="_blank">Archiwum składek i generowanie nowych</a>
            <a href="http://www.tablice.etykietyweselne.pl/admin.php" style="display:inline-block;background:#4D94AD;color:#fff;padding:20px 100px"  target="_blank">Wgrywanie wzorów i ustawianie tablic</a>     
       </div>

</body>
</html>