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

Source for file smallest.php

Documentation is available at smallest.php

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

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