HTML_Progress
[ class tree: HTML_Progress ] [ index: HTML_Progress ] [ all elements ]

Source for file bluesandplus.php

Documentation is available at bluesandplus.php

  1. <?php 
  2. @include '../../include_path.php';
  3. /**
  4.  * Natural Horizontal ProgressBar example with JavaScript customization.
  5.  * See also ProgressMaker usage with pre-set UI model 'BlueSandPlus'.
  6.  * 
  7.  * @version    $Id: bluesandplus.php,v 1.2 2004/04/18 13:25:43 farell Exp $
  8.  * @author     Laurent Laville <pear@laurent-laville.org>
  9.  * @package    HTML_Progress
  10.  */
  11.  
  12. require_once 'HTML/Progress.php';
  13.  
  14. $bar = new HTML_Progress();
  15. $bar->setAnimSpeed(100);
  16. $bar->setIncrement(10);
  17. $bar->setBorderPainted(true);
  18.  
  19. $ui =$bar->getUI();
  20. $ui->setCellAttributes('active-color=#3874B4 inactive-color=#EEEECC width=10');
  21. $ui->setBorderAttributes('width=1 color=navy');
  22. $ui->setStringAttributes('width=60 font-size=14 background-color=#EEEEEE align=center');
  23. $ui->setScript('progress_number.js');
  24.  
  25. foreach (range(0,2as $index{
  26.     $ui->setCellAttributes('color=silver'$index);
  27. }
  28. foreach (range(3,6as $index{
  29.     $ui->setCellAttributes('color=yellow'$index);
  30. }
  31. foreach (range(7,9as $index{
  32.     $ui->setCellAttributes('color=orange'$index);
  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>BlueSandPlus Progress example</title>
  42. <style type="text/css">
  43. <!--
  44. <?php echo $bar->getStyle()?>
  45.  
  46. body {
  47.     background-color: #EEEEEE;
  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>&lt;&lt; <a href="index.html">Back examples TOC</a></p>
  75.  
  76. </body>
  77. </html>

Documentation generated on Mon, 11 Mar 2019 10:15:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.