Location: PHPKode > scripts > Error Management > error-management/list_error.php
<?
include("dbconnect.inc.php");

class ListErrors
	{
/******************************************************************************************************************
-Class variables
/******************************************************************************************************************/
		var $result;
/******************************************************************************************************************
-Used to process the form data
/******************************************************************************************************************/
		function ProcessForm()
			{
				$select="SELECT * FROM error_reports ORDER BY is_fixed ASC,reported_on DESC,severity ASC";
				$this->result=mysql_query($select);
			}
/******************************************************************************************************************
-Used to display the form
/******************************************************************************************************************/
		function DisplayForm()
			{
				?>
				<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
				<html xmlns="http://www.w3.org/1999/xhtml">
				<head>
				<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
				<title>Report Error</title>
				</head>

				<body>
				<br/>
				<h2 align="center">List of Error Reports</h2>
				<br/>
				<table width="80%" border="1" cellspacing="5" align="center">
				  <tr>
					<th scope="col">ID</th>
					<th scope="col">Error Severity</th>
					<th scope="col">Page URL</th>
					<th scope="col">Reported On</th>
					<th scope="col">Is Fixed</th>
					<th scope="col">Action</th>
				  </tr>
				  <?
  						while($row=mysql_fetch_assoc($this->result))
							{
								echo "<tr>\n";
								echo "<td>$row[id]</td>\n";
								echo "<td>$row[severity]</td>\n";
								echo "<td><a href='$row[page_url]'>$row[page_url]</a></td>\n";
								echo "<td>".date('M  d Y h:i:s A',$row['reported_on'])."</td>\n";
								echo "<td>$row[is_fixed]</td>\n";
								echo "<td><input name=\"edit\" type=\"button\" onclick=\"location.href='edit_error.php?id=$row[id]'\" value=\"Edit\"/></td>\n";
								echo "</tr>\n";
							}
				  ?> 
				</table>
				<?
			}
/******************************************************************************************************************
-Main function of the class.
/******************************************************************************************************************/
		function MainFunction()
			{
				$this->ProcessForm();
				$this->DisplayForm();	
			}
	}
	
$list_errors=new ListErrors();
$list_errors->MainFunction();
Return current item: Error Management