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

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