Exemplo n.º 1
0
<?php 
echo $bar1->toHTML();
?>
    </td>
    <td width="50%" align="center">
<?php 
echo $bar2->toHTML();
?>
    </td>
</tr>
</table>

<?php 
do {
    $bar1->display();
    $bar2->display();
    if ($bar2->getPercentComplete() == 1) {
        break;
        // the progress bar has reached 100%
    }
    if ($bar1->getPercentComplete() < 1) {
        $bar1->process();
        $bar1->incValue();
    }
    $bar2->process();
    $bar2->incValue();
} while (1);
?>

</body>
</html>
<?php

require_once 'HTML/Progress.php';
$bar = new HTML_Progress();
$bar->setIncrement(5);
$bar->incValue();
printf('value after 1st update = %d <br/>', $bar->getValue());
$dm =& $bar->getDM();
$dm->incValue();
printf('value after 2nd update = %d <br/>', $dm->getValue());
Exemplo n.º 3
0
<?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>&lt;&lt; <a href="../index.html">Back examples TOC</a></p>

</body>
</html>