For this sample I used the table order_details from samples database,
- Create a public library with the code is in the attached file
Create a blank application with the code below and check the library that you created in the previous step
// Barra de progresso $prb = new ProgressBar(400, 30); // create new ProgressBar (width:300px,height:30px)
$prb->left = 400; // position from left
$prb->top = 120; // position from top
$prb->addLabel('text','txt1');
$prb->setLabelFont('txt1','20');
$prb->setLabelPosition('txt1','405','122','300','20');
$prb->setBarColor('#00FF7F');
$prb->setBarDirection('right');
$prb->show(); // show the ProgressBar
$sql="SELECT * FROM order_details UNION SELECT * FROM order_details UNION SELECT * FROM order_details UNION SELECT * FROM order_details UNION SELECT * FROM order_details"; sc_lookup(dataset,$sql);
$contador= count({dataset});
$prb->max = $contador;
for($b=0;$b<$contador;$b++) {
$nome = {dataset[$b][0]};
$cpf = {dataset[$b][1]};
$id = {dataset[$b][2]};
$prb->moveStep($b);
$prb->setLabelValue('txt1','Processando: '.$b.'/'.$contador);
flush();
ob_flush();}
$prb->setLabelValue('txt1','Concluido!');
ProgressBar.txt (17.5 KB)