home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / redsandback.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  1.6 KB  |  71 lines

  1. <?php 
  2. /**
  3.  * 5 cells Reverse Horizontal ProgressBar example with red skin.
  4.  * See also ProgressMaker usage with pre-set UI model 'RedSandBack'.
  5.  * 
  6.  * @version    $Id: redsandback.php,v 1.1 2003/11/15 18:27:10 thesaur Exp $
  7.  * @author     Laurent Laville <pear@laurent-laville.org>
  8.  * @package    HTML_Progress
  9.  */
  10.  
  11. require_once ('HTML/Progress.php');
  12.  
  13. $bar = new HTML_Progress();
  14. $bar->setIncrement(10);
  15. $bar->setBorderPainted(true);
  16.  
  17. $ui =& $bar->getUI();
  18. $ui->setFillWay('reverse');
  19. $ui->setCellCount(5);
  20. $ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=20');
  21. $ui->setBorderAttributes('width=1 color=#000000');
  22. $ui->setStringAttributes('font-size=14 color=#FF0000 align=left valign=bottom');
  23.  
  24. ?>
  25. <!DOCTYPE html
  26.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  27.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  28.  
  29. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  30. <head>
  31. <title>RedSandBack Progress example</title>
  32. <style type="text/css">
  33. <!--
  34. <?php echo $bar->getStyle(); ?>
  35.  
  36. body {
  37.     background-color: #FFFFFF;
  38.     color: #000000;
  39.     font-family: Verdana, Arial;
  40. }
  41.  
  42. a:visited, a:active, a:link {
  43.     color: navy;
  44. }
  45. // -->
  46. </style>
  47. <script type="text/javascript">
  48. <!--
  49. <?php echo $bar->getScript(); ?>
  50. //-->
  51. </script>
  52. </head>
  53. <body>
  54. <h1><?php echo basename(__FILE__); ?></h1>
  55.  
  56. <?php 
  57. echo $bar->toHtml(); 
  58.  
  59. do {
  60.     $bar->display();
  61.     if ($bar->getPercentComplete() == 1) {
  62.         break;   // the progress bar has reached 100%
  63.     }
  64.     $bar->incValue();
  65. } while(1);
  66. ?>
  67.  
  68. <p><< <a href="index.html">Back examples TOC</a></p>
  69.  
  70. </body>
  71. </html>