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

Source for file litebasic.php

Documentation is available at litebasic.php

  1. <!--
  2.   Demonstration of the basic features of Progress2_Lite
  3.   version of Progress2 without any dependencies
  4.  
  5.   @version    $Id: litebasic.php,v 1.1 2005/06/12 21:05:18 farell Exp $
  6.   @author     Laurent Laville <pear@laurent-laville.org>
  7.   @package    HTML_Progress2
  8.   @subpackage Examples
  9.   @access     public
  10. // -->
  11. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  12.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  13. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
  14. <head>
  15. <title>Progress2 Lite - Simple Example</title>
  16. </head>
  17. <body bgcolor="#E0E0E0">
  18. <p style="background-color:white;width:400px;height:200px;">&nbsp;</p>
  19. <h1>Positionning sheme</h1>
  20. <p>Default behaviour.</p>
  21.  
  22. <?php
  23. require_once 'HTML/Progress2_Lite.php';
  24.  
  25. /**
  26.  * NOTE: The function {@link http://www.php.net/manual/en/function.usleep.php}
  27.  *       did not work on Windows systems until PHP 5.0.0
  28.  */
  29. function _sleep($usecs)
  30. {
  31.     if ((substr(PHP_OS03== 'WIN'&& (substr(PHP_VERSION,0,1'5') ){
  32.         for ($i=0; $i<$usecs$i++}
  33.     else {
  34.         usleep($usecs);
  35.     }
  36. }
  37.  
  38. // Creates a new progress bar 300 pixels width and 30 pixels height
  39. $pbl = new HTML_Progress2_Lite(array('top' => 80'left' => 50'height' => 30));
  40.  
  41. // Adds additional text label
  42. $pbl->addLabel('text','txt1','Progress2 Lite - Simple Example');
  43.  
  44. // Show the progress bar
  45. $pbl->display();
  46.  
  47. // Processes
  48. for($i=1; $i<=100; $i++{
  49.     $pbl->moveStep($i);
  50.     _sleep(100000);
  51. }
  52. ?>
  53. </body>
  54. </html>

Documentation generated on Mon, 11 Mar 2019 14:16:23 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.