<? $page = 5; include './header.inc' ?>
<?

switch ($e)
{
   case 1:
   case 2:
   case 3:
   case 4:
   case 5:
      $showcode = 1;
      break;
   default:
      $showcode = 0;
}

switch ($i)
{
   case 3:
   case 4:
   case 5:
      $showimg = 1;
      break;
   default:
      break;
}

?>
<u>Script Examples</u>
<p>
Here are some examples of using the php_imlib extension.  The first two use
only the functions provided in php_imlib, the rest use the PHP classes.
<ul>
<li><? echo ($e == 1) ?
       'Extension: Upload and Scale an Image' :
       '<a href="examples.php?e=1">Extension: Upload and Scale an Image</a>'
    ?>
<li><? echo ($e == 2) ?
       'Extension: Draw a Text String' :
       '<a href="examples.php?e=2">Extension: Draw a Text String</a>'
    ?>
<li><? echo ($e == 3) ?
       'PHP Classes: Flip, Blend, Text' :
       '<a href="examples.php?e=3">PHP Classes: Flip, Blend, Text</a>'
    ?>
<li><? echo ($e == 4) ?
       'PHP Classes: Draw Rect, Poly, Ellipse' :
       '<a href="examples.php?e=4">PHP Classes: Draw Rect, Poly, Ellipse</a>'
    ?>
<li><? echo ($e == 5) ?
       'PHP Classes: Gradients, Transparency' :
       '<a href="examples.php?e=5">PHP Classes: Gradients, Transparency</a>'
    ?>
</ul></p>
<? if ($showcode) { echo "\n"; ?>
<table border="0">
  <tr>
    <td class="d-cell">
      <? include "./example.$e.inc"; echo "\n" ?>
    </td>
  </tr>
</table>
<? } else if ($showimg) { ?>
<table border="0">
  <tr>
    <td class="d-cell">
      The image created by
      <? if ($i == 3) echo 'PHP Classes: Flip, Blend, Text:';
         else if ($i == 4) echo 'PHP Classes: Draw Rect, Poly, Ellipse:';
         else if ($i == 5) echo 'PHP Classes: Gradients, Transparency:';
      ?>
      <br><br>
      <img src="example.<? echo $i ?>.png">
    </td>
  </tr>
</table>
<? } ?>
