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

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