Miscellaneous Enhancements

Miscellaneous (NOT COMPLETED)

Add Alternative Text

To make you app more accessible to people with disability, you may need to add alternative text to images. Since this app already include the name of the employee in the ListView and in the EMPLOYEE DETAIL pages, it is not a critical step to take.

APPLY TO: Any static or dynamic image on select pages (e.g., EMPLOYEE MASTER PAGE and EMPLOYEE DETAIL page).

  1. Open the master_page.php.
  2. Add the following highlighted code to the alt attribute in the print statements:

         <?php    
    $source_img = $row['Image'];

    if($source_img == "")
    {
    print "<img src='images/photo_not_available.png' width='80' height='80' alt='photo not available' />";
    }
    else
    {
    print "<img src='images/$source_img' width='80' height='80' alt='$source_img' />";
    }
    ?>

    CODE EXPLANATION:
    - The alt attribute is used by screen readers (e.g., JAWS, VoiceOver, Talkback) to read the alternative text of an image.

  3. CHECK POINT: Save the file and preview it with a screen reader. You should HEAR the alt text announced by the screen reader.
  4. Open the detail_page.php.
  5. Add the following highlighted code to the alt attribute in the print statements:

    <?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' />";
    }
    ?>

    CODE EXPLANATION:
    - The alt attribute is used by screen readers (e.g., JAWS, VoiceOver, Talkback) to read the alternative text of an image.

  6. CHECK POINT: Save the file and preview it with a screen reader. You should HEAR the alt text announced by the screen reader.

[back to top]

Use Dynamic Radio Buttons

 

[back to top]

Use Dynamic Checkboxes

 

Delete Images in Folder

 

[back to top]

Output Buffering?

 

[back to top]