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

Source for file ellipse.php

Documentation is available at ellipse.php

  1. <?php 
  2. @include '../../include_path.php';
  3. /**
  4.  * Custom Ellipse Progress example.
  5.  *
  6.  * @version    $Id: ellipse.php,v 1.1 2004/04/18 13:25:43 farell 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->setAnimSpeed(100);
  15. $bar->setIncrement(10);
  16.  
  17. $ui =$bar->getUI();
  18. $ui->setOrientation(HTML_PROGRESS_CIRCLE);
  19. $ui->setStringAttributes('font-size=20 width=100');
  20. $ui->setCellAttributes(array(
  21.     'width' => 200,
  22.     'height' => 100,
  23.     'spacing' => 0,
  24.     'inactive-color' => 'red',
  25.     'active-color' => 'navy'
  26.     )
  27. );
  28. if (isset($_GET['cacheIMG'])) {
  29.     foreach (range(0,10as $index{
  30.         $ui->setCellAttributes(array('background-image' => 'temp/e'.$index.'.png'),$index);
  31.     }
  32. else {
  33.     $ui->drawCircleSegments('temp''e%s.png');
  34. }
  35. ?>
  36. <html>
  37. <head>
  38. <title>Custom Ellipse ProgressBar example</title>
  39. <style type="text/css">
  40. <!--
  41. <?php echo $bar->getStyle()?>
  42.  
  43. body {
  44.     background-color: #FFFFFF;
  45.     color: #000000;
  46.     font-family: Verdana, Arial;
  47. }
  48.  
  49. a:visited, a:active, a:link {
  50.     color: navy;
  51. }
  52. // -->
  53. </style>
  54. <script type="text/javascript">
  55. <!--
  56. <?php echo $ui->getScript()?>
  57. //-->
  58. </script>
  59. </head>
  60. <body>
  61. <h1><?php echo basename(__FILE__)?></h1>
  62.  
  63. <?php 
  64. echo $bar->toHtml()
  65.  
  66. do {
  67.     $bar->display();
  68.     if ($bar->getPercentComplete(== 1{
  69.         break;   // the progress bar has reached 100%
  70.     }
  71.     $bar->incValue();
  72. while(1);
  73.  
  74. ?>
  75.  
  76. <p>&lt;&lt; <a href="index.html">Back examples TOC</a></p>
  77.  
  78. </body>
  79. </html>

Documentation generated on Mon, 11 Mar 2019 10:15:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.