<?
/*
//||||||||||||||||||||||||||||||||||||||||||||||||\\
\\*          SUPER HERO MOD WEB STATS 3.0         //
//                                                \\
\\  Written By ShadowLeader aka 123 (Tim Hansen)  //
//                                                \\
\\              http://SH-MOD.TK                  //
//          Email: shadowleader@jubii.dk          \\
\\          MSN: shadowleader11@hotmail.com       //
//                                                \\
\\   You are allowed to edit anything in these    //
//     files, as long as these lines remain.      \\
\\                                                //
//   If you have any trouble with the system,     \\
\\       go to www.SH-MOD.TK to get help.         //
//                                                \\
\\   Thanks to:                                   //
//   AlleyKat - Help with Template system         \\
\\   MajesticM00se - A little code                //
//   Vittu - Finding bugs                         \\
\\||||||||||||||||||||||||||||||||||||||||||||||||//
*/

require "include/header.php";

dbconn(true);

stdhead();
/////////START/////////
?>
<table border="1" cellspacing="0" style="border-collapse: collapse; border-right: 1px solid; border-left: 1px solid; border-top: 0px; border-bottom: 0px" width="100%" cellpadding="2">
<tr>
<td valign="top" style="border-top: 1px solid; border-bottom: 1px solid">
<?php
if($thestring OR $CURUSER['class'] >= UC_ADMINISTRATOR){
if($_POST['upload']){

$files = $_FILES['upfil']['name'];
$dist = $_SERVER["DOCUMENT_ROOT"] . "/$root_path/image/";

move_uploaded_file($_FILES['upfil']['tmp_name'], $dist . $files);

$files2 = $_FILES['upfil2']['name'];
$dist = $_SERVER["DOCUMENT_ROOT"] . "/$root_path/download/";

move_uploaded_file($_FILES['upfil2']['tmp_name'], $dist . $files2);
			
$files3 = $_FILES['upfil3']['name'];
$dist = $_SERVER["DOCUMENT_ROOT"] . "/$root_path/source/";

move_uploaded_file($_FILES['upfil3']['tmp_name'], $dist . $files3);

mysql_query("INSERT INTO sh_hero_database (sh_name, sh_level, sh_image, sh_description, sh_download, sh_bind, sh_source) values ('$_POST[sh_name]', '$_POST[sh_level]', '$files', '$_POST[sh_description]', '$files2', '$_POST[sh_bind]', '$files3')");

echo"<font class=green>The Hero $_POST[sh_name] has been added.</font>";	
}
if(!$_POST['upload']){
?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">

  <table width=100%>
    <tr>
      <td width="20%" align=left>Name:</td>
      <td width=80% align=left valign=top><input name="sh_name" type="text" class="input" id="sh_name" size="30">
      </td>
    </tr>
    <tr>
      <td width="20%" align=left>Level:</td>
      <td align=left valign=top><select name="sh_level" class="input" id="sh_level">
        <option selected>Level</option>
<? $starttal = 0;
	$nummer = $levels+1;

	$taeller = $starttal;

	while ( $taeller < $nummer )
	{
	echo "<option value=\"".$taeller."\">".$taeller."</option>";
	if($taeller == $nummer-1){
	echo"";
	}
	$taeller = $taeller+1;
	}
?>
      </select></td>
    </tr>
    <tr>
      <td align=left>Upload Pic: </td>
      <td align=left valign=top>        <input name="upfil" type="file" class="input" size="20"></td></tr>
    <tr>
      <td align=left valign=top>Description:</td>
      <td align=left><textarea name="sh_description" cols="26" rows="6" class="input" id="sh_description"></textarea></td>
    </tr>
    <tr>
      <td align=left valign=top>Download file: </td>
      <td align=left><input name="upfil2" type="file" class="input" id="upfil2" size="20"></td>
    </tr>
    <tr>
      <td align=left valign=top>Sma file: </td>
      <td align=left><input name="upfil3" type="file" class="input" id="upfil3" size="20"></td>
    </tr>
    <tr>
      <td align=left valign=top>Bind key: </td>
      <td align=left><select name="sh_bind" class="input" id="sh_bind">
        <option value="1">Yes</option>
        <option value="0" selected>No</option>
                  </select></td>
    </tr>
    <tr>
      <td align=left><input name="upload" type="submit" class="input" value="Submit"></td>
      <td align=left>&nbsp;</td>
    </tr>
  </table>
  </form>
<? }
}else{echo"You do not have access to this page."; }?><br>
</td>
</tr>
</table>
<?
/////////END/////////
stdfoot();
?>