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

  1. <?php 
  2. /**
  3.  * Multiple Vertical ProgressBar example.
  4.  * 
  5.  * @version    $Id: multiple_vertical.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. $bar1 = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
  13. $bar1->setIdent('PB1');
  14. $bar1->setIncrement(10);
  15. $bar1->setBorderPainted(true);
  16.  
  17. $ui1 =& $bar1->getUI();
  18. $ui1->setFillWay('natural');
  19. $ui1->setCellCount(15);
  20. $ui1->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=50 height=13');
  21. $ui1->setBorderAttributes('width=1 color=#000000');
  22. $ui1->setStringAttributes(array(
  23.     'font-size' => 8,
  24.     'color' => '#FF0000',
  25.     'background-color' => '#C3C6C3',
  26.     'align' => 'center', 
  27.     'valign' => 'bottom'
  28. ));
  29.  
  30.  
  31. $bar2 = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL);
  32. $bar2->setIdent('PB2');
  33. $bar2->setIncrement(5);
  34. $bar2->setBorderPainted(true);
  35.  
  36. $ui2 =& $bar2->getUI();
  37. $ui2->setFillWay('reverse');
  38. $ui2->setCellCount(15);
  39. $ui2->setCellAttributes('active-color=#3874B4 inactive-color=#FFDDAA width=50 height=13');
  40. $ui2->setBorderAttributes('width=1 style=dashed color=#000000');
  41. $ui2->setStringAttributes(array(
  42.     'font-size' => 8,
  43.     'color' => 'navy',
  44.     'background-color' => '#C3C6C3',
  45.     'align' => 'center', 
  46.     'valign' => 'bottom'
  47. ));
  48.  
  49. ?>
  50. <!DOCTYPE html
  51.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  52.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  53.  
  54. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  55. <head>
  56. <title>Multiple Vertical ProgressBar example</title>
  57. <style type="text/css">
  58. <!--
  59. <?php 
  60. echo $bar1->getStyle();
  61. echo $bar2->getStyle();
  62. ?>
  63.  
  64. body {
  65.     background-color: #C3C6C3;
  66.     color: #000000;
  67.     font-family: Verdana, Arial;
  68. }
  69.  
  70. a:visited, a:active, a:link {
  71.     color: navy;
  72. }
  73.  
  74. table.container {
  75.     border: 1;
  76.     border-color: navy;
  77.     border-style: dotted;
  78.     cell-spacing: 4;
  79.     cell-padding: 10;
  80.     width: 25%;
  81. // -->
  82. </style>
  83. <script type="text/javascript">
  84. <!--
  85. <?php echo $bar1->getScript(); ?>
  86. //-->
  87. </script>
  88. </head>
  89. <body>
  90. <h1><?php echo basename(__FILE__); ?></h1>
  91.  
  92. <table class="container">
  93. <tr>
  94.     <td width="50%" align="center">
  95. <?php echo $bar1->toHTML(); ?>
  96.     </td>
  97.     <td width="50%" align="center">
  98. <?php echo $bar2->toHTML(); ?>
  99.     </td>
  100. </tr>
  101. </table>
  102.  
  103. <?php 
  104.  
  105. do {
  106.     $bar1->display();
  107.     $bar2->display();
  108.     if ($bar2->getPercentComplete() == 1) {
  109.         break;   // the progress bar has reached 100%
  110.     }
  111.     if ($bar1->getPercentComplete() < 1) {
  112.         $bar1->incValue();
  113.     }
  114.     $bar2->incValue();
  115. } while(1);
  116. ?>
  117.  
  118. <p><< <a href="index.html">Back examples TOC</a></p>
  119.  
  120. </body>
  121. </html>