<?php
	if($_SESSION['level'] < 8)
			{
			$_SESSION['error'] = "You have NO ACCESS to Enhanche Items";
			include('error.php');
			} else {
?>
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
	        <tr>
	          <td class="sitemenu"><strong>Enhance Items</strong></td>
	          </tr>
	        <tr>
	          <td class="sitemenu"><hr size="1" /></td>
	          </tr>
	        <tr>
	          <td align="left" valign="top" class="sitemenu">
			  
			  
			  <table width="100%" border="0" cellspacing="0" cellpadding="0">
	            <tr>
	              <td width="23%" align="left" valign="top" bgcolor="#333333" class="sitemenu">1. Step</td>
	              </tr>
	            <tr>
	              <td align="left" valign="top" class="sitemenu"><table width="100%" border="0" cellspacing="3" cellpadding="0">
	                <tr>
	                  <td align="right" valign="top" class="sitemenu">&nbsp;</td>
	                  <td>&nbsp;</td>
	                  <td class="sitemenu">&nbsp;</td>
	                  </tr>
	                <tr>
	                  <td width="19%" align="right" valign="top" class="sitemenu">Charactername:</td>
	                  <td width="2%">&nbsp;</td>
	                  <td width="79%" class="sitemenu">
					  
					  <form id="form1" name="form1" method="post" action="action.php?action=enhance">
	                    <input name="searchchar" type="text" id="searchchar" size="35" maxlength="25" />
	                    <input type="submit" name="enhancestep2" value="search" />
	                  </form></td>
	                  </tr>
	                <tr>
	                  <td colspan="3" align="right" valign="top" class="sitemenu"><hr size="1" /></td>
	                  </tr>
	                </table></td>
	              </tr>
	            </table>
				
	            <br />
<?php
					if ($_SESSION['enhance'] >= 2)
						{
?>				
	            <table width="100%" border="0" cellspacing="0" cellpadding="0">
	              <tr>
	                <td width="23%" align="left" valign="top" bgcolor="#333333" class="sitemenu">2. Step</td>
	                </tr>
	              <tr>
	                <td align="left" valign="top" class="sitemenu"><table width="100%" border="0" cellspacing="3" cellpadding="0">
	                  <tr>
	                    <td align="right" valign="top" class="sitemenu">&nbsp;</td>
	                    <td>&nbsp;</td>
	                    <td class="sitemenu">&nbsp;</td>
	                    </tr>
	                  <tr>
	                    <td align="right" valign="top" class="sitemenu">Character's:</td>
	                    <td>&nbsp;</td>
	                    <td class="sitemenu"><form id="form4" name="form4" method="post" action="action.php?action=enhance">
	                      <select name="characterid">
<?php

						foreach($_SESSION['enhanceids'] as $key => $charids)
							{
								if ($_SESSION['enhancechar'] == $charids)
									{
									echo "<option value='".$_SESSION['enhancechars'][$key]."' selected='selected'>".$charids."</option>";
									} else {
									echo "<option value='".$_SESSION['enhancechars'][$key]."'>".$charids."</option>";
									}
							}

?>



	                        </select>
	                      </td>
	                    </tr>
	                  <tr>
	                    <td align="right" valign="top" class="sitemenu">&nbsp;</td>
	                    <td>&nbsp;</td>
	                    <td class="sitemenu">&nbsp;</td>
	                    </tr>
	                  <tr>
	                    <td width="19%" align="right" valign="top" class="sitemenu">ItemID to Enhance:</td>
	                    <td width="2%">&nbsp;</td>
	                    <td width="79%" class="sitemenu">
	                      <input name="itemid" type="text" size="10" maxlength="5" />
	                      <input type="submit" name="enhancestep3" id="button2" value="search" />
	                      </form></td>
	                    </tr>
	                  <tr>
	                    <td colspan="3" align="right" valign="top" class="sitemenu"><hr size="1" /></td>
	                    </tr>
	                  </table></td>
	                </tr>
                </table>
<?php

						}
					if ($_SESSION['enhance'] >= 3)
						{
?>				
				
	            <br />
				
				
	            <table width="100%" border="0" cellspacing="0" cellpadding="0">
	              <tr>
	                <td width="23%" align="left" valign="top" bgcolor="#333333" class="sitemenu">3. Step</td>
	                </tr>
	              <tr>
	                <td align="left" valign="top" class="sitemenu"><table width="100%" border="0" cellspacing="3" cellpadding="0">
	                  <tr>
	                    <td align="right" valign="top" class="sitemenu">&nbsp;</td>
	                    <td>&nbsp;</td>
	                    <td class="sitemenu">&nbsp;</td>
	                    </tr>
	                  <tr>
	                    <td width="19%" align="right" valign="top" class="sitemenu">Item Key:</td>
	                    <td width="2%">&nbsp;</td>
	                    <td width="79%" class="sitemenu"><form id="form3" name="form1" method="post" action="action.php?action=enhance">
	                      <select name="itemkey" id="select">
<?php
						foreach ($_SESSION['enhancekey'] as $value) 
									{
										echo "<option value='".$value."' selected='selected'>".$value."</option>";
									}
?>
	                        </select>
	                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;enhance to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	                      <select name="itemlevel" onchange='submit();'>
							<option value="0">+0</option>
	                        <option value="1">+1</option>
	                        <option value="2">+2</option>
	                        <option value="3">+3</option>
	                        <option value="4">+4</option>
	                        <option value="5">+5</option>
	                        <option value="6">+6</option>
	                        <option value="7">+7</option>
	                        <option value="8">+8</option>
	                        <option value="9">+9</option>
	                        </select>
							<input type="hidden" name="enhanceitem" id="enhanceitem" />
	                    </form></td>
	                    </tr>
	                  <tr>
	                    <td colspan="3" align="right" valign="top" class="sitemenu"><hr size="1" /></td>
	                    </tr>
<?php
					unset($_SESSION['enhancechar']);
					unset($_SESSION['enhancechars']);
					unset($_SESSION['enhanceids']);
					unset($_SESSION['enhancekey']);
						}
					if ($_SESSION['enhance'] >= 4)
						{
?>
	                  <tr>
	                    <td align="right" valign="top" class="sitemenu">&nbsp;</td>
	                    <td>&nbsp;</td>
	                    <td class="sitemenu"><?php echo $_SESSION['enhancemsg']; ?></td>
	                    </tr>
<?php
					unset($_SESSION['enhance']);
						}
						if ($_SESSION['enhance'] >= 5)
						{
?>
	                  <tr>
	                    <td align="right" valign="top" class="sitemenu">&nbsp;</td>
	                    <td>&nbsp;</td>
	                    <td class="sitemenu"><?php echo $_SESSION['enhancemsg']; ?></td>
	                    </tr>
<?php
					unset($_SESSION['enhance']);
						}
?>
	                  </table></td>
	                </tr>
                </table>
	
	            <br />
	            <br />
<br /></td>
	          </tr>
          </table>
<?php
	}
?>