<TR> <TD><B>Untrained Soldiers</B></TD> <TD align=right> <? numecho($user->uu) ?> </TD> </TR> <TR> <TD class=subh><B>Spies</B></TD> <TD class=subh align=right> <? numecho($user->spies) ?> </TD> </TR> <TR> <TD><B>Total Fighting Force</B></TD> <TD align=right> <? numecho(getTotalFightingForce($user)) ?> </TD> </TR> </TBODY> </TABLE> <P> <? $merc = getCommonInfo(); ?> <FORM action=mercs.php method=post> <TABLE class=table_lines cellSpacing=0 cellPadding=6 width="100%" border=0> <TBODY> <TR> <TH align=middle colSpan=4>Buy Portuguese Mercenaries</TH> </TR>
$b+= round(($income * $conf["race"][$users[$i]->race]["income"]) / 100); } //mysql_query("UPDATE UserDetails SET SA=$SA,DA=$DA,CA=$CA,RA=$RA WHERE active='1' AND ID='".$users[$i]->ID."'") or die(mysql_error()); if ($users[$i]->alliance > 0) { $allq = mysql_query("SELECT tax from alliances WHERE id={$users[$i]->alliance}") or die(mysql_error()); $alla = mysql_fetch_object($allq); $a = floor($b * ($alla->tax)); $b-= $a; mysql_query("UPDATE alliances a,UserDetails u SET a.gold=a.gold+FLOOR($b*a.tax) WHERE u.id={$users[$i]->ID} AND a.id={$users[$i]->alliance}") or die(mysql_error()); } $comBous = floor($b * 0.09); mysql_query("UPDATE UserDetails SET gold=gold+$comBous, commandergold=$comBous WHERE active='1' AND commander='" . $users[$i]->ID . "'") or die(mysql_error()); $OffBonus = floor($users[$i]->up * 0.03); mysql_query("UPDATE UserDetails SET officerup=officerup+$OffBonus WHERE active='1' AND ID='" . $users[$i]->commander . "'") or die(mysql_error()); $avgtbg+= $b / $c; //add to counter $avgarmy+= getTotalFightingForce($users[$i]) / $c; //Army size $avgup+= $users[$i]->up / $c; //UP echo "Did update for user: {$users[$i]->ID} <br> \n"; } $q = mysql_query("SELECT up,ID,officerup FROM UserDetails WHERE active=1") or die(mysql_query()); while ($r = mysql_fetch_object($q)) { if ($r->officerup >= floor($r->up * 0.03)) { mysql_query("UPDATE UserDetails SET uu=uu+FLOOR(up*0.03),officerup=FLOOR(up*0.03) WHERE ID={$r->ID}") or die(mysql_error()); } else { mysql_query("UPDATE UserDetails SET uu=uu+officerup WHERE ID={$r->ID}") or die(mysql_error()); } } mysql_free_result($q); $avgsql = "SELECT floor(sum(sa)/count(*)) as avgsa, floor(sum(da)/count(*)) as avgda, floor(sum(ca)/count(*)) as avgca, floor(sum(ra)/count(*)) as avgra FROM UserDetails where active=1"; $avq = mysql_query($avgsql) or die(mysql_error()); $avr = mysql_fetch_array($avq, MYSQL_ASSOC);
<TR> <TD><B>Trained Defense Mercenaries</B></TD> <TD align=right><? numecho($user->damercs) ?></TD></TR> <TR> <TD><B>Untrained Soldiers</B></TD> <TD align=right><? numecho($user->uu) ?></TD></TR> <TR> <TD class=subh><B>Spies</B></TD> <TD class=subh align=right><? numecho($user->spies) ?></TD></TR> <TR> <TD class=subh><B>Special Forces</B></TD> <TD class=subh align=right><? numecho($user->specialforces) ?></TD></TR> <TR> <TR> <TD><B>Total Fighting Force</B></TD> <TD align=right><? numecho(getTotalFightingForce($user)) ?></TD></TR> </TBODY> </TABLE><BR></TD> <TD rowspan="2" vAlign=top width="50%"> <FORM action=train.php method=post> <TABLE class=table_lines cellSpacing=0 cellPadding=6 width="100%" border=0> <TBODY> <TR> <TH align=middle colSpan=4>Train Your Troops</TH></TR> <TR> <TH class=subh align=left>Training Program</TH> <TH class=subh align=right>Cost Per Unit</TH> <TH class=subh>Quantity</TH><TH class=subh></TH></TR> <TR> <TD>Attack Specialist</TD>
echo $users[$i]->ID; ?> "><? echo $users[$i]->userName ?></A> <?php echo $tag; ?> </TD> <? if ($attacker->supporter > 0) { echo "<td><a href='attack.php?numspies=1&defender_id=" . ($users[$i]->ID) . "&mission_type=recon'>Spy</a> <a href='attack.php?defender_id2=" . ($users[$i]->ID) . "&attackbut=Balanced!'>Attack</a> </td>"; } ?> <TD align=right><? numecho(getTotalFightingForce($users[$i])); ?></TD> <TD align=left><?php echo $conf["race"][$users[$i]->race]["name"]; ?> </TD> <TD style="PADDING-RIGHT: 20px" align=right><? $rn = (rand(90, 110) / 100); $dC = $users[$i]->CA; $aC = $attacker->CA; if (($users[$i]->ID != $attacker->ID) AND (($dC * $rn) > $aC or !$_SESSION['isLogined'])) { echo "??????"; } else { numecho($users[$i]->gold); } // echo "<!--$rn $dC";print_r($users[$i]); echo " $aC-->";
$pCountF+= (($pCount > $pCountF) ? 1 : 0); if (!$cgi['page']) { $cgi['page'] = 1; } $officers = getOfficers($cgi['id'], $cgi['page']); for ($i = 0;$i < count($officers);$i++) { ?> <tr> <td><a href="stats.php?id=<?php echo $officers[$i]->userID; ?> "><?php echo $officers[$i]->userName; ?> </a></td> <td align="right"><? numecho(getTotalFightingForce($officers[$i])); ?></td> <td align="left"> <?php echo $conf["race"][$officers[$i]->race]["name"]; ?> </td> <td align="right"><? numecho($officers[$i]->rank); ?></td> </tr> <? } } else { ?> <TR> <TD align=middle colSpan=4>No Officers</TD> </TR> <?