PageRenderTime 74ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/modules/base.php

https://github.com/advocaite/Stargate-Wars
PHP | 134 lines | 130 code | 4 blank | 0 comment | 10 complexity | 0529d4efa33ae8562530e18d698e3db5 MD5 | raw file
  1. <?
  2. include_once("../config.php");
  3. $pagegen = new page_gen();
  4. $pagegen->round_to = 4;
  5. $pagegen->start();
  6. $s = new Game();
  7. if (!$s->loggedIn || !$_GET['time']){ header("Location: https://realmbattles.org/SGWnew/index.php?"); }
  8. $s->updatePower($_SESSION['userid']);
  9. $base = $s->baseVars();
  10. if ($base->allyid != 0 ){
  11. $allyinfo = $s->getallyinfo($base->allyid);}
  12. $newsQ = mysql_query("SELECT * FROM news ORDER BY id DESC") or die(mysql_error());
  13. ?>
  14. <table align="center" border="0" cellpadding="10" cellspacing="0" width="90%">
  15. <?
  16. while ($news = mysql_fetch_array($newsQ)) {
  17. $datenews = date('jS M y, G:i', ($news[news_time]+3600*$logged[cas_modif]));
  18. echo "<tr>
  19. <td class=\"news1\"><font color\"yellow\">".$news[news_naslov]." </font>(posted by <font color\"yellow\">".$news[user_name]."</font> at ".$datenews.")</td>
  20. </tr>
  21. <tr>
  22. <td class=\"news2\">".$news[news_text]."</td>
  23. </tr>
  24. <tr><td></td></tr>";
  25. }
  26. echo "</table>";?>
  27. <table width="100%" border="0">
  28. <tr>
  29. <td width="58%" align="center" valign="top"><table width="100%" border="0">
  30. <tr>
  31. <td width="39%" align="left" valign="top" bordercolor="#000000">Name [ID]</td>
  32. <td width="61%" align="left" valign="top" bordercolor="#000000"><?= $base->uname." [ ".$_SESSION['userid']." ]"; ?></td>
  33. </tr>
  34. <tr>
  35. <td align="left" valign="top" bordercolor="#000000">E-mail <?= $_SESSION['userid']; ?></td>
  36. <td align="left" valign="top" bordercolor="#000000"><?= $base->email; ?></td>
  37. </tr>
  38. <tr>
  39. <td align="left" valign="top" bordercolor="#000000">Race</td>
  40. <td align="left" valign="top" bordercolor="#000000"><?= $base->r_name; ?></td>
  41. </tr>
  42. <tr>
  43. <td align="left" valign="top" bordercolor="#000000">Commander</td>
  44. <td align="left" valign="top" bordercolor="#000000"><a href="javascript:void(0)" onclick="sendData('user','get','<?= $base->cid; ?>'); return false"><?= $base->cname; ?></a></td>
  45. </tr>
  46. <tr>
  47. <td align="left" valign="top" bordercolor="#000000">HomePlanet Name </td>
  48. <td align="left" valign="top" bordercolor="#000000"><?= $base->plnt_name; ?></td>
  49. </tr>
  50. <tr>
  51. <td align="left" valign="top" bordercolor="#000000">HomePlanet Size </td>
  52. <td align="left" valign="top" bordercolor="#000000"><?= $base->text; ?></td>
  53. </tr>
  54. <tr>
  55. <td align="left" valign="top" bordercolor="#000000">Total Planets Owned </td>
  56. <td align="left" valign="top" bordercolor="#000000"><?= number_format($base->ttlPlanetsOwned); ?></td>
  57. </tr>
  58. <tr>
  59. <td align="left" valign="top" bordercolor="#000000">Unit Production </td>
  60. <td align="left" valign="top" bordercolor="#000000"><?= number_format($base->up); ?> a Turn</td>
  61. </tr>
  62. <tr>
  63. <td align="left" valign="top" bordercolor="#000000">Turn Income Production </td>
  64. <td align="left" valign="top" bordercolor="#000000"><?= number_format($base->income); ?> Naquadah</td>
  65. </tr>
  66. <tr>
  67. <td colspan="2" align="left" valign="top">Defense and Covert Alert Level *TBC</td>
  68. </tr>
  69. </table><br /><table width="100%" border="0">
  70. <?Debug::printMsg(__CLASS__, __FUNCTION__, "Start of alliance info");?>
  71. <tr>
  72. <td colspan="3" align="left">Alliance Management *TBC </td>
  73. </tr>
  74. <tr>
  75. <td colspan="3" align="left">List of Alliances </td>
  76. </tr>
  77. <tr>
  78. <td width="12%" align="left">Alliance: </td>
  79. <td width="38%" align="left"><?if ($base->allyid == 0 ){echo "None</td>";} else { ?><a href="javascript:void(0)" onclick="sendData('ally_mlist','get','<?= $base->allyid; ?>'); return false"><?= $allyinfo->allyname ?></a></td><?}?>
  80. <?if ($base->allyid == 0 ){?><td width="50%" align="left"><a href="javascript:void(0)" onclick="sendData('c_ally','get','<?= $base->uid; ?>'); return false;">Creat Alliance </a></td><?}else{?>
  81. <td width="50%" align="left"><input type="submit" name='allyenter' value='Enter Alliance' onclick="this.value='What ever...'; this.disabled=true; sendData('ally_mlist','get','<?=$base->allyid; ?>');" /></td><?}?>
  82. </tr>
  83. </table><br /><table width="100%" border="0">
  84. <tr>
  85. <td colspan="5" align="left">Office Management</td>
  86. </tr>
  87. <tr>
  88. <td colspan="2" align="left">Accept New Officers?: </td>
  89. <td colspan="1.5" align="left">&nbsp;</td>
  90. <td colspan="1.5" align="left">&nbsp;</td>
  91. </tr>
  92. <tr><td align="left">Name</td>
  93. <td align="left">Army Size</td>
  94. <td align="left">Mercenaries</td>
  95. <td align="left">Race</td>
  96. <td align="left">Rank</td>
  97. </tr>
  98. <?
  99. $offi = $s->getOfficers($_SESSION['userid']);
  100. for($x=0; $x<count($offi); $x++)
  101. {
  102. echo "<tr><td><a href=\"javascript:void(0)\" onclick=\"sendData('user','get','".$offi[$x]["uid"]."'); return false\">".$offi[$x]["name"]."</a>
  103. </td><td>".number_format($offi[$x]["size"])."</td><td>".number_format($offi[$x]["mercs"])."</td><td>"
  104. .$offi[$x]["race"]."</td><td>".$offi[$x]["rank"]."</td></tr>";
  105. }
  106. echo "<tr> <td colspan='5'>Number of Officers: ".count($offi)."</td> </tr>"
  107. ?>
  108. </table></td>
  109. <td width="42%" align="center" valign="top"><? include_once('mil_rank.php'); ?><br />
  110. <? include_once('./personnel.php'); ?></td>
  111. </tr>
  112. <tr>
  113. <td colspan="2" align="center" valign="middle"><table width="58%" border="0">
  114. <tr>
  115. <td align="center" valign="top">Recruitment</td>
  116. </tr>
  117. <tr>
  118. <td align="center" valign="top">Post this link around get more players and more army for your self spread the word a ragging war is going on here</td>
  119. </tr>
  120. <tr>
  121. <td align="center" valign="top"><a href="javascript:void(0)" onclick="sendData('recruit','get','<?= $base->link; ?>'); return false">http://localhost/recruit.php?link=<?= $base->link; ?></a></td> </td>
  122. </tr>
  123. </table></td>
  124. </tr>
  125. </table>
  126. <?
  127. $pagegen->stop();
  128. echo "Query Count: ".$s->queryCount."<br>";
  129. print('page generation time: ' . $pagegen->gen());
  130. ?>