\n";
echo "\n";
echo "\n";
echo "\n";
}
else
if ($action == 'image')
{
if ($authorized)
{
echo "\n";
echo " Back to overview\n";
}
}
else
if ($action == 'upload')
{
if ($authorized && isset($_FILES['filename']))
{
$name = $_FILES['filename']['name'];
$type = $_FILES['filename']['type'];
$tmp_name = $_FILES['filename']['tmp_name'];
$error = $_FILES['filename']['error'];
$size = $_FILES['filename']['size'];
switch ($error)
{
case 0:
if ($type == 'image/gif' || $type == 'image/jpeg' || $type == 'image/pjpeg')
{
if ($size <= $max_size)
{
if (!file_exists($upload_folder. $name))
{
if (move_uploaded_file($tmp_name, $upload_folder. $name))
{
echo "Image succesfully uploaded!
\n";
echo "Filename: ". $upload_folder. $name. " \n";
}
else
{
echo "Error: Upload failed, please verify the folder's permissions.\n";
}
}
else
{
echo "Error: The image already exists.\n";
}
}
else
{
echo "Error: The image is too big.\n";
}
}
else
{
echo "Error: Wrong file type, please only use jpg or gif images.\n";
}
break;
case 1:
echo "Error: The uploaded file exceeds the 'upload_max_filesize' directive.\n";
break;
case 2:
echo "Error: The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.\n";
break;
case 3:
echo "Error: The uploaded file was only partially uploaded.\n";
break;
case 4:
echo "Error: No file was uploaded.\n";
break;
case 6:
echo "Error: Missing a temporary folder.\n";
break;
case 7:
echo "Error: Failed to write file to disk.\n";
break;
case 8:
echo "Error: File upload stopped by extension.\n";
break;
}
}
else
{
echo "Error: No filename specified! \n";
}
echo "
Back to overview\n";
exit;
}
else
if ($action == 'edit' || $action == 'new')
{
if ($authorized)
{
$text = '';
$title = '';
if ($id >= 0)
{
$sql = "SELECT * FROM $mysql_table WHERE id = '".$id."'";
$result = mysql_query($sql, $db);
if ($data = mysql_fetch_array($result))
{
$text = $data['wwb_text'];
$title = $data['wwb_title'];
}
}
echo "\n";
}
}
else
{
if ($authorized)
{
echo "Create new item ";
echo "Upload image ";
echo "Image list ";
echo "Logout
\n";
}
$sql = "SELECT * FROM $mysql_table WHERE `wwb_id` = 'ixnet.blo' ORDER BY wwb_index ASC";
$result = mysql_query($sql, $db);
$num_rows = mysql_num_rows($result);
if ($num_rows > 0)
{
while ($data = mysql_fetch_array($result))
{
echo "" . $data['wwb_title'] . " \r\n";
echo $data['wwb_text'];
echo " ";
echo " \n";
if ($authorized)
{
echo "