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

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