Like the EMPLOYEE MASTER PAGE that uses a series of multiple THUMBNAIL images if that enhancement was added, the EMPLOYEE DETAIL page will use a LARGER version of this SAME image for each employee.
<img style='float:left; margin-right:20px; border:1px solid black;' src='images/photo_not_available.png' width='307' height='240' alt='photo not available' />
<table>
<img style='float:left; margin-right:20px; border:1px solid black;' src='images/photo_not_available.png' width='307' height='240' alt='photo not available' />
<img style='float:left; margin-right:20px; border:1px solid black;'
src='images/<?php echo $result[0]["Image"]?>' width='307' height='240' alt='photo not available' />
Again, like the EMPLOYEE MASTER PAGE that uses avatar images if that enhancement was added, the EMPLOYEE DETAIL page will use a LARGER version of this SAME avatar image for each employee if the image file is missing:
<img style='float:left; margin-right:20px; border:1px solid black;'
src='images/<?php echo $result[0]["Image"]?>' width='307' height='240' alt='photo not available' />
<?php $source_img = $result[0]['Image']; if($source_img == "") { print "<img style='float:left; margin-right:20px; border:1px solid black;' src='images/photo_not_available.png' width='307' height='240' alt='photo not available' />"; } else { print "<img style='float:left; margin-right:20px; border:1px solid black;' src='images/$source_img' width='307' height='240' alt='$source_img' />"; } ?>
There are times when you want to "capture" non-user data (e.g., date/time) from the database system, etc.
<tr>
<td colspan="2" align="center">Date/Time Entered: </td>
</tr>
</table>
<tr>
<td colspan="2" align="center">Date/Time Entered: <?php echo $result[0]["DateEntered"];?></td>
</tr>
</table>
While not necessary, creating alternating row colors for a table can be a very aesthetic design especially if the table expands a long width. Moreover, it makes is easily for users with low vision to easily zoom and navigate each row easier.
/* Alternating Row Colors -----------------*/
div table tr:nth-child(even)
{
background-color: #CCC;
}
div table tr:nth-child(odd)
{
background-color: antiquewhite
}
div table th
{
background-color: black;
color: white;
}
table td
{
padding-left: 5px;
}
Currently, the Delete Dialog Box uses a generic button (DELETE EMPLOYEE and a generic question (Are you sure you want to delete this employee?)). We want to make both the button and the question more "personalized" for each employee.
<tr>
<td colspan = "2" align="center"> <a data-role = "button" data-inline = "true" href = "delete_page.php?recordID=<?php echo $result[0]["ID"];?>" onclick = "return confirm('Are you sure you want to delete this employee?')">DELETE EMPLOYEE</a> </td>
</tr>
<tr>
<?php $selectedName = $result[0]['FirstName'].' '.$result[0]['LastName'].'?';?>
<td colspan = "2" align="center"> <a data-role = "button" data-inline = "true" href = "delete_page.php?recordID=<?php echo $result[0]["ID"];?>"
onclick = "return confirm('Are you sure you want to delete <?php echo $selectedName ?>')">DELETE <?php echo $selectedName ?></a> </td>
</tr>
CODE EXPLANATION:
- Notice that the FIRST PHP script does NOT have an echo statement. That's because it is used only to set the value of the $selectedName variable not display it.
Currently, the Delete Dialog Box uses the default JavaScript format. Here, we will create a custom dialog box using jQueryMobile.
ADD LATER...