getenddatestate.php

<? include 'xmlheader.php'?>
<?
echo "<?xml version=\"1.0\" ?>";?>
<root>
<?php     
    
include 'include.php';

    
openDatabase();

    
$gameid getGameId();

    
$sGetStateQuery "SELECT temporaryattraction, permanentattraction, attractionsuccesses, attractionrerolls, attractionfailures FROM game WHERE gameid = ".$gameid;

    
$rowGame queryDatabaseForSingleRow($sGetStateQuery);

    
outputRowAsXml($rowGame);

    
$sCompatibilityCountQuery "SELECT COUNT(1) AS compatibilitycount FROM compatibility WHERE gameid = ".$gameid;

    
$rowCount queryDatabaseForSingleRow($sCompatibilityCountQuery);

    
outputRowAsXml($rowCount);

    
//TODO: Um. Temporary.
    
$status 0;

    
$otheruserid getOtherUserId();

    if (
$_SESSION['userid']< $otheruserid)
    {
         
$status = !$status;    
    }

    
$statusOutput $status "active" "passive";

    echo 
"<status>".$statusOutput."</status>";

    
closeDatabase();
?>
</root>