04-12-2011, 08:53 PM
Hi
Not sure if this is the right place to post this, so Mods please move it to the right place if necessary.
I am working on a mysql player reporting system for our comunities servers. I already have the reporting side in place, with a php web front end to view all the reported players in a table, with date, reason, reporter etc
I now want to integrate an admin response system into the web page by adding a checkbox to each entry in the table, and a text box with submit button at the bottom of the table. If a row is selected with the checkbox, then entering text in the textbox and pressing the submit button will enter that text into the response column for the selected row in the database.
But I have very little experience with php (writing our web admin system took me several weeks on Google...) and was hoping someone could help me out!
This is the basic page. I haven't included any of my attempts to integrate the response system, as they haven't worked...
Any ideas/pointers gratefully accepted, thanks!
Not sure if this is the right place to post this, so Mods please move it to the right place if necessary.
I am working on a mysql player reporting system for our comunities servers. I already have the reporting side in place, with a php web front end to view all the reported players in a table, with date, reason, reporter etc
I now want to integrate an admin response system into the web page by adding a checkbox to each entry in the table, and a text box with submit button at the bottom of the table. If a row is selected with the checkbox, then entering text in the textbox and pressing the submit button will enter that text into the response column for the selected row in the database.
But I have very little experience with php (writing our web admin system took me several weeks on Google...) and was hoping someone could help me out!
This is the basic page. I haven't included any of my attempts to integrate the response system, as they haven't worked...
PHP Code:
<?php
include("include/session.php");
include("include/header.php");
?>
<?php
$host="localhost";
$username="blabla";
$password="blabla";
$database="blabla";
mysql_connect($host,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
?>
<table>
<tr>
<td><img src="images/spacer001.gif" height=50 width=1></td>
<td><img src="images/spacer001.gif" height=1 width=100></td>
</tr>
<tr><td align='right'><img src="images/logo02.jpg"></td><td rowspan=2> <img src="images/spacer002.gif" height=300 width=1></td></tr>
<tr><td class='main' align='right' valign='top'>
<?php
/**
* User has already logged in, so display relavent links, including
* a link to the admin center if the user is an administrator.
*/
if($session->logged_in){
echo "<h1>" . COMMUNITYNAME . " Admin Tools</h1>";
echo "<h1>Player Reporting System</h1>";
echo "<br>";
?>
<center>
<h1><small><small><span style="font-family: Verdana;"><b>Reported Players</b></span></small></small></h1>
</center>
<br>
<table align="center" border="1" width="70%">
<tbody>
<tr>
<td style="font-family: Verdana;"><b>Date</b></td>
<td style="font-family: Verdana;"><b>Server</b></td>
<td style="font-family: Verdana;"><b>Map</b></td>
<td style="font-family: Verdana;"><b>Player</b></td>
<td style="font-family: Verdana;"><b>STEAM ID</b></td>
<td style="font-family: Verdana;"><b>Reported by</b></td>
<td style="font-family: Verdana;"><b>STEAM ID</b></td>
<td style="font-family: Verdana;"><b>Reason</b></td>
</tr>
<tr>
</tbody>
<?php
mysql_query("SET NAMES 'utf8'");
$result=mysql_query("SELECT * FROM report");
$num=mysql_numrows($result);
mysql_close();
$i=0;
while ($i < $num) {
$id=mysql_result($result,$i,"id");
$name=mysql_result($result,$i,"name");
$steamid=mysql_result($result,$i,"steamid");
$server=mysql_result($result,$i,"server");
$map=mysql_result($result,$i,"map");
$reason=mysql_result($result,$i,"reason");
$date=mysql_result($result,$i,"date");
$reportername=mysql_result($result,$i,"reportername");
$reporterid=mysql_result($result,$i,"reporterid");
echo "\t<tr><td>$date</td><td>$server</td><td>$map</td><td>$name</td><td>$steamid</td><td>$reportername</td><td>$reporterid</td><td>$reason</td></tr>\n";
$i++;
}
?>
</table>
<?php
include("include/footer.php");
}
else
{
header( 'Location: index.php' ) ;
}
?>
</td></tr>
</table>
</body>
</html>
Any ideas/pointers gratefully accepted, thanks!