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

  1. <?php 
  2. /**
  3.  * Natural Horizontal ProgressBar example with blue skin.
  4.  * See also ProgressMaker usage with pre-set UI model 'BlueSand'.
  5.  * 
  6.  * @version    $Id: bluesand.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->setCellAttributes('active-color=#3874B4 inactive-color=#EEEECC width=10');
  19. $ui->setBorderAttributes('width=1 color=navy');
  20. $ui->setStringAttributes('width=60 font-size=14 background-color=#EEEEEE align=center');
  21.  
  22. ?>
  23. <!DOCTYPE html
  24.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  25.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  26.  
  27. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  28. <head>
  29. <title>BlueSand Progress example</title>
  30. <style type="text/css">
  31. <!--
  32. <?php echo $bar->getStyle(); ?>
  33.  
  34. body {
  35.     background-color: #EEEEEE;
  36.     color: #000000;
  37.     font-family: Verdana, Arial;
  38. }
  39.  
  40. a:visited, a:active, a:link {
  41.     color: navy;
  42. }
  43. // -->
  44. </style>
  45. <script type="text/javascript">
  46. <!--
  47. <?php echo $bar->getScript(); ?>
  48. //-->
  49. </script>
  50. </head>
  51. <body>
  52. <h1><?php echo basename(__FILE__); ?></h1>
  53.  
  54. <?php 
  55. echo $bar->toHtml(); 
  56.  
  57. do {
  58.     $bar->display();
  59.     if ($bar->getPercentComplete() == 1) {
  60.         break;   // the progress bar has reached 100%
  61.     }
  62.     $bar->incValue();
  63. } while(1);
  64. ?>
  65.  
  66. <p><< <a href="index.html">Back examples TOC</a></p>
  67.  
  68. </body>
  69. </html>