ok so i was working on the approval script from a while ago. and then i realized that it only shows the ones that are by name.
this script i wrote just arrays everyone that is in the db from approved=0.
but i want it to match with the service that they did.
so for example it finds the id number, gets the name, then puts the name with the service they did with the amount of hours.
this script i wrote just arrays everyone that is in the db from approved=0.
but i want it to match with the service that they did.
so for example it finds the id number, gets the name, then puts the name with the service they did with the amount of hours.
PHP:
<?php
session_start();
if(isset($_SESSION['verify'])) {
echo "<h1>Approval Section</h1><br>";
mysql_connect("localhost", "ashin951_keydb", "___") or die(mysql_error());
mysql_select_db("ashin951_keydb") or die(mysql_error());
//User Approval Script
$result2 = mysql_query("SELECT * FROM service WHERE approved='0'") or die(mysql_error());
$result3 = mysql_query("SELECT * FROM community") or die(mysql_error());
echo "<table border='1'>";
echo "<tr> <th>Name</th> <th>Action</th> <th>Hours</th> <th>Approve</th> </tr>";
while($row = mysql_fetch_array( $result2 ) and $row2 = mysql_fetch_array( $result3 )) {
// Print out the contents of each row into a table
echo "<tr><td>";
echo $row2['name'];
echo "</td><td>";
echo $row['action'];
echo "</td>";
echo "<td>";
echo $row['hours'];
echo "</td><td>";
$id = $row['id'];
echo "<form action=\"approve.php\" method=\"post\"><input name=\"approve[]\" value=\"$id\" type=\"checkbox\">";
echo "</td></tr>";
}
echo "</table>";
echo "<input type=\"submit\" name=\"Approve\" value=\"Approve\"></form>";
} else {
echo "Access Denied.";
}
?>
<title>Approval Section</title>