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

  1. <?php 
  2. /**
  3.  * Horizontal no String ProgressBar example.
  4.  * 
  5.  * @version    $Id: horizontal_nostring.php,v 1.2 2003/11/16 17:34:50 farell 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(10);
  14. $bar->setStringPainted(true);   // get space for the string
  15. $bar->setString('');            // but don't paint it
  16.  
  17. ?>
  18. <!DOCTYPE html
  19.     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  20.     "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  21.  
  22. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  23. <head>
  24. <title>Horizontal no String ProgressBar example</title>
  25. <style type="text/css">
  26. <!--
  27. <?php echo $bar->getStyle(); ?>
  28.  
  29. body {
  30.     background-color: #FFFFFF;
  31.     color: #000000;
  32.     font-family: Verdana, Arial;
  33. }
  34.  
  35. a:visited, a:active, a:link {
  36.     color: navy;
  37. }
  38. // -->
  39. </style>
  40. <script type="text/javascript">
  41. <!--
  42. <?php echo $bar->getScript(); ?>
  43. //-->
  44. </script>
  45. </head>
  46. <body>
  47. <h1><?php echo basename(__FILE__); ?></h1>
  48.  
  49. <?php 
  50. echo $bar->toHtml(); 
  51.  
  52. do {
  53.     $bar->display();
  54.     if ($bar->getPercentComplete() == 1) {
  55.         break;   // the progress bar has reached 100%
  56.     }
  57.     $bar->incValue();
  58. } while(1);
  59. ?>
  60.  
  61. <p><< <a href="index.html">Back examples TOC</a></p>
  62.  
  63. <h2>print_r </h2>
  64. <pre>
  65. <?php 
  66. print_r($bar->toArray()); 
  67. ?>
  68. </pre>
  69.  
  70. </body>
  71. </html>