I'm getting something odd, on the 1st Good Thru column of our (=AoA= gaming clan) financial report page, on the first 3 rows, the year is blank, and no matter what I change, such as taking out the top 3 entries, they always are blank.
http://www.aoateam.com/modules.php?name=Donations
<?
include("header.php");
include "aoadbconfig.php";
db();
$formdata_res=mysql_query("SELECT * FROM nuke_donations WHERE approved='y' order by id");
while ($formdata=mysql_fetch_object($formdata_res)) {
$membername=htmlentities($formdata->membername);
$amountsent=htmlentities($formdata->amountsent);
$amountsentgaming=htmlentities($formdata->amountsentgaming);
$amountsentweb=htmlentities($formdata->amountsentweb);
$exp_yr=$formdata->yearsubmitted;
$exp_month=$formdata->monthsubmitted;
$gamingexpdate = $amountsentgaming / 8;
$webexpdate = $amountsentweb / 12;
$today = getdate();
$thismonth = $today['mon'];
$thisyear = $today['year'];
$expmonthe = $exp_month + $gamingexpdate - 1;
$expmonth = floor($expmonthe);
if($expmonth > 12)
{
$howmanyyears = $expmonth / 12;
$howmanyyear = floor($howmanyyears);
$howmanyyea = $howmanyyear * 12;
$absval = abs($howmanyyears);
if($howmanyyears==$absval){
$howmanyyea = $howmanyyea - 1;
$howmanyyear = $howmanyyear - 1;
}
$expmonth = $expmonth - $howmanyyea;
$expyr = $exp_yr + $howmanyyear;
}
$monthmark = $thismonth - $exp_month;
if($monthmark > 0)
{
$extractmoneymonth = $thismonth - $exp_month;
$extractmoneymon = $extractmoneymonth * 8;
$amountsentgaming = $amountsentgaming - $extramoneymon;
}
if($monthmark < 0)
{
$extramonmonth = abs($monthmark);
$extramonmont = $exp_yr - $extramoneymonth;
$extramonmon = $extramonmont * 8;
$amountsentgaming = $amountsentgaming - $extramonmon;
}
$yearmark = $thisyear - $exp_yr;
if($yearmark > 0){
$extractmoneyyear = $yearmark * 96;
$amountsentgaming = $amountsentgaming - $extractmoneyyear;
$amountsentweb = $amountsentweb - ($yearmark * 12);
}
$webexpyr = $exp_yr+$webexpdate;
$webexp = floor($webexpyr);
$amountsentadded = "SELECT SUM(amountsent)
FROM nuke_donations WHERE approved='y'";
$result = mysql_query($amountsentadded) or die (mysql_error() );
$row = mysql_fetch_array($result);
$gamingamountsentadded = "SELECT SUM(amountsentgaming)
FROM nuke_donations WHERE approved='y'";
$result2 = mysql_query($gamingamountsentadded) or die (mysql_error() );
$row2 = mysql_fetch_array($result2);
$webamountsentadded = "SELECT SUM(amountsentweb)
FROM nuke_donations WHERE approved='y'";
$result3 = mysql_query($webamountsentadded) or die (mysql_error() );
$row3 = mysql_fetch_array($result3);
$pagecontent.="<tr><td>{$membername}</td><td>$ {$amountsent}</td><td>$ {$amountsentgaming}</td><td>{$expmonth} - {$expyr}</td><td>$ {$amountsentweb}</td><td>January {$webexp}</td></tr>";
}
db_close();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<?
if (!eregi("modules.php", $PHP_SELF))
{ die ("You can't access this rows directly..."); }
$index = 1;
require_once("mainfile.php");
$module_name = basename(dirname(__FILE__));
get_lang($module_name);
?>
<center>Americas Online Army Financial Report 03 - 04</center><br>
<center>JULY INVOICE<br></center><br><center><?php
echo date ("l - F dS, Y - h:i:s A");
?></center><br>
<TABLE border=1 cellspacing="0" cellpadding="0"><tr bgcolor="#BB0000"><td><b>Member Name</b></td><td><b>Amount<BR>Sent</b></td><td><b>Gaming<br>Servers</b></td><td><b>Good<br>Thru:</b></td><td><b>Web<br>Servers</b></td><td><b>Good<br>Thru:</b></td></tr>
<?=$pagecontent;?>
</TABLE>
<br>
<TABLE border="1" cellpadding="1" cellspacing="1"><tr bgcolor="#BB0000"><td><center><b>Amount Sent<br>Total</b></center></td><td><center><b>Gaming Server<br>Total</center></b></td><td><center><b>Web Server<br>Total</b></center></td></tr>
<?
echo "<tr><td>$ ";
echo $row[0];
echo "</td><td>$ ";
echo $row2[0];
echo "</td><td>$ ";
echo $row3[0];
echo "</td></tr>";
echo "</TABLE>";
?>
<br><br><br>
<center><br><br></center><center><small>Powered By : <a href=http://www.aoateam.com>=AoA= Web Development Team</a><br>
</center></small>
<?
include("footer.php");
?>
</body>
</html>