121 lines
5.2 KiB
PHP
121 lines
5.2 KiB
PHP
|
<?php
|
||
|
session_start();
|
||
|
|
||
|
$id=$_SESSION['id'];
|
||
|
$galaxy=$_SESSION['galaxy'];
|
||
|
$ss=$_SESSION['ss'];
|
||
|
$pos=$_SESSION['pos'];
|
||
|
$race=$_SESSION['race'];
|
||
|
|
||
|
require('bdd.php');
|
||
|
require('../connectBDD.php');
|
||
|
|
||
|
|
||
|
if ($_GET['tec'] == 1) {
|
||
|
$n=($informatique-1);
|
||
|
$cristal -= ceil(pow(2,$n)*500);
|
||
|
$hydrogene -= ceil(pow(2,$n)*150);
|
||
|
$temps_tec = time() + ceil((420*2*($informatique+1))/pow(1.25,($labo-1)));
|
||
|
$tec = 1;
|
||
|
mysql_query("UPDATE planete SET cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ($_GET['tec'] == 2) {
|
||
|
$n=($detection-1);
|
||
|
$metal -= ceil(pow(2,$n)*500);
|
||
|
$cristal -= ceil(pow(2,$n)*750);
|
||
|
$hydrogene -= ceil(pow(2,$n)*100);
|
||
|
$temps_tec = time() + ceil((600*2*($detection+1))/pow(1.25,($labo-2)));
|
||
|
$tec = 2;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ($_GET['tec'] == 3) {
|
||
|
$n=($armement-1);
|
||
|
$metal -= ceil(pow(2,$n)*2500);
|
||
|
$cristal -= ceil(pow(2,$n)*500);
|
||
|
$temps_tec = time() + ceil((1500*2*($armement+1))/pow(1.25,($labo-5)));
|
||
|
$tec = 3;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ($_GET['tec'] == 4) {
|
||
|
$n=($blindage-1);
|
||
|
$metal -= ceil(pow(2,$n)*4000);
|
||
|
$cristal -= ceil(pow(2,$n)*1500);
|
||
|
$temps_tec = time() + ceil((1710*2*($blindage+1))/pow(1.25,($labo-4)));
|
||
|
$tec = 4;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ($_GET['tec'] == 5) {
|
||
|
$n=($energie_t-1);
|
||
|
$metal -= ceil(pow(2,$n)*2000);
|
||
|
$cristal -= ceil(pow(2,$n)*1500);
|
||
|
$hydrogene -= ceil(pow(2,$n)*300);
|
||
|
$temps_tec = time() + ceil((900*2*($energie_t+1))/pow(1.25,($labo-2)));
|
||
|
$tec = 5;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ($_GET['tec'] == 6) {
|
||
|
$n=($reacteur-1);
|
||
|
$metal -= ceil(pow(2,$n)*1400);
|
||
|
$cristal -= ceil(pow(2,$n)*400);
|
||
|
$temps_tec = time() + ceil((510*2*($reacteur+1))/pow(1.25,($labo-2)));
|
||
|
$tec = 6;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ($_GET['tec'] == 7) {
|
||
|
$n=($reacteur_f-1);
|
||
|
$metal -= ceil(pow(2,$n)*3000);
|
||
|
$cristal -= ceil(pow(2,$n)*2100);
|
||
|
$hydrogene -= ceil(pow(2,$n)*750);
|
||
|
$temps_tec = time() + ceil((1650*2*($reacteur_f+1))/pow(1.25,($labo-4)));
|
||
|
$tec = 7;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ($_GET['tec'] == 8) {
|
||
|
$n=($reacteur_ff-1);
|
||
|
$metal -= ceil(pow(2,$n)*5000);
|
||
|
$cristal -= ceil(pow(2,$n)*4000);
|
||
|
$hydrogene -= ceil(pow(2,$n)*1500);
|
||
|
$temps_tec = time() + ceil((2400*2*($reacteur_ff+1))/pow(1.25,($labo-6)));
|
||
|
$tec = 8;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ( $_GET['tec'] == 9) {
|
||
|
$n=($medecine-1);
|
||
|
$metal -= ceil(pow(2,$n)*800);
|
||
|
$cristal -= ceil(pow(2,$n)*1000);
|
||
|
$temps_tec = time() + ceil((360*2*($medecine+1))/pow(1.25,($labo-1)));
|
||
|
$tec = 9;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ($_GET['tec'] == 10) {
|
||
|
$n=($tactique-1);
|
||
|
$metal -= ceil(pow(2,$n)*2600);
|
||
|
$cristal -= ceil(pow(2,$n)*2600);
|
||
|
$temps_tec = time() + ceil((4410*2*($tactique+1))/pow(1.25,($labo-3)));
|
||
|
$tec = 10;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
else if ($_GET['tec'] == 11) {
|
||
|
$n=($spartan-1);
|
||
|
$metal -= ceil(pow(3,$n)*5200);
|
||
|
$cristal -= ceil(pow(3,$n)*4250);
|
||
|
$hydrogene -= ceil(pow(3,$n)*850);
|
||
|
$temps_tec = time() + ceil((5000*2*($spartan+1))/pow(1.25,($labo-8)));
|
||
|
$tec = 11;
|
||
|
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||
|
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
|
||
|
}
|
||
|
|
||
|
mysql_close();
|
||
|
header('Location: laboratoire.php');
|
||
|
?>
|