Location: PHPKode > projects > MyOWNSpace > MyOWNspace_v8.2/www/myownstretchware/index.php
<?php
$stretchware=array("1" => array 
("titre"=>"Adios (ShutDown)", 
"image"=>"Adios.jpg"), 
"2" => array 
("titre"=>"Before-Walking", 
"image"=>"Before_Walking.jpg"), 
"3" => array 
("titre"=>"Good Morning(StartUP)", 
"image"=>"Good_Morning.jpg"), 
"4" => array 
("titre"=>"Graphic Artist", 
"image"=>"Graphic_Artist.jpg"), 
"5" => array 
("titre"=>"Hand, Arm, Shoulder & Neck", 
"image"=>"Hand,Arm,Shoulder&Neck.jpg"), 
"6" => array 
("titre"=>"Hand, Wrist & Forearm", 
"image"=>"Hand,Wrist&Forearm.jpg"), 
"7" => array 
("titre"=>"Keyboard Operator", 
"image"=>"Keyboard_Operator.jpg"), 
"8" => array 
("titre"=>"Lower Back", 
"image"=>"Lower_Back.jpg"), 
"9" => array 
("titre"=>"Neck & Shoulder Stiffness", 
"image"=>"Neck&Shoulder_Stiffness.jpg"), 
"10" => array 
("titre"=>"Online", 
"image"=>"Online.jpg"), 
"11" => array 
("titre"=>"On The Phone", 
"image"=>"On-The-Phone.jpg"), 
"12" => array 
("titre"=>"Spontaneous", 
"image"=>"Spontaneous.jpg"), 
"13" => array 
("titre"=>"Standing", 
"image"=>"Standing.jpg"),
"14" => array 
("titre"=>"Stressed Out", 
"image"=>"StressedOut.jpg"));
/* MAKE A MENU
*/
$n=0;
$select=$_GET['stretch'];
$dropmenu = "<p><FORM name=\"otherpages\" action=\"index.php\" method=\"GET\">\n";
$dropmenu .= "<select name=\"stretch\" size=\"1\" class=\"user\" onChange=\"document.otherpages.submit()\">\n";

for($i=1;$i<=count($stretchware);$i++)
{

$dropmenu .= "<option value=".$i;
if($select==$i) $dropmenu.=" selected";
$dropmenu .=">".$stretchware[$i]['titre']."</option>";

}
$dropmenu .= "</select>&nbsp;\n"."</FORM>";
if($_GET['stretch']!=""){
$n=$_GET['stretch'];
$titre=$stretchware[$n]['titre'];
$image=$stretchware[$n]['image'];
$max=count($stretchware)-2;
$logo="stretchwarelogo.gif";
$offset = $_COOKIE["MyOwnStretchWare"];
$load="setpause()";
}
else if((isset($_GET['offset']))&&($_GET['offset']!="")){
$offset=$_GET['offset'];
$logo="StretchWare.gif";
$duree = 31536000; // 1 an en secondes !
setcookie("MyOwnStretchWare"); 
setcookie("MyOwnStretchWare",$offset,time()+$duree);
$load="settimes()"; 
} else  if(($_GET['offset']=="")||(!isset($_GET['offset']))){
$logo="StretchWare.gif";}
else if((isset($_GET['stretch']))&&($_GET['stretch']!="")){
$logo="stretchwarelogo.gif";
$offset = $_COOKIE["MyOwnStretchWare"];
$load="settimes()"; 
}
switch ($n) {
case 0:
   $navmenu='<FORM name="previous" method="GET"><input disabled type="submit" name="stretch" value="'.($n-1).'">';
   $navmenu.='<input type="submit" name="stretch" value="'.($n+1).'"></form>';
   break;
case 1:
   $navmenu='<FORM name="previous" method="GET"><input disabled type="submit" name="stretch" value="'.($n-1).'">';
   $navmenu.='<input type="submit" name="stretch" value="'.($n+1).'"></form>';
   break;
case $max:
   $navmenu='<FORM name="previous" method="GET"><input type="submit" name="stretch" value="'.($n-1).'">';
   $navmenu.='<input disabled type="submit" name="stretch" value="'.($n+1).'"></form>';
   break;
default:
   $dropmenu.='<FORM name="previous" method="GET"><input type="submit" name="stretch" value="'.($n-1).'">';
   $dropmenu.='<input type="submit" name="stretch" value="'.($n+1).'"></form>';
   break;
}

$navmenu.='<form><input onClick="location.href=\'index.php?offset='.$offset.'\'" type="button" value="START"></FORM>';
$dropmenu.="</p>";

$page='<center><div style="position:relative;margin-left: auto;margin-right: auto;width:250px;text-align:center;top:100px;" id="time">
<form name="PAGEFORM" action="index.php" method="GET">
<div style="width:250px;position:relative" ><B style="background:white;font-size:15px;font-family:verdana"> 
Remind me to stretch every:<br>
<select name="offset" style="font-size:15px;" onChange="document.PAGEFORM.submit()">
<option value="60" ';
if($_GET['offset']==60) $page.=' selected';
$page.='>1 Minute</option>
<option value="300"';
if($_GET['offset']==300) $page.=' selected';
$page.='>5 Minutes</option>
<option value="600"';
if($_GET['offset']==600) $page.=' selected';
$page.='>10 Minutes</option>
<option value="900"';
if($_GET['offset']==900) $page.=' selected';
$page.='>15 Minutes</option>
<option value="1200"';
if($_GET['offset']==1200) $page.=' selected';
$page.='>20 Minutes </option>
<option value="1800"';
if($_GET['offset']==1800) $page.=' selected';
$page.='>30 Minutes</option>
<option value="3600"';
if($_GET['offset']==3600) $page.=' selected';
$page.='>1 Hour</option>
<option value="5400"';
if($_GET['offset']==5400) $page.=' selected';
$page.='>90 Minutes</option>
<option value="7200"';
if($_GET['offset']==7200) $page.=' selected';
$page.='>2 Hours</option>
<option value="10800"';
if($_GET['offset']==10800) $page.=' selected';
$page.='>3 Hours</option>';
$page.='</select></B>
</div>
<div id="widget1Here" style="top:15px;width:250px;position:relative"></div>
</div></FORM></center>';

?>

<html>
<head>
<title>MyOwnStretchWare</title>

<style>
.bgBar1 {
background: #0066FF;
#border: 1px solid #99CCFF;
color: #ffffff;
font-weight : bold;
font-style : italic;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
}
.bgBar2 {
background: #0066FF;
#border: 1px solid #99CCFF;
color: #ffffff;
font-weight : bold;
font-style : italic;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
}
.bars {
width:350px;
text-align:center;
position:relative;
#display:inline;
padding:3px;
}
</style>

<script language="javascript" src="../classes/percent_bar.js">
</script>
<script language="javascript" src="../classes/soundmanager.js">
</script>
<script language="Javascript"> 
/**
 * ProgressBar.html - DHTML Progress Bar Widget demo
 *
 * @version 19 Apr 2005
 * @author  Joseph Oster, wingo.com
 */

var startTime;
var finishTime = null;
var timerID;

var totPct1 ;

var fetchInterval = 0.01;
var pctIncr  = 0.05;

var pb1;

function setProgress() {

  pb1.setPercent(totPct1);

  if (totPct1 < 1.0) timerID = setTimeout("setProgress()", fetchInterval);
  else if (finishTime == null) {
    finishTime = new Date();
    }
  }

var timerID = null
var timerRunning = false

/*      
	Script By Lefteris Haritou
        http://www.geocities.com/~lef
        Please Keep The Credit Above
        No Copyrights but be fair
*/

function display()
{
rtime=(parseFloat(document.PAGEFORM.offset.value)-(etime-ctime))*(100/parseFloat(document.PAGEFORM.offset.value));
//window.document.write("status:" + rtime  + " %")
	
totPct1 = rtime * .01;
startTime = new Date();
finishTime = null;
setProgress();
window.setTimeout("checktime()",1000)
timerRunning = true
}

function settimes()
{

  pb1 = new jt_ProgressBar(document.getElementById("widget1Here"), 250, 10, "bgBar1");
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	etime=hours*3600+mins*60+secs;
	etime+=<? if (isset( $_GET['offset'])) echo $_GET['offset']; else echo '1200';?>
	
	
	/*
	You can change the value of 1200 according to how much
	time you wish to set the timer. Where 1200 is time in secs (1200 = 20
	mins * 60 secs/min). Max time is 60 mins (3600secs)
	*/
	
	checktime();
}

function checktime()
{
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	ctime=hours*3600+mins*60+secs
	if(ctime>=etime) expired();
	else display();

}

function expired()
{
//soundManager.play('bell');

alert("It's time for a Break!")
var page=Math.floor(Math.random(13)*10)+1;
page='?stretch=' + page ;
location.href = page;
}

function setpause()
{
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	etime=hours*3600+mins*60+secs;
	etime+=200;
	
	
	/*
	You can change the value of 1200 according to how much
	time you wish to set the timer. Where 1200 is time in secs (1200 = 20
	mins * 60 secs/min). Max time is 60 mins (3600secs)
	*/
	
	checkpause();
}

function checkpause()
{
	var time= new Date();
	hours= time.getHours();
	mins= time.getMinutes();
	secs= time.getSeconds();
	ctime=hours*3600+mins*60+secs
	if(ctime>=etime) pauseexpired();
else window.setTimeout("checkpause()",1000)

}

function pauseexpired()
{

var page=Math.floor(Math.random(13)*10);
page='index.php?offset=' + document.cookie;
location.href = page;
}

//-->
</script>

</script>
</head>
<body onload="<?echo $load; ?>" style="background:url(background.jpg)">
<div id="container">
 <!-- this is the flash sound container element. -->
</div>
<div id=logo" style="z-index: 2;vertical-align:text-top;display:inline;position:absolute;left:0px;top:0px;text-align:left;font-size:20px;font-family:Verdana;font-style:italic;font-color:cyan;font-weight:bold;">
<span><DIV style="position:absolute;left:0;"><img src="<? echo $logo; ?>"></DIV>
<DIV style="position:absolute; left:40px;width:500;vertical-align:text-top;line-height:90%;">MyOwnStretchWare<br><small style="font-size:11px;">Reverse Engineering for Public Health</small></DIV></div>

<div style="background:url(background.jpg);width:90%;height:350px;top:35px;vertical-align:middle;position:relative;text-align:center">
<div id="image" style="margin-left: auto;margin-right: auto;width:auto;height:380px;text-align:center">
<? if($n>0) echo '<b>'.$titre.'</b><br><img src="'.$image.'">'; 
else echo $page;
?>
</div>
<div id="menu" style="display:inline;padding:2px 2px 2px 2px;">
<? echo $dropmenu.$navmenu; ?>
</div>

</div>
</body>

</html>
Return current item: MyOWNSpace