@ 2014-02-01T19:55:25Z <?php
<?php
require_once('constanten.php5');
require_once('functiounen.php5');
include('functions.lib.php');
include('zipextract.cls.php');
error_reporting(E_ALL);
// test-ausgaab
$n=0;
echo($n.' ');
$n++;
if(isset($_POST['uploadfile']))
{
$uploadfile = $_POST['uploadfile'];
}
if(isset($_REQUEST['action']))
{
$action = $_REQUEST['action'];
}
// test-ausgaab
echo($n.' ');
$n++;
ini_set('max_execution_time', 600);
ini_set('max_input_time', 600);
ini_set('memory_limit', 32);
// test-ausgaab
echo($n.' ');
$n++;
if( (isset($action)) && ($action == "Upload") )
{
// test-ausgaab
echo($n.' ');
$n++;
//----------------- FEHLERMELDUNGEN genéreieren falls néideg ---------------------------//
if($_FILES['uploadfile']['error']!=0)
{
switch ($_FILES['uploadfile']['error'])
{
case 1:
die(header('Location: http://'.$_SERVER['HTTP_HOST'].'/include/bicher_rop.php5?fehler=ZeGrouss'));
break;
case 2:
die(header('Location: http://'.$_SERVER['HTTP_HOST'].'/include/bicher_rop.php5?fehler=ZeGrouss'));
break;
case 3:
die(header('Location: http://'.$_SERVER['HTTP_HOST'].'/include/bicher_rop.php5?fehler=NetGanz'));
break;
case 4:
die(header('Location: http://'.$_SERVER['HTTP_HOST'].'/include/bicher_rop.php5?fehler=KengFile'));
break;
case 6:
die(header('Location: http://'.$_SERVER['HTTP_HOST'].'/include/bicher_rop.php5?fehler=KeenTMP'));
break;
case 7:
die(header('Location: http://'.$_SERVER['HTTP_HOST'].'/include/bicher_rop.php5?fehler=NetSchreiwen'));
break;
default:
die(header('Location: http://'.$_SERVER['HTTP_HOST'].'/include/bicher_rop.php5?fehler=KengAhnung'));
break;
}
}
// also iwerpreifen ech net wirklech eppes, mee bon et berouegt d'Gewessen
if( (isset($_FILES['uploadfile']['name']))
&& (strtolower(substr($_FILES['uploadfile']['name'],-3))!='zip') )
{
die(header('Location: http://'.$_SERVER['HTTP_HOST'].'biller_rop.php5?fehler=KengZip'));
}
echo('
<html>
<head>
<title>Billercher roplueden Version 0.0</title>
</head>
<body>
<span style="font-size:20px;">Billercher roplueden Version 0.0</span>');
echo('<form action="biller_rop.php5?action=Upload" method="post" enctype="multipart/form-data">
<p>Eng .zip -Datei mat de Billercher w.e.g.: <input type="file" name="uploadfile"></p>');
echo('<p><input type="submit" name="submit" value="Upload"></p> </form>');
$filename = "test.zip";
$uploaddir = './ul/';
$bild_dir = '../biller/bicher/';
$thumb_dir = '../biller/thumbs/';
move_uploaded_file($_FILES['uploadfile']['tmp_name'], $uploaddir . $filename);
$zip=new Zipextract($uploaddir . $filename);
$array_zip=$zip -> list_files();
$fehler=FALSE;
echo('Biller: '.count($array_zip).'<br />');
$fehler_update=array();
foreach($array_zip as $file_ref => $bild)
{
echo('- '.$file_ref.'<br>');
if(strtolower(substr($bild,-3))!='jpg')
{
$fehler='keenJPEG';
echo('Do waar eng Datei derbäi dei keen JPEG-Bild ass:<br />');
echo($bild.'<br />');
}
else
{
if ($file_handle = fopen($bild_dir.$bild, 'wb'))
{
fwrite($file_handle, $zip->extract_file($file_ref));
fclose($file_handle);
}
else
{
$fehler='net_geschriwen';
echo('Zut, ech konnt d\'Bild '.$bild.' net saven :(<br />');
}
$zip -> extract_file($file_ref);
$bild_source=imagecreatefromjpeg($bild_dir.$bild);
$source_size=getimagesize($bild_dir.$bild);
$target_divider=floor($source_size[0]/50);
$target_y=floor($source_size[1]/$target_divider);
$bild_target=imagecreatetruecolor(50,$target_y);
imagecopyresampled($bild_target,$bild_source,0,0,0,0,50,$target_y,$source_size[0],$source_size[1]);
imagejpeg($bild_target,$thumb_dir.$bild);
$conn_db=verbannen();
$bild_numm=substr($bild,0,-4);
$update_bild='
UPDATE
bicher
SET
bild=1
WHERE
bestell_nr=\''.$bild_numm.'\'';
if(!$process_update=@mysql_query($update_bild,$conn_db))
{
$fehler_update[]=$bild_numm;
}
}
}
if($fehler===FALSE)
{
if(!empty($fehler_update))
{
echo('<br />Daat waar et, huet BAAL alles geklappt');
echo('<br />Leider konnt ech puer billercher kenger bestell_nr zouuerdnen<br />');
echo('Daat waren dei heiten:<br />');
foreach($fehler_update as $numm)
{
echo($numm.'<br />');
}
}
else
{
echo('<br />Daat waar et, alles geklappt, schon färdesch :-)');
}
echo('<br />An elo kucke mer eis nach un weieng Billercher daat waren<br /><br />');
echo('<table>');
echo('<tr><td>Daat grousst Bild</td><td width="10"></td><td>an dei verklengert Versioun dervun</td></tr>');
foreach($array_zip as $bild)
{
echo('<tr><td>'.$bild.'</td></tr>');
echo('<tr><td><img src="'.$bild_dir.$bild.'"></td><td></td><td><img src="'.$thumb_dir.$bild.'"></td></tr>');
}
echo('</table>');
}
unset($zip);
unlink($uploaddir . $filename);
}
else
{
echo('
<html>
<head>
<title>Billercher roplueden Version 0.0</title>
</head>
<body>
<span style="font-size:20px;">Billercher roplueden Version 0.0</span>');
//----------------- FEHLERMELDUNGEN ---------------------------//
// test-ausgaab
echo($n.' ');
$n++;
if(isset($_REQUEST['fehler']))
{
switch ($_REQUEST['fehler'])
{
case 'ZeGrouss':
echo('<h1>D\'File ass leider ze grouss, net mei wei 10Mb w.e.g.</h1>');
break;
case 'NetGanz':
echo('<h1>D\'File ass net ganz ropgeluede gin</h1>');
break;
case 'KengFile':
echo('<h1>Et ass keng File ropgeluede gin</h1>');
break;
case 'KeenTMP':
echo('<h1>Ech konnt d\'File net saven(keen TMP directory), do ass mächteg eng schief gelaaf...</h1>');
break;
case 'NetSchreiwen':
echo('<h1>Ech konnt d\'File net saven, do ass mächteg eng schief gelaaf...</h1>');
break;
case 'KengAhnung':
echo('<h1>Hmm, do ass eppes schief gaang, hun awer net rausfonnt waat :(</h1>');
break;
case 'KengZip':
echo('<h1>Et MUSS eng .zip file sin(</h1>');
break;
}
}
// test-ausgaab
echo($n.' ');
$n++;
//----------------- FORMULAIRE FIIR UPLOAD ---------------------------//
echo('<form action="biller_rop.php5?action=Upload" method="post" enctype="multipart/form-data">
<p>Eng .zip -Datei mat de Billercher w.e.g.: <input type="file" name="uploadfile"></p>');
echo('<p><input type="submit" name="submit" value="Upload"></p> </form>');
}
echo('</body></html>');
// test-ausgaab
echo($n.' ');
$n++;
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).
Version System time (s) User time (s) Memory (MiB) 5.4.24 0.010 0.053 18.64 5.4.23 0.013 0.050 19.03 5.4.22 0.007 0.057 19.03 5.4.21 0.017 0.053 18.75 5.4.20 0.027 0.040 19.08 5.4.19 0.007 0.077 18.74 5.4.18 0.020 0.057 18.88 5.4.17 0.023 0.057 18.90 5.4.16 0.013 0.060 18.72 5.4.15 0.017 0.050 18.88 5.4.14 0.013 0.063 16.40 5.4.13 0.010 0.070 16.54 5.4.12 0.003 0.057 16.42 5.4.11 0.010 0.050 16.47 5.4.10 0.013 0.050 16.48 5.4.9 0.013 0.043 16.55 5.4.8 0.010 0.047 16.37 5.4.7 0.010 0.057 16.57 5.4.6 0.007 0.053 16.53 5.4.5 0.010 0.047 16.41 5.4.4 0.013 0.047 16.33 5.4.3 0.010 0.050 16.52 5.4.2 0.023 0.040 16.50 5.4.1 0.020 0.047 16.46 5.4.0 0.017 0.053 15.75 5.3.28 0.017 0.043 14.52 5.3.27 0.017 0.043 14.51 5.3.26 0.010 0.060 14.38 5.3.25 0.020 0.060 14.61 5.3.24 0.010 0.053 14.63 5.3.23 0.000 0.057 14.62 5.3.22 0.003 0.053 14.61 5.3.21 0.003 0.067 14.44 5.3.20 0.010 0.063 14.42 5.3.19 0.007 0.053 14.34 5.3.18 0.023 0.063 14.72 5.3.17 0.003 0.063 14.58 5.3.16 0.020 0.037 14.56 5.3.15 0.007 0.057 14.57 5.3.14 0.010 0.053 14.57 5.3.13 0.010 0.050 14.64 5.3.12 0.013 0.047 14.25 5.3.11 0.020 0.050 14.42 5.3.10 0.010 0.070 13.92 5.3.9 0.013 0.050 13.79 5.3.8 0.013 0.053 13.87 5.3.7 0.010 0.067 13.87 5.3.6 0.010 0.050 14.02 5.3.5 0.013 0.053 13.94 5.3.4 0.007 0.050 13.83 5.3.3 0.017 0.040 13.93 5.3.2 0.007 0.067 13.66 5.3.1 0.007 0.057 13.70 5.3.0 0.003 0.077 13.65
preferences:dark mode live preview
136.05 ms | 1394 KiB | 7 Q