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

Source for file square.php

Documentation is available at square.php

  1. <?php 
  2. @include '../include_path.php';
  3. /**
  4.  * Basic Square Progress example.
  5.  *
  6.  * <b>start</b> parameter could be equal to:
  7.  * - 'topleft'     = beginning at top left corner (default)
  8.  * - 'topright'    = beginning at top right corner
  9.  * - 'bottomright' = beginning at bottom right corner
  10.  * - 'bottomleft'  = beginning at bottom left corner
  11.  * 
  12.  * @version    $Id: square.php,v 1.1 2004/06/29 20:48:52 farell Exp $
  13.  * @author     Laurent Laville <pear@laurent-laville.org>
  14.  * @package    HTML_Progress
  15.  */
  16.  
  17. require_once 'HTML/Progress.php';
  18.  
  19. $s = isset($_GET['start']$_GET['start''topleft';
  20.  
  21. $bar = new HTML_Progress();
  22. $bar->setAnimSpeed(100);
  23. $bar->setIncrement(10);
  24.  
  25. $ui =$bar->getUI();
  26. $ui->setStringAttributes('valign=top align=center height=30');
  27. $ui->setOrientation(HTML_PROGRESS_POLYGONAL);
  28. $ui->setCellAttributes('width=20 height=20');
  29. $w = 3;
  30. $h = 3;
  31. $ui->setCellCoordinates($w,$h);          // square 3x3
  32. $coord $ui->getCellCoordinates();
  33.  
  34. switch (strtolower($s)) {
  35.  case 'topright':
  36.      for ($i=1; $i<$w$i++{
  37.          $shift array_shift($coord);
  38.          array_push($coord$shift);
  39.      }
  40.      break;
  41.  case 'bottomright':
  42.      for ($i=1; $i<($w+$h-1)$i++{
  43.          $shift array_shift($coord);
  44.          array_push($coord$shift);
  45.      }
  46.      break;
  47.  case 'bottomleft':
  48.      for ($i=1; $i<$w$i++{
  49.          $pop array_pop($coord);
  50.          array_unshift($coord$pop);
  51.      }
  52.      break;
  53.  case 'topleft':
  54.  default:     
  55.      break;
  56. }
  57. $ui->setCellCoordinates($w$h$coord);
  58. ?>
  59. <html>
  60. <head>
  61. <title>Basic Square ProgressBar example</title>
  62. <style type="text/css">
  63. <!--
  64. <?php echo $bar->getStyle()?>
  65.  
  66. body {
  67.     background-color: #FFFFFF;
  68.     color: #000000;
  69.     font-family: Verdana, Arial;
  70. }
  71.  
  72. a:visited, a:active, a:link {
  73.     color: navy;
  74. }
  75. // -->
  76. </style>
  77. <script type="text/javascript">
  78. <!--
  79. <?php echo $ui->getScript()?>
  80. //-->
  81. </script>
  82. </head>
  83. <body>
  84. <h1><?php echo basename(__FILE__)?></h1>
  85.  
  86. <?php 
  87. echo $bar->toHtml()
  88. $bar->run();
  89. ?>
  90.  
  91. <p>&lt;&lt; <a href="../index.html">Back examples TOC</a></p>
  92.  
  93. </body>
  94. </html>

Documentation generated on Mon, 11 Mar 2019 13:52:39 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.