Source for file RequestStatus.class.php
Documentation is available at RequestStatus.class.php
* Sample of user-task script, that also handle response for progress meter
* @version $Id: RequestStatus.class.php,v 1.1 2007/01/22 17:57:26 farell Exp $
* @author Laurent Laville <pear@laurent-laville.org>
* @package HTML_Progress2
var $status = array ('labels' => array (), 'percentage' => 0 );
if (!isset ($_SESSION['progressPercentage'])) {
$_SESSION['progressPercentage'] = 0;
* Returns only new percentage value
* Returns new percentage value with associate new labels values.
* You can define label value even, if its not declared in progress bar;
* no error will be raised.
* See example default3.php and label id 'txt4' usage
if ($status['percentage'] < 25 ) {
$this->status['labels']['txt1'] = '1st quarter';
$this->status['labels']['txt2'] = 'Q1';
} elseif ($status['percentage'] < 50 ) {
$this->status['labels']['txt1'] = '2nd quarter';
$this->status['labels']['txt2'] = 'Q2';
} elseif ($status['percentage'] < 75 ) {
$this->status['labels']['txt1'] = '3rd quarter';
$this->status['labels']['txt2'] = 'Q3';
$this->status['labels']['txt1'] = '4th quarter';
$this->status['labels']['txt4'] = 'Q4';
* Move on current user-task and returns full status of progress meter.
* Here we simulate a user-task that take many cycles to complete, and we
* Move on current user-task and returns only new percentage of progress meter.
* Here we simulate a user-task that take many cycles to complete, and we
* Updates only progress meter status
$newVal = $_SESSION['progressPercentage'] + mt_rand(1 , 25 );
$_SESSION['progressPercentage'] = min(100 , $newVal);
$this->status['percentage'] = $_SESSION['progressPercentage'];
Documentation generated on Mon, 11 Mar 2019 14:54:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|