Location: PHPKode > projects > eCanteen > ecanteen/user/printcancelledpage.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/>.
?>
<?
	session_start();
if ($_SESSION['userlevel']>=3)
{
	
	
include("../include/constants.php");     mysql_free_result($res);

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Page</title> 
<? 
$objConnection1=mysql_connect(DB_SERVER, DB_USER, DB_PASS);
  mysql_select_db(DB_NAME);
list($Nowdate,$NowTime)=explode(" ",date("Y-m-d"));
$sqlstmt="SELECT transactions.`TransactionID`, transactions.`TransactionNumber`, transactions.`TargetDate`, transactions.`TransactionDescription`, transactions.`DepositAmount`, transactions.`PrintDate`, transactions.`DepositAmount`, break.`BreakID`, break.`Break`, minorcustomer.`FirstName`, minorcustomer.`LastName`, minorcustomer.`Class$`, class.`Class`, class.`~SiteID$` FROM class INNER JOIN ((transactions INNER JOIN break ON transactions.`BreakID` = break.`BreakID`) INNER JOIN MinorCustomer ON transactions.`MinorAccountID` = minorcustomer.`CustomerID`) ON class.`ClassID` = minorcustomer.`Class$` WHERE (((transactions.`TransactionNumber`)=0) AND ((transactions.`TargetDate`)='".$_GET["date"]."') AND ((transactions.`PrintDate`) Is Not Null) AND ((break.`BreakID`)=".$_GET["BreakID"].") AND ((class.`~SiteID$`)=".$_SESSION['SiteID']."));";
//echo $sqlstmt;
//response.Write sqlstmt

print "<br/>";
$SearchList=mysql_query($sqlstmt);

$SearchListnum=mysql_numrows($SearchList);


list($Orderdate,$OrderTime)=explode(" ",mysql_result($SearchList,0,"TargetDate"));
?>    
</head>
<body>

<h2>Cancelled <?echo mysql_result($SearchList,0,"Break") ;?> orders for <?echo $Orderdate; ?></h2>
<table style="width:500px" border="1">
<? 
$StName=-120;
$i=0;
while($i<$SearchListnum)
{
  //list($Orderdate,$OrderTime)=explode(" ",mysql_result($SearchList,$i,"TargetDate"));
  if ($StName!=mysql_result($SearchList,$i,"TransactionID"))
  {
		?>
        <tr>
		
				
        <td>
                <? 
    $TotalCost=0;
    print mysql_result($SearchList,$i,"Class")." : ";
    print mysql_result($SearchList,$i,"FirstName")." ";
    print mysql_result($SearchList,$i,"lastname")." ";
    print mysql_result($SearchList,$i,"TransactionID")." ";
    //print mysql_result($SearchList,$i,"Break")." order for ".$Orderdate;
    $StName=mysql_result($SearchList,$i,"TransactionID");
  } ?></td>
            
						
            <td >
                <?   echo mysql_result($SearchList,$i,"TransactionDescription");?></td>
            <td>
            </td>
            <td >
                <?   echo "$".mysql_result($SearchList,$i,"DepositAmount");?></td>
            
            
                </td>
            
        </tr>
        
        <?   $i++;
} ?>
    </table>

</body>
</html>
<?}?>
Return current item: eCanteen