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

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