This is the view of the events (basic) Can I do the if/else statement to chose font color base of a MySQL Query Result? (see below) And
No matter how I have written this, it will not turn into a scrolling table. I want the headers to stay fixed. I also don't want to rely on Java-most of the staff logs in mobile. I will if I have to though!
The other thing I am not seeing how to do, but I know is also possible.... having an "edit event" "view positions" buttons. I am thinking it has to do with storing a variable, but how do you make sure the variables code pulls the event singularly from your query using the Event_ID ??
This is my first site outside of an HTML site. This is the raw synopsis:
Building a site that has users with profiles & 6 permission levels. Client & various staffing levels; I use php to code the access because it is not so much about being able to query/change the database-its more so I am handling with php. There is a time log, and keeps up with the pay to the staff and what the client owes per their hours. This is the first layer view once logged in as any staffmember (sans the edit event which is reserved for high perm staff) upon clicking "view positions" they need to be able to request the shift (separate table-please correct me if I am wrong-I have all foreign keys in database in place so making this event table should be along the same as all the others but with diff variables/queries etc. So in theory all I have to do is get the grabbing of the ID field and using it down)
Here is my code. Why is it not setting the client named in green?
<html>
<body>
<?php require_once('auth.php'); ?>
<?php $sql = "SELECT * FROM Events ORDER BY EventDate DESC LIMIT 40";
$sqlRes = mysql_query($sql);
$req1 = mysql_num_rows($sqlRes);
$colorpick = $sqlRes['BusinessName'];?>
<div class="event_view">
<table border="1" cellspacing="2" cellpadding="2" width="100%" height="100%" bgcolor="silver" style="border-collapse:collapse;">
<tr>
<th><font face="Arial, Helvetica, sans-serif" color="black">Event Date</font></th>
<th><font face="Arial, Helvetica, sans-serif" color="black">Event Name</font></th>
<th><font face="Arial, Helvetica, sans-serif" color="black">Start Time</font></th>
<th><font face="Arial, Helvetica, sans-serif" color="black">End Time</font></th>
<th><font face="Arial, Helvetica, sans-serif" color="black">Client Name</font></th>
</tr>
<?php
$i=0;
while ($i < $req1) {
$f1=mysql_result($sqlRes,$i,"EventDate");
$f2=mysql_result($sqlRes,$i,"EventName");
$f3=mysql_result($sqlRes,$i,"Hour");
$f4=mysql_result($sqlRes,$i,"EndHour");
$f5=mysql_result($sqlRes,$i,"BusinessName");
?>
<tr>
<td><font face="Arial, Helvetica, sans-serif" color="black"><?php echo $f1; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif" color="black"><?php echo $f2; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif" color="black"><?php echo $f3; ?></font></td>
<td><font face="Arial, Helvetica, sans-serif" color="black"><?php echo $f4; ?></font></td>
<td><?php if($colorpick == 'ClientA') { ?>
<font face="Arial, Helvetica, sans-serif" color="green"><?php echo $f5; ?></font>;
<?php } else($colorpick != 'ClientA'); ?>
<font face="Arial, Helvetica, sans-serif" color="black"><?php echo $f5; ?></font></td>
</tr>
<?php
$i++;
}
?>
</table>
</div>
</body>
</html>