<?php require_once 'HTML/Progress.php'; $bar = new HTML_Progress(); $bar->setValue(50); $bar->setBorderPainted(true); $ui =& $bar->getUI(); $ui->setFillWay('reverse'); $ui->setCellCount(5); $ui->setCellAttributes('active-color=#970038 inactive-color=#FFDDAA width=20'); $ui->setBorderAttributes('width=1 color=#000000'); $ui->setStringAttributes('font-size=14 color=#FF0000 align=left valign=bottom'); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3c.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>setStringAttributes example</title> <style type="text/css"> <!-- <?php echo $bar->getStyle(); ?> // --> </style> <script type="text/javascript"> <!-- <?php echo $ui->getScript();
<?php require_once 'HTML/Progress.php'; $bar = new HTML_Progress(); $bar->setValue(45); printf('direct way: value = %d <br/>', $bar->getValue()); $dm =& $bar->getDM(); $dm->setValue(45); printf('another way: value = %d <br/>', $dm->getValue());
<?php require_once 'HTML/Progress.php'; $bar = new HTML_Progress(); $bar->setStringPainted(true); $bar->setValue(25); $ui =& $bar->getUI(); $ui->setStringAttributes('width=350 align=left'); ?> <html> <head> <title>setStringPainted example</title> <style type="text/css"> <!-- <?php echo $bar->getStyle(); ?> // --> </style> <script type="text/javascript"> <!-- <?php echo $bar->getScript(); ?> //--> </script> </head> <body> <?php echo $bar->toHtml();
<?php echo $bar1->toHTML(); ?> </td> <td width="25%" align="center"> <?php echo $bar2->toHTML(); ?> </td> </tr> </table> <?php do { $bar1->display(); $bar1->process(); // warning: don't forget it (even for a demo) if ($bar1->getPercentComplete() == 1) { $bar1->setValue(0); // the 1st progress bar has reached 100%, do a new loop } else { $bar1->incValue(); // updates 1st progress bar } } while ($bar2->getPercentComplete() < 1); ?> <p><< <a href="../index.html">Back examples TOC</a></p> </body> </html>
//--> </script> </head> <body> <?php echo $bar->toHtml(); $loop = 0; do { $bar->display(); $bar->sleep(); // for purpose of demo only if ($bar->getPercentComplete() == 1) { $loop++; if ($bar->isIndeterminate()) { $bar->setValue(0); } else { break; // progress bar reached 100% in determinate mode } } else { $bar->incValue(); } /** rule to decide when to switch back to determinate mode * - after two full loops and half one */ if ($bar->isIndeterminate()) { if ($loop == 2 && $bar->getValue() == 50) { $bar->setIndeterminate(false); $bar->setString(null); // display % string
<?php require_once 'HTML/Progress.php'; $bar = new HTML_Progress(); $bar->setValue(18); printf('direct way: progress completed at %f <br/>', $bar->getPercentComplete()); $dm =& $bar->getDM(); printf('another way: progress completed at %f <br/>', $dm->getPercentComplete());
<?php @(include '../include_path.php'); /** * Basic Vertical ProgressBar example. * * @version $Id: basic.php,v 1.1 2004/07/05 21:32:31 farell Exp $ * @author Laurent Laville <*****@*****.**> * @package HTML_Progress */ require_once 'HTML/Progress.php'; $bar = new HTML_Progress(HTML_PROGRESS_BAR_VERTICAL); $bar->setAnimSpeed(100); $bar->setValue(85); ?> <html> <head> <title>Basic Vertical ProgressBar example</title> <style type="text/css"> <!-- <?php echo $bar->getStyle(); ?> body { background-color: #FFFFFF; color: #000000; font-family: Verdana, Arial; } a:visited, a:active, a:link {
$ui->setOrientation(HTML_PROGRESS_BAR_VERTICAL); $ui->setCellAttributes('active-color=#3874B4 inactive-color=#EEEECC width=65'); ?> <head> <title>display example</title> <style type="text/css"> <!-- <?php echo $bar->getStyle(); ?> // --> </style> <script type="text/javascript"> <!-- <?php echo $bar->getScript(); ?> //--> </script> </head> <body> <h1>Screenshot </h1> <?php $bar->setValue(65); echo $bar->toHtml(); $bar->display(); ?> </body> </html>