Jump to content

Need help finishing up this code! probably something simple..


jbrill

Recommended Posts

im trying to finish up an "organize" code, all i need to do now is display the results. i have put in where they need to be could someone  look over the code and help me finish it or at least offer suggestions.

 

<?


include 'admin_header.php';

// this part validates whether the user is logged in as a administrator or not
if($_SESSION['type'] != "admin")
{
echo "You are either not logged in, or logged in but with no authority to access this page.<br>please visit the log in page <a href=index.php>here</a>.";
}




else
{


include 'admin_jobmenu.php';


$status = (isset($_GET["status"])) ? $_GET["status"] : NULL;
$customer= (isset($_GET["customer"])) ? $_GET["customer"] : NULL;
$keyword= (isset($_GET["keyword"])) ? $_GET["keyword"] : NULL;


$myTable = "";


$query = "";
$query = ($status != "" && $status != NULL) ? ($query = "") ? "WHERE status = '$status'" : " AND status = '$status'" : "";
$query = ($customer!= "" && $customer!= NULL) ? ($query = "") ? "WHERE name= '$customer'" : " AND name= '$customer'" : NULL;
$query = ($keyword!= "" && $keyword!= NULL) ? ($query = "") ? "WHERE keyword= '$keyword'" : " AND keyword= '$keyword'" : NULL;
$query = "SELECT * FROM jobs " & $query;

?>

<table border="0" width="80%" bgcolor="#ffffff" class="MainBody1" cellpaddin="0" cellspacing="0">
<tr>
<td class="underline">Quote Number</td>
<td class="underline">Job Number</td>
<td class="underline">PO Number</td>
<td class="underline">Customer</td>
<td class="underline">Status</td>
<td class="underline">Action</td>
</tr>

<?
// this is where the results are to be displayed.
echo '<tr>';
echo '<td>' ID GOES HERE'</td>';
echo '<td>' JOB NUMBER GOES HERE'</td>';
echo '<td>' PO NUMBER GOES HERE'</td>';
echo '<td>' NAME GOES HERE'</td>';
echo '<td>' STATUS GOES HERE'</td>';
echo '<td>Action</td>';
echo '</tr>';

?>
</table>

<? include 'admin_footer.php'; ?>

<?
}?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.