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

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