<?php
require "./Cart.php";

if (isset($Upload))
     exec("mv $DOCUMENT_ROOT/$images/$image_file_name.jpg");

if (isset($Delete))
     exec("rm $DOCUMENT_ROOT/$images/$image_name");

adminHeader( "$Company", "Picture Addition");

echo  "<FORM ACTION=\"$PHP_SELF?topic=pictures.php\" METHOD=\"POST\">";
echo "<SELECT NAME=image_name>\n";
echo "<OPTION VALUE=\"\">SELECT A PICTURE TO DELETE\n";
$handle=opendir("$images");
while ($f = readdir($handle))
     if ($f != '.' && $f != '..')
          echo '<option value="'.$f.'">'.$f."\n";
closedir($handle);
echo "</SELECT> \n";
echo  "<INPUT TYPE=\"submit\" name=\"Delete\" VALUE=\"Delete FILE\"></FORM>";

echo  "<FORM ENCTYPE=\"multipart/form-data\" ACTION=\"$PHP_SELF?topic=pictures.php\" METHOD=\"POST\">";
echo  "<INPUT TYPE=\"hidden\" NAME=\"MAX_FILE_SIZE\" VALUE=\"200000\">";
blueFont( "Arial", "Send this file:<br>");
echo  "<INPUT NAME=\"image\" TYPE=\"file\"><br>";
blueFont( "Arial", "File name on server (letters, digits and underscores please):<br>");
echo  "<INPUT NAME=\"image_file_name\" TYPE=\"text\"><br>";
echo  "<INPUT TYPE=\"submit\" name=\"Upload\" VALUE=\"Send FILE\"></FORM>";
blueFont( "Arial", "<P><B>This file MUST be a JPEG (jpg) image.</B>");

adminFooter($Relative);
?>
