Page 1 of 1

Removing progress bar, after 100% processing

Posted: Sun Sep 13, 2009 3:19 pm
by sumittyagi
In this code I am using CSS to show the progress of the execution, but after 100% execution of the program, I want to hide the progress indicator from the page. How can i do that....
here is my code

CSS CODE

Code: Select all

 
<style>
.progress_wrapper {width:295px;border:1px solid #ccc;position:absolute;top:360px;left:20%;margin-left:-150px}
.progress {height:20px;background-color:#000}
</style>
 
 
PHP CODE, the colored code is for the progress indicator, I want to hide the progress indicator after 100% processing, Any help is highly appreciated.

Code: Select all

 
    
    $query = "Select employee_id, employee_first_name, employee_last_name, employee_city, employee_state, employee_phone from champion_db.employee where employee_is_deleted = 0 and branch_id = '". $branch . "' ORDER by employee_first_name";
    
    $result = pg_query($query);
    $count = pg_num_rows($result);
    
    //echo "count is".$count;
    if (!$result) {
        echo "Problem with query " . $query . "<br/>";
        echo pg_last_error();
        exit();
    }
 
[b]// THE CODE FOR THE PROGRESS BAR STARTS HERE [/b]
 
$width = 0;       //  the starting width
$width_per_iteration = 300 / $count; // how many pixels should the progress div be increased per each iteration
ob_start();
    while($myrow = pg_fetch_assoc($result)) { 
    echo '<div class="progress_wrapper"><div class="progress" style="width:' . $width . 'px;"></div></div>';
    $width += $width_per_iteration;
    
    
    ob_flush();
    flush();
// I OMITTED THE CODE FOR THE PROCESSING...
}}
 
I am new to the PHP programming, so this might be a stupid question, but any help is highly appreciated.
Thanks in Advance.

Re: Removing progress bar, after 100% processing

Posted: Sun Sep 13, 2009 5:35 pm
by Ollie Saunders
... or use JavaScript to do the same. Prefer CSS.

Re: Removing progress bar, after 100% processing

Posted: Mon Sep 14, 2009 10:34 am
by sumittyagi
Why it doesnt show in internet explorer.
Is there any way I can make a progress bar indicator and have it in all the Broswers.

Re: Removing progress bar, after 100% processing

Posted: Mon Sep 14, 2009 11:46 am
by Ollie Saunders
You can probably just output 256 bytes of whitespace: str_repeat(' ', 256);