<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

include_once( "../include/class.SQLInteger.php" );
include_once("auth.php");
include("../languages/".$shortlang."/scripts.inc.php");

## mysql verbindung aufbauen
db_connect($db_host, $db_user, $db_pass);
## /mysql verbindung aufbauen

$id = safe_query( "select code from ereignisse where code = ?  and anbieter='' and kunde=''", TRUE, new SQLInteger( $code ) );
$anzahlereignisse = db_num_rows($id);
if ($anzahlereignisse == 0)
	{
	 $fehlertext = ltext('messages__no_messages');
	 include("allgemein_servermeldungen.php");
	 exit();
	}
$end = $start + $schritte;

?>
<HTML>
<HEAD>
<META content="text/html; charset=<? echo $lang_html_charset; ?>" http-equiv=Content-Type>
<LINK href="<?=$strSkinName?>/style.css" rel=stylesheet type=text/css>
</HEAD>

<BODY bgColor=#ffffff bottomMargin=0 leftMargin=0 topMargin=0 MARGINHEIGHT="0" MARGINWIDTH="0">
<br><? include("../fehler.inc.php"); ?>
<script>
function doChange()
{
document.forms[0].submit();
}
</script>

<table class="tblbgcolor" align="left" border="1" cellpadding="3" cellspacing="0" bordercolorlight="#CCCCCC" bordercolordark="#FFFFFF">
<tr>
    <td valign="top"> 
	    <? if ($anzahlereignisse > 0)  { ?> 
    		<P><b>
		<? 
		    if ($code == 0) { 
			echo ltext('errtype_notices'); 
		    } elseif ($code == 1) { 
			echo ltext('errtype_errors'); 
		    } else { 
			echo ltext('errtype_warnings'); 
		    } 
		?> 
		<? echo $start + 1; ?> 
		- 
    		<? if ($anzahlereignisse > $end) { 
			echo $end; 
		    } else { 
			echo $anzahlereignisse; 
		    } 
		?>
		</b></P>

		<table width="455" border="1" cellspacing="0" bordercolorlight="<? echo $color_dark_grey; ?>" cellpadding="3" bordercolordark="#ffffff">
		<tr>
		    <td colspan=3 class="titel-3" >
			<? echo ltext("alse2_subtitle1"); ?>
		    </td>
		</tr>
		<tr> 
        	    <td class="titel-3" >
			<? echo ltext("alse2_cell_time"); ?>
		    </td>
        	    <td class="titel-3" >
			<? echo ltext("alse2_cell_error"); ?>
		    </td>
        	    <td class="titel-3" >
			<? echo ltext("alse2_cell_script"); ?>
		    </td>
    		</tr>
    		<?

		if ($db_type == "mysql")
		{
		    $id = safe_query( "SELECT * FROM ereignisse WHERE code = ? AND anbieter = '' AND kunde = '' ORDER BY ident DESC
			LIMIT ?, ?", TRUE, new SQLInteger($code), new SQLInteger($start), new SQLInteger($schritte) );
		} else
		{
		    $id = safe_query( "SELECT * FROM ereignisse WHERE code = ? AND anbieter = '' AND kunde = '' ORDER BY ident DESC
			LIMIT ?, ?", TRUE, new SQLInteger($code), new SQLInteger($schritte), new SQLInteger($start) );
		}

		while ($werte = db_fetch_array($id)) {

		    $datum = date($lang_format_datetime_long, $werte["timestamp"]);
		    $nachricht = mlf_text($werte["nachricht"]);

		?> 
    		    <tr> 
        		<td>
			    <? echo $datum; ?>
			</td>
        		<td>
			    <? echo $nachricht; ?>
			</td>
        		<td>
			    <? echo $werte["script"]; ?>
			</td>
    		    </tr>
    		<? } ?>

        	<tr>
		    <? if ($start > 0) { ?>
		    <td align="center">&nbsp;
			<b><i>&lt;&lt;</i></b>
        		<a class=data href="allgemein_servermeldungen2.php?code=<? echo $code; ?>&amp;start=<? echo $start - $schritte; ?>&amp;schritte=<? echo $schritte; ?>">
			    <? echo ltext("alse2_link_back"); ?>
			</a> 
		    </td>
        	    <? } ?>
		    <? 
			if ( ($start > 0) && ($anzahlereignisse > $end) ) {
			    $colspannumb = 1; 
			} elseif ( ($start > 0) || ($anzahlereignisse > $end) ) {
			    $colspannumb = 2;
			} else {
			    $colspannumb = 3;
			}
		    ?>
        	    <td align="center" colspan=<? echo $colspannumb; ?>>
			<a class=data href="allgemein_servermeldungen.php">
			    <? echo ltext("alse2_link_select"); ?>
			</a>
		    </td>

		    <? if ($anzahlereignisse > $end) { ?> 
		    <td align="center">&nbsp;
        		<a class=data href="allgemein_servermeldungen2.php?code=<? echo $code; ?>&amp;start=<? echo $start + $schritte; ?>&amp;schritte=<? echo $schritte; ?>">
			    <? echo ltext("alse2_link_next"); ?>
			</a>
			<b><i>&gt;&gt;</i></b>
		    </td>
        	    <? } ?>
    		</tr>
    		</table>
	    <? } else { ?>
	    
		<? if ($code == 0) { ?>
		    <b><i>
			<? echo ltext("alse2_error1"); ?>
		    </i></b>
		<? } ?>    
		<? if ($code == 1) { ?>
		    <b><i>
			<? echo ltext("alse2_error2"); ?>
		    </i></b>
		<? } ?>
		<? if ($code == 2) { ?>
		    <b><i>
			<? echo ltext("alse2_error3"); ?>
		    </i></b>
		<? } 
	       } 
	     ?>
    </TD>
</TR>
</TABLE>
</BODY>
</HTML>
<?
db_close();
?>
