<?php
	if($_SESSION['level'] < 8)
			{
			$_SESSION['error'] = "You have NO ACCESS to to add News!!<br>Only GM's and Dev's can add News!!";
			include('error.php');
			} else {
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="23%" align="left" valign="top" bgcolor="#333333" class="sitemenu">Select News to Delete</td>
                </tr>
				
				<tr>
                     <td colspan="4" align="left" valign="top" class="sitemenu">
<?php
					echo $_SESSION['delmsg']; 
					unset($_SESSION['delmsg']);			
?>
					
					</td>
                </tr>
                <tr>
                  <td align="left" valign="top" class="sitemenu"><form id="form1" name="form1" method="post" action="action.php?action=delnews">
                    <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>
                        <td class="sitemenu">&nbsp;</td>
                      </tr>
                      <tr>
                        <td width="18%" align="left" valign="top" class="sitemenu"><strong>Datum</strong></td>
                        <td width="57%" align="left" valign="top" class="sitemenu"><strong>Topic</strong></td>
                        <td width="18%" align="left" valign="top" class="sitemenu"><strong>Poster</strong></td>
                        <td width="7%" align="right" valign="top" class="sitemenu"><strong>Del</strong></td>
                      </tr>
                      <tr>
                        <td colspan="4" align="left" valign="top" class="sitemenu"><hr size="1" /></td>
                      </tr>
					  <tr>
                        <td colspan="4" align="right" valign="top" class="sitemenu"><input type="submit" name="button2" id="button2" value="Delete marked News" /></td>
                      </tr>
<?php
					$bg = "";
					$result = mysql_query("SELECT * FROM global_news ORDER BY newsdate DESC") or die("Anfrage nicht erfolgreich");	  
					while ($out = mysql_fetch_array($result))
						{
								if ($bg== "") { $bg = "#4F4F4F"; } else { $bg = ""; }
								$datum = date("M d Y h:i a",$out['newsdate']);
								echo "	<tr>
										<td align='left' valign='top' bgcolor='".$bg."' class='sitemenu'><font size='1'>".$datum."</font></td>
										<td align='left' valign='top' bgcolor='".$bg."' class='sitemenu'>".$out['newstopic']."</td>
										<td align='left' valign='top' bgcolor='".$bg."' class='sitemenu'>".$out['newsposter']."</td>
										<td align='right' valign='top' bgcolor='".$bg."' class='sitemenu'><input type='checkbox' name='deletenews[]' value='".$out['id']."' /></td>
										</tr>";
						}
?>
                      
                      <tr>
                        <td colspan="4" align="right" valign="top" class="sitemenu"><input type="submit" name="button" id="button" value="Delete marked News" /></td>
                        </tr>
                    </table>
                  </form></td>
                </tr>
              </table>
<?php
}
?>