prognose_kehl/progress/beispiel2.php
2023-01-30 08:01:11 +01:00

62 lines
2.0 KiB
PHP
Executable File

<? require("ProgressClass.php"); ?>
<html>
<head>
<title>ProgressClass v1.0 - Beispiel 2</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.normal { font-family: Arial, Helvetica, sans-serif; font-size: 12px}
.ueberschrift { font-family: Arial, Helvetica, sans-serif; font-size: 16px; font-weight: bold}
.unterueberschrift { font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; font-style: italic}
-->
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p class="ueberschrift">ProgressClass v1.0 - Beispiel 2</p>
<p class="unterueberschrift">Fortschrittsbalken mit Button, dynamischer Beschriftung und Farbe.<br>
(funktioniert nur ab IE 5.x oder Netscape 6.x)
</p>
<?
if ($break) {
echo '<p class="normal"><b><font color="red">Aktion abgebrochen.</font></b></p></body></html>';
exit();
}
function send($email) {
global $progress;
echo "Sende E-Mail an $email ... OK<br>";
$progress->setLabel("Sende E-Mail an $email ...");
}
$progress=new ProgressClass();
$progress->setButton('Abbrechen',""; echo $_SERVER['PHP_SELF'] . "?break=1");
$progress->setLabel('E-Mails vorbereiten ...');
$progress->make();
?>
<p class="normal">
<?
for ($i=1;$i<=100;$i++) {
usleep(100000);
if ($i==10) send('paulmueller@domain.de');
if ($i==20) send('lisa@springfield.de');
if ($i==30) send('donald@entenhausen.de');
if ($i==40) send('marketing@firma.de');
if ($i==50) send('dr.peter@arzt.de');
if ($i==60) send('schueler@schule.de');
if ($i==70) send('lehrer@schule.de');
if ($i==80) send('niemand@world.de');
if ($i==90) send('xxx@yyy.de');
$progress->setPercent($i);
$progress->setBarColor('#'.dechex(100-$i+156).dechex($i+80).'00');
}
$progress->setLabel('Fertig!');
sleep(1);
$progress->hide();
?>
</p>
<p class="normal">
Die Anzeige diente nur zur Demonstration. Es wurden nicht wirklich E-Mails versandt.
</body>
</html>