Location: PHPKode > projects > eCanteen > ecanteen/setvars.php
<?//Copyright David Byrne 2007

//This file is part of eCanteen.

//    eCanteen is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.

//    eCanteen is distributed in the hope that it will be useful
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.

//    You should have received a copy of the GNU General Public License
//    along with eCanteen.  If not, see <http://www.gnu.org/licenses/>.?>

<?php
	include("include/constants.php");     mysql_free_result($res);
	session_start();
$conn=mysql_connect(DB_SERVER, DB_USER, DB_PASS);
  mysql_select_db(DB_NAME);
$sql="SELECT `SiteID`, `Site`, `Site Number`, `WelcomeMessage`,`WebMasterContact`, `WebMasterEmail`, `AdminContact`, `AdminEmail`, `Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday` FROM `siteid` WHERE (((`SiteID`)=".$_SESSION['SiteID']."));";
$rs=mysql_query($sql);
$value=mysql_result($rs,0,"WelcomeMessage");  
$resultx=setcookie("WelcomeMessage",$value,0,"","",0);
$value=mysql_result($rs,0,"WebMasterContact");
setcookie('WebMasterContact',$value,0,"","",0);
$value=mysql_result($rs,0,"WebMasterEmail");
setcookie('WebMasterEmail',$value,0,"","",0);
$value=mysql_result($rs,0,"Site");
setcookie("Site",$value,0,"","",0);
$value=mysql_result($rs,0,"AdminEmail");
setcookie("AdminEmail",$value,0,"","",0);
$value=mysql_result($rs,0,"AdminContact");
setcookie("AdminContact",$value,0,"","",0);
$nondaysString="";	
if (mysql_result($rs,0,"Sunday")!=True)
{
 $nondaysString=$nondaysString."1,";	
}
if (mysql_result($rs,0,"Monday")!=True)
{
 $nondaysString=$nondaysString."2,";	
}
if (mysql_result($rs,0,"Tuesday")!=True)
{
 $nondaysString=$nondaysString."3,";	
}
if (mysql_result($rs,0,"Wednesday")!=True)
{
 $nondaysString=$nondaysString."4,";	
}
if (mysql_result($rs,0,"Thursday")!=True)
{
 $nondaysString=$nondaysString."5,";	
}
if (mysql_result($rs,0,"Friday")!=True)
{
 $nondaysString=$nondaysString."6,";	
}
if (mysql_result($rs,0,"Saturday")!=True)
{
 $nondaysString=$nondaysString."7,";	
}

$nondaysString=substr($nondaysString, 0, strlen($nondaysString)-1); 

setcookie("nondaysString",$nondaysString,0,"","",0);


//print "<br/>";
//print_r($_COOKIE);
mysql_close($conn);
$rs=null;
$con=null;
?>
<html>
<body>
</body>
</html>
Return current item: eCanteen