PageRenderTime 50ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/production.php

https://bitbucket.org/ogsteam/mod-production
PHP | 536 lines | 483 code | 24 blank | 29 comment | 130 complexity | f128b046b19994626018dafc542bf28f MD5 | raw file
  1. <?php
  2. /***************************************************************************
  3. * filename : production.php
  4. * package : Mod Production
  5. * version : 1.4a
  6. * desc. : Calcul de la production miničre
  7. * Authors : Kal Nightmare & Scaler - http://ogsteam.fr
  8. * created : 10:30 08/11/2007
  9. * modified : 10:34 05/09/2009
  10. ***************************************************************************/
  11. error_reporting(E_ALL);
  12. if (!defined('IN_SPYOGAME')) die("Hacking attempt");
  13. require_once("views/page_header.php");
  14. $start = 101;
  15. $nb_planet = $start + find_nb_planete_user() - 1;
  16. $filename = "mod/production/version.txt";
  17. if (file_exists($filename)) $file = file($filename);
  18. $mod_version = trim($file[1]);
  19. $forum_link = "http://ogsteam.fr/";
  20. $creator_name = "<a href=mailto:jojolam44@hotmail.com>Jojo.lam44</a> &copy; 2006<br />";
  21. $modifier_name1 = "<a href=mailto:kalnightmare@free.fr>Kal Nightmare</a> &copy;2006";
  22. $modifier_name2 = "<a href=mailto:gon.freecks@gmail.com>Scaler</a> &copy; 2007";
  23. $modifier_name3 = "<a>Shad</a> &copy; 2011";
  24. $updator_name = "<a>Pitch314</a> &copy; 2013";
  25. // Récupération des chaines de langue
  26. require_once("mod/production/lang/lang_fr.php");
  27. //if (file_exists("mod/production/lang/lang_".$server_config['language'].".php")) require_once("mod/production/lang/lang_".$server_config['language'].".php");
  28. //if (file_exists("mod/production/lang/lang_".$user_data['user_language'].".php")) require("mod/production/lang/lang_".$user_data['user_language'].".php");
  29. // Enregistrement des données
  30. for ($i=$start;$i<=$nb_planet;$i++) {
  31. if (isset($_POST['planete'.$i])) {
  32. if ($_POST['planete'.$i] == 1) {
  33. if (isset($_POST['SS'.$i]) && isset($_POST['M'.$i]) && isset($_POST['C'.$i]) && isset($_POST['D'.$i]) && isset($_POST['SoP'.$i]) && isset($_POST['FR'.$i])) {
  34. if (is_numeric($_POST['SS'.$i]) && is_numeric($_POST['M'.$i]) && is_numeric($_POST['C'.$i]) && is_numeric($_POST['D'.$i]) && is_numeric($_POST['SoP'.$i]) && is_numeric($_POST['FR'.$i])) {
  35. $request = "update ".TABLE_USER_BUILDING." set Sat = ".$_POST['SS'.$i];
  36. $request .= ", M = ".$_POST['M'.$i].", C = ".$_POST['C'.$i].", D = ".$_POST['D'.$i];
  37. $request .= ", CES = ".$_POST['SoP'.$i].", CEF = ".$_POST['FR'.$i];
  38. $request .= " where user_id = ".$user_data["user_id"]." and planet_id = ".$i;
  39. $db->sql_query($request);
  40. }
  41. }
  42. if (isset($_POST['rap_SS'.$i]) && isset($_POST['rap_M'.$i]) && isset($_POST['rap_C'.$i]) && isset($_POST['rap_D'.$i]) && isset($_POST['rap_SoP'.$i]) && isset($_POST['rap_FR'.$i])) {
  43. if (is_numeric($_POST['rap_SS'.$i]) && is_numeric($_POST['rap_M'.$i]) && is_numeric($_POST['rap_C'.$i]) && is_numeric($_POST['rap_D'.$i]) && is_numeric($_POST['rap_SoP'.$i]) && is_numeric($_POST['rap_FR'.$i])) {
  44. $request = "update ".TABLE_USER_BUILDING." set Sat_percentage = ".$_POST['rap_SS'.$i];
  45. $request .= ", M_percentage = ".$_POST['rap_M'.$i].", C_percentage = ".$_POST['rap_C'.$i].", D_percentage = ".$_POST['rap_D'.$i];
  46. $request .= ", CES_percentage = ".$_POST['rap_SoP'.$i].", CEF_percentage = ".$_POST['rap_FR'.$i];
  47. $request .= " where user_id = ".$user_data["user_id"]." and planet_id = ".$i;
  48. $db->sql_query($request);
  49. }
  50. }
  51. }
  52. }
  53. }
  54. // Récupération des informations sur l'énergie et les officiers
  55. if (isset($_POST['techno_energie'])) {
  56. if (is_numeric($_POST['techno_energie'])) {
  57. $request = "update ".TABLE_USER_TECHNOLOGY." set NRJ = ".$_POST['techno_energie']." where user_id = ".$user_data["user_id"];
  58. $db->sql_query($request);
  59. }
  60. if (isset($_POST['techno_plasma'])) {
  61. if (is_numeric($_POST['techno_plasma'])) {
  62. $request = "update ".TABLE_USER_TECHNOLOGY." set Plasma = ".$_POST['techno_plasma']." where user_id = ".$user_data["user_id"];
  63. $db->sql_query($request);
  64. }
  65. }
  66. $ingenieur = $geologue = '0';
  67. if (isset($_POST['ingenieur']) && $_POST['ingenieur'] == 'on') $ingenieur = '1';
  68. if (isset($_POST['geologue']) && $_POST['geologue'] == 'on') $geologue = '1';
  69. $request = "update ".TABLE_USER." set off_ingenieur = '".$ingenieur."'";
  70. $request .= ", off_geologue = '".$geologue."'";
  71. $request .= " where user_id = ".$user_data["user_id"];
  72. $db->sql_query($request);
  73. }
  74. // Récupération des informations sur les mines
  75. $planet = array("planet_id" => "", "M_percentage" => 0, "C_percentage" => 0, "D_percentage" => 0, "CES_percentage" => 100, "CEF_percentage" => 100, "Sat_percentage" => 100, "fields" => 163);
  76. $quet = mysql_query("SELECT planet_id, M_percentage, C_percentage, D_percentage, CES_percentage, CEF_percentage, Sat_percentage, fields FROM ".TABLE_USER_BUILDING." WHERE user_id = ".$user_data["user_id"]." AND planet_id < 199 ORDER BY planet_id");
  77. $user_building = array_fill($start, $nb_planet, $planet);
  78. while ($row = mysql_fetch_assoc($quet)) {
  79. $arr = $row;
  80. unset($arr["planet_id"]);
  81. $user_percentage[$row["planet_id"]] = $arr;
  82. }
  83. // Récupération des informations sur l'énergie et les officiers
  84. $user_empire = user_get_empire();
  85. $user_building = $user_empire["building"];
  86. $bati = array('','M','C','D','SoP','FR','SS');
  87. // Récupération des informations sur les technologies
  88. if ($user_empire["technology"]) $user_technology = $user_empire["technology"];
  89. else $user_technology = '0';
  90. // Récupération des informations sur les officiers
  91. $query = mysql_fetch_assoc(mysql_query("SELECT `off_ingenieur`, `off_geologue` FROM ".TABLE_USER." WHERE `user_id` = ".$user_data["user_id"]));
  92. $ingenieur = $query["off_ingenieur"];
  93. $geologue = $query["off_geologue"];
  94. //Récupération des informatitions sur la techno plasma
  95. $techno_plasma = $user_technology['Plasma'];
  96. // Réparation des informations sur la vitesse univers
  97. //$query = mysql_fetch_assoc(mysql_query("SELECT `config_value` FROM ".TABLE_CONFIG." WHERE config_name = 'speed_uni'"));
  98. // pour les version d'OGSpy jusqu'ŕ 3.04b, par défaut : 1
  99. // pour l'uni 50 français qui est ŕ vitesse *2, il faut donc mettre... 2 !
  100. //if (!$query["config_value"]) $query["config_value"] = 1;
  101. // modif pour 3.0.7 on economise une requete pour piocher dans global
  102. $vitesse = $server_config['speed_uni']
  103. ?>
  104. <script src="http://www.ogsteam.besaba.com/js/stat.js" type="text/javascript"> </script>
  105. <SCRIPT LANGUAGE=Javascript SRC="js/ogame_formula.js"></SCRIPT>
  106. <script type="text/javascript">
  107. var nb_planet = <?php echo $nb_planet;?>;
  108. var start = <?php echo $start;?>;
  109. var batimentsOGSpy = new Array();
  110. var ressource = 2;
  111. <?php
  112. for ($i=$start;$i<=$nb_planet;$i++) {
  113. if ($user_building[$i]['planet_name'] != '') {
  114. $Planete[$i] = 1;
  115. echo "batimentsOGSpy[".$i."] = new Array('".
  116. $user_building[$i]['planet_name']."','".
  117. $user_building[$i]['M']."','".
  118. $user_building[$i]['C']."','".
  119. $user_building[$i]['D']."','".
  120. $user_building[$i]['CES']."','".
  121. $user_building[$i]['CEF']."','".
  122. $user_building[$i]['Sat']."','".
  123. $user_building[$i]['temperature_max']."','".
  124. $user_percentage[$i]['M_percentage']."','".
  125. $user_percentage[$i]['C_percentage']."','".
  126. $user_percentage[$i]['D_percentage']."','".
  127. $user_percentage[$i]['CES_percentage']."','".
  128. $user_percentage[$i]['CEF_percentage']."','".
  129. $user_percentage[$i]['Sat_percentage']."',1);\n";
  130. } else {
  131. $Planete[$i] = 0;
  132. echo "batimentsOGSpy[".$i."] = new Array('','','','','','','','','','','','','','',0);\n";
  133. }
  134. }
  135. echo "vitesse = ".$vitesse.";\n";
  136. ?>
  137. function chargement () {
  138. <?php
  139. $temp = array('',8,9,10,11,12,13);
  140. for ($i=$start;$i<=$nb_planet;$i++) {
  141. for ($b=1;$b<=6;$b++) {
  142. echo "document.getElementById('".$bati[$b].$i."').value = batimentsOGSpy[".$i."][".$b."];\n";
  143. echo "document.getElementById('rap_".$bati[$b].$i."').value = batimentsOGSpy[".$i."][".$temp[$b]."];\n";
  144. }
  145. $j = $i - 100;
  146. echo "document.getElementById('global".$j."').checked = true;\n";
  147. }
  148. echo "document.getElementById('techno_energie').value = ".$user_technology['NRJ'].";\n";
  149. echo "document.getElementById('techno_plasma').value = ".$user_technology['Plasma'].";\n";
  150. echo "document.getElementById('ingenieur').checked = ";
  151. if ($ingenieur == 1) echo "true;\n";
  152. else echo "false;\n";
  153. echo "document.getElementById('geologue').checked = ";
  154. if ($geologue == 1) echo "true;\n";
  155. else echo "false;\n";
  156. echo "document.getElementById('full_off').checked = ";
  157. echo "false;\n";
  158. // if ($full_off == 1) echo "true;\n";
  159. // else echo "false;\n";
  160. ?>
  161. verif_donnee ();
  162. }
  163. function add (bat,plan,inc) {
  164. bati = new Array('','M','C','D','SoP','FR','SS');
  165. if (bat == 7) {
  166. document.getElementById('techno_energie').value = parseFloat(document.getElementById('techno_energie').value) + inc;
  167. } else {
  168. if (bat == 8) {
  169. document.getElementById('techno_plasma').value = parseFloat(document.getElementById('techno_plasma').value) + inc;
  170. } else {
  171. document.getElementById(bati[bat] + plan).value = parseFloat(document.getElementById(bati[bat] + plan).value) + inc;
  172. }
  173. }
  174. verif_donnee ();
  175. }
  176. function selection (sel) {
  177. if (sel == 0) sel = false;
  178. else sel = true;
  179. for (i=1;i<=nb_planet;i++) document.getElementById('global' + i).checked = sel;
  180. verif_donnee ();
  181. }
  182. function verif_donnee(envoye) {
  183. <?php
  184. // avant modif pour 3.0.7
  185. //global = new Array(0,1,1,1,1,1,1,1,1,1);
  186. echo "global = new Array(0";
  187. for ($i=$start;$i<=$nb_planet;$i++){
  188. echo ",1";
  189. }
  190. echo ");";
  191. ?>
  192. <?php
  193. for ($i=$start;$i<=$nb_planet;$i++){
  194. $j = $i - 100;
  195. for ($b=1;$b<=5;$b++) echo "if ((isNaN(parseFloat(document.getElementById('".$bati[$b].$i."').value))) || parseFloat(document.getElementById('".$bati[$b].$i."').value) < 0 ) document.getElementById('".$bati[$b].$i."').value = batimentsOGSpy[".$i."][".$b."];\n";
  196. echo "if (!document.getElementById('global".$j."').checked) global[".$j."] = 0;\n";
  197. }
  198. for ($i=$start;$i<=$nb_planet;$i++){
  199. echo "if ((isNaN(parseFloat(document.getElementById('".$bati[6].$i."').value))) || parseFloat(document.getElementById('".$bati[6].$i."').value) < 0 ) document.getElementById('".$bati[$b].$i."').value = batimentsOGSpy[".$i."][6];\n";
  200. }
  201. ?>
  202. if ((isNaN(parseFloat(document.getElementById('techno_energie').value))) || parseFloat(document.getElementById('techno_energie').value) < 0 ) document.getElementById('techno_energie').value = technologieNRJ;
  203. if ((isNaN(parseFloat(document.getElementById('techno_plasma').value))) || parseFloat(document.getElementById('techno_plasma').value) < 0 ) document.getElementById('techno_plasma').value = technologiePlasma;
  204. ingenieur = 1;
  205. if (document.getElementById('ingenieur').checked) {
  206. ingenieur = 1.1;
  207. }
  208. geologue = 1;
  209. if (document.getElementById('geologue').checked) {
  210. geologue = 1.1;
  211. }
  212. full_off = 1;
  213. if (document.getElementById('full_off').checked) {
  214. full_off = 1.12;
  215. document.getElementById('geologue').checked=true;
  216. document.getElementById('ingenieur').checked=true;
  217. }
  218. if (envoye == 1) document.forms.Save.submit();
  219. else recup_donnee ();
  220. }
  221. function recup_donnee () {
  222. donnee = new Array;
  223. <?php
  224. for ($b=1;$b<=6;$b++){
  225. echo "donnee['".$bati[$b]."'] = new Array;\n";
  226. echo "donnee['rap_".$bati[$b]."'] = new Array;\n";
  227. for ($i=$start;$i<=$nb_planet;$i++){
  228. echo "donnee['".$bati[$b]."'][".$i."] = parseFloat(document.getElementById('".$bati[$b].$i."').value);\n";
  229. echo "donnee['rap_".$bati[$b]."'][".$i."] = parseFloat(document.getElementById('rap_".$bati[$b].$i."').value);\n";
  230. }
  231. }
  232. ?>
  233. technologieNRJ = parseFloat(document.getElementById('techno_energie').value);
  234. technologiePlasma = parseFloat(document.getElementById('techno_plasma').value);
  235. calcul ();
  236. }
  237. function calcul () {
  238. ratio = new Array();
  239. cases = new Array();
  240. cases_base = new Array(0<?php
  241. for ($i=$start;$i<=$nb_planet;$i++) echo ", ".($user_building[$i]["fields_used"] - $user_building[$i]['M'] - $user_building[$i]['C'] - $user_building[$i]['D'] - $user_building[$i]['CES'] - $user_building[$i]['CEF']);
  242. ?>);
  243. energie = new Array();
  244. energie_tot = new Array();
  245. metal_heure = new Array();
  246. cristal_heure = new Array();
  247. deut_heure = new Array();
  248. metal_heure[nb_planet+1] = 0;
  249. cristal_heure[nb_planet+1] = 0;
  250. deut_heure[nb_planet+1] = 0;
  251. if (full_off != 1) {
  252. geologue = full_off;
  253. ingenieur = full_off;
  254. }
  255. for (i=start;i<=nb_planet;i++) {
  256. if (batimentsOGSpy[i][14] == 1) {
  257. prod_energie = Math.round((Math.round((donnee['rap_SoP'][i]/100) * (Math.floor(20 * donnee['SoP'][i] * Math.pow(1.1, donnee['SoP'][i])))) + Math.round((donnee['rap_FR'][i]/100) * (Math.floor(30 * donnee['FR'][i] * Math.pow(1.05 + 0.01 * technologieNRJ, donnee['FR'][i])))) + Math.round((donnee['rap_SS'][i]/100) * (donnee['SS'][i] * Math.floor((batimentsOGSpy[i][7] * 1 + 140) / 6)))) * ingenieur);
  258. cons_energie = Math.ceil((donnee['rap_M'][i]/100)*(Math.ceil(10 * donnee['M'][i] * Math.pow(1.1, donnee['M'][i])))) + Math.ceil((donnee['rap_C'][i]/100)*(Math.ceil(10 * donnee['C'][i] * Math.pow(1.1, donnee['C'][i])))) + Math.ceil((donnee['rap_D'][i]/100)*(Math.ceil(20 * donnee['D'][i] * Math.pow(1.1, donnee['D'][i]))));
  259. if (cons_energie == 0) cons_energie = 1;
  260. energie[i] = prod_energie - cons_energie;
  261. energie_tot[i] = prod_energie;
  262. ratio[i] = Math.floor((prod_energie/cons_energie)*100)/100;
  263. if (ratio[i] > 1) ratio[i] = 1;
  264. if (cons_energie == 1) energie[i] = 0;
  265. metal_heure[i] = vitesse * ( 30 + Math.floor(donnee['rap_M'][i]/100 * ratio[i] * 30 * donnee['M'][i] * Math.pow(1.1, donnee['M'][i]) * (geologue + 0.01 * technologiePlasma)));
  266. cristal_heure[i] = vitesse * Math.floor(15 + donnee['rap_C'][i]/100 * ratio[i] * 20 * donnee['C'][i] * Math.pow(1.1, donnee['C'][i]) * (geologue + 0.0066 * technologiePlasma));
  267. deut_heure[i] = vitesse * Math.floor(donnee['rap_D'][i]/100 * ratio[i] * 10 * donnee['D'][i] * Math.pow(1.1, donnee['D'][i]) * (1.44 - 0.004 * batimentsOGSpy[i][7]) * geologue - Math.round((donnee['rap_FR'][i]/100) * 10 * donnee['FR'][i] * Math.pow(1.1, donnee['FR'][i])));
  268. var j = i-100;
  269. if (global[j] == 1) {
  270. metal_heure[nb_planet+1] = metal_heure[nb_planet+1] + metal_heure[i];
  271. cristal_heure[nb_planet+1] = cristal_heure[nb_planet+1] + cristal_heure[i];
  272. deut_heure[nb_planet+1] = deut_heure[nb_planet+1] + deut_heure[i];
  273. }
  274. cases[i] = cases_base[i] + donnee['M'][i] + donnee['C'][i] + donnee['D'][i] + donnee['SoP'][i] + donnee['FR'][i];
  275. }
  276. }
  277. ecrire();
  278. }
  279. function ecrire() {
  280. <?php
  281. for ($i=$start;$i<=$nb_planet;$i++) {
  282. if ($Planete[$i] == 1) {
  283. echo "if (batimentsOGSpy['".$i."'][14] == 1) {\n";
  284. echo "\tif (ratio[".$i."] == 1) couleur = 'lime';\n\telse couleur = 'red';\n";
  285. echo "\tif (cases[".$i."] <= ".$user_building[$i]["fields"].") couleur2 = 'lime';\n\telse couleur2 = 'red';\n";
  286. echo "\tdocument.getElementById('fact".$i."').innerHTML = '<font color=\'' + couleur + '\'>' + ratio[".$i."] + '</font>';\n";
  287. echo "\tdocument.getElementById('cases".$i."').innerHTML = '<font color=\'' + couleur2 + '\'>' + format(".$user_building[$i]["fields_used"].") + '</font>';\n";
  288. echo "\tdocument.getElementById('cases_tot".$i."').innerHTML = format(".$user_building[$i]["fields"].");\n";
  289. echo "\tdocument.getElementById('energie".$i."').innerHTML = '<font color=\'' + couleur + '\'>' + format(energie[".$i."]) + '</font>';\n";
  290. echo "\tdocument.getElementById('energie_tot".$i."').innerHTML = format(energie_tot[".$i."]);\n";
  291. echo "\tdocument.getElementById('prodh_M".$i."').innerHTML = '<font color=\'' + couleur + '\'>' + format(metal_heure[".$i."]) + '</font>';\n";
  292. echo "\tdocument.getElementById('prodh_C".$i."').innerHTML = '<font color=\'' + couleur + '\'>' + format(cristal_heure[".$i."]) + '</font>';\n";
  293. echo "\tdocument.getElementById('prodh_D".$i."').innerHTML = '<font color=\'' + couleur + '\'>' + format(deut_heure[".$i."]) + '</font>';\n";
  294. echo "\tdocument.getElementById('prodj_M".$i."').innerHTML = '<font color=\'' + couleur + '\'>' + format(24 * metal_heure[".$i."]) + '</font>';\n";
  295. echo "\tdocument.getElementById('prodj_C".$i."').innerHTML = '<font color=\'' + couleur + '\'>' + format(24 * cristal_heure[".$i."]) + '</font>';\n";
  296. echo "\tdocument.getElementById('prodj_D".$i."').innerHTML = '<font color=\'' + couleur + '\'>' + format(24 * deut_heure[".$i."]) + '</font>';\n";
  297. echo "} else document.getElementById('global".$i."').disabled = true;\n";
  298. }
  299. } ?>
  300. document.getElementById('prodh_mtot').innerHTML = format(metal_heure[nb_planet+1]);
  301. document.getElementById('prodh_ctot').innerHTML = format(cristal_heure[nb_planet+1]);
  302. document.getElementById('prodh_dtot').innerHTML = format(deut_heure[nb_planet+1]);
  303. document.getElementById('prodh_ptot').innerHTML = format(Math.floor((metal_heure[nb_planet+1] + cristal_heure[nb_planet+1] + deut_heure[nb_planet+1]) / 1000));
  304. document.getElementById('prodj_mtot').innerHTML = format(24 * metal_heure[nb_planet+1]);
  305. document.getElementById('prodj_ctot').innerHTML = format(24 * cristal_heure[nb_planet+1]);
  306. document.getElementById('prodj_dtot').innerHTML = format(24 * deut_heure[nb_planet+1]);
  307. document.getElementById('prodj_ptot').innerHTML = format(Math.floor(24 * (metal_heure[nb_planet+1] + cristal_heure[nb_planet+1] + deut_heure[nb_planet+1]) / 1000));
  308. document.getElementById('prods_mtot').innerHTML = format(24 * 7 * metal_heure[nb_planet+1]);
  309. document.getElementById('prods_ctot').innerHTML = format(24 * 7 * cristal_heure[nb_planet+1]);
  310. document.getElementById('prods_dtot').innerHTML = format(24 * 7 * deut_heure[nb_planet+1]);
  311. document.getElementById('prods_ptot').innerHTML = format(Math.floor(24 * 7 * (metal_heure[nb_planet+1] + cristal_heure[nb_planet+1] + deut_heure[nb_planet+1]) / 1000));
  312. func_rapport();
  313. }
  314. function func_rapport(ress) {
  315. if (ress > 0 && ress < 4) ressource = ress;
  316. rapport_arr = new Array('',deut_heure[nb_planet+1],cristal_heure[nb_planet+1],metal_heure[nb_planet+1]);
  317. rapport = rapport_arr[ressource] / ressource;
  318. document.getElementById('rapport_m').innerHTML = Math.round(100 * metal_heure[nb_planet+1] / rapport) / 100;
  319. document.getElementById('rapport_c').innerHTML = Math.round(100 * cristal_heure[nb_planet+1] / rapport) / 100;
  320. document.getElementById('rapport_d').innerHTML = Math.round(100 * deut_heure[nb_planet+1] / rapport) / 100;
  321. }
  322. function format(x) {
  323. var signe = '';
  324. if (x < 0) {
  325. x = Math.abs(x);
  326. signe = '-';
  327. }
  328. var str = x.toString(), n = str.length;
  329. if (n < 4) return (signe + x);
  330. else return (signe + ((n % 3) ? str.substr(0, n % 3) + '&nbsp;' : '')) + str.substr(n % 3).match(new RegExp('[0-9]{3}', 'g')).join('&nbsp;');
  331. }
  332. window.onload = function () {Biper(); chargement();}
  333. </script>
  334. <table width="100%">
  335. <tr>
  336. <td class="c" colspan="<?php echo $nb_planet+1;?>"><?php echo $lang['prod_uction_mod']."&nbsp;<input type='submit' value='".$lang['prod_save']."' onClick='javascript:verif_donnee (1)'>&nbsp;<input type='submit' value='".$lang['prod_reset'];?>' onClick="javascript:chargement ()"></td>
  337. </tr>
  338. <tr>
  339. <th><a>
  340. <?php
  341. echo $lang['prod_planete']."</a></th>\n";
  342. for ($i=$start;$i<=$nb_planet;$i++) {
  343. $name[$i] = $user_building[$i]["planet_name"];
  344. if ($name[$i] == "") $name[$i] = "&nbsp;";
  345. echo "\t<th><a>".$name[$i]."</a></th>\n";
  346. }
  347. ?>
  348. </tr>
  349. <tr>
  350. <th><a>
  351. <?php
  352. echo $lang['prod_coordinates']."</a></th>\n";
  353. for ($i=$start;$i<=$nb_planet;$i++) {
  354. $coordinates = $user_building[$i]["coordinates"];
  355. if ($coordinates == "") $coordinates = "&nbsp;";
  356. else $coordinates = "[".$coordinates."]";
  357. echo "\t<th>".$coordinates."</th>\n";
  358. }
  359. ?>
  360. </tr>
  361. <tr>
  362. <th><a>
  363. <?php
  364. echo $lang['prod_temperature']."</a></th>\n";
  365. for ($i=$start;$i<=$nb_planet;$i++) {
  366. $temperature[$i] = $user_building[$i]["temperature_max"];
  367. if ($temperature[$i] == "") $temperature[$i] = "&nbsp;";
  368. echo "\t<th>".$temperature[$i]."</th>\n";
  369. }
  370. ?>
  371. </tr>
  372. <tr>
  373. <th><a>
  374. <?php
  375. echo $lang['prod_fields']."</a></th>\n";
  376. for ($i=$start;$i<=$nb_planet;$i++) echo "\t<th><font color='lime'><span id='cases".$i."'>".$user_building[$i]["fields"]."</span></font> / <font color='lime'><span id='cases_tot".$i."'>".$user_building[$i]["fields_used"]."</span></font></th>\n";
  377. ?>
  378. </tr>
  379. <tr>
  380. <th><a>
  381. <?php
  382. echo $lang['prod_energy']."</a></th>\n";
  383. for ($i=$start;$i<=$nb_planet;$i++) echo "\t<th><font color='lime'><span id='energie".$i."'></span></font> / <font color='lime'><span id='energie_tot".$i."'></span></font></th>\n";
  384. ?>
  385. </tr>
  386. <tr>
  387. <td class="c" colspan="<?php echo $nb_planet+1;?>"><?php echo $lang['prod_buildings'];?></td>
  388. </tr>
  389. <form name="Save" method="post" action="">
  390. <?php
  391. for ($b=1;$b<=5;$b++) {
  392. echo "<tr><th><a>".$lang['prod_building_'.$bati[$b]]."</a></th>";
  393. for ($i=$start;$i<=$nb_planet;$i++) {
  394. echo "\t<th><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:add (".$b.",".$i.",-1)'>-</a><input type='text' id='".$bati[$b].$i."' name='".$bati[$b].$i."' size='2' maxlength='2' onBlur='javascript:verif_donnee (0)' value='0'><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:add (".$b.",".$i.",1)'>+</a>\n";
  395. echo "\t\t<select id='rap_".$bati[$b].$i."' name='rap_".$bati[$b].$i."' onChange='javascript:verif_donnee (0)'>";
  396. for ($j=100;$j>=0;$j=$j-10) echo "<option value='".$j."'>".$j."%</option>";
  397. echo "</select></th>\n";
  398. }
  399. echo "</tr>";
  400. }
  401. echo "<tr><th><a>".$lang['prod_SS']."</a></th>";
  402. for ($i=$start;$i<=$nb_planet;$i++) {
  403. echo "<input type='hidden' name='planete".$i."' value='".$Planete[$i]."'>";
  404. echo "\t<th><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:add (6,".$i.",-1)'>-</a><input type='text' id='".$bati[6].$i."' name='".$bati[6].$i."' size='2' maxlength='6' onBlur=\"javascript:verif_donnee (0)\" value='0'><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:add (6,".$i.",1)'>+</a>\n";
  405. echo "\t\t<select id='rap_".$bati[6].$i."' name='rap_".$bati[6].$i."' onChange='javascript:add (6,".$i.",1)'>";
  406. for ($j=100; $j>=0; $j=$j-10) echo "<option value='".$j."'>".$j."%</option>";
  407. echo "</select></th>\n";
  408. }
  409. echo "</tr>";
  410. ?>
  411. <tr>
  412. <td class="c" colspan="<?php echo $nb_planet;?>"><?php echo $lang['prod_tech_off'];?></td>
  413. </tr>
  414. <tr><th><a><?php echo $lang['prod_technology_En'];?></a></th>
  415. <th><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:add (7,0,-1)'>-</a><input type='text' id='techno_energie' name='techno_energie' size='2' maxlength='6' onBlur='javascript:verif_donnee (0)' value='0'><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:add (7,0,1)'>+</a></th>
  416. <th><a><?php echo $lang['prod_technology_Pl'];?></a></th>
  417. <th><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:add (8,0,-1)'>-</a><input type='text' id='techno_plasma' name='techno_plasma' size='2' maxlength='6' onBlur='javascript:verif_donnee (0)' value='0'><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:add (8,0,1)'>+</a></th>
  418. <th colspan="2" onmouseover="Tip('<table width=&quot;200&quot;><tr><td align=&quot;center&quot; class=&quot;c&quot;><?php echo $lang['prod_officer_E'];?></td></tr><tr><th align=&quot;center&quot;><a><?php echo $lang['prod_officer_E_help'];?></a></th></tr></table>')" onmouseout="UnTip()"><label><input type='checkbox' id='ingenieur' name='ingenieur' onClick='javascript:verif_donnee (0)'> <a><?php echo $lang['prod_officer_E'];?></a></label></th>
  419. <th colspan="2" onmouseover="Tip('<table width=&quot;200&quot;><tr><td align=&quot;center&quot; class=&quot;c&quot;><?php echo $lang['prod_officer_G'];?></td></tr><tr><th align=&quot;center&quot;><a><?php echo $lang['prod_officer_G_help'];?></a></th></tr></table>')" onmouseout="UnTip()"><label><input type='checkbox' id='geologue' name='geologue' onClick='javascript:verif_donnee (0)'> <a><?php echo $lang['prod_officer_G'];?></a></label></th>
  420. <th colspan="2" onmouseover="Tip('<table width=&quot;200&quot;><tr><td align=&quot;center&quot; class=&quot;c&quot;><?php echo $lang['prod_officer_full'];?></td></tr><tr><th align=&quot;center&quot;><a><?php echo $lang['prod_officer_full_help'];?></a></th></tr></table>')" onmouseout="UnTip()"><label><input type='checkbox' id='full_off' name='fulloff' onClick='javascript:verif_donnee (0)'> <a><?php echo $lang['prod_officer_full'];?></a></label></th>
  421. </tr>
  422. </form>
  423. <tr>
  424. <td class="c" colspan="<?php echo $nb_planet+1;?>">
  425. <?php
  426. echo $lang['prod_prod_hour']."</td>\n</tr>\n<tr>\n<th><a>".$lang['prod_prod_factor']."</a></th>\n";
  427. for ($i=$start;$i<=$nb_planet;$i++) echo "\t<th><span id='fact".$i."'></span></th>\n";
  428. ?>
  429. </tr>
  430. <?php
  431. for ($b=1;$b<=3;$b++) {
  432. echo "<tr><th><a>".$lang['prod_building_'.$bati[$b]]."</a></th>";
  433. for ($i=$start;$i<=$nb_planet;$i++) echo "\t<th><span id='prodh_".$bati[$b].$i."'></span></th>\n";
  434. echo "</tr>";
  435. }
  436. ?>
  437. <tr>
  438. <td class="c" colspan="<?php echo $nb_planet+1;?>">
  439. <?php
  440. echo $lang['prod_prod_day']."</td>\n</tr>\n";
  441. for ($b=1;$b<=3;$b++) {
  442. echo'<tr><th><a>'.$lang['prod_building_'.$bati[$b]].'</a></th>';
  443. for ($i=$start;$i<=$nb_planet;$i++) echo "\t<th><span id='prodj_".$bati[$b].$i."'></span></th>\n";
  444. echo "</tr>";
  445. }
  446. ?>
  447. <tr>
  448. <td class="c" colspan="<?php echo $nb_planet+1;?>">
  449. <?php
  450. echo $lang['prod_total_prod']."</td>\n</tr>\n<tr><th><table width='100%' style='border:none'><tr><th style='border:none'><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:selection (0)' title='".$lang['prod_none']."'>-</a></th><th style='border:none'><a>".$lang['prod_account']."</a></th><th style='border:none'><a style='cursor: pointer;vertical-align: middle;' onClick='javascript:selection (1)' title='".$lang['prod_all']."'>+</a></th></tr></table></th>\n";
  451. for ($i=101;$i<=$nb_planet;$i++) {
  452. $j=$i -100;
  453. echo "\t<th><label><input type='";
  454. if ($Planete[$i] == 1) echo "checkbox";
  455. else echo "hidden";
  456. echo "' id='global$j' name='global$j' onClick='javascript:verif_donnee (0)'>&nbsp;$name[$i]</label></th>\n";
  457. }
  458. ?>
  459. </tr>
  460. <tr>
  461. <th><a><?php echo $lang['prod_hour'];?></a></th>
  462. <th><a><?php echo $lang['prod_M'];?></a></th>
  463. <th><font color='lime'><span id='prodh_mtot'></span></font></th>
  464. <th><a><?php echo $lang['prod_C'];?></a></th>
  465. <th><font color='lime'><span id='prodh_ctot'></span></font></th>
  466. <th><a><?php echo $lang['prod_D'];?></a></th>
  467. <th><font color='lime'><span id='prodh_dtot'></span></font></th>
  468. <th><a><?php echo $lang['prod_points'];?></a></th>
  469. <th><font color='lime'><span id='prodh_ptot'></span></font></th>
  470. <th><a><?php echo $lang['prod_hour'];?></a></th>
  471. </tr>
  472. <tr>
  473. <th><a><?php echo $lang['prod_day'];?></a></th>
  474. <th><a><?php echo $lang['prod_M'];?></a></th>
  475. <th><font color='lime'><span id='prodj_mtot'></span></font></th>
  476. <th><a><?php echo $lang['prod_C'];?></a></th>
  477. <th><font color='lime'><span id='prodj_ctot'></span></font></th>
  478. <th><a><?php echo $lang['prod_D'];?></a></th>
  479. <th><font color='lime'><span id='prodj_dtot'></span></font></th>
  480. <th><a><?php echo $lang['prod_points'];?></a></th>
  481. <th><font color='lime'><span id='prodj_ptot'></span></font></th>
  482. <th><a><?php echo $lang['prod_day'];?></a></th>
  483. </tr>
  484. <tr>
  485. <th><a><?php echo $lang['prod_week'];?></a></th>
  486. <th><a><?php echo $lang['prod_M'];?></a></th>
  487. <th><font color='lime'><span id='prods_mtot'></span></font></th>
  488. <th><a><?php echo $lang['prod_C'];?></a></th>
  489. <th><font color='lime'><span id='prods_ctot'></span></font></th>
  490. <th><a><?php echo $lang['prod_D'];?></a></th>
  491. <th><font color='lime'><span id='prods_dtot'></span></font></th>
  492. <th><a><?php echo $lang['prod_points'];?></a></th>
  493. <th><font color='lime'><span id='prods_ptot'></span></font></th>
  494. <th><a><?php echo $lang['prod_week'];?></a></th>
  495. </tr>
  496. <tr>
  497. <th><a><?php echo $lang['prod_ratio'];?></a></th>
  498. <th onClick="javascript:func_rapport (3)" title="<?php echo $lang['prod_ref'];?>"><img style="cursor: help;" src="images/help_2.png" alt="?"> <a><?php echo $lang['prod_M'];?></a></th>
  499. <th onClick="javascript:func_rapport (3)" title="<?php echo $lang['prod_ref'];?>"><font color='lime'><span id='rapport_m'></span></font></th>
  500. <th onClick="javascript:func_rapport (2)" title="<?php echo $lang['prod_ref'];?>"><img style="cursor: help;" src="images/help_2.png" alt="?"> <a><?php echo $lang['prod_C'];?></a></th>
  501. <th onClick="javascript:func_rapport (2)" title="<?php echo $lang['prod_ref'];?>"><font color='lime'><span id='rapport_c'></span></font></th>
  502. <th onClick="javascript:func_rapport (1)" title="<?php echo $lang['prod_ref'];?>"><img style="cursor: help;" src="images/help_2.png" alt="?"> <a><?php echo $lang['prod_D'];?></a></th>
  503. <th onClick="javascript:func_rapport (1)" title="<?php echo $lang['prod_ref'];?>"><font color='lime'><span id='rapport_d'></span></font></th>
  504. </tr>
  505. </table>
  506. <br/>
  507. <?php
  508. echo "<div align=center><font size='2'>".sprintf($lang['prod_created_by'],$mod_version,$creator_name,$modifier_name1,$modifier_name2,$modifier_name3)."</font><br />".
  509. "<div align=center><font size='2'>".sprintf($lang['prod_updated_by'],$mod_version,$updator_name)."</font><br />".
  510. "<font size='1'><a href='".$forum_link."' target='_blank'>".$lang['prod_forum']."</a>.</font></div>";
  511. require_once("views/page_tail.php");
  512. ?>