Location: PHPKode > projects > eCanteen > ecanteen/Home.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/>.

include("include/constants.php");

mysql_free_result();
session_start();

$recid=$_SESSION['CustomerID'];
$siteid=$_SESSION['SiteID'];
mysql_connect(DB_SERVER, DB_USER, DB_PASS);
  mysql_select_db(DB_NAME);

$sqlstmt="SELECT `SiteID`, `Site`, `Site Number`, `WelcomeMessage`, `WebMasterContact`, `WebMasterEmail`, `AdminContact`, `AdminEmail`, `PostalAddress`, `Postcode`, `ChequeTo`, `CashPayment`, `PayPalDetails`, `Phone`, `Fax`,`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday` FROM siteid WHERE `SiteID`=".$_SESSION['SiteID'].";";

$objRecordset1=mysql_query($sqlstmt);

?>


<center>

<h1><? 

echo htmlspecialchars(mysql_result($objRecordset1,0,"WelcomeMessage"));?><br /></h1>

<table class="tbl" border="0" cellspacing="1" cellpadding="5" width="50%">
<tr>
<td class="hr"><? echo htmlspecialchars("SiteID")."&nbsp;" ?></td>
<td class="dr">

<input type="text" size="10"  readonly name="SiteID" value="<? echo mysql_result($objRecordset1,0,"SiteID") ;?>">

</td>
</tr>

<tr>
<td class="hr"><? echo htmlspecialchars("Site")."&nbsp;" ?></td>
<td class="dr"><?echo htmlspecialchars(mysql_result($objRecordset1,0,"Site")) ;?></td>
</tr>


<tr>
<td class="hr"><? echo htmlspecialchars("Site Number")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"Site Number")) ;?></td>
</tr>



<tr>
<td class="hr"><? echo htmlspecialchars("WebMasterContact")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"WebMasterContact"));?></td>
</tr>

<tr>
<td class="hr"><? echo htmlspecialchars("WebMasterEmail")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"WebMasterEmail"));?></td>
</tr>

<tr>
<td class="hr"><? echo htmlspecialchars("AdminContact")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"AdminContact")) ;?></td>
</tr>

<tr>
<td class="hr"><? echo htmlspecialchars("AdminEmail")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"AdminEmail")) ;?></td>
</tr>

<tr>
<td class="hr"><? echo htmlspecialchars("PostalAddress")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"PostalAddress")) ;?></td>
</tr>

<tr>
<td class="hr"><? echo htmlspecialchars("Postcode")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"Postcode")) ;?></td>
</tr>

<tr>
<td class="hr"><? echo htmlspecialchars("ChequeTo")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"ChequeTo")) ;?></td>
</tr>




<tr>
<td class="hr"><? echo htmlspecialchars("Phone")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"Phone")) ;?></td>
</tr>

<tr>
<td class="hr"><? echo htmlspecialchars("Fax")."&nbsp;" ?></td>
<td class="dr"><? echo htmlspecialchars(mysql_result($objRecordset1,0,"Fax")) ;?></td>
</tr>
</table>
<br/>
<table class="tbl" border="0" cellspacing="1" cellpadding="5" width="50%">


<tr></tr>
<tr>
<td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td>

</tr>
<tr>
<td>
<?

if (mysql_result($objRecordset1,0,"Sunday")==True)
{
print " Open  ";
}else{
print "Closed";
}
?>
</td><td>
<?

if (mysql_result($objRecordset1,0,"Monday")==True)
{
print " Open  ";
}else{
print "Closed";
}
?>
</td><td><?

if (mysql_result($objRecordset1,0,"Tuesday")==True)
{
print " Open  ";
}else{
print "Closed";
}
?></td><td>
<?
if (mysql_result($objRecordset1,0,"Wednesday")==True)
{
print " Open  ";
}else{
print "Closed";
}
?>
</td><td>
<?
if (mysql_result($objRecordset1,0,"Thursday")==True)
{
print " Open  ";
}else{
print "Closed";
}
?>
</td><td><?
if (mysql_result($objRecordset1,0,"Friday")==True)
{
print " Open  ";
}else{
print "Closed";
}
?>

</td>
<td><?
if (mysql_result($objRecordset1,0,"Saturday")==True)
{
print " Open  ";
}else{
print "Closed";
}
?>

</td>
</tr>



</table>



</center>
Return current item: eCanteen