Login   Register  
PHP Classes
elePHPant
Icontem

File: sample4.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Tom Schaefer  >  Script Progress  >  sample4.php  >  Download  
File: sample4.php
Role: Example script
Content type: text/plain
Description: styled progress bar
Class: Script Progress
Flush page output to show progress of server task
Author: By
Last change: bug fix
Date: 2012-03-15 04:27
Size: 944 bytes
 

Contents

Class file image Download
<?php

include_once 'class.php';

/**
 * eight steps, each sleeps for 1 sec 
 */
$buff = new ScriptProgress(81000000);

# put some styles and a div-tag ahead
$buff->set("<style>div{margin:2px;border:2px solid blue;background-color:blue;display:inline-block;width:10px;height:16px;}</style><div></div>");
# do some stuff here
$buff->next();


# second div
$buff->set("<div></div>");
# do some stuff here
$buff->next();

# third div
$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();

$buff->set("<div></div>");
# do some stuff here
$buff->next();


# end operation
$buff->set("<br>done");
# do some stuff here
$buff->next();