1
0
Fork 0
zutil-php/test/phpprogressbar.php
2010-11-04 16:14:19 +00:00

97 lines
No EOL
2.6 KiB
PHP

<?php
require_once("../class/PHPProgressBar.php");
// Example of use
echo"<html>
<head>
<style type='text/css'>
.progressEX1, .progressEX2, .progressEX3, .progressEX4, .progressEX5, .progressEX6, .progressEX7{
background: transparent url(../img/bar-grey.gif) repeat-x scroll 0%;
border: 1px solid black;
color: white;
height: 16px;
margin: 5pt;
padding: 0pt;
position: relative;
text-align: center;
width; 150px;
border-collapse: collapse;
}
.progressEX1 b, .progressEX2 b, .progressEX3 b, .progressEX4 b, .progressEX5 b, .progressEX6 b, .progressEX7 b{
float: left;
height: 16px;
margin: 0pt;
padding: 0pt;
font-size: 11px;
}
.progressEX1 b{
background: transparent url(../img/bar-red.gif) repeat-x scroll 0%;
}
.progressEX2 b{
background: transparent url(../img/bar-yellow.gif) repeat-x scroll 0%;
}
.progressEX3 b{
background: transparent url(../img/bar-darkyellow.gif) repeat-x scroll 0%;
}
.progressEX4 b{
background: transparent url(../img/bar-darkgreen.gif) repeat-x scroll 0%;
}
.progressEX5 b{
background: transparent url(../img/bar-green.gif) repeat-x scroll 0%;
}
.progressEX6 b{
background: transparent url(../img/bar-lightblue.gif) repeat-x scroll 0%;
}
.progressEX7 b{
background: transparent url(../img/bar-blue.gif) repeat-x scroll 0%;
}
</style>
</head>
<body><center>
<div class='progressEX1'>
<b style='width: 80%' />
<span>Red</span>
</div>
<div class='progressEX2'>
<b style='width: 80%' />
<span>Yellow</span>
</div>
<div class='progressEX3'>
<b style='width: 80%' />
<span>Dark Yellow</span>
</div>
<div class='progressEX4'>
<b style='width: 80%' />
<span>Dark Green</span>
</div>
<div class='progressEX5'>
<b style='width: 80%' />
<span>Green</span>
</div>
<div class='progressEX6'>
<b style='width: 80%' />
<span>Light Blue</span>
</div>
<div class='progressEX7'>
<b style='width: 80%' />
<span>Blue</span>
</div>
";
$p1 = new PHPProgressBar(550, 16, "../img/bar-grey.gif", "../img/bar-life.gif");
$p2 = new PHPProgressBar(550, 16, "../img/bar-grey.gif", "../img/bar-mana.gif");
$p3 = new PHPProgressBar(550, 16, "../img/bar-grey.gif", "../img/bar-life.gif");
$p4 = new PHPProgressBar(550, 16, "../img/bar-grey.gif", "../img/bar-mana.gif");
for($i=0;$i<=100;$i+=2){
sleep(1);
$p1->setValue($i);
$p1->setText($i."%");
$p2->setValue($i/2,1);
$p2->setText(($i/2)."%",1);
$p3->setValue($i/4,2);
$p3->setText(($i/4)."%",2);
$p4->setValue($i/3,3);
$p4->setText(($i/3)."%",3);
//echo $i."% > ";
}
echo"</center></body></html>";
$p1->redirect("http://google.com");
?>