diff --git a/JsPHP.php b/JsPHP.php deleted file mode 100644 index 1373e5e..0000000 --- a/JsPHP.php +++ /dev/null @@ -1,110 +0,0 @@ -
"; -progressBarInit(550, 16, "img/bar-grey.gif", "img/bar-life.gif"); -progressBarInit(550, 16, "img/bar-grey.gif", "img/bar-mana.gif"); -progressBarInit(550, 16, "img/bar-grey.gif", "img/bar-life.gif"); -progressBarInit(550, 16, "img/bar-grey.gif", "img/bar-mana.gif"); -for($i=0;$i<=100;$i+=2){ - sleep(1); - progressSetValue($i); - progressSetText($i."%"); - progressSetValue($i/2,1); - progressSetText(($i/2)."%",1); - progressSetValue($i/4,2); - progressSetText(($i/4)."%",2); - progressSetValue($i/3,3); - progressSetText(($i/3)."%",3); - //echo $i."% > "; -} -echo"
"; -redirect("http://google.com"); - -function progressBarInit($width, $height, $imgBar, $imgProggress){ - GLOBAL $progressInit, $progressNextId; - if(!$progressInit){ - echo" - "; - $progressInit = true; - } - $id = $progressNextId; - $progressNextId++; - echo" - -
-
- -
-
- "; - flush(); - return $id; -} -function progressSetValue($value,$id=0){ - echo" - - "; - flush(); -} -function progressSetText($text,$id=0){ - echo" - - "; - flush(); -} - -function redirect($url){ - echo" - - "; - flush(); -} -?> \ No newline at end of file diff --git a/class/PHPProgressBar.php b/class/PHPProgressBar.php new file mode 100644 index 0000000..68115c9 --- /dev/null +++ b/class/PHPProgressBar.php @@ -0,0 +1,91 @@ + + + "; + self::$progressInit = true; + } + $this->id = self::$progressNextId; + self::$progressNextId++; + echo" + +
+
+ +
+
+ "; + flush(); + } + public function setValue($value){ + echo" + + "; + flush(); + } + public function setText($text){ + echo" + + "; + flush(); + } + + public function redirect($url){ + echo" + + "; + flush(); + } +} +?> \ No newline at end of file diff --git a/img/progressbarcenter.jpg b/img/progressbarcenter.jpg new file mode 100644 index 0000000..f1dbc7d Binary files /dev/null and b/img/progressbarcenter.jpg differ diff --git a/img/progressbarleft.jpg b/img/progressbarleft.jpg new file mode 100644 index 0000000..fd389dc Binary files /dev/null and b/img/progressbarleft.jpg differ diff --git a/img/progressbarright.jpg b/img/progressbarright.jpg new file mode 100644 index 0000000..ab868d5 Binary files /dev/null and b/img/progressbarright.jpg differ diff --git a/img/progresscenter.jpg b/img/progresscenter.jpg new file mode 100644 index 0000000..85a18bb Binary files /dev/null and b/img/progresscenter.jpg differ diff --git a/img/progressleft.jpg b/img/progressleft.jpg new file mode 100644 index 0000000..52fdee2 Binary files /dev/null and b/img/progressleft.jpg differ diff --git a/img/progressright.jpg b/img/progressright.jpg new file mode 100644 index 0000000..52fdee2 Binary files /dev/null and b/img/progressright.jpg differ diff --git a/test/phpprogressbar.php b/test/phpprogressbar.php new file mode 100644 index 0000000..1c9a519 --- /dev/null +++ b/test/phpprogressbar.php @@ -0,0 +1,23 @@ +
"; +$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"
"; +$p1->redirect("http://google.com"); +?> \ No newline at end of file