PX : code

Progress bar (js) by Stig S. Bakken
Download this code


<?php // -*- C++ -*-
/*
 * $Id: pbar.phl,v 1.2 1998/04/14 09:22:04 ssb Exp $
 */

function make_progress_bar($cells) {
    global 
$image_path;
    echo(
"<center><table border=0 cellpadding=0 cellspacing=2>\n");
    echo(
" <tr>\n");
    for (
$cell 1$cell <= $cells$cell++) {
    echo(
"  <td><img name=\"pbar$cell\" ".
         
"src=\"${image_path}pbar-blank.gif\" alt=\"\"></td>\n");
    }
    echo(
" </tr>\n</table></center>\n");
    
flush();
}

function 
show_progress($num$status) {
    global 
$image_path;
    if (
$status) {
    
$icon "pbar-done";
    } else {
    
$icon "pbar-failed";
    }
    
javascript("document.pbar$num.src = '${image_path}${icon}.gif';");
    
flush();
}

?>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.