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

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