ACC SHELL
<?php
$id = (int) $_GET['new2'];
$q = "SELECT typ FROM upload WHERE id = '$id'";
extract(mysql_fetch_assoc(mysql_query($q)));
if(isset($_POST['s']) )
{
$resizeWidth = (int) $_POST['resizeWidth'];
$resizeHeight = (int) $_POST['resizeHeight'];
$img = new image;
$img->load("../upload/$id.$typ");
$img->resize($resizeWidth, $resizeHeight, "../upload/$id");
die( header("Location: admin.php?upload") );
}
$nav = array(
"upload" =>"Správce souborů",
"upload&new" =>"Přidat soubor"
);
list($width, $height) = getimagesize("../upload/$id.$typ");
if($width > 800)
{
$height = round(800/($width/$height));
$width = 600;
}
?>
<?php include 'head.inc.php'; ?>
<form action="<?php echo "admin.php?upload&new2=$id"; ?>" method="post" enctype="multipart/form-data" class="form">
<fieldset>
<legend>Přidat soubor</legend>
<table>
<tr>
<td>Šířka:</td>
<td><input type="text" name="resizeWidth" id="resizeWidth" onkeyup="resize(this)" class="iText" /></td>
</tr>
<tr>
<td>Výška:</td>
<td><input type="text" name="resizeHeight" id="resizeHeight" onkeyup="resize(this)" class="iText" /></td>
</tr>
<tr>
<td></td>
<td align="center"><img src="<?php echo "../upload/$id.$typ?".mktime(); ?>" id="resizeImage" width="<?php echo $width; ?>" height="<?php echo $height; ?>" onload="resizeLoad()" /></td>
</table>
</fieldset>
<p><input type="submit" name="s" value="Uložit" /></p>
</form>
<?php include 'foot.inc.php'; ?>
ACC SHELL 2018