Ajout d'une étape de linting dans DroneCi (#3)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Corrige un doublons laissé par le rebase semi-manuel Ajout d'une étape de linting dans DroneCi Fix linting Co-authored-by: Nigel Sheldon <nigelsheldon@live.fr> Reviewed-on: https://gitea.nemunai.re/halo-battle/game/pulls/3
This commit is contained in:
parent
5b17a7dbd7
commit
dd61d3b66b
263 changed files with 45327 additions and 42695 deletions
|
|
@ -3,208 +3,198 @@ require_once("Class/Donnees/interface.php");
|
|||
|
||||
class dAlliancesBatiments implements Donnees
|
||||
{
|
||||
public static function metal($id, $niveau, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$metal = ceil(pow(1.5, $niveau)*68);
|
||||
break;
|
||||
case 1:
|
||||
$metal = ceil(pow(1.6, $niveau)*53);
|
||||
break;
|
||||
case 2:
|
||||
$metal = ceil(pow(1.5, $niveau)*242);
|
||||
break;
|
||||
case 3:
|
||||
$metal = ceil(pow(1.5, $niveau)*92);
|
||||
break;
|
||||
case 4:
|
||||
$metal = ceil(pow(1.73, $niveau)*800);
|
||||
break;
|
||||
case 5:
|
||||
$metal = ceil(pow(2, $niveau)*750);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function metal($id, $niveau, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$metal = ceil(pow(1.5, $niveau)*68);
|
||||
break;
|
||||
case 1:
|
||||
$metal = ceil(pow(1.6, $niveau)*53);
|
||||
break;
|
||||
case 2:
|
||||
$metal = ceil(pow(1.5, $niveau)*242);
|
||||
break;
|
||||
case 3:
|
||||
$metal = ceil(pow(1.5, $niveau)*92);
|
||||
break;
|
||||
case 4:
|
||||
$metal = ceil(pow(1.73, $niveau)*800);
|
||||
break;
|
||||
case 5:
|
||||
$metal = ceil(pow(2, $niveau)*750);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
return $metal;
|
||||
}
|
||||
return $metal;
|
||||
}
|
||||
|
||||
public static function cristal($id, $niveau, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$cristal = ceil(pow(1.5, $niveau)*17);
|
||||
break;
|
||||
case 1:
|
||||
$cristal = ceil(pow(1.6, $niveau)*27);
|
||||
break;
|
||||
case 2:
|
||||
$cristal = ceil(pow(1.5, $niveau)*72);
|
||||
break;
|
||||
case 3:
|
||||
$cristal = ceil(pow(1.5, $niveau)*37);
|
||||
break;
|
||||
case 4:
|
||||
$cristal = ceil(pow(1.73, $niveau)*420);
|
||||
break;
|
||||
case 5:
|
||||
$cristal = ceil(pow(2, $niveau)*500);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function cristal($id, $niveau, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$cristal = ceil(pow(1.5, $niveau)*17);
|
||||
break;
|
||||
case 1:
|
||||
$cristal = ceil(pow(1.6, $niveau)*27);
|
||||
break;
|
||||
case 2:
|
||||
$cristal = ceil(pow(1.5, $niveau)*72);
|
||||
break;
|
||||
case 3:
|
||||
$cristal = ceil(pow(1.5, $niveau)*37);
|
||||
break;
|
||||
case 4:
|
||||
$cristal = ceil(pow(1.73, $niveau)*420);
|
||||
break;
|
||||
case 5:
|
||||
$cristal = ceil(pow(2, $niveau)*500);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
return $cristal;
|
||||
}
|
||||
return $cristal;
|
||||
}
|
||||
|
||||
public static function hydrogene($id, $niveau, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 1:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 2:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 3:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 4:
|
||||
$hydrogene = ceil(pow(1.68, $niveau)*285);
|
||||
break;
|
||||
case 5:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function hydrogene($id, $niveau, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 1:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 2:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 3:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 4:
|
||||
$hydrogene = ceil(pow(1.68, $niveau)*285);
|
||||
break;
|
||||
case 5:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
return $hydrogene;
|
||||
}
|
||||
return $hydrogene;
|
||||
}
|
||||
|
||||
public static function credits($id, $niveau, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$credits = ceil(pow(1.68, $niveau)*25);
|
||||
break;
|
||||
case 1:
|
||||
$credits = ceil(pow(1.68, $niveau)*85);
|
||||
break;
|
||||
case 2:
|
||||
$credits = ceil(pow(1.68, $niveau)*185);
|
||||
break;
|
||||
case 3:
|
||||
$credits = ceil(pow(1.68, $niveau)*285);
|
||||
break;
|
||||
case 4:
|
||||
$credits = ceil(pow(1.68, $niveau)*385);
|
||||
break;
|
||||
case 5:
|
||||
$credits = ceil(pow(1.68, $niveau)*485);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function credits($id, $niveau, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$credits = ceil(pow(1.68, $niveau)*25);
|
||||
break;
|
||||
case 1:
|
||||
$credits = ceil(pow(1.68, $niveau)*85);
|
||||
break;
|
||||
case 2:
|
||||
$credits = ceil(pow(1.68, $niveau)*185);
|
||||
break;
|
||||
case 3:
|
||||
$credits = ceil(pow(1.68, $niveau)*285);
|
||||
break;
|
||||
case 4:
|
||||
$credits = ceil(pow(1.68, $niveau)*385);
|
||||
break;
|
||||
case 5:
|
||||
$credits = ceil(pow(1.68, $niveau)*485);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
return $credits;
|
||||
}
|
||||
return $credits;
|
||||
}
|
||||
|
||||
public static function temps($id, $niveau, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$sec = pow(1.5, $niveau)*6;
|
||||
break;
|
||||
case 1:
|
||||
$sec = pow(1.55, $niveau)*6;
|
||||
break;
|
||||
case 2:
|
||||
$sec = pow(1.624, $niveau)*6;
|
||||
break;
|
||||
case 3:
|
||||
$sec = pow(1.597, $niveau)*6;
|
||||
break;
|
||||
case 4:
|
||||
$sec = pow(1.7, $niveau)*6;
|
||||
break;
|
||||
case 5:
|
||||
$sec = ceil(pow(2, $niveau)*720);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function temps($id, $niveau, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$sec = pow(1.5, $niveau)*6;
|
||||
break;
|
||||
case 1:
|
||||
$sec = pow(1.55, $niveau)*6;
|
||||
break;
|
||||
case 2:
|
||||
$sec = pow(1.624, $niveau)*6;
|
||||
break;
|
||||
case 3:
|
||||
$sec = pow(1.597, $niveau)*6;
|
||||
break;
|
||||
case 4:
|
||||
$sec = pow(1.7, $niveau)*6;
|
||||
break;
|
||||
case 5:
|
||||
$sec = ceil(pow(2, $niveau)*720);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment d'alliance ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//Accélération du temps de construction
|
||||
$sec /= VITESSE;
|
||||
//Accélération du temps de construction
|
||||
$sec /= VITESSE;
|
||||
|
||||
return $sec;
|
||||
}
|
||||
return $sec;
|
||||
}
|
||||
|
||||
|
||||
public static function image($id, surface $planete)
|
||||
{
|
||||
if ($planete->race == "covenant")
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
//return "batimentcovieux4.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_covenant_default;
|
||||
}
|
||||
elseif ($planete->race == "humain")
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
//return "batimentcovieux4.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_humain_default;
|
||||
}
|
||||
else
|
||||
trigger_error("Impossible de trouver la race pour ".$planete->race, E_USER_ERROR);
|
||||
}
|
||||
public static function image($id, surface $planete)
|
||||
{
|
||||
if ($planete->race == "covenant") {
|
||||
switch ($id) {
|
||||
case 0:
|
||||
//return "batimentcovieux4.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_covenant_default;
|
||||
} elseif ($planete->race == "humain") {
|
||||
switch ($id) {
|
||||
case 0:
|
||||
//return "batimentcovieux4.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_humain_default;
|
||||
} else {
|
||||
trigger_error("Impossible de trouver la race pour ".$planete->race, E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function needed($id, surface $planete, $print = false)
|
||||
{
|
||||
$neededAlliancesBatiments =
|
||||
array(
|
||||
0,
|
||||
array(
|
||||
array('batiments', 0, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 0, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 0, 5)
|
||||
),
|
||||
array(
|
||||
array('batiments', 0, 4)
|
||||
),
|
||||
array(
|
||||
array('batiments', 0, 2)
|
||||
)
|
||||
);
|
||||
public static function needed($id, surface $planete, $print = false)
|
||||
{
|
||||
$neededAlliancesBatiments =
|
||||
array(
|
||||
0,
|
||||
array(
|
||||
array('batiments', 0, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 0, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 0, 5)
|
||||
),
|
||||
array(
|
||||
array('batiments', 0, 4)
|
||||
),
|
||||
array(
|
||||
array('batiments', 0, 2)
|
||||
)
|
||||
);
|
||||
|
||||
if ($print)
|
||||
return dDonnees::print_neededCheck($neededAlliancesBatiments[$id], $planete);
|
||||
else
|
||||
return dDonnees::neededCheck($neededAlliancesBatiments[$id], $planete);
|
||||
}
|
||||
if ($print) {
|
||||
return dDonnees::print_neededCheck($neededAlliancesBatiments[$id], $planete);
|
||||
} else {
|
||||
return dDonnees::neededCheck($neededAlliancesBatiments[$id], $planete);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -3,515 +3,489 @@ require_once("Class/Donnees/interface.php");
|
|||
|
||||
class dBatiments implements Donnees
|
||||
{
|
||||
public static function metal($id, $niveau, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$metal = ceil(pow(1.5, $niveau)*68);
|
||||
break;
|
||||
case 1:
|
||||
$metal = ceil(pow(1.6, $niveau)*53);
|
||||
break;
|
||||
case 2:
|
||||
$metal = ceil(pow(1.5, $niveau)*242);
|
||||
break;
|
||||
case 3:
|
||||
$metal = ceil(pow(1.5, $niveau)*92);
|
||||
break;
|
||||
case 4:
|
||||
//$metal = ceil(pow(1.73, $niveau)*800);
|
||||
$metal = ceil(pow(3, $niveau)*5000);
|
||||
break;
|
||||
case 5:
|
||||
$metal = ceil(pow(2, $niveau)*750);
|
||||
break;
|
||||
case 6:
|
||||
$metal = ceil(pow(2, $niveau)*200);
|
||||
break;
|
||||
case 7:
|
||||
$metal = ceil(pow(2, $niveau)*520);
|
||||
break;
|
||||
case 8:
|
||||
$metal = ceil(pow(2, $niveau)*600);
|
||||
break;
|
||||
case 9:
|
||||
$metal = ceil(pow(2, $niveau)*200);
|
||||
break;
|
||||
case 10:
|
||||
$metal = ceil(pow(2, $niveau)*400);
|
||||
break;
|
||||
case 11:
|
||||
$metal = ceil(pow(1.7, $niveau)*600);
|
||||
break;
|
||||
public static function metal($id, $niveau, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$metal = ceil(pow(1.5, $niveau)*68);
|
||||
break;
|
||||
case 1:
|
||||
$metal = ceil(pow(1.6, $niveau)*53);
|
||||
break;
|
||||
case 2:
|
||||
$metal = ceil(pow(1.5, $niveau)*242);
|
||||
break;
|
||||
case 3:
|
||||
$metal = ceil(pow(1.5, $niveau)*92);
|
||||
break;
|
||||
case 4:
|
||||
//$metal = ceil(pow(1.73, $niveau)*800);
|
||||
$metal = ceil(pow(3, $niveau)*5000);
|
||||
break;
|
||||
case 5:
|
||||
$metal = ceil(pow(2, $niveau)*750);
|
||||
break;
|
||||
case 6:
|
||||
$metal = ceil(pow(2, $niveau)*200);
|
||||
break;
|
||||
case 7:
|
||||
$metal = ceil(pow(2, $niveau)*520);
|
||||
break;
|
||||
case 8:
|
||||
$metal = ceil(pow(2, $niveau)*600);
|
||||
break;
|
||||
case 9:
|
||||
$metal = ceil(pow(2, $niveau)*200);
|
||||
break;
|
||||
case 10:
|
||||
$metal = ceil(pow(2, $niveau)*400);
|
||||
break;
|
||||
case 11:
|
||||
$metal = ceil(pow(1.7, $niveau)*600);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
$metal = ceil(pow($niveau, 2.075)*1000+1500);
|
||||
break;
|
||||
case 13:
|
||||
$metal = ceil(pow($niveau,2.8)*1000+299000);
|
||||
break;
|
||||
case 14:
|
||||
$metal = ceil(pow($niveau, 2)*1200+140000);
|
||||
break;
|
||||
case 15:
|
||||
$metal = ceil(pow($niveau, 2)*1000+80000);
|
||||
break;
|
||||
case 16:
|
||||
$metal = ceil(pow($niveau, 2)*850+60000);
|
||||
break;
|
||||
case 17:
|
||||
$metal = ceil(pow($niveau, 2.5)*500 -300);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
case 12:
|
||||
$metal = ceil(pow($niveau, 2.075)*1000+1500);
|
||||
break;
|
||||
case 13:
|
||||
$metal = ceil(pow($niveau, 2.8)*1000+299000);
|
||||
break;
|
||||
case 14:
|
||||
$metal = ceil(pow($niveau, 2)*1200+140000);
|
||||
break;
|
||||
case 15:
|
||||
$metal = ceil(pow($niveau, 2)*1000+80000);
|
||||
break;
|
||||
case 16:
|
||||
$metal = ceil(pow($niveau, 2)*850+60000);
|
||||
break;
|
||||
case 17:
|
||||
$metal = ceil(pow($niveau, 2.5)*500 -300);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
//Bonus technologique pour les mines
|
||||
if ($id <= 3)
|
||||
{
|
||||
if ($planete->technologies[0] &262144)
|
||||
{
|
||||
$metal *= 0.85;
|
||||
}
|
||||
elseif ($planete->technologies[0] &131072)
|
||||
{
|
||||
$metal *= 0.9;
|
||||
}
|
||||
elseif ($planete->technologies[0] &65536)
|
||||
{
|
||||
$metal *= 0.95;
|
||||
}
|
||||
}
|
||||
//On tient compte des bonus
|
||||
//Bonus technologique pour les mines
|
||||
if ($id <= 3) {
|
||||
if ($planete->technologies[0] &262144) {
|
||||
$metal *= 0.85;
|
||||
} elseif ($planete->technologies[0] &131072) {
|
||||
$metal *= 0.9;
|
||||
} elseif ($planete->technologies[0] &65536) {
|
||||
$metal *= 0.95;
|
||||
}
|
||||
}
|
||||
|
||||
return $metal;
|
||||
}
|
||||
return $metal;
|
||||
}
|
||||
|
||||
public static function cristal($id, $niveau, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$cristal = ceil(pow(1.5, $niveau)*17);
|
||||
break;
|
||||
case 1:
|
||||
$cristal = ceil(pow(1.6, $niveau)*27);
|
||||
break;
|
||||
case 2:
|
||||
$cristal = ceil(pow(1.5, $niveau)*72);
|
||||
break;
|
||||
case 3:
|
||||
$cristal = ceil(pow(1.5, $niveau)*37);
|
||||
break;
|
||||
case 4:
|
||||
//$cristal = ceil(pow(1.73, $niveau)*420);
|
||||
$cristal = ceil(pow(3, $niveau)*3000);
|
||||
break;
|
||||
case 5:
|
||||
$cristal = ceil(pow(2, $niveau)*500);
|
||||
break;
|
||||
case 6:
|
||||
$cristal = ceil(pow(2, $niveau)*150);
|
||||
break;
|
||||
case 7:
|
||||
$cristal = ceil(pow(2, $niveau)*380);
|
||||
break;
|
||||
case 8:
|
||||
$cristal = ceil(pow(2, $niveau)*450);
|
||||
break;
|
||||
case 9:
|
||||
$cristal = ceil(pow(2, $niveau)*100);
|
||||
break;
|
||||
case 10:
|
||||
$cristal = ceil(pow(2, $niveau)*260);
|
||||
break;
|
||||
case 11:
|
||||
$cristal = ceil(pow(1.7, $niveau)*420);
|
||||
break;
|
||||
public static function cristal($id, $niveau, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$cristal = ceil(pow(1.5, $niveau)*17);
|
||||
break;
|
||||
case 1:
|
||||
$cristal = ceil(pow(1.6, $niveau)*27);
|
||||
break;
|
||||
case 2:
|
||||
$cristal = ceil(pow(1.5, $niveau)*72);
|
||||
break;
|
||||
case 3:
|
||||
$cristal = ceil(pow(1.5, $niveau)*37);
|
||||
break;
|
||||
case 4:
|
||||
//$cristal = ceil(pow(1.73, $niveau)*420);
|
||||
$cristal = ceil(pow(3, $niveau)*3000);
|
||||
break;
|
||||
case 5:
|
||||
$cristal = ceil(pow(2, $niveau)*500);
|
||||
break;
|
||||
case 6:
|
||||
$cristal = ceil(pow(2, $niveau)*150);
|
||||
break;
|
||||
case 7:
|
||||
$cristal = ceil(pow(2, $niveau)*380);
|
||||
break;
|
||||
case 8:
|
||||
$cristal = ceil(pow(2, $niveau)*450);
|
||||
break;
|
||||
case 9:
|
||||
$cristal = ceil(pow(2, $niveau)*100);
|
||||
break;
|
||||
case 10:
|
||||
$cristal = ceil(pow(2, $niveau)*260);
|
||||
break;
|
||||
case 11:
|
||||
$cristal = ceil(pow(1.7, $niveau)*420);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
$cristal = ceil(pow($niveau, 1.8)*1000+1000);
|
||||
break;
|
||||
case 13:
|
||||
$cristal = ceil(pow($niveau,2.5)*1000+149000);
|
||||
break;
|
||||
case 14:
|
||||
$cristal = ceil(pow($niveau, 2)*900+99000);
|
||||
break;
|
||||
case 15:
|
||||
$cristal = ceil(pow($niveau, 2)*750+65000);
|
||||
break;
|
||||
case 16:
|
||||
$cristal = ceil(pow($niveau, 2)*650+50000);
|
||||
break;
|
||||
case 17:
|
||||
$cristal = ceil(pow($niveau, 2.4)*400-250);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
case 12:
|
||||
$cristal = ceil(pow($niveau, 1.8)*1000+1000);
|
||||
break;
|
||||
case 13:
|
||||
$cristal = ceil(pow($niveau, 2.5)*1000+149000);
|
||||
break;
|
||||
case 14:
|
||||
$cristal = ceil(pow($niveau, 2)*900+99000);
|
||||
break;
|
||||
case 15:
|
||||
$cristal = ceil(pow($niveau, 2)*750+65000);
|
||||
break;
|
||||
case 16:
|
||||
$cristal = ceil(pow($niveau, 2)*650+50000);
|
||||
break;
|
||||
case 17:
|
||||
$cristal = ceil(pow($niveau, 2.4)*400-250);
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
//Bonus technologique pour les mines
|
||||
if ($id <= 3)
|
||||
{
|
||||
if ($planete->technologies[0] &262144)
|
||||
{
|
||||
$cristal *= 0.85;
|
||||
}
|
||||
elseif ($planete->technologies[0] &131072)
|
||||
{
|
||||
$cristal *= 0.9;
|
||||
}
|
||||
elseif ($planete->technologies[0] &65536)
|
||||
{
|
||||
$cristal *= 0.95;
|
||||
}
|
||||
}
|
||||
//On tient compte des bonus
|
||||
//Bonus technologique pour les mines
|
||||
if ($id <= 3) {
|
||||
if ($planete->technologies[0] &262144) {
|
||||
$cristal *= 0.85;
|
||||
} elseif ($planete->technologies[0] &131072) {
|
||||
$cristal *= 0.9;
|
||||
} elseif ($planete->technologies[0] &65536) {
|
||||
$cristal *= 0.95;
|
||||
}
|
||||
}
|
||||
|
||||
return $cristal;
|
||||
}
|
||||
return $cristal;
|
||||
}
|
||||
|
||||
public static function hydrogene($id, $niveau, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 1:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 2:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 3:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 4:
|
||||
//$hydrogene = ceil(pow(1.68, $niveau)*285);
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 5:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 6:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 7:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 8:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 9:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 10:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 11:
|
||||
$hydrogene = ceil(pow(1.7, $niveau)*100);
|
||||
break;
|
||||
public static function hydrogene($id, $niveau, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 1:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 2:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 3:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 4:
|
||||
//$hydrogene = ceil(pow(1.68, $niveau)*285);
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 5:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 6:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 7:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 8:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 9:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 10:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 11:
|
||||
$hydrogene = ceil(pow(1.7, $niveau)*100);
|
||||
break;
|
||||
|
||||
case 12:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 13:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 14:
|
||||
$hydrogene = ceil(pow($niveau, 2)*500+30000);
|
||||
break;
|
||||
case 15:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 16:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 17:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
case 12:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 13:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 14:
|
||||
$hydrogene = ceil(pow($niveau, 2)*500+30000);
|
||||
break;
|
||||
case 15:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 16:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 17:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
//Bonus technologique pour les mines
|
||||
if ($id <= 3)
|
||||
{
|
||||
if ($planete->technologies[0] &262144)
|
||||
{
|
||||
$hydrogene *= 0.85;
|
||||
}
|
||||
elseif ($planete->technologies[0] &131072)
|
||||
{
|
||||
$hydrogene *= 0.9;
|
||||
}
|
||||
elseif ($planete->technologies[0] &65536)
|
||||
{
|
||||
$hydrogene *= 0.95;
|
||||
}
|
||||
}
|
||||
//On tient compte des bonus
|
||||
//Bonus technologique pour les mines
|
||||
if ($id <= 3) {
|
||||
if ($planete->technologies[0] &262144) {
|
||||
$hydrogene *= 0.85;
|
||||
} elseif ($planete->technologies[0] &131072) {
|
||||
$hydrogene *= 0.9;
|
||||
} elseif ($planete->technologies[0] &65536) {
|
||||
$hydrogene *= 0.95;
|
||||
}
|
||||
}
|
||||
|
||||
return $hydrogene;
|
||||
}
|
||||
return $hydrogene;
|
||||
}
|
||||
|
||||
public static function credits($id, $niveau, surface $planete)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public static function credits($id, $niveau, surface $planete)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function temps($id, $niveau, surface $planete, $demolition = false)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$sec = pow(1.5, $niveau)*6;
|
||||
break;
|
||||
case 1:
|
||||
$sec = pow(1.55, $niveau)*6;
|
||||
break;
|
||||
case 2:
|
||||
$sec = pow(1.624, $niveau)*6;
|
||||
break;
|
||||
case 3:
|
||||
$sec = pow(1.597, $niveau)*6;
|
||||
break;
|
||||
case 4:
|
||||
$sec = pow(1.7, $niveau)*6;
|
||||
break;
|
||||
case 5:
|
||||
$sec = ceil(pow(2, $niveau)*720);
|
||||
break;
|
||||
case 6:
|
||||
$sec = ceil(pow(2, $niveau)*720);
|
||||
break;
|
||||
case 7:
|
||||
$sec = ceil(pow(2, $niveau)*420);
|
||||
break;
|
||||
case 8:
|
||||
$sec = ceil(pow(2, $niveau)*600);
|
||||
break;
|
||||
case 9:
|
||||
$sec = ceil(pow(2, $niveau)*300);
|
||||
break;
|
||||
case 10:
|
||||
$sec = ceil(pow(2, $niveau)*1200);
|
||||
break;
|
||||
case 11:
|
||||
$sec = ceil((pow(1.9, $niveau)*800));
|
||||
break;
|
||||
public static function temps($id, $niveau, surface $planete, $demolition = false)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$sec = pow(1.5, $niveau)*6;
|
||||
break;
|
||||
case 1:
|
||||
$sec = pow(1.55, $niveau)*6;
|
||||
break;
|
||||
case 2:
|
||||
$sec = pow(1.624, $niveau)*6;
|
||||
break;
|
||||
case 3:
|
||||
$sec = pow(1.597, $niveau)*6;
|
||||
break;
|
||||
case 4:
|
||||
$sec = pow(1.7, $niveau)*6;
|
||||
break;
|
||||
case 5:
|
||||
$sec = ceil(pow(2, $niveau)*720);
|
||||
break;
|
||||
case 6:
|
||||
$sec = ceil(pow(2, $niveau)*720);
|
||||
break;
|
||||
case 7:
|
||||
$sec = ceil(pow(2, $niveau)*420);
|
||||
break;
|
||||
case 8:
|
||||
$sec = ceil(pow(2, $niveau)*600);
|
||||
break;
|
||||
case 9:
|
||||
$sec = ceil(pow(2, $niveau)*300);
|
||||
break;
|
||||
case 10:
|
||||
$sec = ceil(pow(2, $niveau)*1200);
|
||||
break;
|
||||
case 11:
|
||||
$sec = ceil((pow(1.9, $niveau)*800));
|
||||
break;
|
||||
|
||||
case 12:
|
||||
$sec = ceil(pow($niveau, 2.5)*60+4)*60;
|
||||
break;
|
||||
case 13:
|
||||
$sec = ceil(pow($niveau, 1.6)*60+60)*60;
|
||||
break;
|
||||
case 14:
|
||||
$sec = ceil(pow($niveau, 2)*5+3)*60;
|
||||
break;
|
||||
case 15:
|
||||
$sec = pow($niveau, 2)*240;
|
||||
break;
|
||||
case 16:
|
||||
$sec = pow($niveau, 2)*180;
|
||||
break;
|
||||
case 17:
|
||||
$sec = pow($niveau, 1.65)*3600;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
case 12:
|
||||
$sec = ceil(pow($niveau, 2.5)*60+4)*60;
|
||||
break;
|
||||
case 13:
|
||||
$sec = ceil(pow($niveau, 1.6)*60+60)*60;
|
||||
break;
|
||||
case 14:
|
||||
$sec = ceil(pow($niveau, 2)*5+3)*60;
|
||||
break;
|
||||
case 15:
|
||||
$sec = pow($niveau, 2)*240;
|
||||
break;
|
||||
case 16:
|
||||
$sec = pow($niveau, 2)*180;
|
||||
break;
|
||||
case 17:
|
||||
$sec = pow($niveau, 1.65)*3600;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Batiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On applique le bonus de temps des ingénieurs et des centrales informatiques
|
||||
if ($id == 11 && $planete->casernes[7])
|
||||
$sec /= (1.0025 * $planete->casernes[7]);
|
||||
elseif ($id != 11 && ($planete->casernes[7] || $planete->batiments[11]))
|
||||
$sec /= (pow(1.23, $planete->batiments[11]) + 1.0025 * $planete->casernes[7]);
|
||||
//On applique le bonus de temps des ingénieurs et des centrales informatiques
|
||||
if ($id == 11 && $planete->casernes[7]) {
|
||||
$sec /= (1.0025 * $planete->casernes[7]);
|
||||
} elseif ($id != 11 && ($planete->casernes[7] || $planete->batiments[11])) {
|
||||
$sec /= (pow(1.23, $planete->batiments[11]) + 1.0025 * $planete->casernes[7]);
|
||||
}
|
||||
|
||||
//Accélération du temps de construction
|
||||
$sec /= VITESSE;
|
||||
//Accélération du temps de construction
|
||||
$sec /= VITESSE;
|
||||
|
||||
if ($demolition)
|
||||
return $sec * Donnees::coeff_demolition;
|
||||
else
|
||||
return $sec;
|
||||
}
|
||||
if ($demolition) {
|
||||
return $sec * Donnees::coeff_demolition;
|
||||
} else {
|
||||
return $sec;
|
||||
}
|
||||
}
|
||||
|
||||
public static function type($id)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
return 1;
|
||||
case 6:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
return 2;
|
||||
case 5:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
return 4;
|
||||
return 6;
|
||||
default:
|
||||
trigger_error("Bâtiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
public static function type($id)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
return 1;
|
||||
case 6:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
return 2;
|
||||
case 5:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
return 4;
|
||||
return 6;
|
||||
default:
|
||||
trigger_error("Bâtiment ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function image($id, surface $planete)
|
||||
{
|
||||
if ($planete->race == "covenant")
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
return "batimentcovieux4.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "cristaloo3.png";
|
||||
break;
|
||||
case 2:
|
||||
return "powersupplycoviejq1.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "solaire.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "sanstitrevi7.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "oeilduprophetewj6.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "covielabocn5.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "chantierterrestrehg1.jpg";
|
||||
break;
|
||||
case 8:
|
||||
return "sanstitretruecolor09zn6.jpg";
|
||||
break;
|
||||
case 9:
|
||||
return "caserncov0ry.jpg";
|
||||
break;
|
||||
case 10:
|
||||
return "stockagebasement1cs10bl.jpg";
|
||||
break;
|
||||
case 11:
|
||||
return "ordianteur_hologramme.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_covenant_default;
|
||||
}
|
||||
elseif ($planete->race == "humain")
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
return "mine_m.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "mine_c.png";
|
||||
break;
|
||||
case 2:
|
||||
return "synchroniseur.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "centrale solaire.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "centrale electrique.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "baseradardl3.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "recherches.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "chantierterrestrecopybj8.jpg";
|
||||
break;
|
||||
case 8:
|
||||
return "chantier spatial.jpg";
|
||||
break;
|
||||
case 9:
|
||||
return "ecole militaire.jpg";
|
||||
break;
|
||||
case 10:
|
||||
return "stockage.jpg";
|
||||
break;
|
||||
case 11:
|
||||
return "search0yp.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_humain_default;
|
||||
}
|
||||
else
|
||||
trigger_error("Impossible de trouver la race pour ".$planete->race, E_USER_ERROR);
|
||||
}
|
||||
public static function image($id, surface $planete)
|
||||
{
|
||||
if ($planete->race == "covenant") {
|
||||
switch ($id) {
|
||||
case 0:
|
||||
return "batimentcovieux4.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "cristaloo3.png";
|
||||
break;
|
||||
case 2:
|
||||
return "powersupplycoviejq1.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "solaire.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "sanstitrevi7.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "oeilduprophetewj6.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "covielabocn5.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "chantierterrestrehg1.jpg";
|
||||
break;
|
||||
case 8:
|
||||
return "sanstitretruecolor09zn6.jpg";
|
||||
break;
|
||||
case 9:
|
||||
return "caserncov0ry.jpg";
|
||||
break;
|
||||
case 10:
|
||||
return "stockagebasement1cs10bl.jpg";
|
||||
break;
|
||||
case 11:
|
||||
return "ordianteur_hologramme.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_covenant_default;
|
||||
} elseif ($planete->race == "humain") {
|
||||
switch ($id) {
|
||||
case 0:
|
||||
return "mine_m.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "mine_c.png";
|
||||
break;
|
||||
case 2:
|
||||
return "synchroniseur.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "centrale solaire.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "centrale electrique.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "baseradardl3.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "recherches.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "chantierterrestrecopybj8.jpg";
|
||||
break;
|
||||
case 8:
|
||||
return "chantier spatial.jpg";
|
||||
break;
|
||||
case 9:
|
||||
return "ecole militaire.jpg";
|
||||
break;
|
||||
case 10:
|
||||
return "stockage.jpg";
|
||||
break;
|
||||
case 11:
|
||||
return "search0yp.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_humain_default;
|
||||
} else {
|
||||
trigger_error("Impossible de trouver la race pour ".$planete->race, E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function needed($id, surface $planete, $print = false)
|
||||
{
|
||||
$neededBatiments =
|
||||
array (
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
array(
|
||||
array("batiments", 3, 12),
|
||||
array("batiments_max", 4, 4)
|
||||
),
|
||||
0,
|
||||
0,
|
||||
array(
|
||||
array("technologies", 2,3)
|
||||
),
|
||||
array(
|
||||
array("technologies", 2,4)
|
||||
),
|
||||
0,
|
||||
0,
|
||||
array(
|
||||
array("technologies", 1,12)
|
||||
),
|
||||
0,
|
||||
array(
|
||||
array("technologies", 3,8)
|
||||
),
|
||||
array(
|
||||
array("technologies", 7,12)
|
||||
),
|
||||
array(
|
||||
array("technologies", 3,6)
|
||||
),
|
||||
array(
|
||||
array("technologies", 3,7)
|
||||
),
|
||||
0
|
||||
);
|
||||
public static function needed($id, surface $planete, $print = false)
|
||||
{
|
||||
$neededBatiments =
|
||||
array(
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
array(
|
||||
array("batiments", 3, 12),
|
||||
array("batiments_max", 4, 4)
|
||||
),
|
||||
0,
|
||||
0,
|
||||
array(
|
||||
array("technologies", 2,3)
|
||||
),
|
||||
array(
|
||||
array("technologies", 2,4)
|
||||
),
|
||||
0,
|
||||
0,
|
||||
array(
|
||||
array("technologies", 1,12)
|
||||
),
|
||||
0,
|
||||
array(
|
||||
array("technologies", 3,8)
|
||||
),
|
||||
array(
|
||||
array("technologies", 7,12)
|
||||
),
|
||||
array(
|
||||
array("technologies", 3,6)
|
||||
),
|
||||
array(
|
||||
array("technologies", 3,7)
|
||||
),
|
||||
0
|
||||
);
|
||||
|
||||
if ($print)
|
||||
return dDonnees::print_neededCheck($neededBatiments[$id], $planete);
|
||||
else
|
||||
return dDonnees::neededCheck($neededBatiments[$id], $planete);
|
||||
}
|
||||
if ($print) {
|
||||
return dDonnees::print_neededCheck($neededBatiments[$id], $planete);
|
||||
} else {
|
||||
return dDonnees::neededCheck($neededBatiments[$id], $planete);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -3,299 +3,293 @@ require_once("Class/Donnees/interface.php");
|
|||
|
||||
class dCaserne implements Donnees
|
||||
{
|
||||
public static function metal($id, $nombre, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$metal = 80;
|
||||
break;
|
||||
case 1:
|
||||
$metal = 110;
|
||||
break;
|
||||
case 2:
|
||||
$metal = 150;
|
||||
break;
|
||||
case 3:
|
||||
$metal = 220;
|
||||
break;
|
||||
case 4:
|
||||
$metal = 180;
|
||||
break;
|
||||
case 5:
|
||||
$metal = 25000;
|
||||
break;
|
||||
case 6:
|
||||
$metal = 100;
|
||||
break;
|
||||
case 7:
|
||||
$metal = 90;
|
||||
break;
|
||||
case 8:
|
||||
$metal = 300;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function metal($id, $nombre, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$metal = 80;
|
||||
break;
|
||||
case 1:
|
||||
$metal = 110;
|
||||
break;
|
||||
case 2:
|
||||
$metal = 150;
|
||||
break;
|
||||
case 3:
|
||||
$metal = 220;
|
||||
break;
|
||||
case 4:
|
||||
$metal = 180;
|
||||
break;
|
||||
case 5:
|
||||
$metal = 25000;
|
||||
break;
|
||||
case 6:
|
||||
$metal = 100;
|
||||
break;
|
||||
case 7:
|
||||
$metal = 90;
|
||||
break;
|
||||
case 8:
|
||||
$metal = 300;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1)
|
||||
$metal *= 0.9;
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1) {
|
||||
$metal *= 0.9;
|
||||
}
|
||||
|
||||
return $metal * $nombre;
|
||||
}
|
||||
return $metal * $nombre;
|
||||
}
|
||||
|
||||
public static function cristal($id, $nombre, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$cristal = 45;
|
||||
break;
|
||||
case 1:
|
||||
$cristal = 90;
|
||||
break;
|
||||
case 2:
|
||||
$cristal = 105;
|
||||
break;
|
||||
case 3:
|
||||
$cristal = 150;
|
||||
break;
|
||||
case 4:
|
||||
$cristal = 100;
|
||||
break;
|
||||
case 5:
|
||||
$cristal = 10000;
|
||||
break;
|
||||
case 6:
|
||||
$cristal = 100;
|
||||
break;
|
||||
case 7:
|
||||
$cristal = 105;
|
||||
break;
|
||||
case 8:
|
||||
$cristal = 250;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function cristal($id, $nombre, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$cristal = 45;
|
||||
break;
|
||||
case 1:
|
||||
$cristal = 90;
|
||||
break;
|
||||
case 2:
|
||||
$cristal = 105;
|
||||
break;
|
||||
case 3:
|
||||
$cristal = 150;
|
||||
break;
|
||||
case 4:
|
||||
$cristal = 100;
|
||||
break;
|
||||
case 5:
|
||||
$cristal = 10000;
|
||||
break;
|
||||
case 6:
|
||||
$cristal = 100;
|
||||
break;
|
||||
case 7:
|
||||
$cristal = 105;
|
||||
break;
|
||||
case 8:
|
||||
$cristal = 250;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1)
|
||||
$cristal *= 0.9;
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1) {
|
||||
$cristal *= 0.9;
|
||||
}
|
||||
|
||||
return $cristal * $nombre;
|
||||
}
|
||||
return $cristal * $nombre;
|
||||
}
|
||||
|
||||
public static function hydrogene($id, $nombre, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 1:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 2:
|
||||
$hydrogene = 20;
|
||||
break;
|
||||
case 3:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 4:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 5:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 6:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 7:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 8:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function hydrogene($id, $nombre, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 1:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 2:
|
||||
$hydrogene = 20;
|
||||
break;
|
||||
case 3:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 4:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 5:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 6:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 7:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 8:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1)
|
||||
$hydrogene *= 0.9;
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1) {
|
||||
$hydrogene *= 0.9;
|
||||
}
|
||||
|
||||
return $hydrogene * $nombre;
|
||||
}
|
||||
return $hydrogene * $nombre;
|
||||
}
|
||||
|
||||
public static function credits($id, $nombre, surface $planete)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public static function credits($id, $nombre, surface $planete)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function temps($id, $nombre, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$temps = 60;
|
||||
$moins = 1;
|
||||
break;
|
||||
case 1:
|
||||
$temps = 240;
|
||||
$moins = 2;
|
||||
break;
|
||||
case 2:
|
||||
$temps = 240;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 3:
|
||||
$temps = 720;
|
||||
$moins = 5;
|
||||
break;
|
||||
case 4:
|
||||
$temps = 300;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 5:
|
||||
$temps = 29700;
|
||||
$moins = 10;
|
||||
break;
|
||||
case 6:
|
||||
$temps = 90;
|
||||
$moins = 2;
|
||||
break;
|
||||
case 7:
|
||||
$temps = 90;
|
||||
$moins = 2;
|
||||
break;
|
||||
case 8:
|
||||
$temps = 900;
|
||||
$moins = 5;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function temps($id, $nombre, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$temps = 60;
|
||||
$moins = 1;
|
||||
break;
|
||||
case 1:
|
||||
$temps = 240;
|
||||
$moins = 2;
|
||||
break;
|
||||
case 2:
|
||||
$temps = 240;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 3:
|
||||
$temps = 720;
|
||||
$moins = 5;
|
||||
break;
|
||||
case 4:
|
||||
$temps = 300;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 5:
|
||||
$temps = 29700;
|
||||
$moins = 10;
|
||||
break;
|
||||
case 6:
|
||||
$temps = 90;
|
||||
$moins = 2;
|
||||
break;
|
||||
case 7:
|
||||
$temps = 90;
|
||||
$moins = 2;
|
||||
break;
|
||||
case 8:
|
||||
$temps = 900;
|
||||
$moins = 5;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte de la vitesse
|
||||
$temps /= VITESSE;
|
||||
//On tient compte de la vitesse
|
||||
$temps /= VITESSE;
|
||||
|
||||
//On tient compte des bonus
|
||||
return ceil($temps/pow(1.25, ($planete->batiments[9] - $moins))) * $nombre;
|
||||
}
|
||||
//On tient compte des bonus
|
||||
return ceil($temps/pow(1.25, ($planete->batiments[9] - $moins))) * $nombre;
|
||||
}
|
||||
|
||||
|
||||
public static function image($id, surface $planete)
|
||||
{
|
||||
if ($planete->race == "covenant")
|
||||
{
|
||||
array('','','','','','','','','');
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
return "grunt1.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "jackal.jpg";
|
||||
break;
|
||||
case 2:
|
||||
return "94990342wb4.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "98004530fx3.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "88091275ja8.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "hunter1.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "81770345oo4.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "88218731ts1.jpg";
|
||||
break;
|
||||
case 8:
|
||||
return "72188202fg9.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_covenant_default;
|
||||
}
|
||||
elseif ($planete->race == "humain")
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
return "marines.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "marinehf0.jpg";
|
||||
break;
|
||||
case 2:
|
||||
return "grenadier.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "TCAO2.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "sniper.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "spartan.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "ingenieurs.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "exosquelettehbpb2.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_humain_default;
|
||||
}
|
||||
else
|
||||
trigger_error("Impossible de trouver la race pour ".$planete->race, E_USER_ERROR);
|
||||
}
|
||||
public static function image($id, surface $planete)
|
||||
{
|
||||
if ($planete->race == "covenant") {
|
||||
array('','','','','','','','','');
|
||||
switch ($id) {
|
||||
case 0:
|
||||
return "grunt1.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "jackal.jpg";
|
||||
break;
|
||||
case 2:
|
||||
return "94990342wb4.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "98004530fx3.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "88091275ja8.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "hunter1.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "81770345oo4.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "88218731ts1.jpg";
|
||||
break;
|
||||
case 8:
|
||||
return "72188202fg9.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_covenant_default;
|
||||
} elseif ($planete->race == "humain") {
|
||||
switch ($id) {
|
||||
case 0:
|
||||
return "marines.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "marinehf0.jpg";
|
||||
break;
|
||||
case 2:
|
||||
return "grenadier.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "TCAO2.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "sniper.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "spartan.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "ingenieurs.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "exosquelettehbpb2.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_humain_default;
|
||||
} else {
|
||||
trigger_error("Impossible de trouver la race pour ".$planete->race, E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function needed($id, surface $planete, $print = false)
|
||||
{
|
||||
$neededCaserne =
|
||||
array(
|
||||
array(
|
||||
array('batiments', 9, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 5)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 10)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 5)
|
||||
)
|
||||
);
|
||||
public static function needed($id, surface $planete, $print = false)
|
||||
{
|
||||
$neededCaserne =
|
||||
array(
|
||||
array(
|
||||
array('batiments', 9, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 5)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 10)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 9, 5)
|
||||
)
|
||||
);
|
||||
|
||||
if ($print)
|
||||
return dDonnees::print_neededCheck($neededCaserne[$id], $planete);
|
||||
else
|
||||
return dDonnees::neededCheck($neededCaserne[$id], $planete);
|
||||
}
|
||||
if ($print) {
|
||||
return dDonnees::print_neededCheck($neededCaserne[$id], $planete);
|
||||
} else {
|
||||
return dDonnees::neededCheck($neededCaserne[$id], $planete);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,202 +1,217 @@
|
|||
<?php
|
||||
if(!defined('ONYX')) exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
interface Donnees
|
||||
{
|
||||
const image_covenant_default = "../covenant_na.jpg";
|
||||
const image_humain_default = "../humain_na.jpg";
|
||||
const image_covenant_default = "../covenant_na.jpg";
|
||||
const image_humain_default = "../humain_na.jpg";
|
||||
|
||||
const coeff_demolition = 0.6;
|
||||
const coeff_demolition = 0.6;
|
||||
|
||||
public static function metal($id, $niveau, surface $planete);
|
||||
public static function cristal($id, $niveau, surface $planete);
|
||||
public static function hydrogene($id, $niveau, surface $planete);
|
||||
public static function credits($id, $niveau, surface $planete);
|
||||
public static function temps($id, $niveau, surface $planete);
|
||||
public static function metal($id, $niveau, surface $planete);
|
||||
public static function cristal($id, $niveau, surface $planete);
|
||||
public static function hydrogene($id, $niveau, surface $planete);
|
||||
public static function credits($id, $niveau, surface $planete);
|
||||
public static function temps($id, $niveau, surface $planete);
|
||||
|
||||
public static function image($id, surface $planete);
|
||||
public static function image($id, surface $planete);
|
||||
|
||||
public static function needed($id, surface $planete, $print = false);
|
||||
public static function needed($id, surface $planete, $print = false);
|
||||
}
|
||||
|
||||
class dDonnees{
|
||||
static function tailleFile(surface $planete)
|
||||
{
|
||||
//On calcul la taille maximale de la file d'attente
|
||||
if (!empty($planete->technologies[1]))
|
||||
{
|
||||
if (($planete->technologies[1] &131072) == 131072) return 5;
|
||||
elseif (($planete->technologies[1] &65536) == 65536) return 4;
|
||||
elseif (($planete->technologies[1] &32768) == 32768) return 3;
|
||||
else return 2;
|
||||
}
|
||||
else return 3; //Au cas où il n'y ait pas de technologie sur le lieu, on fixe la taille de la file d'attente
|
||||
}
|
||||
class dDonnees
|
||||
{
|
||||
public static function tailleFile(surface $planete)
|
||||
{
|
||||
//On calcul la taille maximale de la file d'attente
|
||||
if (!empty($planete->technologies[1])) {
|
||||
if (($planete->technologies[1] &131072) == 131072) {
|
||||
return 5;
|
||||
} elseif (($planete->technologies[1] &65536) == 65536) {
|
||||
return 4;
|
||||
} elseif (($planete->technologies[1] &32768) == 32768) {
|
||||
return 3;
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
} else {
|
||||
return 3;
|
||||
} //Au cas où il n'y ait pas de technologie sur le lieu, on fixe la taille de la file d'attente
|
||||
}
|
||||
|
||||
|
||||
static function neededCheck($tableau, surface $planete)
|
||||
{
|
||||
if (!is_array($tableau)) return true;
|
||||
else
|
||||
{
|
||||
foreach ($tableau as $need)
|
||||
{
|
||||
switch($need[0])
|
||||
{
|
||||
case 'batiments':
|
||||
if (get_class($planete) == "Planete" && $planete->batiments[$need[1]] < $need[2])
|
||||
return false;
|
||||
break;
|
||||
case 'batiments_max':
|
||||
if (get_class($planete) == "Planete" && $planete->batiments[$need[1]] > $need[2])
|
||||
return false;
|
||||
break;
|
||||
case 'technologies':
|
||||
if (((int)$planete->technologies[$need[1]]& dTechnologies::idToBit($need[2])) == 0)
|
||||
return false;
|
||||
break;
|
||||
case 'casernes':
|
||||
if ($planete->casernes[$need[1]] < $need[2])
|
||||
return false;
|
||||
break;
|
||||
case 'terrestres':
|
||||
if ($planete->terrestres[$need[1]] < $need[2])
|
||||
return false;
|
||||
break;
|
||||
case 'vaisseaux':
|
||||
if ($planete->vaisseaux[$need[1]] < $need[2])
|
||||
return false;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
public static function neededCheck($tableau, surface $planete)
|
||||
{
|
||||
if (!is_array($tableau)) {
|
||||
return true;
|
||||
} else {
|
||||
foreach ($tableau as $need) {
|
||||
switch ($need[0]) {
|
||||
case 'batiments':
|
||||
if (get_class($planete) == "Planete" && $planete->batiments[$need[1]] < $need[2]) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'batiments_max':
|
||||
if (get_class($planete) == "Planete" && $planete->batiments[$need[1]] > $need[2]) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'technologies':
|
||||
if (((int)$planete->technologies[$need[1]]& dTechnologies::idToBit($need[2])) == 0) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'casernes':
|
||||
if ($planete->casernes[$need[1]] < $need[2]) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'terrestres':
|
||||
if ($planete->terrestres[$need[1]] < $need[2]) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case 'vaisseaux':
|
||||
if ($planete->vaisseaux[$need[1]] < $need[2]) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
static function print_neededCheck($tableau, surface $planete)
|
||||
{
|
||||
global $LANG;
|
||||
$race = $planete->race;
|
||||
if (!is_array($tableau)) return 'Débloqué';
|
||||
else
|
||||
{
|
||||
$return = '';
|
||||
foreach ($tableau as $need)
|
||||
{
|
||||
switch($need[0])
|
||||
{
|
||||
case 'batiments':
|
||||
if ($planete->batiments[$need[1]] < $need[2])
|
||||
$return .= '<span class="lack">'.ucfirst($LANG[$race]["batiments"]["noms_sing"][$need[1]]).' niveau '.$need[2].' (batiment)</span><br />';
|
||||
else
|
||||
$return .= ucfirst($LANG[$race]["batiments"]["noms_sing"][$need[1]]).' niveau '.$need[2].' (batiment)<br />';
|
||||
break;
|
||||
case 'batiments_max':
|
||||
if ($planete->batiments[$need[1]] > $need[2])
|
||||
$return .= '<span class="lack">'.ucfirst($LANG[$race]["batiments"]["noms_sing"][$need[1]]).' < niveau '.($need[2]+1).' (batiment)</span><br />';
|
||||
else
|
||||
$return .= ucfirst($LANG[$race]["batiments"]["noms_sing"][$need[1]]).' < niveau '.($need[2]+1).' (batiment)<br />';
|
||||
break;
|
||||
case 'technologies':
|
||||
if (((int)$planete->technologies[$need[1]]& dTechnologies::idToBit($need[2])) == 0)
|
||||
$return .= '<span class="lack">'.$LANG[$race]["technologies"]["noms_sing"][$need[1]][$need[2]].' (technologie)</span><br />';
|
||||
else
|
||||
$return .= $LANG[$race]["technologies"]["noms_sing"][$need[1]][$need[2]].' (technologie)<br />';
|
||||
break;
|
||||
case 'casernes':
|
||||
if ($planete->casernes[$need[1]] < $need[2])
|
||||
$return .= '<span class="lack">'.$need[2].' '.$LANG[$race]["caserne"]["noms_pluriel"][$need[1]].' (unité de la caserne)</span><br />';
|
||||
else
|
||||
$return .= $need[2].' '.$LANG[$race]["caserne"]["noms_pluriel"][$need[1]].' (unité de la caserne)<br />';
|
||||
break;
|
||||
case 'terrestres':
|
||||
if ($planete->terrestres[$need[1]] < $need[2])
|
||||
$return .= '<span class="lack">'.$need[2].' '.$LANG[$race]["terrestre"]["noms_pluriel"][$need[1]].' (unité du chantier terrestre)</span><br />';
|
||||
else
|
||||
$return .= $need[2].' '.$LANG[$race]["terrestre"]["noms_pluriel"][$need[1]].' (unité du chantier terrestre)<br />';
|
||||
break;
|
||||
case 'vaisseaux':
|
||||
if ($planete->vaisseaux[$need[1]] < $need[2])
|
||||
$return .= '<span class="lack">'.$need[2].' '.$LANG[$race]["vaisseaux"]["noms_pluriel"][$need[1]].' (unité du chantier spatial)</span><br />';
|
||||
else
|
||||
$return .= $need[2].' '.$LANG[$race]["vaisseaux"]["noms_pluriel"][$need[1]].' (unité du chantier spatial)<br />';
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
public static function print_neededCheck($tableau, surface $planete)
|
||||
{
|
||||
global $LANG;
|
||||
$race = $planete->race;
|
||||
if (!is_array($tableau)) {
|
||||
return 'Débloqué';
|
||||
} else {
|
||||
$return = '';
|
||||
foreach ($tableau as $need) {
|
||||
switch ($need[0]) {
|
||||
case 'batiments':
|
||||
if ($planete->batiments[$need[1]] < $need[2]) {
|
||||
$return .= '<span class="lack">'.ucfirst($LANG[$race]["batiments"]["noms_sing"][$need[1]]).' niveau '.$need[2].' (batiment)</span><br />';
|
||||
} else {
|
||||
$return .= ucfirst($LANG[$race]["batiments"]["noms_sing"][$need[1]]).' niveau '.$need[2].' (batiment)<br />';
|
||||
}
|
||||
break;
|
||||
case 'batiments_max':
|
||||
if ($planete->batiments[$need[1]] > $need[2]) {
|
||||
$return .= '<span class="lack">'.ucfirst($LANG[$race]["batiments"]["noms_sing"][$need[1]]).' < niveau '.($need[2]+1).' (batiment)</span><br />';
|
||||
} else {
|
||||
$return .= ucfirst($LANG[$race]["batiments"]["noms_sing"][$need[1]]).' < niveau '.($need[2]+1).' (batiment)<br />';
|
||||
}
|
||||
break;
|
||||
case 'technologies':
|
||||
if (((int)$planete->technologies[$need[1]]& dTechnologies::idToBit($need[2])) == 0) {
|
||||
$return .= '<span class="lack">'.$LANG[$race]["technologies"]["noms_sing"][$need[1]][$need[2]].' (technologie)</span><br />';
|
||||
} else {
|
||||
$return .= $LANG[$race]["technologies"]["noms_sing"][$need[1]][$need[2]].' (technologie)<br />';
|
||||
}
|
||||
break;
|
||||
case 'casernes':
|
||||
if ($planete->casernes[$need[1]] < $need[2]) {
|
||||
$return .= '<span class="lack">'.$need[2].' '.$LANG[$race]["caserne"]["noms_pluriel"][$need[1]].' (unité de la caserne)</span><br />';
|
||||
} else {
|
||||
$return .= $need[2].' '.$LANG[$race]["caserne"]["noms_pluriel"][$need[1]].' (unité de la caserne)<br />';
|
||||
}
|
||||
break;
|
||||
case 'terrestres':
|
||||
if ($planete->terrestres[$need[1]] < $need[2]) {
|
||||
$return .= '<span class="lack">'.$need[2].' '.$LANG[$race]["terrestre"]["noms_pluriel"][$need[1]].' (unité du chantier terrestre)</span><br />';
|
||||
} else {
|
||||
$return .= $need[2].' '.$LANG[$race]["terrestre"]["noms_pluriel"][$need[1]].' (unité du chantier terrestre)<br />';
|
||||
}
|
||||
break;
|
||||
case 'vaisseaux':
|
||||
if ($planete->vaisseaux[$need[1]] < $need[2]) {
|
||||
$return .= '<span class="lack">'.$need[2].' '.$LANG[$race]["vaisseaux"]["noms_pluriel"][$need[1]].' (unité du chantier spatial)</span><br />';
|
||||
} else {
|
||||
$return .= $need[2].' '.$LANG[$race]["vaisseaux"]["noms_pluriel"][$need[1]].' (unité du chantier spatial)<br />';
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
}
|
||||
|
||||
static function nameVAR($name)
|
||||
{
|
||||
if ($name == "alli_batiments")
|
||||
return "alli_batiments";
|
||||
elseif ($name == "batiments")
|
||||
return "batiments";
|
||||
elseif ($name == "technologies")
|
||||
return "technologies";
|
||||
elseif ($name == "casernes")
|
||||
return "caserne";
|
||||
elseif ($name == "terrestres")
|
||||
return "terrestre";
|
||||
elseif ($name == "vaisseaux")
|
||||
return "spatial";
|
||||
elseif ($name == "coeff_bat")
|
||||
return "coeff";
|
||||
}
|
||||
public static function nameVAR($name)
|
||||
{
|
||||
if ($name == "alli_batiments") {
|
||||
return "alli_batiments";
|
||||
} elseif ($name == "batiments") {
|
||||
return "batiments";
|
||||
} elseif ($name == "technologies") {
|
||||
return "technologies";
|
||||
} elseif ($name == "casernes") {
|
||||
return "caserne";
|
||||
} elseif ($name == "terrestres") {
|
||||
return "terrestre";
|
||||
} elseif ($name == "vaisseaux") {
|
||||
return "spatial";
|
||||
} elseif ($name == "coeff_bat") {
|
||||
return "coeff";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static function capaciteVilles(surface $planete)
|
||||
{
|
||||
return $planete->cases * pow($planete->batiments[17], -3) + 10;
|
||||
}
|
||||
public static function capaciteVilles(surface $planete)
|
||||
{
|
||||
return $planete->cases * pow($planete->batiments[17], -3) + 10;
|
||||
}
|
||||
|
||||
static function nameVilles($level)
|
||||
{
|
||||
switch ($level)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
return "Poste d'observation taille ".($level+1);
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
return "Poste avancé taille ".($level-2);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
return "Colonie taille ".($level-5);
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
return "Ville taille ".($level-8);
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return "Cité taille ".($level-12);
|
||||
break;
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
return "Grande cité taille ".($level-15);
|
||||
break;
|
||||
case 19:
|
||||
return "Mégapole";
|
||||
break;
|
||||
case 20:
|
||||
return "Mégalopole";
|
||||
break;
|
||||
default:
|
||||
trigger_error("Taille de ville incorrect !");
|
||||
}
|
||||
}
|
||||
public static function nameVilles($level)
|
||||
{
|
||||
switch ($level) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
return "Poste d'observation taille ".($level+1);
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
return "Poste avancé taille ".($level-2);
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
return "Colonie taille ".($level-5);
|
||||
break;
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
return "Ville taille ".($level-8);
|
||||
break;
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return "Cité taille ".($level-12);
|
||||
break;
|
||||
case 16:
|
||||
case 17:
|
||||
case 18:
|
||||
return "Grande cité taille ".($level-15);
|
||||
break;
|
||||
case 19:
|
||||
return "Mégapole";
|
||||
break;
|
||||
case 20:
|
||||
return "Mégalopole";
|
||||
break;
|
||||
default:
|
||||
trigger_error("Taille de ville incorrect !");
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -3,475 +3,468 @@ require_once("Class/Donnees/interface.php");
|
|||
|
||||
class dTerrestre implements Donnees
|
||||
{
|
||||
public static function metal($id, $nombre, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$cristal = 300;
|
||||
break;
|
||||
case 1:
|
||||
$cristal = 420;
|
||||
break;
|
||||
case 2:
|
||||
$cristal = 600;
|
||||
break;
|
||||
case 3:
|
||||
$cristal = 950;
|
||||
break;
|
||||
case 4:
|
||||
$cristal = 240;
|
||||
break;
|
||||
case 5:
|
||||
$cristal = 260;
|
||||
break;
|
||||
case 6:
|
||||
$cristal = 420;
|
||||
break;
|
||||
case 7:
|
||||
$cristal = 500;
|
||||
break;
|
||||
case 8:
|
||||
$cristal = 230;
|
||||
break;
|
||||
case 9:
|
||||
$cristal = 650;
|
||||
break;
|
||||
case 10:
|
||||
$cristal = 1750;
|
||||
break;
|
||||
case 11:
|
||||
$cristal = 3750;
|
||||
break;
|
||||
case 12:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 13:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 14:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 15:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$unite." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function metal($id, $nombre, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$cristal = 300;
|
||||
break;
|
||||
case 1:
|
||||
$cristal = 420;
|
||||
break;
|
||||
case 2:
|
||||
$cristal = 600;
|
||||
break;
|
||||
case 3:
|
||||
$cristal = 950;
|
||||
break;
|
||||
case 4:
|
||||
$cristal = 240;
|
||||
break;
|
||||
case 5:
|
||||
$cristal = 260;
|
||||
break;
|
||||
case 6:
|
||||
$cristal = 420;
|
||||
break;
|
||||
case 7:
|
||||
$cristal = 500;
|
||||
break;
|
||||
case 8:
|
||||
$cristal = 230;
|
||||
break;
|
||||
case 9:
|
||||
$cristal = 650;
|
||||
break;
|
||||
case 10:
|
||||
$cristal = 1750;
|
||||
break;
|
||||
case 11:
|
||||
$cristal = 3750;
|
||||
break;
|
||||
case 12:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 13:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 14:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 15:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$unite." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1)
|
||||
$cristal *= 0.9;
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1) {
|
||||
$cristal *= 0.9;
|
||||
}
|
||||
|
||||
return $cristal * $nombre;
|
||||
}
|
||||
return $cristal * $nombre;
|
||||
}
|
||||
|
||||
public static function cristal($id, $nombre, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$cristal = 300;
|
||||
break;
|
||||
case 1:
|
||||
$cristal = 420;
|
||||
break;
|
||||
case 2:
|
||||
$cristal = 600;
|
||||
break;
|
||||
case 3:
|
||||
$cristal = 950;
|
||||
break;
|
||||
case 4:
|
||||
$cristal = 240;
|
||||
break;
|
||||
case 5:
|
||||
$cristal = 260;
|
||||
break;
|
||||
case 6:
|
||||
$cristal = 420;
|
||||
break;
|
||||
case 7:
|
||||
$cristal = 500;
|
||||
break;
|
||||
case 8:
|
||||
$cristal = 230;
|
||||
break;
|
||||
case 9:
|
||||
$cristal = 650;
|
||||
break;
|
||||
case 10:
|
||||
$cristal = 1750;
|
||||
break;
|
||||
case 11:
|
||||
$cristal = 3750;
|
||||
break;
|
||||
case 12:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 13:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 14:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 15:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function cristal($id, $nombre, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$cristal = 300;
|
||||
break;
|
||||
case 1:
|
||||
$cristal = 420;
|
||||
break;
|
||||
case 2:
|
||||
$cristal = 600;
|
||||
break;
|
||||
case 3:
|
||||
$cristal = 950;
|
||||
break;
|
||||
case 4:
|
||||
$cristal = 240;
|
||||
break;
|
||||
case 5:
|
||||
$cristal = 260;
|
||||
break;
|
||||
case 6:
|
||||
$cristal = 420;
|
||||
break;
|
||||
case 7:
|
||||
$cristal = 500;
|
||||
break;
|
||||
case 8:
|
||||
$cristal = 230;
|
||||
break;
|
||||
case 9:
|
||||
$cristal = 650;
|
||||
break;
|
||||
case 10:
|
||||
$cristal = 1750;
|
||||
break;
|
||||
case 11:
|
||||
$cristal = 3750;
|
||||
break;
|
||||
case 12:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 13:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 14:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
case 15:
|
||||
$cristal = 9500;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1)
|
||||
$cristal *= 0.9;
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1) {
|
||||
$cristal *= 0.9;
|
||||
}
|
||||
|
||||
return $cristal * $nombre;
|
||||
}
|
||||
return $cristal * $nombre;
|
||||
}
|
||||
|
||||
public static function hydrogene($id, $nombre, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 1:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 2:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 3:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 4:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 5:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 6:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 7:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 8:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 9:
|
||||
$hydrogene = 80;
|
||||
break;
|
||||
case 10:
|
||||
$hydrogene = 100;
|
||||
break;
|
||||
case 11:
|
||||
$hydrogene = 120;
|
||||
break;
|
||||
case 12:
|
||||
$hydrogene = 1500;
|
||||
break;
|
||||
case 13:
|
||||
$hydrogene = 1500;
|
||||
break;
|
||||
case 14:
|
||||
$hydrogene = 1500;
|
||||
break;
|
||||
case 15:
|
||||
$hydrogene = 1500;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function hydrogene($id, $nombre, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 1:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 2:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 3:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 4:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 5:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 6:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 7:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 8:
|
||||
$hydrogene = 0;
|
||||
break;
|
||||
case 9:
|
||||
$hydrogene = 80;
|
||||
break;
|
||||
case 10:
|
||||
$hydrogene = 100;
|
||||
break;
|
||||
case 11:
|
||||
$hydrogene = 120;
|
||||
break;
|
||||
case 12:
|
||||
$hydrogene = 1500;
|
||||
break;
|
||||
case 13:
|
||||
$hydrogene = 1500;
|
||||
break;
|
||||
case 14:
|
||||
$hydrogene = 1500;
|
||||
break;
|
||||
case 15:
|
||||
$hydrogene = 1500;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1)
|
||||
$hydrogene *= 0.9;
|
||||
//On tient compte des bonus
|
||||
if (isset($planete->politique) && $planete->politique == 1) {
|
||||
$hydrogene *= 0.9;
|
||||
}
|
||||
|
||||
return $hydrogene * $nombre;
|
||||
}
|
||||
return $hydrogene * $nombre;
|
||||
}
|
||||
|
||||
public static function credits($id, $nombre, surface $planete)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
public static function credits($id, $nombre, surface $planete)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function temps($id, $nombre, surface $planete)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
$temps = 720;
|
||||
$moins = 1;
|
||||
break;
|
||||
case 1:
|
||||
$temps = 2040;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 2:
|
||||
$temps = 7200;
|
||||
$moins = 4;
|
||||
break;
|
||||
case 3:
|
||||
$temps = 3960;
|
||||
$moins = 6;
|
||||
break;
|
||||
case 4:
|
||||
$temps = 600;
|
||||
$moins = 1;
|
||||
break;
|
||||
case 5:
|
||||
$temps = 1080;
|
||||
$moins = 2;
|
||||
break;
|
||||
case 6:
|
||||
$temps = 2160;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 7:
|
||||
$temps = 4680;
|
||||
$moins = 5;
|
||||
break;
|
||||
case 8:
|
||||
$temps = 1080;
|
||||
$moins = 1;
|
||||
break;
|
||||
case 9:
|
||||
$temps = 2040;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 10:
|
||||
$temps = 7200;
|
||||
$moins = 4;
|
||||
break;
|
||||
case 11:
|
||||
$temps = 3960;
|
||||
$moins = 7;
|
||||
break;
|
||||
case 12:
|
||||
$temps = 3960;
|
||||
$moins = 9;
|
||||
break;
|
||||
case 13:
|
||||
$temps = 3960;
|
||||
$moins = 9;
|
||||
break;
|
||||
case 14:
|
||||
$temps = 3960;
|
||||
$moins = 9;
|
||||
break;
|
||||
case 15:
|
||||
$temps = 3960;
|
||||
$moins = 9;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
public static function temps($id, $nombre, surface $planete)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
$temps = 720;
|
||||
$moins = 1;
|
||||
break;
|
||||
case 1:
|
||||
$temps = 2040;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 2:
|
||||
$temps = 7200;
|
||||
$moins = 4;
|
||||
break;
|
||||
case 3:
|
||||
$temps = 3960;
|
||||
$moins = 6;
|
||||
break;
|
||||
case 4:
|
||||
$temps = 600;
|
||||
$moins = 1;
|
||||
break;
|
||||
case 5:
|
||||
$temps = 1080;
|
||||
$moins = 2;
|
||||
break;
|
||||
case 6:
|
||||
$temps = 2160;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 7:
|
||||
$temps = 4680;
|
||||
$moins = 5;
|
||||
break;
|
||||
case 8:
|
||||
$temps = 1080;
|
||||
$moins = 1;
|
||||
break;
|
||||
case 9:
|
||||
$temps = 2040;
|
||||
$moins = 3;
|
||||
break;
|
||||
case 10:
|
||||
$temps = 7200;
|
||||
$moins = 4;
|
||||
break;
|
||||
case 11:
|
||||
$temps = 3960;
|
||||
$moins = 7;
|
||||
break;
|
||||
case 12:
|
||||
$temps = 3960;
|
||||
$moins = 9;
|
||||
break;
|
||||
case 13:
|
||||
$temps = 3960;
|
||||
$moins = 9;
|
||||
break;
|
||||
case 14:
|
||||
$temps = 3960;
|
||||
$moins = 9;
|
||||
break;
|
||||
case 15:
|
||||
$temps = 3960;
|
||||
$moins = 9;
|
||||
break;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
|
||||
//On tient compte de la vitesse
|
||||
$temps /= VITESSE;
|
||||
//On tient compte de la vitesse
|
||||
$temps /= VITESSE;
|
||||
|
||||
//On tient compte des bonus
|
||||
return ceil($temps/pow(1.25, ($planete->batiments[7] - $moins))) * $nombre;
|
||||
}
|
||||
//On tient compte des bonus
|
||||
return ceil($temps/pow(1.25, ($planete->batiments[7] - $moins))) * $nombre;
|
||||
}
|
||||
|
||||
public static function type($id)
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
return true;
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return false;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
public static function type($id)
|
||||
{
|
||||
switch ($id) {
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
return true;
|
||||
case 8:
|
||||
case 9:
|
||||
case 10:
|
||||
case 11:
|
||||
case 12:
|
||||
case 13:
|
||||
case 14:
|
||||
case 15:
|
||||
return false;
|
||||
default:
|
||||
trigger_error("Unité ".$id." introuvable dans les données", E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function image($id, surface $planete)
|
||||
{
|
||||
if ($planete->race == "covenant")
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
//Unités terrestres
|
||||
case 0:
|
||||
return "bansheeqp0.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "spirit1.jpg";
|
||||
break;
|
||||
case 2:
|
||||
return "phantomfu2.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "boardingcraft.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "ghostic1.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "shadow.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "spectre.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "wraith.jpg";
|
||||
break;
|
||||
public static function image($id, surface $planete)
|
||||
{
|
||||
if ($planete->race == "covenant") {
|
||||
switch ($id) {
|
||||
//Unités terrestres
|
||||
case 0:
|
||||
return "bansheeqp0.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "spirit1.jpg";
|
||||
break;
|
||||
case 2:
|
||||
return "phantomfu2.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "boardingcraft.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "ghostic1.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "shadow.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "spectre.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "wraith.jpg";
|
||||
break;
|
||||
|
||||
//Défenses
|
||||
case 8:
|
||||
return "shade.jpg";
|
||||
break;
|
||||
case 9:
|
||||
return "defcovie.jpg";
|
||||
break;
|
||||
case 10:
|
||||
return "tourellebarreau.jpg";
|
||||
break;
|
||||
case 11:
|
||||
return "tourelle.jpg";
|
||||
break;
|
||||
case 12:
|
||||
return "lanceur_torpilles.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_covenant_default;
|
||||
}
|
||||
elseif ($planete->race == "humain")
|
||||
{
|
||||
switch($id)
|
||||
{
|
||||
//Unités terrestres
|
||||
case 0:
|
||||
return "csnusparrowhawkkp4.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "pelican.jpg";
|
||||
break;
|
||||
case 2:
|
||||
return "csnushortswordad3.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "albatross.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "warthog-vrl.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "M12G1_LAAV_Warthog.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "M12A1_LAAV_Warthog.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "scorpionN.jpg";
|
||||
break;
|
||||
//Défenses
|
||||
case 8:
|
||||
return "shade.jpg";
|
||||
break;
|
||||
case 9:
|
||||
return "defcovie.jpg";
|
||||
break;
|
||||
case 10:
|
||||
return "tourellebarreau.jpg";
|
||||
break;
|
||||
case 11:
|
||||
return "tourelle.jpg";
|
||||
break;
|
||||
case 12:
|
||||
return "lanceur_torpilles.jpg";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_covenant_default;
|
||||
} elseif ($planete->race == "humain") {
|
||||
switch ($id) {
|
||||
//Unités terrestres
|
||||
case 0:
|
||||
return "csnusparrowhawkkp4.jpg";
|
||||
break;
|
||||
case 1:
|
||||
return "pelican.jpg";
|
||||
break;
|
||||
case 2:
|
||||
return "csnushortswordad3.jpg";
|
||||
break;
|
||||
case 3:
|
||||
return "albatross.jpg";
|
||||
break;
|
||||
case 4:
|
||||
return "warthog-vrl.jpg";
|
||||
break;
|
||||
case 5:
|
||||
return "M12G1_LAAV_Warthog.jpg";
|
||||
break;
|
||||
case 6:
|
||||
return "M12A1_LAAV_Warthog.jpg";
|
||||
break;
|
||||
case 7:
|
||||
return "scorpionN.jpg";
|
||||
break;
|
||||
|
||||
//Défenses
|
||||
case 8:
|
||||
//return "";
|
||||
break;
|
||||
case 9:
|
||||
//return "";
|
||||
break;
|
||||
case 10:
|
||||
//return "";
|
||||
break;
|
||||
case 11:
|
||||
//return "";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_humain_default;
|
||||
}
|
||||
else
|
||||
trigger_error("Impossible de trouver la race pour ".$planete->race, E_USER_ERROR);
|
||||
}
|
||||
//Défenses
|
||||
case 8:
|
||||
//return "";
|
||||
break;
|
||||
case 9:
|
||||
//return "";
|
||||
break;
|
||||
case 10:
|
||||
//return "";
|
||||
break;
|
||||
case 11:
|
||||
//return "";
|
||||
break;
|
||||
}
|
||||
return Donnees::image_humain_default;
|
||||
} else {
|
||||
trigger_error("Impossible de trouver la race pour ".$planete->race, E_USER_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function needed($id, surface $planete, $print = false)
|
||||
{
|
||||
$neededTerrestre = array(
|
||||
array(
|
||||
array('batiments', 7, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 4)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 6)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 5)
|
||||
),
|
||||
//Défenses
|
||||
array(
|
||||
array('batiments', 7, 1),
|
||||
array('technologies', 6, 0)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 3),
|
||||
array('technologies', 6, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 4),
|
||||
array('technologies', 6, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 4),
|
||||
array('technologies', 6, 4)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 8),
|
||||
array('technologies', 6, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 8),
|
||||
array('technologies', 6, 5)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 8),
|
||||
array('technologies', 6, 6)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 10),
|
||||
array('technologies', 7, 11)
|
||||
)
|
||||
);
|
||||
public static function needed($id, surface $planete, $print = false)
|
||||
{
|
||||
$neededTerrestre = array(
|
||||
array(
|
||||
array('batiments', 7, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 4)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 6)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 5)
|
||||
),
|
||||
//Défenses
|
||||
array(
|
||||
array('batiments', 7, 1),
|
||||
array('technologies', 6, 0)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 3),
|
||||
array('technologies', 6, 3)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 4),
|
||||
array('technologies', 6, 1)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 4),
|
||||
array('technologies', 6, 4)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 8),
|
||||
array('technologies', 6, 2)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 8),
|
||||
array('technologies', 6, 5)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 8),
|
||||
array('technologies', 6, 6)
|
||||
),
|
||||
array(
|
||||
array('batiments', 7, 10),
|
||||
array('technologies', 7, 11)
|
||||
)
|
||||
);
|
||||
|
||||
if ($print)
|
||||
return dDonnees::print_neededCheck($neededTerrestre[$id], $planete);
|
||||
else
|
||||
return dDonnees::neededCheck($neededTerrestre[$id], $planete);
|
||||
}
|
||||
if ($print) {
|
||||
return dDonnees::print_neededCheck($neededTerrestre[$id], $planete);
|
||||
} else {
|
||||
return dDonnees::neededCheck($neededTerrestre[$id], $planete);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -3,255 +3,249 @@ require_once("Class/File/interface.php");
|
|||
|
||||
class FileAlliancesBatiments extends FileCommun implements File
|
||||
{
|
||||
public function objectInFile($object)
|
||||
{
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
foreach($file as $keyE => $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function objectInFile($object)
|
||||
{
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[0] == $object) {
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function nbObjectInFile($object, $type = null)
|
||||
{
|
||||
$c = 0;
|
||||
if (isset($type))
|
||||
{
|
||||
if (!isset($type) || $type)
|
||||
{
|
||||
foreach($this->files as $file)
|
||||
{
|
||||
$c += count(array_keys($file, array($object, true)));
|
||||
}
|
||||
}
|
||||
if (!isset($type) || !$type)
|
||||
{
|
||||
foreach($this->files as $file)
|
||||
{
|
||||
$c += count(array_keys($file, array($object, false)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
public function nbObjectInFile($object, $type = null)
|
||||
{
|
||||
$c = 0;
|
||||
if (isset($type)) {
|
||||
if (!isset($type) || $type) {
|
||||
foreach ($this->files as $file) {
|
||||
$c += count(array_keys($file, array($object, true)));
|
||||
}
|
||||
}
|
||||
if (!isset($type) || !$type) {
|
||||
foreach ($this->files as $file) {
|
||||
$c += count(array_keys($file, array($object, false)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function addObjet($object, $nombre, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete))
|
||||
throw new ExceptionHB(1, 1);
|
||||
public function addObjet($object, $nombre, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete)) {
|
||||
throw new ExceptionHB(1, 1);
|
||||
}
|
||||
|
||||
//Validation des conditions de construction
|
||||
if (!dAlliancesBatiments::needed($object, $planete))
|
||||
throw new ExceptionHB(1, 2);
|
||||
//Validation des conditions de construction
|
||||
if (!dAlliancesBatiments::needed($object, $planete)) {
|
||||
throw new ExceptionHB(1, 2);
|
||||
}
|
||||
|
||||
//On vérifie qu'il n'y ait pas une demande de démolition du même bâtiment
|
||||
if ($this->nbObjectInFile($object, true) >= 1)
|
||||
throw new ExceptionHB(1, 7);
|
||||
//On vérifie qu'il n'y ait pas une demande de démolition du même bâtiment
|
||||
if ($this->nbObjectInFile($object, true) >= 1) {
|
||||
throw new ExceptionHB(1, 7);
|
||||
}
|
||||
|
||||
//Calcul du prochain niveau du batiment
|
||||
$nextLvl = $planete->batiments[$object] + $this->nbObjectInFile($object, false) + 1;
|
||||
//Calcul du prochain niveau du batiment
|
||||
$nextLvl = $planete->batiments[$object] + $this->nbObjectInFile($object, false) + 1;
|
||||
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dAlliancesBatiments::metal($object, $nextLvl, $planete), dAlliancesBatiments::cristal($object, $nextLvl, $planete), dAlliancesBatiments::hydrogene($object, $nextLvl, $planete), dAlliancesBatiments::credits($object, $nextLvl, $planete)))
|
||||
{
|
||||
$this->files[$lieu][] = array($object, false);
|
||||
$planete->addModif("file_bat");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
throw new ExceptionHB(1, 4);
|
||||
}
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dAlliancesBatiments::metal($object, $nextLvl, $planete), dAlliancesBatiments::cristal($object, $nextLvl, $planete), dAlliancesBatiments::hydrogene($object, $nextLvl, $planete), dAlliancesBatiments::credits($object, $nextLvl, $planete))) {
|
||||
$this->files[$lieu][] = array($object, false);
|
||||
$planete->addModif("file_bat");
|
||||
return true;
|
||||
} else {
|
||||
throw new ExceptionHB(1, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public function addDemolition($object, $nombre, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete))
|
||||
throw new ExceptionHB(1, 1);
|
||||
public function addDemolition($object, $nombre, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete)) {
|
||||
throw new ExceptionHB(1, 1);
|
||||
}
|
||||
|
||||
//On vérifie que le niveau actuel du batiment ne soit non nul
|
||||
if ($planete->batiments[$object] <= $this->nbObjectInFile($object, false))
|
||||
throw new ExceptionHB(1, 6);
|
||||
//On vérifie que le niveau actuel du batiment ne soit non nul
|
||||
if ($planete->batiments[$object] <= $this->nbObjectInFile($object, false)) {
|
||||
throw new ExceptionHB(1, 6);
|
||||
}
|
||||
|
||||
//On vérifie qu'il n'y ait pas une demande de construction du même bâtiment
|
||||
if ($this->nbObjectInFile($object, false) >= 1)
|
||||
throw new ExceptionHB(1, 7);
|
||||
//On vérifie qu'il n'y ait pas une demande de construction du même bâtiment
|
||||
if ($this->nbObjectInFile($object, false) >= 1) {
|
||||
throw new ExceptionHB(1, 7);
|
||||
}
|
||||
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
$this->files[$lieu][] = array($object, true);
|
||||
$this->files[$lieu][] = array($object, true);
|
||||
|
||||
$planete->addModif("file_bat");
|
||||
$planete->addModif("file_bat");
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id]))
|
||||
throw new ExceptionHB(1, 5);
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id])) {
|
||||
throw new ExceptionHB(1, 5);
|
||||
}
|
||||
|
||||
//On récupère le type de batiment
|
||||
$object = $this->files[$lieu][$id][0];
|
||||
//On récupère le type de batiment
|
||||
$object = $this->files[$lieu][$id][0];
|
||||
|
||||
//On gère les démolition
|
||||
//@todo -cFileBatiments Est-ce vraiment utile de calculer le niveau du batiment en cas de démolition ?
|
||||
if ($this->files[$lieu][$id][1])
|
||||
$lvlAnnule = $planete->batiments[$object] - $this->nbObjectInFile($object, true) + 1;
|
||||
else
|
||||
$lvlAnnule = $planete->batiments[$object] + $this->nbObjectInFile($object, false);
|
||||
//On gère les démolition
|
||||
//@todo -cFileBatiments Est-ce vraiment utile de calculer le niveau du batiment en cas de démolition ?
|
||||
if ($this->files[$lieu][$id][1]) {
|
||||
$lvlAnnule = $planete->batiments[$object] - $this->nbObjectInFile($object, true) + 1;
|
||||
} else {
|
||||
$lvlAnnule = $planete->batiments[$object] + $this->nbObjectInFile($object, false);
|
||||
}
|
||||
|
||||
//On met à jour le temps si on vient d'annuler le premier batiment en lice
|
||||
if ($id == $this->findFirstKey($lieu))
|
||||
$this->times[$lieu] = time();
|
||||
//On met à jour le temps si on vient d'annuler le premier batiment en lice
|
||||
if ($id == $this->findFirstKey($lieu)) {
|
||||
$this->times[$lieu] = time();
|
||||
}
|
||||
|
||||
$planete->addModif("file_bat");
|
||||
$planete->addModif("file_bat");
|
||||
|
||||
if (!$this->files[$lieu][$id][1])
|
||||
{
|
||||
//On redonne 60% des ressources au joueur si c'est la première construction dans la file d'attente
|
||||
if ($id == 0)
|
||||
$planete->addRessources(dAlliancesBatiments::metal($object, $lvlAnnule, $planete)*0.6, dAlliancesBatiments::cristal($object, $lvlAnnule, $planete)*0.6, dAlliancesBatiments::hydrogene($object, $lvlAnnule, $planete)*0.6, dAlliancesBatiments::credits($object, $lvlAnnule, $planete)*0.6);
|
||||
else
|
||||
$planete->addRessources(dAlliancesBatiments::metal($object, $lvlAnnule, $planete), dAlliancesBatiments::cristal($object, $lvlAnnule, $planete), dAlliancesBatiments::hydrogene($object, $lvlAnnule, $planete), dAlliancesBatiments::credits($object, $lvlAnnule, $planete));
|
||||
}
|
||||
if (!$this->files[$lieu][$id][1]) {
|
||||
//On redonne 60% des ressources au joueur si c'est la première construction dans la file d'attente
|
||||
if ($id == 0) {
|
||||
$planete->addRessources(dAlliancesBatiments::metal($object, $lvlAnnule, $planete)*0.6, dAlliancesBatiments::cristal($object, $lvlAnnule, $planete)*0.6, dAlliancesBatiments::hydrogene($object, $lvlAnnule, $planete)*0.6, dAlliancesBatiments::credits($object, $lvlAnnule, $planete)*0.6);
|
||||
} else {
|
||||
$planete->addRessources(dAlliancesBatiments::metal($object, $lvlAnnule, $planete), dAlliancesBatiments::cristal($object, $lvlAnnule, $planete), dAlliancesBatiments::hydrogene($object, $lvlAnnule, $planete), dAlliancesBatiments::credits($object, $lvlAnnule, $planete));
|
||||
}
|
||||
}
|
||||
|
||||
//Effacement de la file
|
||||
unset($this->files[$lieu][$id]);
|
||||
//Effacement de la file
|
||||
unset($this->files[$lieu][$id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0)
|
||||
continue;
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//On parcourt la file
|
||||
foreach ($file as $keyE => $element)
|
||||
{
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
//On parcourt la file
|
||||
foreach ($file as $keyE => $element) {
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
|
||||
//On gère les démolitions
|
||||
if ($element[1])
|
||||
{
|
||||
//On récupère le niveau actuel du batiment
|
||||
$lvl = $planete->batiments[$element[0]];
|
||||
//On gère les démolitions
|
||||
if ($element[1]) {
|
||||
//On récupère le niveau actuel du batiment
|
||||
$lvl = $planete->batiments[$element[0]];
|
||||
|
||||
//On calcul le temps de démolition nécessaire (60% du niveau actuel)
|
||||
$tempsNecessaire = dAlliancesBatiments::temps($element[0], $lvl, $planete, true);
|
||||
//On calcul le temps de démolition nécessaire (60% du niveau actuel)
|
||||
$tempsNecessaire = dAlliancesBatiments::temps($element[0], $lvl, $planete, true);
|
||||
|
||||
if ($tempsEcoule >= $tempsNecessaire)
|
||||
{
|
||||
$metal = dAlliancesBatiments::metal($element[0], $lvl, $planete);
|
||||
$cristal = dAlliancesBatiments::cristal($element[0], $lvl, $planete);
|
||||
$hydrogene = dAlliancesBatiments::hydrogene($element[0], $lvl, $planete);
|
||||
if ($tempsEcoule >= $tempsNecessaire) {
|
||||
$metal = dAlliancesBatiments::metal($element[0], $lvl, $planete);
|
||||
$cristal = dAlliancesBatiments::cristal($element[0], $lvl, $planete);
|
||||
$hydrogene = dAlliancesBatiments::hydrogene($element[0], $lvl, $planete);
|
||||
|
||||
//On redonne 70% des ressources du batiment au joueur
|
||||
$planete->addRessources($metal*0.7, $cristal*0.7, $hydrogene*0.7);
|
||||
//On redonne 70% des ressources du batiment au joueur
|
||||
$planete->addRessources($metal*0.7, $cristal*0.7, $hydrogene*0.7);
|
||||
|
||||
//On retire un niveau au batiment
|
||||
$planete->batiments[$element[0]]--;
|
||||
//On retire un niveau au batiment
|
||||
$planete->batiments[$element[0]]--;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("batiments", $element[0]));
|
||||
$planete->addModif("file_bat");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("batiments", $element[0]));
|
||||
$planete->addModif("file_bat");
|
||||
|
||||
//On retire les points
|
||||
$planete->addPoints($metal, $cristal, $hydrogene, 0, true);
|
||||
//On retire les points
|
||||
$planete->addPoints($metal, $cristal, $hydrogene, 0, true);
|
||||
|
||||
unset($metal, $cristal, $hydrogene);
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else
|
||||
break;
|
||||
}
|
||||
else //Cas de la construction
|
||||
{
|
||||
//Récupération du niveau du batiment
|
||||
$lvl = $planete->batiments[$element[0]] + 1;
|
||||
unset($metal, $cristal, $hydrogene);
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else {
|
||||
break;
|
||||
}
|
||||
} else { //Cas de la construction
|
||||
//Récupération du niveau du batiment
|
||||
$lvl = $planete->batiments[$element[0]] + 1;
|
||||
|
||||
$tempsNecessaire = dAlliancesBatiments::temps($element[0], $lvl, $planete);
|
||||
$tempsNecessaire = dAlliancesBatiments::temps($element[0], $lvl, $planete);
|
||||
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($tempsEcoule >= $tempsNecessaire)
|
||||
{
|
||||
//On ajoute un niveau au batiment
|
||||
$planete->batiments[$element[0]]++;
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($tempsEcoule >= $tempsNecessaire) {
|
||||
//On ajoute un niveau au batiment
|
||||
$planete->batiments[$element[0]]++;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("batiments", $element[0]));
|
||||
$planete->addModif("file_bat");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("batiments", $element[0]));
|
||||
$planete->addModif("file_bat");
|
||||
|
||||
//On ajoute les points
|
||||
$planete->addPoints(dAlliancesBatiments::metal($element[0], $planete->batiments[$element[0]], $planete), dAlliancesBatiments::cristal($element[0], $planete->batiments[$element[0]], $planete), dAlliancesBatiments::hydrogene($element[0], $planete->batiments[$element[0]], $planete));
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//On ajoute les points
|
||||
$planete->addPoints(dAlliancesBatiments::metal($element[0], $planete->batiments[$element[0]], $planete), dAlliancesBatiments::cristal($element[0], $planete->batiments[$element[0]], $planete), dAlliancesBatiments::hydrogene($element[0], $planete->batiments[$element[0]], $planete));
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function printFile(SURFACE $planete, $lieu = NULL)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file)
|
||||
{
|
||||
if (isset($lieu) && $lieu != $keyF)
|
||||
continue;
|
||||
public function printFile(SURFACE $planete, $lieu = null)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
if (isset($lieu) && $lieu != $keyF) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element)
|
||||
{
|
||||
if ($element[1]) //Cas d'une démolition
|
||||
{
|
||||
$temps = dAlliancesBatiments::temps($element[0], $planete->batiments[$element[0]], $planete, true);
|
||||
if ($prems)
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
}
|
||||
else //Cas d'une construction
|
||||
{
|
||||
$temps = dAlliancesBatiments::temps($element[0], $planete->batiments[$element[0]]+1, $planete);
|
||||
if ($prems)
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[1]) { //Cas d'une démolition
|
||||
$temps = dAlliancesBatiments::temps($element[0], $planete->batiments[$element[0]], $planete, true);
|
||||
if ($prems) {
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
} else { //Cas d'une construction
|
||||
$temps = dAlliancesBatiments::temps($element[0], $planete->batiments[$element[0]]+1, $planete);
|
||||
if ($prems) {
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -3,266 +3,258 @@ require_once("Class/File/interface.php");
|
|||
|
||||
class FileBatiments extends FileCommun implements File
|
||||
{
|
||||
public function objectInFile($object)
|
||||
{
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
foreach($file as $keyE => $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function objectInFile($object)
|
||||
{
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[0] == $object) {
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function nbObjectInFile($object, $type = null)
|
||||
{
|
||||
$c = 0;
|
||||
if (!isset($object))
|
||||
{
|
||||
foreach($this->files as $file)
|
||||
{
|
||||
$c += count($file);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($type) || $type)
|
||||
{
|
||||
foreach($this->files as $file)
|
||||
{
|
||||
$c += count(array_keys($file, array($object, true)));
|
||||
}
|
||||
}
|
||||
if (!isset($type) || !$type)
|
||||
{
|
||||
foreach($this->files as $file)
|
||||
{
|
||||
$c += count(array_keys($file, array($object, false)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
public function nbObjectInFile($object, $type = null)
|
||||
{
|
||||
$c = 0;
|
||||
if (!isset($object)) {
|
||||
foreach ($this->files as $file) {
|
||||
$c += count($file);
|
||||
}
|
||||
} else {
|
||||
if (!isset($type) || $type) {
|
||||
foreach ($this->files as $file) {
|
||||
$c += count(array_keys($file, array($object, true)));
|
||||
}
|
||||
}
|
||||
if (!isset($type) || !$type) {
|
||||
foreach ($this->files as $file) {
|
||||
$c += count(array_keys($file, array($object, false)));
|
||||
}
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function addObjet($object, $nombre, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete))
|
||||
throw new ExceptionHB(1, 1);
|
||||
public function addObjet($object, $nombre, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete)) {
|
||||
throw new ExceptionHB(1, 1);
|
||||
}
|
||||
|
||||
//Validation des conditions de construction
|
||||
if (!dBatiments::needed($object, $planete))
|
||||
throw new ExceptionHB(1, 2);
|
||||
//Validation des conditions de construction
|
||||
if (!dBatiments::needed($object, $planete)) {
|
||||
throw new ExceptionHB(1, 2);
|
||||
}
|
||||
|
||||
//On vérifie qu'il n'y ait pas une demande de démolition du même bâtiment
|
||||
if ($this->nbObjectInFile($object, true) >= 1)
|
||||
throw new ExceptionHB(1, 7);
|
||||
//On vérifie qu'il n'y ait pas une demande de démolition du même bâtiment
|
||||
if ($this->nbObjectInFile($object, true) >= 1) {
|
||||
throw new ExceptionHB(1, 7);
|
||||
}
|
||||
|
||||
//On vérifie qu'il reste suffisamment de place sur la planète
|
||||
if ($planete->casesRest <= 0 || $planete->casesRest <= $this->nbObjectInFile(null))
|
||||
throw new ExceptionHB(1, 0);
|
||||
//On vérifie qu'il reste suffisamment de place sur la planète
|
||||
if ($planete->casesRest <= 0 || $planete->casesRest <= $this->nbObjectInFile(null)) {
|
||||
throw new ExceptionHB(1, 0);
|
||||
}
|
||||
|
||||
//Calcul du prochain niveau du batiment
|
||||
$nextLvl = $planete->batiments[$object] + $this->nbObjectInFile($object, false) + 1;
|
||||
//Calcul du prochain niveau du batiment
|
||||
$nextLvl = $planete->batiments[$object] + $this->nbObjectInFile($object, false) + 1;
|
||||
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dBatiments::metal($object, $nextLvl, $planete), dBatiments::cristal($object, $nextLvl, $planete), dBatiments::hydrogene($object, $nextLvl, $planete), dBatiments::credits($object, $nextLvl, $planete)))
|
||||
{
|
||||
$this->files[$lieu][] = array($object, false);
|
||||
$planete->addModif("file_bat");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
throw new ExceptionHB(1, 4);
|
||||
}
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dBatiments::metal($object, $nextLvl, $planete), dBatiments::cristal($object, $nextLvl, $planete), dBatiments::hydrogene($object, $nextLvl, $planete), dBatiments::credits($object, $nextLvl, $planete))) {
|
||||
$this->files[$lieu][] = array($object, false);
|
||||
$planete->addModif("file_bat");
|
||||
return true;
|
||||
} else {
|
||||
throw new ExceptionHB(1, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public function addDemolition($object, $nombre, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete))
|
||||
throw new ExceptionHB(1, 1);
|
||||
public function addDemolition($object, $nombre, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete)) {
|
||||
throw new ExceptionHB(1, 1);
|
||||
}
|
||||
|
||||
//On vérifie que le niveau actuel du batiment ne soit non nul
|
||||
if ($planete->batiments[$object] <= $this->nbObjectInFile($object, false))
|
||||
throw new ExceptionHB(1, 6);
|
||||
//On vérifie que le niveau actuel du batiment ne soit non nul
|
||||
if ($planete->batiments[$object] <= $this->nbObjectInFile($object, false)) {
|
||||
throw new ExceptionHB(1, 6);
|
||||
}
|
||||
|
||||
//On vérifie qu'il n'y ait pas une demande de construction du même bâtiment
|
||||
if ($this->nbObjectInFile($object, false) >= 1)
|
||||
throw new ExceptionHB(1, 7);
|
||||
//On vérifie qu'il n'y ait pas une demande de construction du même bâtiment
|
||||
if ($this->nbObjectInFile($object, false) >= 1) {
|
||||
throw new ExceptionHB(1, 7);
|
||||
}
|
||||
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
$this->files[$lieu][] = array($object, true);
|
||||
$this->files[$lieu][] = array($object, true);
|
||||
|
||||
$planete->addModif("file_bat");
|
||||
$planete->addModif("file_bat");
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id]))
|
||||
throw new ExceptionHB(1, 5);
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id])) {
|
||||
throw new ExceptionHB(1, 5);
|
||||
}
|
||||
|
||||
//On récupère le type de batiment
|
||||
$object = $this->files[$lieu][$id][0];
|
||||
//On récupère le type de batiment
|
||||
$object = $this->files[$lieu][$id][0];
|
||||
|
||||
//On gère les démolition
|
||||
//@todo -cFileBatiments Est-ce vraiment utile de calculer le niveau du batiment en cas de démolition ?
|
||||
if ($this->files[$lieu][$id][1])
|
||||
$lvlAnnule = $planete->batiments[$object] - $this->nbObjectInFile($object, true) + 1;
|
||||
else
|
||||
$lvlAnnule = $planete->batiments[$object] + $this->nbObjectInFile($object, false);
|
||||
//On gère les démolition
|
||||
//@todo -cFileBatiments Est-ce vraiment utile de calculer le niveau du batiment en cas de démolition ?
|
||||
if ($this->files[$lieu][$id][1]) {
|
||||
$lvlAnnule = $planete->batiments[$object] - $this->nbObjectInFile($object, true) + 1;
|
||||
} else {
|
||||
$lvlAnnule = $planete->batiments[$object] + $this->nbObjectInFile($object, false);
|
||||
}
|
||||
|
||||
//On met à jour le temps si on vient d'annuler le premier batiment en lice
|
||||
if ($id == $this->findFirstKey($lieu))
|
||||
$this->times[$lieu] = time();
|
||||
//On met à jour le temps si on vient d'annuler le premier batiment en lice
|
||||
if ($id == $this->findFirstKey($lieu)) {
|
||||
$this->times[$lieu] = time();
|
||||
}
|
||||
|
||||
$planete->addModif("file_bat");
|
||||
$planete->addModif("file_bat");
|
||||
|
||||
if (!$this->files[$lieu][$id][1])
|
||||
{
|
||||
//On redonne 60% des ressources au joueur si c'est la première construction dans la file d'attente
|
||||
if ($id == 0)
|
||||
$planete->addRessources(dBatiments::metal($object, $lvlAnnule, $planete)*0.6, dBatiments::cristal($object, $lvlAnnule, $planete)*0.6, dBatiments::hydrogene($object, $lvlAnnule, $planete)*0.6, dBatiments::credits($object, $lvlAnnule, $planete)*0.6);
|
||||
else
|
||||
$planete->addRessources(dBatiments::metal($object, $lvlAnnule, $planete), dBatiments::cristal($object, $lvlAnnule, $planete), dBatiments::hydrogene($object, $lvlAnnule, $planete), dBatiments::credits($object, $lvlAnnule, $planete));
|
||||
}
|
||||
if (!$this->files[$lieu][$id][1]) {
|
||||
//On redonne 60% des ressources au joueur si c'est la première construction dans la file d'attente
|
||||
if ($id == 0) {
|
||||
$planete->addRessources(dBatiments::metal($object, $lvlAnnule, $planete)*0.6, dBatiments::cristal($object, $lvlAnnule, $planete)*0.6, dBatiments::hydrogene($object, $lvlAnnule, $planete)*0.6, dBatiments::credits($object, $lvlAnnule, $planete)*0.6);
|
||||
} else {
|
||||
$planete->addRessources(dBatiments::metal($object, $lvlAnnule, $planete), dBatiments::cristal($object, $lvlAnnule, $planete), dBatiments::hydrogene($object, $lvlAnnule, $planete), dBatiments::credits($object, $lvlAnnule, $planete));
|
||||
}
|
||||
}
|
||||
|
||||
//Effacement de la file
|
||||
unset($this->files[$lieu][$id]);
|
||||
//Effacement de la file
|
||||
unset($this->files[$lieu][$id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0)
|
||||
continue;
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//On parcourt la file
|
||||
foreach ($file as $keyE => $element)
|
||||
{
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
//On parcourt la file
|
||||
foreach ($file as $keyE => $element) {
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
|
||||
//On gère les démolitions
|
||||
if ($element[1])
|
||||
{
|
||||
//On récupère le niveau actuel du batiment
|
||||
$lvl = $planete->batiments[$element[0]];
|
||||
//On gère les démolitions
|
||||
if ($element[1]) {
|
||||
//On récupère le niveau actuel du batiment
|
||||
$lvl = $planete->batiments[$element[0]];
|
||||
|
||||
//On calcul le temps de démolition nécessaire (60% du niveau actuel)
|
||||
$tempsNecessaire = dBatiments::temps($element[0], $lvl, $planete, true);
|
||||
//On calcul le temps de démolition nécessaire (60% du niveau actuel)
|
||||
$tempsNecessaire = dBatiments::temps($element[0], $lvl, $planete, true);
|
||||
|
||||
if ($tempsEcoule >= $tempsNecessaire)
|
||||
{
|
||||
$metal = dBatiments::metal($element[0], $lvl, $planete);
|
||||
$cristal = dBatiments::cristal($element[0], $lvl, $planete);
|
||||
$hydrogene = dBatiments::hydrogene($element[0], $lvl, $planete);
|
||||
if ($tempsEcoule >= $tempsNecessaire) {
|
||||
$metal = dBatiments::metal($element[0], $lvl, $planete);
|
||||
$cristal = dBatiments::cristal($element[0], $lvl, $planete);
|
||||
$hydrogene = dBatiments::hydrogene($element[0], $lvl, $planete);
|
||||
|
||||
//On redonne 70% des ressources du batiment au joueur
|
||||
$planete->addRessources($metal*0.7, $cristal*0.7, $hydrogene*0.7);
|
||||
//On redonne 70% des ressources du batiment au joueur
|
||||
$planete->addRessources($metal*0.7, $cristal*0.7, $hydrogene*0.7);
|
||||
|
||||
//On retire un niveau au batiment
|
||||
$planete->batiments[$element[0]]--;
|
||||
//On retire un niveau au batiment
|
||||
$planete->batiments[$element[0]]--;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("batiments", $element[0]));
|
||||
$planete->addModif("file_bat");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("batiments", $element[0]));
|
||||
$planete->addModif("file_bat");
|
||||
|
||||
//On retire les points
|
||||
$planete->addPoints($metal, $cristal, $hydrogene, 0, true);
|
||||
//On retire les points
|
||||
$planete->addPoints($metal, $cristal, $hydrogene, 0, true);
|
||||
|
||||
unset($metal, $cristal, $hydrogene);
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else
|
||||
break;
|
||||
}
|
||||
else //Cas de la construction
|
||||
{
|
||||
//Récupération du niveau du batiment
|
||||
$lvl = $planete->batiments[$element[0]] + 1;
|
||||
unset($metal, $cristal, $hydrogene);
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else {
|
||||
break;
|
||||
}
|
||||
} else { //Cas de la construction
|
||||
//Récupération du niveau du batiment
|
||||
$lvl = $planete->batiments[$element[0]] + 1;
|
||||
|
||||
$tempsNecessaire = dBatiments::temps($element[0], $lvl, $planete);
|
||||
$tempsNecessaire = dBatiments::temps($element[0], $lvl, $planete);
|
||||
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($tempsEcoule >= $tempsNecessaire)
|
||||
{
|
||||
//On ajoute un niveau au batiment
|
||||
$planete->batiments[$element[0]]++;
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($tempsEcoule >= $tempsNecessaire) {
|
||||
//On ajoute un niveau au batiment
|
||||
$planete->batiments[$element[0]]++;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("batiments", $element[0]));
|
||||
$planete->addModif("file_bat");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("batiments", $element[0]));
|
||||
$planete->addModif("file_bat");
|
||||
|
||||
//On ajoute les points
|
||||
$planete->addPoints(dBatiments::metal($element[0], $planete->batiments[$element[0]], $planete), dBatiments::cristal($element[0], $planete->batiments[$element[0]], $planete), dBatiments::hydrogene($element[0], $planete->batiments[$element[0]], $planete));
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//On ajoute les points
|
||||
$planete->addPoints(dBatiments::metal($element[0], $planete->batiments[$element[0]], $planete), dBatiments::cristal($element[0], $planete->batiments[$element[0]], $planete), dBatiments::hydrogene($element[0], $planete->batiments[$element[0]], $planete));
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function printFile(SURFACE $planete, $lieu = null)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file)
|
||||
{
|
||||
if (isset($lieu) && $lieu != $keyF)
|
||||
continue;
|
||||
public function printFile(SURFACE $planete, $lieu = null)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
if (isset($lieu) && $lieu != $keyF) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element)
|
||||
{
|
||||
if ($element[1]) //Cas d'une démolition
|
||||
{
|
||||
$temps = dBatiments::temps($element[0], $planete->batiments[$element[0]], $planete, true);
|
||||
if ($prems)
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
}
|
||||
else //Cas d'une construction
|
||||
{
|
||||
$temps = dBatiments::temps($element[0], $planete->batiments[$element[0]]+1, $planete);
|
||||
if ($prems)
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[1]) { //Cas d'une démolition
|
||||
$temps = dBatiments::temps($element[0], $planete->batiments[$element[0]], $planete, true);
|
||||
if ($prems) {
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
} else { //Cas d'une construction
|
||||
$temps = dBatiments::temps($element[0], $planete->batiments[$element[0]]+1, $planete);
|
||||
if ($prems) {
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -3,307 +3,304 @@ require_once("Class/File/interface.php");
|
|||
|
||||
class FileCaserne extends FileCommun implements File
|
||||
{
|
||||
public function objectInFile($object, $lieu = null)
|
||||
{
|
||||
if (isset($lieu))
|
||||
{
|
||||
if (!empty($this->files[$lieu]))
|
||||
{
|
||||
foreach($this->files[$lieu] as $keyE => $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
return array($lieu, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
foreach($file as $keyE => $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function objectInFile($object, $lieu = null)
|
||||
{
|
||||
if (isset($lieu)) {
|
||||
if (!empty($this->files[$lieu])) {
|
||||
foreach ($this->files[$lieu] as $keyE => $element) {
|
||||
if ($element[0] == $object) {
|
||||
return array($lieu, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[0] == $object) {
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function nbObjectInFile($object)
|
||||
{
|
||||
$c = 0;
|
||||
foreach($this->files as $key => $file)
|
||||
{
|
||||
foreach($file as $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
$c += $element[1];
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
public function nbObjectInFile($object)
|
||||
{
|
||||
$c = 0;
|
||||
foreach ($this->files as $key => $file) {
|
||||
foreach ($file as $element) {
|
||||
if ($element[0] == $object) {
|
||||
$c += $element[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function addObjet($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999)
|
||||
throw new ExceptionHB(3, 8);
|
||||
public function addObjet($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999) {
|
||||
throw new ExceptionHB(3, 8);
|
||||
}
|
||||
|
||||
//Validation des conditions de construction
|
||||
if (!dCaserne::needed($object, $planete))
|
||||
throw new ExceptionHB(3, 2);
|
||||
//Validation des conditions de construction
|
||||
if (!dCaserne::needed($object, $planete)) {
|
||||
throw new ExceptionHB(3, 2);
|
||||
}
|
||||
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!($sauvLastKey = $this->objectInFile($object, $lieu)) && !$this->checkMaxSize($planete, $lieu))
|
||||
throw new ExceptionHB(3, 1);
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!($sauvLastKey = $this->objectInFile($object, $lieu)) && !$this->checkMaxSize($planete, $lieu)) {
|
||||
throw new ExceptionHB(3, 1);
|
||||
}
|
||||
|
||||
//On tronque au maximum d'unités constructible sur la planète
|
||||
if (($metal = dCaserne::metal($object, 1, $planete)) > 0)
|
||||
$metal = $planete->metal/$metal;
|
||||
else
|
||||
$metal = $nombre;
|
||||
if (($cristal = dCaserne::cristal($object, 1, $planete)) > 0)
|
||||
$cristal = $planete->cristal/$cristal;
|
||||
else
|
||||
$cristal = $nombre;
|
||||
if (($hydrogene = dCaserne::hydrogene($object, 1, $planete)) > 0)
|
||||
$hydrogene = $planete->hydrogene/$hydrogene;
|
||||
else
|
||||
$hydrogene = $nombre;
|
||||
//On tronque au maximum d'unités constructible sur la planète
|
||||
if (($metal = dCaserne::metal($object, 1, $planete)) > 0) {
|
||||
$metal = $planete->metal/$metal;
|
||||
} else {
|
||||
$metal = $nombre;
|
||||
}
|
||||
if (($cristal = dCaserne::cristal($object, 1, $planete)) > 0) {
|
||||
$cristal = $planete->cristal/$cristal;
|
||||
} else {
|
||||
$cristal = $nombre;
|
||||
}
|
||||
if (($hydrogene = dCaserne::hydrogene($object, 1, $planete)) > 0) {
|
||||
$hydrogene = $planete->hydrogene/$hydrogene;
|
||||
} else {
|
||||
$hydrogene = $nombre;
|
||||
}
|
||||
|
||||
$nombre = floor(min($nombre, $metal, $cristal, $hydrogene));
|
||||
$nombre = floor(min($nombre, $metal, $cristal, $hydrogene));
|
||||
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dCaserne::metal($object, $nombre, $planete), dCaserne::cristal($object, $nombre, $planete), dCaserne::hydrogene($object, $nombre, $planete), dCaserne::credits($object, $nombre, $planete)))
|
||||
{
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if(isset($sauvLastKey) && isset($this->files[$sauvLastKey[0]][$sauvLastKey[1]]))
|
||||
{
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($sauvLastKey[0]);
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dCaserne::metal($object, $nombre, $planete), dCaserne::cristal($object, $nombre, $planete), dCaserne::hydrogene($object, $nombre, $planete), dCaserne::credits($object, $nombre, $planete))) {
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if (isset($sauvLastKey) && isset($this->files[$sauvLastKey[0]][$sauvLastKey[1]])) {
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($sauvLastKey[0]);
|
||||
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($lieu))
|
||||
{
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
} else {
|
||||
if (!isset($lieu)) {
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
}
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
}
|
||||
|
||||
$planete->addModif("file_cas");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
throw new ExceptionHB(3, 4);
|
||||
}
|
||||
$planete->addModif("file_cas");
|
||||
return true;
|
||||
} else {
|
||||
throw new ExceptionHB(3, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public function addDemolition($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete, $lieu) && !($sauvLastKey = $this->objectInFile($object, $lieu)))
|
||||
throw new ExceptionHB(3, 1);
|
||||
public function addDemolition($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete, $lieu) && !($sauvLastKey = $this->objectInFile($object, $lieu))) {
|
||||
throw new ExceptionHB(3, 1);
|
||||
}
|
||||
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999)
|
||||
throw new ExceptionHB(3, 8);
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999) {
|
||||
throw new ExceptionHB(3, 8);
|
||||
}
|
||||
|
||||
//On vérifie que le nombre d'unité actuel soit non nul
|
||||
if ($planete->casernes[$object] < $nombre)
|
||||
throw new ExceptionHB(3, 6);
|
||||
//On vérifie que le nombre d'unité actuel soit non nul
|
||||
if ($planete->casernes[$object] < $nombre) {
|
||||
throw new ExceptionHB(3, 6);
|
||||
}
|
||||
|
||||
if (!isset($lieu))
|
||||
{
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
if (!isset($lieu)) {
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if(isset($sauvLastKey))
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
else
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if (isset($sauvLastKey)) {
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
} else {
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
}
|
||||
|
||||
$planete->addModif("file_cas");
|
||||
$planete->addModif("file_cas");
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id]))
|
||||
throw new ExceptionHB(1, 5);
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id])) {
|
||||
throw new ExceptionHB(1, 5);
|
||||
}
|
||||
|
||||
//Si $nombre est supérieur au nombre présent dans la file, on le réduit
|
||||
if ($this->files[$lieu][$id][1] < $nombre)
|
||||
$nombre = $this->files[$lieu][$id][1];
|
||||
//Si $nombre est supérieur au nombre présent dans la file, on le réduit
|
||||
if ($this->files[$lieu][$id][1] < $nombre) {
|
||||
$nombre = $this->files[$lieu][$id][1];
|
||||
}
|
||||
|
||||
//On récupère les informations disponibles
|
||||
$objet = $this->files[$lieu][$id][0];
|
||||
$nombreMax = $this->files[$lieu][$id][1];
|
||||
//On récupère les informations disponibles
|
||||
$objet = $this->files[$lieu][$id][0];
|
||||
$nombreMax = $this->files[$lieu][$id][1];
|
||||
|
||||
//On met à jour le temps si on vient d'annuler le premier groupe d'unités en lice
|
||||
if ($id == $this->findFirstKey($lieu) && $nombreMax == $nombre)
|
||||
$this->times[$lieu] = time();
|
||||
//On met à jour le temps si on vient d'annuler le premier groupe d'unités en lice
|
||||
if ($id == $this->findFirstKey($lieu) && $nombreMax == $nombre) {
|
||||
$this->times[$lieu] = time();
|
||||
}
|
||||
|
||||
$planete->addModif("file_cas");
|
||||
$planete->addModif("file_cas");
|
||||
|
||||
if (!$this->files[$lieu][$id][2])
|
||||
$planete->addRessources(dCaserne::metal($objet, $nombre, $planete), dCaserne::cristal($objet, $nombre, $planete), dCaserne::hydrogene($objet, $nombre, $planete), dCaserne::credits($objet, $nombre, $planete));
|
||||
if (!$this->files[$lieu][$id][2]) {
|
||||
$planete->addRessources(dCaserne::metal($objet, $nombre, $planete), dCaserne::cristal($objet, $nombre, $planete), dCaserne::hydrogene($objet, $nombre, $planete), dCaserne::credits($objet, $nombre, $planete));
|
||||
}
|
||||
|
||||
//Effacement de la file
|
||||
if ($nombre >= $nombreMax)
|
||||
unset($this->files[$lieu][$id]);
|
||||
else
|
||||
$this->files[$lieu][$id][1] -= $nombre;
|
||||
$planete->addModif("file_cas");
|
||||
//Effacement de la file
|
||||
if ($nombre >= $nombreMax) {
|
||||
unset($this->files[$lieu][$id]);
|
||||
} else {
|
||||
$this->files[$lieu][$id][1] -= $nombre;
|
||||
}
|
||||
$planete->addModif("file_cas");
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0)
|
||||
continue;
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//On parcourt la liste à la recherche des unités terminées dans l'ordre
|
||||
foreach($file as $keyE => $element)
|
||||
{
|
||||
//Calcul du temps écoulé depuis le dernier entraînement
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
//On parcourt la liste à la recherche des unités terminées dans l'ordre
|
||||
foreach ($file as $keyE => $element) {
|
||||
//Calcul du temps écoulé depuis le dernier entraînement
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
|
||||
//On gére les licenciments !
|
||||
if ($element[2])
|
||||
{
|
||||
//On vérifie qu'il reste des unités du type sur la planète
|
||||
if ($planete->casernes[$element[0]] <= 0)
|
||||
{
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$planete->addModif("file_cas");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Récupération de 60% du temps nécessaire
|
||||
$tempsNecessaire = dCaserne::temps($element[0], 1, $planete) * 0.6;
|
||||
//On gére les licenciments !
|
||||
if ($element[2]) {
|
||||
//On vérifie qu'il reste des unités du type sur la planète
|
||||
if ($planete->casernes[$element[0]] <= 0) {
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$planete->addModif("file_cas");
|
||||
} else {
|
||||
//Récupération de 60% du temps nécessaire
|
||||
$tempsNecessaire = dCaserne::temps($element[0], 1, $planete) * 0.6;
|
||||
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1], $planete->casernes[$element[0]]);
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1], $planete->casernes[$element[0]]);
|
||||
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0)
|
||||
{
|
||||
//On redonne 70% des ressources de l'unité au joueur
|
||||
$planete->addRessources(dCaserne::metal($element[0], $nbUnitee, $planete)*0.7, dCaserne::cristal($element[0], $nbUnitee, $planete)*0.7, dCaserne::hydrogene($element[0], $nbUnitee, $planete)*0.7, dCaserne::credits($element[0], $nbUnitee, $planete)*0.7);
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0) {
|
||||
//On redonne 70% des ressources de l'unité au joueur
|
||||
$planete->addRessources(dCaserne::metal($element[0], $nbUnitee, $planete)*0.7, dCaserne::cristal($element[0], $nbUnitee, $planete)*0.7, dCaserne::hydrogene($element[0], $nbUnitee, $planete)*0.7, dCaserne::credits($element[0], $nbUnitee, $planete)*0.7);
|
||||
|
||||
//On retire les unités
|
||||
$planete->casernes[$element[0]] -= $nbUnitee;
|
||||
//On retire les unités
|
||||
$planete->casernes[$element[0]] -= $nbUnitee;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1])
|
||||
unset($this->filefiles[$keyF][$keyE]);
|
||||
else
|
||||
$this->file[$key][1] -= $nbUnitee;
|
||||
$this->timefiles[$keyF] += $tempsNecessaire*$nbUnitee;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1]) {
|
||||
unset($this->filefiles[$keyF][$keyE]);
|
||||
} else {
|
||||
$this->file[$key][1] -= $nbUnitee;
|
||||
}
|
||||
$this->timefiles[$keyF] += $tempsNecessaire*$nbUnitee;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("casernes", $element[0]));
|
||||
$planete->addModif("file_cas");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("casernes", $element[0]));
|
||||
$planete->addModif("file_cas");
|
||||
|
||||
if ($nbUnitee < $element[1])
|
||||
return false;
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour cette unité, on annule toutes les suivantes
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
else //Cas de la construction
|
||||
{
|
||||
//Récupération du temps nécessaire
|
||||
$tempsNecessaire = dCaserne::temps($element[0], 1, $planete);
|
||||
if ($nbUnitee < $element[1]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour cette unité, on annule toutes les suivantes
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else { //Cas de la construction
|
||||
//Récupération du temps nécessaire
|
||||
$tempsNecessaire = dCaserne::temps($element[0], 1, $planete);
|
||||
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1]);
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1]);
|
||||
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0)
|
||||
{
|
||||
//On ajoute le nombre d'unités
|
||||
$planete->casernes[$element[0]] += $nbUnitee;
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0) {
|
||||
//On ajoute le nombre d'unités
|
||||
$planete->casernes[$element[0]] += $nbUnitee;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1])
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
else
|
||||
$this->files[$keyF][$keyE][1] -= $nbUnitee;
|
||||
$this->times[$keyF] += $tempsNecessaire * $nbUnitee;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1]) {
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
} else {
|
||||
$this->files[$keyF][$keyE][1] -= $nbUnitee;
|
||||
}
|
||||
$this->times[$keyF] += $tempsNecessaire * $nbUnitee;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("casernes", $element[0]));
|
||||
$planete->addModif("file_cas");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("casernes", $element[0]));
|
||||
$planete->addModif("file_cas");
|
||||
|
||||
if ($nbUnitee < $element[1])
|
||||
break;
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($nbUnitee < $element[1]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function printFile(SURFACE $planete, $lieu = NULL)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file)
|
||||
{
|
||||
if (isset($lieu) && $lieu != $keyF)
|
||||
continue;
|
||||
public function printFile(SURFACE $planete, $lieu = null)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
if (isset($lieu) && $lieu != $keyF) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element)
|
||||
{
|
||||
if ($element[2])
|
||||
{
|
||||
$temps = dCaserne::temps($element[0], 1, $planete) * 0.6;
|
||||
if ($prems)
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
else
|
||||
$temps_moins = 0;
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems);
|
||||
}
|
||||
else
|
||||
{
|
||||
$temps = dCaserne::temps($element[0], 1, $planete);
|
||||
if ($prems)
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
else
|
||||
$temps_moins = 0;
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems);
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[2]) {
|
||||
$temps = dCaserne::temps($element[0], 1, $planete) * 0.6;
|
||||
if ($prems) {
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
} else {
|
||||
$temps_moins = 0;
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems);
|
||||
} else {
|
||||
$temps = dCaserne::temps($element[0], 1, $planete);
|
||||
if ($prems) {
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
} else {
|
||||
$temps_moins = 0;
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems);
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,113 +1,113 @@
|
|||
<?php
|
||||
if(!defined('ONYX')) exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
interface File
|
||||
{
|
||||
public function objectInFile($object);
|
||||
public function nbObjectInFile($object);
|
||||
public function addObjet($object, $nombre, surface $planete);
|
||||
public function addDemolition($object, $nombre, surface $planete);
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete);
|
||||
public function ready(surface $planete);
|
||||
public function objectInFile($object);
|
||||
public function nbObjectInFile($object);
|
||||
public function addObjet($object, $nombre, surface $planete);
|
||||
public function addDemolition($object, $nombre, surface $planete);
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete);
|
||||
public function ready(surface $planete);
|
||||
|
||||
public function printFile(surface $planete, $lieu = NULL);
|
||||
public function printFile(surface $planete, $lieu = null);
|
||||
}
|
||||
|
||||
class FileCommun
|
||||
{
|
||||
protected $files = array();
|
||||
protected $times = array();
|
||||
protected $simultane;
|
||||
protected $files = array();
|
||||
protected $times = array();
|
||||
protected $simultane;
|
||||
|
||||
function __construct()
|
||||
{
|
||||
$this->times[] = time();
|
||||
$this->simultane = 1;
|
||||
}
|
||||
public function __construct()
|
||||
{
|
||||
$this->times[] = time();
|
||||
$this->simultane = 1;
|
||||
}
|
||||
|
||||
function refreshTime($lieu)
|
||||
{
|
||||
if (empty($this->files[$lieu]) || count($this->files[$lieu]) < 1)
|
||||
$this->times[$lieu] = time();
|
||||
}
|
||||
public function refreshTime($lieu)
|
||||
{
|
||||
if (empty($this->files[$lieu]) || count($this->files[$lieu]) < 1) {
|
||||
$this->times[$lieu] = time();
|
||||
}
|
||||
}
|
||||
|
||||
function reajusteVacances($timelost)
|
||||
{
|
||||
foreach($this->times as $key => $time)
|
||||
$this->times[$key] += $timelost;
|
||||
public function reajusteVacances($timelost)
|
||||
{
|
||||
foreach ($this->times as $key => $time) {
|
||||
$this->times[$key] += $timelost;
|
||||
}
|
||||
|
||||
return serialize($this);
|
||||
}
|
||||
return serialize($this);
|
||||
}
|
||||
|
||||
function hasObject()
|
||||
{
|
||||
foreach($this->files as $file)
|
||||
{
|
||||
if (count($file) > 0)
|
||||
return true;
|
||||
}
|
||||
public function hasObject()
|
||||
{
|
||||
foreach ($this->files as $file) {
|
||||
if (count($file) > 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkMaxSize(surface $planete, $lieu = null)
|
||||
{
|
||||
$nombre = 0;
|
||||
if (isset($lieu))
|
||||
{
|
||||
if (!empty($this->files[$lieu]))
|
||||
$nombre = count($this->files[$lieu]);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($this->files as $file)
|
||||
{
|
||||
$nombre += count($file);
|
||||
}
|
||||
}
|
||||
public function checkMaxSize(surface $planete, $lieu = null)
|
||||
{
|
||||
$nombre = 0;
|
||||
if (isset($lieu)) {
|
||||
if (!empty($this->files[$lieu])) {
|
||||
$nombre = count($this->files[$lieu]);
|
||||
}
|
||||
} else {
|
||||
foreach ($this->files as $file) {
|
||||
$nombre += count($file);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ($nombre < dDonnees::tailleFile($planete));
|
||||
}
|
||||
return ($nombre < dDonnees::tailleFile($planete));
|
||||
}
|
||||
|
||||
function findShorter()
|
||||
{
|
||||
$short = 0;
|
||||
$value = 99;
|
||||
foreach($this->files as $key => $file)
|
||||
{
|
||||
if ($key >= $this->simultane)
|
||||
break;
|
||||
public function findShorter()
|
||||
{
|
||||
$short = 0;
|
||||
$value = 99;
|
||||
foreach ($this->files as $key => $file) {
|
||||
if ($key >= $this->simultane) {
|
||||
break;
|
||||
}
|
||||
|
||||
$count = count($file);
|
||||
if ($value > $count)
|
||||
{
|
||||
$value = $count;
|
||||
$short = $key;
|
||||
}
|
||||
}
|
||||
$count = count($file);
|
||||
if ($value > $count) {
|
||||
$value = $count;
|
||||
$short = $key;
|
||||
}
|
||||
}
|
||||
|
||||
return $short;
|
||||
}
|
||||
return $short;
|
||||
}
|
||||
|
||||
function findFirstKey($lieu)
|
||||
{
|
||||
foreach($this->files[$lieu] as $key => $file)
|
||||
return $key;
|
||||
}
|
||||
public function findFirstKey($lieu)
|
||||
{
|
||||
foreach ($this->files[$lieu] as $key => $file) {
|
||||
return $key;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DEBUG__print()
|
||||
{
|
||||
var_dump($this);
|
||||
var_dump($this->files);
|
||||
}
|
||||
public function DEBUG__print()
|
||||
{
|
||||
var_dump($this);
|
||||
var_dump($this->files);
|
||||
}
|
||||
|
||||
function DEBUG__setTime($lieu, $moins)
|
||||
{
|
||||
$this->times[$lieu] -= $moins;
|
||||
public function DEBUG__setTime($lieu, $moins)
|
||||
{
|
||||
$this->times[$lieu] -= $moins;
|
||||
|
||||
return $this->times[$lieu];
|
||||
}
|
||||
return $this->times[$lieu];
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -3,307 +3,304 @@ require_once("Class/File/interface.php");
|
|||
|
||||
class FileSpatial extends FileCommun implements File
|
||||
{
|
||||
public function objectInFile($object, $lieu = null)
|
||||
{
|
||||
if (isset($lieu))
|
||||
{
|
||||
if (!empty($this->files[$lieu]))
|
||||
{
|
||||
foreach($this->files[$lieu] as $keyE => $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
return array($lieu, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
foreach($file as $keyE => $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function objectInFile($object, $lieu = null)
|
||||
{
|
||||
if (isset($lieu)) {
|
||||
if (!empty($this->files[$lieu])) {
|
||||
foreach ($this->files[$lieu] as $keyE => $element) {
|
||||
if ($element[0] == $object) {
|
||||
return array($lieu, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[0] == $object) {
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function nbObjectInFile($object)
|
||||
{
|
||||
$c = 0;
|
||||
foreach($this->files as $key => $file)
|
||||
{
|
||||
foreach($file as $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
$c += $element[1];
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
public function nbObjectInFile($object)
|
||||
{
|
||||
$c = 0;
|
||||
foreach ($this->files as $key => $file) {
|
||||
foreach ($file as $element) {
|
||||
if ($element[0] == $object) {
|
||||
$c += $element[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function addObjet($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999)
|
||||
throw new ExceptionHB(3, 8);
|
||||
public function addObjet($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999) {
|
||||
throw new ExceptionHB(3, 8);
|
||||
}
|
||||
|
||||
//Validation des conditions de construction
|
||||
if (!dSpatial::needed($object, $planete))
|
||||
throw new ExceptionHB(3, 2);
|
||||
//Validation des conditions de construction
|
||||
if (!dSpatial::needed($object, $planete)) {
|
||||
throw new ExceptionHB(3, 2);
|
||||
}
|
||||
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!($sauvLastKey = $this->objectInFile($object, $lieu)) && !$this->checkMaxSize($planete, $lieu))
|
||||
throw new ExceptionHB(3, 1);
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!($sauvLastKey = $this->objectInFile($object, $lieu)) && !$this->checkMaxSize($planete, $lieu)) {
|
||||
throw new ExceptionHB(3, 1);
|
||||
}
|
||||
|
||||
//On tronque au maximum d'unités constructible sur la planète
|
||||
if (($metal = dSpatial::metal($object, 1, $planete)) > 0)
|
||||
$metal = $planete->metal/$metal;
|
||||
else
|
||||
$metal = $nombre;
|
||||
if (($cristal = dSpatial::cristal($object, 1, $planete)) > 0)
|
||||
$cristal = $planete->cristal/$cristal;
|
||||
else
|
||||
$cristal = $nombre;
|
||||
if (($hydrogene = dSpatial::hydrogene($object, 1, $planete)) > 0)
|
||||
$hydrogene = $planete->hydrogene/$hydrogene;
|
||||
else
|
||||
$hydrogene = $nombre;
|
||||
//On tronque au maximum d'unités constructible sur la planète
|
||||
if (($metal = dSpatial::metal($object, 1, $planete)) > 0) {
|
||||
$metal = $planete->metal/$metal;
|
||||
} else {
|
||||
$metal = $nombre;
|
||||
}
|
||||
if (($cristal = dSpatial::cristal($object, 1, $planete)) > 0) {
|
||||
$cristal = $planete->cristal/$cristal;
|
||||
} else {
|
||||
$cristal = $nombre;
|
||||
}
|
||||
if (($hydrogene = dSpatial::hydrogene($object, 1, $planete)) > 0) {
|
||||
$hydrogene = $planete->hydrogene/$hydrogene;
|
||||
} else {
|
||||
$hydrogene = $nombre;
|
||||
}
|
||||
|
||||
$nombre = floor(min($nombre, $metal, $cristal, $hydrogene));
|
||||
$nombre = floor(min($nombre, $metal, $cristal, $hydrogene));
|
||||
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dSpatial::metal($object, $nombre, $planete), dSpatial::cristal($object, $nombre, $planete), dSpatial::hydrogene($object, $nombre, $planete), dSpatial::credits($object, $nombre, $planete)))
|
||||
{
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if(isset($sauvLastKey) && isset($this->files[$sauvLastKey[0]][$sauvLastKey[1]]))
|
||||
{
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($sauvLastKey[0]);
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dSpatial::metal($object, $nombre, $planete), dSpatial::cristal($object, $nombre, $planete), dSpatial::hydrogene($object, $nombre, $planete), dSpatial::credits($object, $nombre, $planete))) {
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if (isset($sauvLastKey) && isset($this->files[$sauvLastKey[0]][$sauvLastKey[1]])) {
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($sauvLastKey[0]);
|
||||
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($lieu))
|
||||
{
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
} else {
|
||||
if (!isset($lieu)) {
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
}
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
}
|
||||
|
||||
$planete->addModif("file_vais");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
throw new ExceptionHB(3, 4);
|
||||
}
|
||||
$planete->addModif("file_vais");
|
||||
return true;
|
||||
} else {
|
||||
throw new ExceptionHB(3, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public function addDemolition($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete, $lieu) && !($sauvLastKey = $this->objectInFile($object, $lieu)))
|
||||
throw new ExceptionHB(3, 1);
|
||||
public function addDemolition($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete, $lieu) && !($sauvLastKey = $this->objectInFile($object, $lieu))) {
|
||||
throw new ExceptionHB(3, 1);
|
||||
}
|
||||
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999)
|
||||
throw new ExceptionHB(3, 8);
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999) {
|
||||
throw new ExceptionHB(3, 8);
|
||||
}
|
||||
|
||||
//On vérifie que le nombre d'unité actuel soit non nul
|
||||
if ($planete->vaisseaux[$object] < $nombre)
|
||||
throw new ExceptionHB(3, 6);
|
||||
//On vérifie que le nombre d'unité actuel soit non nul
|
||||
if ($planete->vaisseaux[$object] < $nombre) {
|
||||
throw new ExceptionHB(3, 6);
|
||||
}
|
||||
|
||||
if (!isset($lieu))
|
||||
{
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
if (!isset($lieu)) {
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if(isset($sauvLastKey))
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
else
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if (isset($sauvLastKey)) {
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
} else {
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
}
|
||||
|
||||
$planete->addModif("file_vais");
|
||||
$planete->addModif("file_vais");
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id]))
|
||||
throw new ExceptionHB(1, 5);
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id])) {
|
||||
throw new ExceptionHB(1, 5);
|
||||
}
|
||||
|
||||
//Si $nombre est supérieur au nombre présent dans la file, on le réduit
|
||||
if ($this->files[$lieu][$id][1] < $nombre)
|
||||
$nombre = $this->files[$lieu][$id][1];
|
||||
//Si $nombre est supérieur au nombre présent dans la file, on le réduit
|
||||
if ($this->files[$lieu][$id][1] < $nombre) {
|
||||
$nombre = $this->files[$lieu][$id][1];
|
||||
}
|
||||
|
||||
//On récupère les informations disponibles
|
||||
$objet = $this->files[$lieu][$id][0];
|
||||
$nombreMax = $this->files[$lieu][$id][1];
|
||||
//On récupère les informations disponibles
|
||||
$objet = $this->files[$lieu][$id][0];
|
||||
$nombreMax = $this->files[$lieu][$id][1];
|
||||
|
||||
//On met à jour le temps si on vient d'annuler le premier groupe d'unités en lice
|
||||
if ($id == $this->findFirstKey($lieu) && $nombreMax == $nombre)
|
||||
$this->times[$lieu] = time();
|
||||
//On met à jour le temps si on vient d'annuler le premier groupe d'unités en lice
|
||||
if ($id == $this->findFirstKey($lieu) && $nombreMax == $nombre) {
|
||||
$this->times[$lieu] = time();
|
||||
}
|
||||
|
||||
$planete->addModif("file_vais");
|
||||
$planete->addModif("file_vais");
|
||||
|
||||
if (!$this->files[$lieu][$id][2])
|
||||
$planete->addRessources(dSpatial::metal($objet, $nombre, $planete), dSpatial::cristal($objet, $nombre, $planete), dSpatial::hydrogene($objet, $nombre, $planete), dSpatial::credits($objet, $nombre, $planete));
|
||||
if (!$this->files[$lieu][$id][2]) {
|
||||
$planete->addRessources(dSpatial::metal($objet, $nombre, $planete), dSpatial::cristal($objet, $nombre, $planete), dSpatial::hydrogene($objet, $nombre, $planete), dSpatial::credits($objet, $nombre, $planete));
|
||||
}
|
||||
|
||||
//Effacement de la file
|
||||
if ($nombre >= $nombreMax)
|
||||
unset($this->files[$lieu][$id]);
|
||||
else
|
||||
$this->files[$lieu][$id][1] -= $nombre;
|
||||
$planete->addModif("file_vais");
|
||||
//Effacement de la file
|
||||
if ($nombre >= $nombreMax) {
|
||||
unset($this->files[$lieu][$id]);
|
||||
} else {
|
||||
$this->files[$lieu][$id][1] -= $nombre;
|
||||
}
|
||||
$planete->addModif("file_vais");
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0)
|
||||
continue;
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//On parcourt la liste à la recherche des unités terminées dans l'ordre
|
||||
foreach($file as $keyE => $element)
|
||||
{
|
||||
//Calcul du temps écoulé depuis le dernier entraînement
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
//On parcourt la liste à la recherche des unités terminées dans l'ordre
|
||||
foreach ($file as $keyE => $element) {
|
||||
//Calcul du temps écoulé depuis le dernier entraînement
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
|
||||
//On gére les licenciments !
|
||||
if ($element[2])
|
||||
{
|
||||
//On vérifie qu'il reste des unités du type sur la planète
|
||||
if ($planete->vaisseaux[$element[0]] <= 0)
|
||||
{
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$planete->addModif("file_vais");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Récupération de 60% du temps nécessaire
|
||||
$tempsNecessaire = dSpatial::temps($element[0], 1, $planete) * 0.6;
|
||||
//On gére les licenciments !
|
||||
if ($element[2]) {
|
||||
//On vérifie qu'il reste des unités du type sur la planète
|
||||
if ($planete->vaisseaux[$element[0]] <= 0) {
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$planete->addModif("file_vais");
|
||||
} else {
|
||||
//Récupération de 60% du temps nécessaire
|
||||
$tempsNecessaire = dSpatial::temps($element[0], 1, $planete) * 0.6;
|
||||
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1], $planete->vaisseaux[$element[0]]);
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1], $planete->vaisseaux[$element[0]]);
|
||||
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0)
|
||||
{
|
||||
//On redonne 70% des ressources de l'unité au joueur
|
||||
$planete->addRessources(dSpatial::metal($element[0], $nbUnitee, $planete)*0.7, dSpatial::cristal($element[0], $nbUnitee, $planete)*0.7, dSpatial::hydrogene($element[0], $nbUnitee, $planete)*0.7, dSpatial::credits($element[0], $nbUnitee, $planete)*0.7);
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0) {
|
||||
//On redonne 70% des ressources de l'unité au joueur
|
||||
$planete->addRessources(dSpatial::metal($element[0], $nbUnitee, $planete)*0.7, dSpatial::cristal($element[0], $nbUnitee, $planete)*0.7, dSpatial::hydrogene($element[0], $nbUnitee, $planete)*0.7, dSpatial::credits($element[0], $nbUnitee, $planete)*0.7);
|
||||
|
||||
//On retire les unités
|
||||
$planete->vaisseaux[$element[0]] -= $nbUnitee;
|
||||
//On retire les unités
|
||||
$planete->vaisseaux[$element[0]] -= $nbUnitee;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1])
|
||||
unset($this->filefiles[$keyF][$keyE]);
|
||||
else
|
||||
$this->file[$key][1] -= $nbUnitee;
|
||||
$this->timefiles[$keyF] += $tempsNecessaire*$nbUnitee;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1]) {
|
||||
unset($this->filefiles[$keyF][$keyE]);
|
||||
} else {
|
||||
$this->file[$key][1] -= $nbUnitee;
|
||||
}
|
||||
$this->timefiles[$keyF] += $tempsNecessaire*$nbUnitee;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("vaisseaux", $element[0]));
|
||||
$planete->addModif("file_vais");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("vaisseaux", $element[0]));
|
||||
$planete->addModif("file_vais");
|
||||
|
||||
if ($nbUnitee < $element[1])
|
||||
return false;
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour cette unité, on annule toutes les suivantes
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
else //Cas de la construction
|
||||
{
|
||||
//Récupération du temps nécessaire
|
||||
$tempsNecessaire = dSpatial::temps($element[0], 1, $planete);
|
||||
if ($nbUnitee < $element[1]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour cette unité, on annule toutes les suivantes
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else { //Cas de la construction
|
||||
//Récupération du temps nécessaire
|
||||
$tempsNecessaire = dSpatial::temps($element[0], 1, $planete);
|
||||
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1]);
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1]);
|
||||
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0)
|
||||
{
|
||||
//On ajoute le nombre d'unités
|
||||
$planete->vaisseaux[$element[0]] += $nbUnitee;
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0) {
|
||||
//On ajoute le nombre d'unités
|
||||
$planete->vaisseaux[$element[0]] += $nbUnitee;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1])
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
else
|
||||
$this->files[$keyF][$keyE][1] -= $nbUnitee;
|
||||
$this->times[$keyF] += $tempsNecessaire * $nbUnitee;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1]) {
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
} else {
|
||||
$this->files[$keyF][$keyE][1] -= $nbUnitee;
|
||||
}
|
||||
$this->times[$keyF] += $tempsNecessaire * $nbUnitee;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("vaisseaux", $element[0]));
|
||||
$planete->addModif("file_vais");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("vaisseaux", $element[0]));
|
||||
$planete->addModif("file_vais");
|
||||
|
||||
if ($nbUnitee < $element[1])
|
||||
break;
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($nbUnitee < $element[1]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function printFile(SURFACE $planete, $lieu = NULL)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file)
|
||||
{
|
||||
if (isset($lieu) && $lieu != $keyF)
|
||||
continue;
|
||||
public function printFile(SURFACE $planete, $lieu = null)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
if (isset($lieu) && $lieu != $keyF) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element)
|
||||
{
|
||||
if ($element[2])
|
||||
{
|
||||
$temps = dSpatial::temps($element[0], 1, $planete) * 0.6;
|
||||
if ($prems)
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
else
|
||||
$temps_moins = 0;
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems);
|
||||
}
|
||||
else
|
||||
{
|
||||
$temps = dSpatial::temps($element[0], 1, $planete);
|
||||
if ($prems)
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
else
|
||||
$temps_moins = 0;
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems);
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[2]) {
|
||||
$temps = dSpatial::temps($element[0], 1, $planete) * 0.6;
|
||||
if ($prems) {
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
} else {
|
||||
$temps_moins = 0;
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems);
|
||||
} else {
|
||||
$temps = dSpatial::temps($element[0], 1, $planete);
|
||||
if ($prems) {
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
} else {
|
||||
$temps_moins = 0;
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems);
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -5,159 +5,160 @@ require_once("Class/File/interface.php");
|
|||
|
||||
class FileTechnologies extends FileCommun implements File
|
||||
{
|
||||
public function objectInFile($object)
|
||||
{
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
foreach($file as $keyE => $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public function objectInFile($object)
|
||||
{
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[0] == $object) {
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function nbObjectInFile($branche, $tech = null)
|
||||
{
|
||||
$c = 0;
|
||||
foreach($this->files as $file)
|
||||
{
|
||||
$c += count(array_keys($file, array($branche, $tech)));
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
public function nbObjectInFile($branche, $tech = null)
|
||||
{
|
||||
$c = 0;
|
||||
foreach ($this->files as $file) {
|
||||
$c += count(array_keys($file, array($branche, $tech)));
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function addObjet($branche, $tech, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete))
|
||||
throw new ExceptionHB(4, 1);
|
||||
public function addObjet($branche, $tech, surface $planete)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete)) {
|
||||
throw new ExceptionHB(4, 1);
|
||||
}
|
||||
|
||||
//On vérifie qu'il n'y ait pas une recherche de la même technologie
|
||||
if ($this->nbObjectInFile($branche, $tech) >= 1)
|
||||
throw new ExceptionHB(4, 7);
|
||||
//On vérifie qu'il n'y ait pas une recherche de la même technologie
|
||||
if ($this->nbObjectInFile($branche, $tech) >= 1) {
|
||||
throw new ExceptionHB(4, 7);
|
||||
}
|
||||
|
||||
//On vérifie que la technologie ne soit pas déjà développée
|
||||
if (dTechnologies::idToBit($tech) & $planete->technologies[$branche])
|
||||
throw new ExceptionHB(4, 7);
|
||||
//On vérifie que la technologie ne soit pas déjà développée
|
||||
if (dTechnologies::idToBit($tech) & $planete->technologies[$branche]) {
|
||||
throw new ExceptionHB(4, 7);
|
||||
}
|
||||
|
||||
//Validation des conditions de construction
|
||||
if (!dTechnologies::needed(array($branche, $tech), $planete))
|
||||
throw new ExceptionHB(4, 2);
|
||||
//Validation des conditions de construction
|
||||
if (!dTechnologies::needed(array($branche, $tech), $planete)) {
|
||||
throw new ExceptionHB(4, 2);
|
||||
}
|
||||
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dTechnologies::metal($branche, $tech, $planete), dTechnologies::cristal($branche, $tech, $planete), dTechnologies::hydrogene($branche, $tech, $planete), dTechnologies::credits($branche, $tech, $planete)))
|
||||
{
|
||||
$this->files[$lieu][] = array($branche, $tech);
|
||||
$planete->addModif("file_tech");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
throw new ExceptionHB(4, 4);
|
||||
}
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dTechnologies::metal($branche, $tech, $planete), dTechnologies::cristal($branche, $tech, $planete), dTechnologies::hydrogene($branche, $tech, $planete), dTechnologies::credits($branche, $tech, $planete))) {
|
||||
$this->files[$lieu][] = array($branche, $tech);
|
||||
$planete->addModif("file_tech");
|
||||
return true;
|
||||
} else {
|
||||
throw new ExceptionHB(4, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public function addDemolition($object, $nombre = 1, surface $planete)
|
||||
{
|
||||
trigger_error("Pas de démolition possible pour les technologies");
|
||||
}
|
||||
public function addDemolition($object, $nombre = 1, surface $planete)
|
||||
{
|
||||
trigger_error("Pas de démolition possible pour les technologies");
|
||||
}
|
||||
|
||||
public function delObjet($id, $nombre = 1, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id]))
|
||||
throw new ExceptionHB(4, 5);
|
||||
public function delObjet($id, $nombre = 1, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id])) {
|
||||
throw new ExceptionHB(4, 5);
|
||||
}
|
||||
|
||||
//On récupère la branche et l'id de la technologie
|
||||
$branche = $this->files[$lieu][$id][0];
|
||||
$tech = $this->files[$lieu][$id][1];
|
||||
//On récupère la branche et l'id de la technologie
|
||||
$branche = $this->files[$lieu][$id][0];
|
||||
$tech = $this->files[$lieu][$id][1];
|
||||
|
||||
//On met à jour le temps si on vient d'annuler la première recherche en lice
|
||||
if ($tech == $this->findFirstKey($lieu))
|
||||
$this->times[$lieu] = time();
|
||||
//On met à jour le temps si on vient d'annuler la première recherche en lice
|
||||
if ($tech == $this->findFirstKey($lieu)) {
|
||||
$this->times[$lieu] = time();
|
||||
}
|
||||
|
||||
$planete->addModif("file_tech");
|
||||
$planete->addModif("file_tech");
|
||||
|
||||
//On redonne 70% des ressources au joueur si c'est la première construction dans la file d'attente
|
||||
if ($id == 0)
|
||||
$planete->addRessources(dTechnologies::metal($branche, $tech, $planete)*0.7, dTechnologies::cristal($branche, $tech, $planete)*0.7, dTechnologies::hydrogene($branche, $tech, $planete)*0.7, dTechnologies::credits($branche, $tech, $planete)*0.7);
|
||||
else
|
||||
$planete->addRessources(dTechnologies::metal($branche, $tech, $planete), dTechnologies::cristal($branche, $tech, $planete), dTechnologies::hydrogene($branche, $tech, $planete), dTechnologies::credits($branche, $tech, $planete));
|
||||
//On redonne 70% des ressources au joueur si c'est la première construction dans la file d'attente
|
||||
if ($id == 0) {
|
||||
$planete->addRessources(dTechnologies::metal($branche, $tech, $planete)*0.7, dTechnologies::cristal($branche, $tech, $planete)*0.7, dTechnologies::hydrogene($branche, $tech, $planete)*0.7, dTechnologies::credits($branche, $tech, $planete)*0.7);
|
||||
} else {
|
||||
$planete->addRessources(dTechnologies::metal($branche, $tech, $planete), dTechnologies::cristal($branche, $tech, $planete), dTechnologies::hydrogene($branche, $tech, $planete), dTechnologies::credits($branche, $tech, $planete));
|
||||
}
|
||||
|
||||
//Effacement de la file
|
||||
unset($this->files[$lieu][$id]);
|
||||
//Effacement de la file
|
||||
unset($this->files[$lieu][$id]);
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function ready(surface $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de recherche
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0)
|
||||
continue;
|
||||
public function ready(surface $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de recherche
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//On parcourt la file
|
||||
foreach ($file as $keyE => $element)
|
||||
{
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
//On parcourt la file
|
||||
foreach ($file as $keyE => $element) {
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
|
||||
$tempsNecessaire = dTechnologies::temps($element[0], $element[1], $planete);
|
||||
$tempsNecessaire = dTechnologies::temps($element[0], $element[1], $planete);
|
||||
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($tempsEcoule >= $tempsNecessaire)
|
||||
{
|
||||
//On ajoute un niveau au batiment
|
||||
$planete->technologies[$element[0]] = $planete->technologies[$element[0]] | dTechnologies::idToBit($element[1]);
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($tempsEcoule >= $tempsNecessaire) {
|
||||
//On ajoute un niveau au batiment
|
||||
$planete->technologies[$element[0]] = $planete->technologies[$element[0]] | dTechnologies::idToBit($element[1]);
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$this->times[$keyF] += $tempsNecessaire;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModifUser(array("technologies", $element[0]));
|
||||
$planete->addModif("file_tech");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModifUser(array("technologies", $element[0]));
|
||||
$planete->addModif("file_tech");
|
||||
|
||||
//On ajoute les points
|
||||
$planete->addPoints(dTechnologies::metal($element[0], $element[0], $planete), dTechnologies::cristal($element[0], $element[1], $planete), dTechnologies::hydrogene($element[0], $element[1], $planete), dTechnologies::credits($element[0], $element[1], $planete));
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
//On ajoute les points
|
||||
$planete->addPoints(dTechnologies::metal($element[0], $element[0], $planete), dTechnologies::cristal($element[0], $element[1], $planete), dTechnologies::hydrogene($element[0], $element[1], $planete), dTechnologies::credits($element[0], $element[1], $planete));
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function printFile(surface $planete, $lieu = null)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file)
|
||||
{
|
||||
if (isset($lieu) && $lieu != $keyF)
|
||||
continue;
|
||||
public function printFile(surface $planete, $lieu = null)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
if (isset($lieu) && $lieu != $keyF) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element)
|
||||
{
|
||||
$temps = dTechnologies::temps($element[0], $element[1], $planete);
|
||||
if ($prems)
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element) {
|
||||
$temps = dTechnologies::temps($element[0], $element[1], $planete);
|
||||
if ($prems) {
|
||||
$temps -= time() - $this->times[$keyF];
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], ceil($temps), $prems);
|
||||
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -3,307 +3,304 @@ require_once("Class/File/interface.php");
|
|||
|
||||
class FileTerrestre extends FileCommun implements File
|
||||
{
|
||||
public function objectInFile($object, $lieu = null)
|
||||
{
|
||||
if (isset($lieu))
|
||||
{
|
||||
if (!empty($this->files[$lieu]))
|
||||
{
|
||||
foreach($this->files[$lieu] as $keyE => $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
return array($lieu, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
foreach($file as $keyE => $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function objectInFile($object, $lieu = null)
|
||||
{
|
||||
if (isset($lieu)) {
|
||||
if (!empty($this->files[$lieu])) {
|
||||
foreach ($this->files[$lieu] as $keyE => $element) {
|
||||
if ($element[0] == $object) {
|
||||
return array($lieu, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[0] == $object) {
|
||||
return array($keyF, $keyE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function nbObjectInFile($object)
|
||||
{
|
||||
$c = 0;
|
||||
foreach($this->files as $key => $file)
|
||||
{
|
||||
foreach($file as $element)
|
||||
{
|
||||
if ($element[0] == $object)
|
||||
$c += $element[1];
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
public function nbObjectInFile($object)
|
||||
{
|
||||
$c = 0;
|
||||
foreach ($this->files as $key => $file) {
|
||||
foreach ($file as $element) {
|
||||
if ($element[0] == $object) {
|
||||
$c += $element[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return $c;
|
||||
}
|
||||
|
||||
public function addObjet($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999)
|
||||
throw new ExceptionHB(3, 8);
|
||||
public function addObjet($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999) {
|
||||
throw new ExceptionHB(3, 8);
|
||||
}
|
||||
|
||||
//Validation des conditions de construction
|
||||
if (!dTerrestre::needed($object, $planete))
|
||||
throw new ExceptionHB(3, 2);
|
||||
//Validation des conditions de construction
|
||||
if (!dTerrestre::needed($object, $planete)) {
|
||||
throw new ExceptionHB(3, 2);
|
||||
}
|
||||
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!($sauvLastKey = $this->objectInFile($object, $lieu)) && !$this->checkMaxSize($planete, $lieu))
|
||||
throw new ExceptionHB(3, 1);
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!($sauvLastKey = $this->objectInFile($object, $lieu)) && !$this->checkMaxSize($planete, $lieu)) {
|
||||
throw new ExceptionHB(3, 1);
|
||||
}
|
||||
|
||||
//On tronque au maximum d'unités constructible sur la planète
|
||||
if (($metal = dTerrestre::metal($object, 1, $planete)) > 0)
|
||||
$metal = $planete->metal/$metal;
|
||||
else
|
||||
$metal = $nombre;
|
||||
if (($cristal = dTerrestre::cristal($object, 1, $planete)) > 0)
|
||||
$cristal = $planete->cristal/$cristal;
|
||||
else
|
||||
$cristal = $nombre;
|
||||
if (($hydrogene = dTerrestre::hydrogene($object, 1, $planete)) > 0)
|
||||
$hydrogene = $planete->hydrogene/$hydrogene;
|
||||
else
|
||||
$hydrogene = $nombre;
|
||||
//On tronque au maximum d'unités constructible sur la planète
|
||||
if (($metal = dTerrestre::metal($object, 1, $planete)) > 0) {
|
||||
$metal = $planete->metal/$metal;
|
||||
} else {
|
||||
$metal = $nombre;
|
||||
}
|
||||
if (($cristal = dTerrestre::cristal($object, 1, $planete)) > 0) {
|
||||
$cristal = $planete->cristal/$cristal;
|
||||
} else {
|
||||
$cristal = $nombre;
|
||||
}
|
||||
if (($hydrogene = dTerrestre::hydrogene($object, 1, $planete)) > 0) {
|
||||
$hydrogene = $planete->hydrogene/$hydrogene;
|
||||
} else {
|
||||
$hydrogene = $nombre;
|
||||
}
|
||||
|
||||
$nombre = floor(min($nombre, $metal, $cristal, $hydrogene));
|
||||
$nombre = floor(min($nombre, $metal, $cristal, $hydrogene));
|
||||
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dTerrestre::metal($object, $nombre, $planete), dTerrestre::cristal($object, $nombre, $planete), dTerrestre::hydrogene($object, $nombre, $planete), dTerrestre::credits($object, $nombre, $planete)))
|
||||
{
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if(isset($sauvLastKey) && isset($this->files[$sauvLastKey[0]][$sauvLastKey[1]]))
|
||||
{
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($sauvLastKey[0]);
|
||||
//On vérifie qu'il y ait assez de ressources sur la planète
|
||||
if ($planete->checkAndRetireRessources(dTerrestre::metal($object, $nombre, $planete), dTerrestre::cristal($object, $nombre, $planete), dTerrestre::hydrogene($object, $nombre, $planete), dTerrestre::credits($object, $nombre, $planete))) {
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if (isset($sauvLastKey) && isset($this->files[$sauvLastKey[0]][$sauvLastKey[1]])) {
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($sauvLastKey[0]);
|
||||
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isset($lieu))
|
||||
{
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
} else {
|
||||
if (!isset($lieu)) {
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
}
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
}
|
||||
|
||||
$planete->addModif("file_ter");
|
||||
return true;
|
||||
}
|
||||
else
|
||||
throw new ExceptionHB(3, 4);
|
||||
}
|
||||
$planete->addModif("file_ter");
|
||||
return true;
|
||||
} else {
|
||||
throw new ExceptionHB(3, 4);
|
||||
}
|
||||
}
|
||||
|
||||
public function addDemolition($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete, $lieu) && !($sauvLastKey = $this->objectInFile($object, $lieu)))
|
||||
throw new ExceptionHB(3, 1);
|
||||
public function addDemolition($object, $nombre, surface $planete, $lieu = null)
|
||||
{
|
||||
//On vérifie que l'on ne dépasse pas la taille maximale de la file
|
||||
if (!$this->checkMaxSize($planete, $lieu) && !($sauvLastKey = $this->objectInFile($object, $lieu))) {
|
||||
throw new ExceptionHB(3, 1);
|
||||
}
|
||||
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999)
|
||||
throw new ExceptionHB(3, 8);
|
||||
//Vérification du nombre passé en entrée
|
||||
if (!is_numeric($nombre) || $nombre < 0 || $nombre > 99999) {
|
||||
throw new ExceptionHB(3, 8);
|
||||
}
|
||||
|
||||
//On vérifie que le nombre d'unité actuel soit non nul
|
||||
if ($planete->terrestres[$object] < $nombre)
|
||||
throw new ExceptionHB(3, 6);
|
||||
//On vérifie que le nombre d'unité actuel soit non nul
|
||||
if ($planete->terrestres[$object] < $nombre) {
|
||||
throw new ExceptionHB(3, 6);
|
||||
}
|
||||
|
||||
if (!isset($lieu))
|
||||
{
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
if (!isset($lieu)) {
|
||||
//On recherche le lieu ayant le moins de construction en cours
|
||||
$lieu = $this->findShorter();
|
||||
}
|
||||
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
//On rafraîchit le temps de la file si aucun objet n'est en file d'attente
|
||||
$this->refreshTime($lieu);
|
||||
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if(isset($sauvLastKey))
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
else
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
//Si il existe déjà l'objet en file d'attente, on l'ajoute
|
||||
if (isset($sauvLastKey)) {
|
||||
$this->files[$sauvLastKey[0]][$sauvLastKey[1]][1] += $nombre;
|
||||
} else {
|
||||
$this->files[$lieu][] = array($object, $nombre, false);
|
||||
}
|
||||
|
||||
$planete->addModif("file_ter");
|
||||
$planete->addModif("file_ter");
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id]))
|
||||
throw new ExceptionHB(1, 5);
|
||||
public function delObjet($id, $nombre, $lieu, surface $planete)
|
||||
{
|
||||
//Vérification de l'existance de l'objet en file d'attente
|
||||
if (empty($this->files[$lieu][$id])) {
|
||||
throw new ExceptionHB(1, 5);
|
||||
}
|
||||
|
||||
//Si $nombre est supérieur au nombre présent dans la file, on le réduit
|
||||
if ($this->files[$lieu][$id][1] < $nombre)
|
||||
$nombre = $this->files[$lieu][$id][1];
|
||||
//Si $nombre est supérieur au nombre présent dans la file, on le réduit
|
||||
if ($this->files[$lieu][$id][1] < $nombre) {
|
||||
$nombre = $this->files[$lieu][$id][1];
|
||||
}
|
||||
|
||||
//On récupère les informations disponibles
|
||||
$objet = $this->files[$lieu][$id][0];
|
||||
$nombreMax = $this->files[$lieu][$id][1];
|
||||
//On récupère les informations disponibles
|
||||
$objet = $this->files[$lieu][$id][0];
|
||||
$nombreMax = $this->files[$lieu][$id][1];
|
||||
|
||||
//On met à jour le temps si on vient d'annuler le premier groupe d'unités en lice
|
||||
if ($id == $this->findFirstKey($lieu) && $nombreMax == $nombre)
|
||||
$this->times[$lieu] = time();
|
||||
//On met à jour le temps si on vient d'annuler le premier groupe d'unités en lice
|
||||
if ($id == $this->findFirstKey($lieu) && $nombreMax == $nombre) {
|
||||
$this->times[$lieu] = time();
|
||||
}
|
||||
|
||||
$planete->addModif("file_ter");
|
||||
$planete->addModif("file_ter");
|
||||
|
||||
if (!$this->files[$lieu][$id][2])
|
||||
$planete->addRessources(dTerrestre::metal($objet, $nombre, $planete), dTerrestre::cristal($objet, $nombre, $planete), dTerrestre::hydrogene($objet, $nombre, $planete), dTerrestre::credits($objet, $nombre, $planete));
|
||||
if (!$this->files[$lieu][$id][2]) {
|
||||
$planete->addRessources(dTerrestre::metal($objet, $nombre, $planete), dTerrestre::cristal($objet, $nombre, $planete), dTerrestre::hydrogene($objet, $nombre, $planete), dTerrestre::credits($objet, $nombre, $planete));
|
||||
}
|
||||
|
||||
//Effacement de la file
|
||||
if ($nombre >= $nombreMax)
|
||||
unset($this->files[$lieu][$id]);
|
||||
else
|
||||
$this->files[$lieu][$id][1] -= $nombre;
|
||||
$planete->addModif("file_ter");
|
||||
//Effacement de la file
|
||||
if ($nombre >= $nombreMax) {
|
||||
unset($this->files[$lieu][$id]);
|
||||
} else {
|
||||
$this->files[$lieu][$id][1] -= $nombre;
|
||||
}
|
||||
$planete->addModif("file_ter");
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach($this->files as $keyF => $file)
|
||||
{
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0)
|
||||
continue;
|
||||
public function ready(SURFACE $planete)
|
||||
{
|
||||
//On parcourt la liste des lieux de construction
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
//On vérifie qu'il y a bien des éléments dans cette file d'attente
|
||||
if (count($file) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//On parcourt la liste à la recherche des unités terminées dans l'ordre
|
||||
foreach($file as $keyE => $element)
|
||||
{
|
||||
//Calcul du temps écoulé depuis le dernier entraînement
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
//On parcourt la liste à la recherche des unités terminées dans l'ordre
|
||||
foreach ($file as $keyE => $element) {
|
||||
//Calcul du temps écoulé depuis le dernier entraînement
|
||||
$tempsEcoule = time() - $this->times[$keyF];
|
||||
|
||||
//On gére les licenciments !
|
||||
if ($element[2])
|
||||
{
|
||||
//On vérifie qu'il reste des unités du type sur la planète
|
||||
if ($planete->terrestres[$element[0]] <= 0)
|
||||
{
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$planete->addModif("file_ter");
|
||||
}
|
||||
else
|
||||
{
|
||||
//Récupération de 60% du temps nécessaire
|
||||
$tempsNecessaire = dTerrestre::temps($element[0], 1, $planete) * 0.6;
|
||||
//On gére les licenciments !
|
||||
if ($element[2]) {
|
||||
//On vérifie qu'il reste des unités du type sur la planète
|
||||
if ($planete->terrestres[$element[0]] <= 0) {
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
$planete->addModif("file_ter");
|
||||
} else {
|
||||
//Récupération de 60% du temps nécessaire
|
||||
$tempsNecessaire = dTerrestre::temps($element[0], 1, $planete) * 0.6;
|
||||
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1], $planete->terrestres[$element[0]]);
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1], $planete->terrestres[$element[0]]);
|
||||
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0)
|
||||
{
|
||||
//On redonne 70% des ressources de l'unité au joueur
|
||||
$planete->addRessources(dTerrestre::metal($element[0], $nbUnitee, $planete)*0.7, dTerrestre::cristal($element[0], $nbUnitee, $planete)*0.7, dTerrestre::hydrogene($element[0], $nbUnitee, $planete)*0.7, dTerrestre::credits($element[0], $nbUnitee, $planete)*0.7);
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0) {
|
||||
//On redonne 70% des ressources de l'unité au joueur
|
||||
$planete->addRessources(dTerrestre::metal($element[0], $nbUnitee, $planete)*0.7, dTerrestre::cristal($element[0], $nbUnitee, $planete)*0.7, dTerrestre::hydrogene($element[0], $nbUnitee, $planete)*0.7, dTerrestre::credits($element[0], $nbUnitee, $planete)*0.7);
|
||||
|
||||
//On retire les unités
|
||||
$planete->terrestres[$element[0]] -= $nbUnitee;
|
||||
//On retire les unités
|
||||
$planete->terrestres[$element[0]] -= $nbUnitee;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1])
|
||||
unset($this->filefiles[$keyF][$keyE]);
|
||||
else
|
||||
$this->file[$key][1] -= $nbUnitee;
|
||||
$this->timefiles[$keyF] += $tempsNecessaire*$nbUnitee;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1]) {
|
||||
unset($this->filefiles[$keyF][$keyE]);
|
||||
} else {
|
||||
$this->file[$key][1] -= $nbUnitee;
|
||||
}
|
||||
$this->timefiles[$keyF] += $tempsNecessaire*$nbUnitee;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("terrestres", $element[0]));
|
||||
$planete->addModif("file_ter");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("terrestres", $element[0]));
|
||||
$planete->addModif("file_ter");
|
||||
|
||||
if ($nbUnitee < $element[1])
|
||||
return false;
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour cette unité, on annule toutes les suivantes
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
else //Cas de la construction
|
||||
{
|
||||
//Récupération du temps nécessaire
|
||||
$tempsNecessaire = dTerrestre::temps($element[0], 1, $planete);
|
||||
if ($nbUnitee < $element[1]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour cette unité, on annule toutes les suivantes
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else { //Cas de la construction
|
||||
//Récupération du temps nécessaire
|
||||
$tempsNecessaire = dTerrestre::temps($element[0], 1, $planete);
|
||||
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1]);
|
||||
//Calcul du nombre d'unités maximum
|
||||
$nbUnitee = min(floor($tempsEcoule/$tempsNecessaire), $element[1]);
|
||||
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0)
|
||||
{
|
||||
//On ajoute le nombre d'unités
|
||||
$planete->terrestres[$element[0]] += $nbUnitee;
|
||||
//Si le temps écoulé est suffisant
|
||||
if ($nbUnitee > 0) {
|
||||
//On ajoute le nombre d'unités
|
||||
$planete->terrestres[$element[0]] += $nbUnitee;
|
||||
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1])
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
else
|
||||
$this->files[$keyF][$keyE][1] -= $nbUnitee;
|
||||
$this->times[$keyF] += $tempsNecessaire * $nbUnitee;
|
||||
//On efface l'entrée de la file et on met à jour le temps de la file
|
||||
if ($nbUnitee >= $element[1]) {
|
||||
unset($this->files[$keyF][$keyE]);
|
||||
} else {
|
||||
$this->files[$keyF][$keyE][1] -= $nbUnitee;
|
||||
}
|
||||
$this->times[$keyF] += $tempsNecessaire * $nbUnitee;
|
||||
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("terrestres", $element[0]));
|
||||
$planete->addModif("file_ter");
|
||||
//On demande la mise à jour des champs modifiés
|
||||
$planete->addModif(array("terrestres", $element[0]));
|
||||
$planete->addModif("file_ter");
|
||||
|
||||
if ($nbUnitee < $element[1])
|
||||
break;
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($nbUnitee < $element[1]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
//Si le temps écoulé n'est pas suffisant pour ce batiment, on annule tous les suivants
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function printFile(SURFACE $planete, $lieux = NULL)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file)
|
||||
{
|
||||
if (isset($lieu) && $lieu != $keyF)
|
||||
continue;
|
||||
public function printFile(SURFACE $planete, $lieux = null)
|
||||
{
|
||||
$out = array();
|
||||
foreach ($this->files as $keyF => $file) {
|
||||
if (isset($lieu) && $lieu != $keyF) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element)
|
||||
{
|
||||
if ($element[2])
|
||||
{
|
||||
$temps = dTerrestre::temps($element[0], 1, $planete) * 0.6;
|
||||
if ($prems)
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
else
|
||||
$temps_moins = 0;
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems, dTerrestre::type($element[0]));
|
||||
}
|
||||
else
|
||||
{
|
||||
$temps = dTerrestre::temps($element[0], 1, $planete);
|
||||
if ($prems)
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
else
|
||||
$temps_moins = 0;
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems, dTerrestre::type($element[0]));
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
$prems = true;
|
||||
foreach ($file as $keyE => $element) {
|
||||
if ($element[2]) {
|
||||
$temps = dTerrestre::temps($element[0], 1, $planete) * 0.6;
|
||||
if ($prems) {
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
} else {
|
||||
$temps_moins = 0;
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems, dTerrestre::type($element[0]));
|
||||
} else {
|
||||
$temps = dTerrestre::temps($element[0], 1, $planete);
|
||||
if ($prems) {
|
||||
$temps_moins = time() - $this->times[$keyF];
|
||||
} else {
|
||||
$temps_moins = 0;
|
||||
}
|
||||
$out[$keyF][$keyE] = array($element[0], $element[1], $element[2], ceil($temps * $element[1] - $temps_moins), ceil($temps - $temps_moins), $prems, dTerrestre::type($element[0]));
|
||||
}
|
||||
$prems = false;
|
||||
}
|
||||
}
|
||||
return $out;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -59,22 +59,22 @@
|
|||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_SLICE', 1);
|
||||
define('SERVICES_JSON_SLICE', 1);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_STR', 2);
|
||||
define('SERVICES_JSON_IN_STR', 2);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_ARR', 3);
|
||||
define('SERVICES_JSON_IN_ARR', 3);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
*/
|
||||
define('SERVICES_JSON_IN_OBJ', 4);
|
||||
define('SERVICES_JSON_IN_OBJ', 4);
|
||||
|
||||
/**
|
||||
* Marker constant for Services_JSON::decode(), used to flag stack state
|
||||
|
|
@ -114,48 +114,48 @@ define('SERVICES_JSON_SUPPRESS_ERRORS', 32);
|
|||
*/
|
||||
class Services_JSON
|
||||
{
|
||||
/**
|
||||
* constructs a new JSON instance
|
||||
*
|
||||
* @param int $use object behavior flags; combine with boolean-OR
|
||||
*
|
||||
* possible values:
|
||||
* - SERVICES_JSON_LOOSE_TYPE: loose typing.
|
||||
* "{...}" syntax creates associative arrays
|
||||
* instead of objects in decode().
|
||||
* - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
|
||||
* Values which can't be encoded (e.g. resources)
|
||||
* appear as NULL instead of throwing errors.
|
||||
* By default, a deeply-nested resource will
|
||||
* bubble up with an error, so all return values
|
||||
* from encode() should be checked with isError()
|
||||
*/
|
||||
function Services_JSON($use = 0)
|
||||
/**
|
||||
* constructs a new JSON instance
|
||||
*
|
||||
* @param int $use object behavior flags; combine with boolean-OR
|
||||
*
|
||||
* possible values:
|
||||
* - SERVICES_JSON_LOOSE_TYPE: loose typing.
|
||||
* "{...}" syntax creates associative arrays
|
||||
* instead of objects in decode().
|
||||
* - SERVICES_JSON_SUPPRESS_ERRORS: error suppression.
|
||||
* Values which can't be encoded (e.g. resources)
|
||||
* appear as NULL instead of throwing errors.
|
||||
* By default, a deeply-nested resource will
|
||||
* bubble up with an error, so all return values
|
||||
* from encode() should be checked with isError()
|
||||
*/
|
||||
public function Services_JSON($use = 0)
|
||||
{
|
||||
$this->use = $use;
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a string from one UTF-16 char to one UTF-8 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf16 UTF-16 character
|
||||
* @return string UTF-8 character
|
||||
* @access private
|
||||
*/
|
||||
function utf162utf8($utf16)
|
||||
/**
|
||||
* convert a string from one UTF-16 char to one UTF-8 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf16 UTF-16 character
|
||||
* @return string UTF-8 character
|
||||
* @access private
|
||||
*/
|
||||
public function utf162utf8($utf16)
|
||||
{
|
||||
// oh please oh please oh please oh please oh please
|
||||
if(function_exists('mb_convert_encoding')) {
|
||||
if (function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16');
|
||||
}
|
||||
|
||||
$bytes = (ord($utf16{0}) << 8) | ord($utf16{1});
|
||||
|
||||
switch(true) {
|
||||
switch (true) {
|
||||
case ((0x7F & $bytes) == $bytes):
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
|
|
@ -179,25 +179,25 @@ class Services_JSON
|
|||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* convert a string from one UTF-8 char to one UTF-16 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf8 UTF-8 character
|
||||
* @return string UTF-16 character
|
||||
* @access private
|
||||
*/
|
||||
function utf82utf16($utf8)
|
||||
/**
|
||||
* convert a string from one UTF-8 char to one UTF-16 char
|
||||
*
|
||||
* Normally should be handled by mb_convert_encoding, but
|
||||
* provides a slower PHP-only method for installations
|
||||
* that lack the multibye string extension.
|
||||
*
|
||||
* @param string $utf8 UTF-8 character
|
||||
* @return string UTF-16 character
|
||||
* @access private
|
||||
*/
|
||||
public function utf82utf16($utf8)
|
||||
{
|
||||
// oh please oh please oh please oh please oh please
|
||||
if(function_exists('mb_convert_encoding')) {
|
||||
if (function_exists('mb_convert_encoding')) {
|
||||
return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8');
|
||||
}
|
||||
|
||||
switch(strlen($utf8)) {
|
||||
switch (strlen($utf8)) {
|
||||
case 1:
|
||||
// this case should never be reached, because we are in ASCII range
|
||||
// see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
|
|
@ -223,18 +223,18 @@ class Services_JSON
|
|||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* encodes an arbitrary variable into JSON format
|
||||
*
|
||||
* @param mixed $var any number, boolean, string, array, or object to be encoded.
|
||||
* see argument 1 to Services_JSON() above for array-parsing behavior.
|
||||
* if var is a strng, note that encode() always expects it
|
||||
* to be in ASCII or UTF-8 format!
|
||||
*
|
||||
* @return mixed JSON string representation of input var or an error if a problem occurs
|
||||
* @access public
|
||||
*/
|
||||
function encode($var)
|
||||
/**
|
||||
* encodes an arbitrary variable into JSON format
|
||||
*
|
||||
* @param mixed $var any number, boolean, string, array, or object to be encoded.
|
||||
* see argument 1 to Services_JSON() above for array-parsing behavior.
|
||||
* if var is a strng, note that encode() always expects it
|
||||
* to be in ASCII or UTF-8 format!
|
||||
*
|
||||
* @return mixed JSON string representation of input var or an error if a problem occurs
|
||||
* @access public
|
||||
*/
|
||||
public function encode($var)
|
||||
{
|
||||
switch (gettype($var)) {
|
||||
case 'boolean':
|
||||
|
|
@ -260,7 +260,6 @@ class Services_JSON
|
|||
* escaping with a slash or encoding to UTF-8 where necessary
|
||||
*/
|
||||
for ($c = 0; $c < $strlen_var; ++$c) {
|
||||
|
||||
$ord_var_c = ord($var{$c});
|
||||
|
||||
switch (true) {
|
||||
|
|
@ -304,9 +303,12 @@ class Services_JSON
|
|||
case (($ord_var_c & 0xF0) == 0xE0):
|
||||
// characters U-00000800 - U-0000FFFF, mask 1110XXXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}));
|
||||
$char = pack(
|
||||
'C*',
|
||||
$ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2})
|
||||
);
|
||||
$c += 2;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
|
|
@ -315,10 +317,13 @@ class Services_JSON
|
|||
case (($ord_var_c & 0xF8) == 0xF0):
|
||||
// characters U-00010000 - U-001FFFFF, mask 11110XXX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}));
|
||||
$char = pack(
|
||||
'C*',
|
||||
$ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3})
|
||||
);
|
||||
$c += 3;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
|
|
@ -327,11 +332,14 @@ class Services_JSON
|
|||
case (($ord_var_c & 0xFC) == 0xF8):
|
||||
// characters U-00200000 - U-03FFFFFF, mask 111110XX
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4}));
|
||||
$char = pack(
|
||||
'C*',
|
||||
$ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4})
|
||||
);
|
||||
$c += 4;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
|
|
@ -340,12 +348,15 @@ class Services_JSON
|
|||
case (($ord_var_c & 0xFE) == 0xFC):
|
||||
// characters U-04000000 - U-7FFFFFFF, mask 1111110X
|
||||
// see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
|
||||
$char = pack('C*', $ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4}),
|
||||
ord($var{$c + 5}));
|
||||
$char = pack(
|
||||
'C*',
|
||||
$ord_var_c,
|
||||
ord($var{$c + 1}),
|
||||
ord($var{$c + 2}),
|
||||
ord($var{$c + 3}),
|
||||
ord($var{$c + 4}),
|
||||
ord($var{$c + 5})
|
||||
);
|
||||
$c += 5;
|
||||
$utf16 = $this->utf82utf16($char);
|
||||
$ascii .= sprintf('\u%04s', bin2hex($utf16));
|
||||
|
|
@ -376,12 +387,14 @@ class Services_JSON
|
|||
|
||||
// treat as a JSON object
|
||||
if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) {
|
||||
$properties = array_map(array($this, 'name_value'),
|
||||
array_keys($var),
|
||||
array_values($var));
|
||||
$properties = array_map(
|
||||
array($this, 'name_value'),
|
||||
array_keys($var),
|
||||
array_values($var)
|
||||
);
|
||||
|
||||
foreach($properties as $property) {
|
||||
if(Services_JSON::isError($property)) {
|
||||
foreach ($properties as $property) {
|
||||
if (Services_JSON::isError($property)) {
|
||||
return $property;
|
||||
}
|
||||
}
|
||||
|
|
@ -392,8 +405,8 @@ class Services_JSON
|
|||
// treat it like a regular array
|
||||
$elements = array_map(array($this, 'encode'), $var);
|
||||
|
||||
foreach($elements as $element) {
|
||||
if(Services_JSON::isError($element)) {
|
||||
foreach ($elements as $element) {
|
||||
if (Services_JSON::isError($element)) {
|
||||
return $element;
|
||||
}
|
||||
}
|
||||
|
|
@ -403,12 +416,14 @@ class Services_JSON
|
|||
case 'object':
|
||||
$vars = get_object_vars($var);
|
||||
|
||||
$properties = array_map(array($this, 'name_value'),
|
||||
array_keys($vars),
|
||||
array_values($vars));
|
||||
$properties = array_map(
|
||||
array($this, 'name_value'),
|
||||
array_keys($vars),
|
||||
array_values($vars)
|
||||
);
|
||||
|
||||
foreach($properties as $property) {
|
||||
if(Services_JSON::isError($property)) {
|
||||
foreach ($properties as $property) {
|
||||
if (Services_JSON::isError($property)) {
|
||||
return $property;
|
||||
}
|
||||
}
|
||||
|
|
@ -422,35 +437,35 @@ class Services_JSON
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* array-walking function for use in generating JSON-formatted name-value pairs
|
||||
*
|
||||
* @param string $name name of key to use
|
||||
* @param mixed $value reference to an array element to be encoded
|
||||
*
|
||||
* @return string JSON-formatted name-value pair, like '"name":value'
|
||||
* @access private
|
||||
*/
|
||||
function name_value($name, $value)
|
||||
/**
|
||||
* array-walking function for use in generating JSON-formatted name-value pairs
|
||||
*
|
||||
* @param string $name name of key to use
|
||||
* @param mixed $value reference to an array element to be encoded
|
||||
*
|
||||
* @return string JSON-formatted name-value pair, like '"name":value'
|
||||
* @access private
|
||||
*/
|
||||
public function name_value($name, $value)
|
||||
{
|
||||
$encoded_value = $this->encode($value);
|
||||
|
||||
if(Services_JSON::isError($encoded_value)) {
|
||||
if (Services_JSON::isError($encoded_value)) {
|
||||
return $encoded_value;
|
||||
}
|
||||
|
||||
return $this->encode(strval($name)) . ':' . $encoded_value;
|
||||
}
|
||||
|
||||
/**
|
||||
* reduce a string by removing leading and trailing comments and whitespace
|
||||
*
|
||||
* @param $str string string value to strip of comments and whitespace
|
||||
*
|
||||
* @return string string value stripped of comments and whitespace
|
||||
* @access private
|
||||
*/
|
||||
function reduce_string($str)
|
||||
/**
|
||||
* reduce a string by removing leading and trailing comments and whitespace
|
||||
*
|
||||
* @param $str string string value to strip of comments and whitespace
|
||||
*
|
||||
* @return string string value stripped of comments and whitespace
|
||||
* @access private
|
||||
*/
|
||||
public function reduce_string($str)
|
||||
{
|
||||
$str = preg_replace(array(
|
||||
|
||||
|
|
@ -469,19 +484,19 @@ class Services_JSON
|
|||
return trim($str);
|
||||
}
|
||||
|
||||
/**
|
||||
* decodes a JSON string into appropriate variable
|
||||
*
|
||||
* @param string $str JSON-formatted string
|
||||
*
|
||||
* @return mixed number, boolean, string, array, or object
|
||||
* corresponding to given JSON input string.
|
||||
* See argument 1 to Services_JSON() above for object-output behavior.
|
||||
* Note that decode() always returns strings
|
||||
* in ASCII or UTF-8 format!
|
||||
* @access public
|
||||
*/
|
||||
function decode($str)
|
||||
/**
|
||||
* decodes a JSON string into appropriate variable
|
||||
*
|
||||
* @param string $str JSON-formatted string
|
||||
*
|
||||
* @return mixed number, boolean, string, array, or object
|
||||
* corresponding to given JSON input string.
|
||||
* See argument 1 to Services_JSON() above for object-output behavior.
|
||||
* Note that decode() always returns strings
|
||||
* in ASCII or UTF-8 format!
|
||||
* @access public
|
||||
*/
|
||||
public function decode($str)
|
||||
{
|
||||
$str = $this->reduce_string($str);
|
||||
|
||||
|
|
@ -509,7 +524,6 @@ class Services_JSON
|
|||
return ((float)$str == (integer)$str)
|
||||
? (integer)$str
|
||||
: (float)$str;
|
||||
|
||||
} elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) {
|
||||
// STRINGS RETURNED IN UTF-8 FORMAT
|
||||
$delim = substr($str, 0, 1);
|
||||
|
|
@ -518,7 +532,6 @@ class Services_JSON
|
|||
$strlen_chrs = strlen($chrs);
|
||||
|
||||
for ($c = 0; $c < $strlen_chrs; ++$c) {
|
||||
|
||||
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||
$ord_chrs_c = ord($chrs{$c});
|
||||
|
||||
|
|
@ -602,11 +615,9 @@ class Services_JSON
|
|||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $utf8;
|
||||
|
||||
} elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) {
|
||||
// array, or object notation
|
||||
|
||||
|
|
@ -633,10 +644,8 @@ class Services_JSON
|
|||
if ($chrs == '') {
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
return $arr;
|
||||
|
||||
} else {
|
||||
return $obj;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -645,7 +654,6 @@ class Services_JSON
|
|||
$strlen_chrs = strlen($chrs);
|
||||
|
||||
for ($c = 0; $c <= $strlen_chrs; ++$c) {
|
||||
|
||||
$top = end($stk);
|
||||
$substr_chrs_c_2 = substr($chrs, $c, 2);
|
||||
|
||||
|
|
@ -659,7 +667,6 @@ class Services_JSON
|
|||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
// we are in an array, so just push an element onto the stack
|
||||
array_push($arr, $this->decode($slice));
|
||||
|
||||
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||
// we are in an object, so figure
|
||||
// out the property name and set an
|
||||
|
|
@ -688,14 +695,11 @@ class Services_JSON
|
|||
$obj->$key = $val;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} elseif ((($chrs{$c} == '"') || ($chrs{$c} == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) {
|
||||
// found a quote, and we are not inside a string
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs{$c}));
|
||||
//print("Found start of string at {$c}\n");
|
||||
|
||||
//print("Found start of string at {$c}\n");
|
||||
} elseif (($chrs{$c} == $top['delim']) &&
|
||||
($top['what'] == SERVICES_JSON_IN_STR) &&
|
||||
((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) {
|
||||
|
|
@ -703,59 +707,49 @@ class Services_JSON
|
|||
// we know that it's not escaped becase there is _not_ an
|
||||
// odd number of backslashes at the end of the string so far
|
||||
array_pop($stk);
|
||||
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
|
||||
|
||||
//print("Found end of string at {$c}: ".substr($chrs, $top['where'], (1 + 1 + $c - $top['where']))."\n");
|
||||
} elseif (($chrs{$c} == '[') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a left-bracket, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false));
|
||||
//print("Found start of array at {$c}\n");
|
||||
|
||||
//print("Found start of array at {$c}\n");
|
||||
} elseif (($chrs{$c} == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) {
|
||||
// found a right-bracket, and we're in an array
|
||||
array_pop($stk);
|
||||
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
//print("Found end of array at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
} elseif (($chrs{$c} == '{') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a left-brace, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false));
|
||||
//print("Found start of object at {$c}\n");
|
||||
|
||||
//print("Found start of object at {$c}\n");
|
||||
} elseif (($chrs{$c} == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) {
|
||||
// found a right-brace, and we're in an object
|
||||
array_pop($stk);
|
||||
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
//print("Found end of object at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
} elseif (($substr_chrs_c_2 == '/*') &&
|
||||
in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) {
|
||||
// found a comment start, and we are in an array, object, or slice
|
||||
array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false));
|
||||
$c++;
|
||||
//print("Found start of comment at {$c}\n");
|
||||
|
||||
//print("Found start of comment at {$c}\n");
|
||||
} elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) {
|
||||
// found a comment end, and we're in one now
|
||||
array_pop($stk);
|
||||
$c++;
|
||||
|
||||
for ($i = $top['where']; $i <= $c; ++$i)
|
||||
for ($i = $top['where']; $i <= $c; ++$i) {
|
||||
$chrs = substr_replace($chrs, ' ', $i, 1);
|
||||
}
|
||||
|
||||
//print("Found end of comment at {$c}: ".substr($chrs, $top['where'], (1 + $c - $top['where']))."\n");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (reset($stk) == SERVICES_JSON_IN_ARR) {
|
||||
return $arr;
|
||||
|
||||
} elseif (reset($stk) == SERVICES_JSON_IN_OBJ) {
|
||||
return $obj;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -763,7 +757,7 @@ class Services_JSON
|
|||
/**
|
||||
* @todo Ultimately, this should just call PEAR::isError()
|
||||
*/
|
||||
function isError($data, $code = null)
|
||||
public function isError($data, $code = null)
|
||||
{
|
||||
if (class_exists('pear')) {
|
||||
return PEAR::isError($data, $code);
|
||||
|
|
@ -777,16 +771,18 @@ class Services_JSON
|
|||
}
|
||||
|
||||
if (class_exists('PEAR_Error')) {
|
||||
|
||||
class Services_JSON_Error extends PEAR_Error
|
||||
{
|
||||
function Services_JSON_Error($message = 'unknown error', $code = null,
|
||||
$mode = null, $options = null, $userinfo = null)
|
||||
{
|
||||
public function Services_JSON_Error(
|
||||
$message = 'unknown error',
|
||||
$code = null,
|
||||
$mode = null,
|
||||
$options = null,
|
||||
$userinfo = null
|
||||
) {
|
||||
parent::PEAR_Error($message, $code, $mode, $options, $userinfo);
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
/**
|
||||
|
|
@ -794,13 +790,13 @@ if (class_exists('PEAR_Error')) {
|
|||
*/
|
||||
class Services_JSON_Error
|
||||
{
|
||||
function Services_JSON_Error($message = 'unknown error', $code = null,
|
||||
$mode = null, $options = null, $userinfo = null)
|
||||
{
|
||||
|
||||
public function Services_JSON_Error(
|
||||
$message = 'unknown error',
|
||||
$code = null,
|
||||
$mode = null,
|
||||
$options = null,
|
||||
$userinfo = null
|
||||
) {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -8,133 +8,149 @@
|
|||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
class Alliance extends SURFACE{
|
||||
var $id,
|
||||
$race,
|
||||
$fondateur,
|
||||
$sante,
|
||||
$nom,
|
||||
$tag,
|
||||
$galaxie,
|
||||
$ss,
|
||||
$nom_asteroide,
|
||||
$image_asteroide,
|
||||
$debris_met,
|
||||
$debris_cri,
|
||||
$credits,
|
||||
$metal,
|
||||
$cristal,
|
||||
$hydrogene;
|
||||
class Alliance extends SURFACE
|
||||
{
|
||||
public $id;
|
||||
public $race;
|
||||
public $fondateur;
|
||||
public $sante;
|
||||
public $nom;
|
||||
public $tag;
|
||||
public $galaxie;
|
||||
public $ss;
|
||||
public $nom_asteroide;
|
||||
public $image_asteroide;
|
||||
public $debris_met;
|
||||
public $debris_cri;
|
||||
public $credits;
|
||||
public $metal;
|
||||
public $cristal;
|
||||
public $hydrogene;
|
||||
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de l'alliance à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function Alliance($id = 0){
|
||||
if (!empty($id)) {
|
||||
global $var___db, $config, $table_alliances;
|
||||
global $alli_batimentVAR, $spatialVAR;
|
||||
$bdd = new bdd();
|
||||
$bdd->connexion();
|
||||
$bdd->escape($id);
|
||||
$alli = $bdd->unique_query("SELECT * FROM $table_alliances WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($alli)) {
|
||||
$this->id = $alli["id"];
|
||||
$this->race = $alli["race"];
|
||||
$this->fondateur = $alli["fondateur"];
|
||||
$this->sante = $alli["sante"];
|
||||
$this->nom = $alli["nom"];
|
||||
$this->tag = $alli["tag"];
|
||||
$this->galaxie = $alli["galaxie"];
|
||||
$this->ss = $alli["ss"];
|
||||
$this->position = $alli["wing"];
|
||||
$this->nom_asteroide = $alli["nom_asteroide"];
|
||||
$this->image_asteroide = $alli["image_asteroide"];
|
||||
$this->debris_met = $alli["debris_met"];
|
||||
$this->debris_cri = $alli["debris_cri"];
|
||||
$this->credits = $alli["credits"];
|
||||
$this->metal = $alli["metal"];
|
||||
$this->cristal = $alli["cristal"];
|
||||
$this->hydrogene = $alli["hydrogene"];
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de l'alliance à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function Alliance($id = 0)
|
||||
{
|
||||
if (!empty($id)) {
|
||||
global $var___db, $config, $table_alliances;
|
||||
global $alli_batimentVAR, $spatialVAR;
|
||||
$bdd = new bdd();
|
||||
$bdd->connexion();
|
||||
$bdd->escape($id);
|
||||
$alli = $bdd->unique_query("SELECT * FROM $table_alliances WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($alli)) {
|
||||
$this->id = $alli["id"];
|
||||
$this->race = $alli["race"];
|
||||
$this->fondateur = $alli["fondateur"];
|
||||
$this->sante = $alli["sante"];
|
||||
$this->nom = $alli["nom"];
|
||||
$this->tag = $alli["tag"];
|
||||
$this->galaxie = $alli["galaxie"];
|
||||
$this->ss = $alli["ss"];
|
||||
$this->position = $alli["wing"];
|
||||
$this->nom_asteroide = $alli["nom_asteroide"];
|
||||
$this->image_asteroide = $alli["image_asteroide"];
|
||||
$this->debris_met = $alli["debris_met"];
|
||||
$this->debris_cri = $alli["debris_cri"];
|
||||
$this->credits = $alli["credits"];
|
||||
$this->metal = $alli["metal"];
|
||||
$this->cristal = $alli["cristal"];
|
||||
$this->hydrogene = $alli["hydrogene"];
|
||||
|
||||
foreach($alli_batimentVAR as $bat){
|
||||
$this->batiments[] = $alli[$bat];
|
||||
}
|
||||
$this->file_bat = unserialize($alli["file_bat"]);
|
||||
foreach ($alli_batimentVAR as $bat) {
|
||||
$this->batiments[] = $alli[$bat];
|
||||
}
|
||||
$this->file_bat = unserialize($alli["file_bat"]);
|
||||
|
||||
foreach($spatialVAR as $vais){
|
||||
$this->vaisseaux[] = $plan[$vais];
|
||||
}
|
||||
$this->file_vais = unserialize($alli["file_vais"]);
|
||||
foreach ($spatialVAR as $vais) {
|
||||
$this->vaisseaux[] = $plan[$vais];
|
||||
}
|
||||
$this->file_vais = unserialize($alli["file_vais"]);
|
||||
|
||||
$this->actualiser();
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->actualiser();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Actualise les ressources de la planète en fonction de la production et termine les files d'attentes.
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function actualiser($actuFile = true){
|
||||
//Actualisation des files d'attentes
|
||||
if ($actuFile) {
|
||||
$this->file_pret("alli_batiments");
|
||||
$this->file_pret("vaisseaux");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Actualise les ressources de la planète en fonction de la production et termine les files d'attentes.
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function actualiser($actuFile = true)
|
||||
{
|
||||
//Actualisation des files d'attentes
|
||||
if ($actuFile) {
|
||||
$this->file_pret("alli_batiments");
|
||||
$this->file_pret("vaisseaux");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructeur
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function __destruct(){
|
||||
global $var___db, $config, $table_alliances;
|
||||
$nb = count($this->modif);
|
||||
$out = array();
|
||||
$bdd = new bdd();
|
||||
$bdd->connexion();
|
||||
for($i = 0; $i < $nb; $i++){
|
||||
if (!is_array($this->{$this->modif[$i]})) {
|
||||
$bdd->escape($this->{$this->modif[$i]});
|
||||
if (is_int($this->{$this->modif[$i]}) || is_float($this->{$this->modif[$i]})) $out[] .= $this->modif[$i]." = ".$this->{$this->modif[$i]};
|
||||
else $out[] .= $this->modif[$i]." = '".$this->{$this->modif[$i]}."'";
|
||||
}
|
||||
else {
|
||||
if (preg_match('#file#', $this->modif[$i])) {
|
||||
$prep = serialize($this->{$this->modif[$i]});
|
||||
$bdd->escape($prep);
|
||||
$out[] .= $this->modif[$i]." = '$prep'";
|
||||
}
|
||||
else {
|
||||
if ($this->modif[$i] == "batiments") $calc = "batiment";
|
||||
elseif ($this->modif[$i] == "alli_batiments") $calc = "alli_batiment";
|
||||
elseif ($this->modif[$i] == "technologies") $calc = "technolo";
|
||||
elseif ($this->modif[$i] == "casernes")$calc = "casernen";
|
||||
elseif ($this->modif[$i] == "terrestres") $calc = "nomterrn";
|
||||
elseif ($this->modif[$i] == "vaisseaux") $calc = "nomvaisn";
|
||||
elseif ($this->modif[$i] == "coeff_bat") $calc = "coeff";
|
||||
/**
|
||||
* Destructeur
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
global $var___db, $config, $table_alliances;
|
||||
$nb = count($this->modif);
|
||||
$out = array();
|
||||
$bdd = new bdd();
|
||||
$bdd->connexion();
|
||||
for ($i = 0; $i < $nb; $i++) {
|
||||
if (!is_array($this->{$this->modif[$i]})) {
|
||||
$bdd->escape($this->{$this->modif[$i]});
|
||||
if (is_int($this->{$this->modif[$i]}) || is_float($this->{$this->modif[$i]})) {
|
||||
$out[] .= $this->modif[$i]." = ".$this->{$this->modif[$i]};
|
||||
} else {
|
||||
$out[] .= $this->modif[$i]." = '".$this->{$this->modif[$i]}."'";
|
||||
}
|
||||
} else {
|
||||
if (preg_match('#file#', $this->modif[$i])) {
|
||||
$prep = serialize($this->{$this->modif[$i]});
|
||||
$bdd->escape($prep);
|
||||
$out[] .= $this->modif[$i]." = '$prep'";
|
||||
} else {
|
||||
if ($this->modif[$i] == "batiments") {
|
||||
$calc = "batiment";
|
||||
} elseif ($this->modif[$i] == "alli_batiments") {
|
||||
$calc = "alli_batiment";
|
||||
} elseif ($this->modif[$i] == "technologies") {
|
||||
$calc = "technolo";
|
||||
} elseif ($this->modif[$i] == "casernes") {
|
||||
$calc = "casernen";
|
||||
} elseif ($this->modif[$i] == "terrestres") {
|
||||
$calc = "nomterrn";
|
||||
} elseif ($this->modif[$i] == "vaisseaux") {
|
||||
$calc = "nomvaisn";
|
||||
} elseif ($this->modif[$i] == "coeff_bat") {
|
||||
$calc = "coeff";
|
||||
}
|
||||
|
||||
if (!isset(${$calc.'VAR'})) global ${$calc.'VAR'};
|
||||
if (!isset(${$calc.'VAR'})) {
|
||||
global ${$calc.'VAR'};
|
||||
}
|
||||
|
||||
$nombr = count(${$calc.'VAR'});
|
||||
for($j = 0; $j < $nombr; $j++){
|
||||
$bdd->escape($this->{$this->modif[$i]}[$j]);
|
||||
$out[] .= ${$calc.'VAR'}[$j]." = ".$this->{$this->modif[$i]}[$j]."";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($out)) $plan = $bdd->unique_query("UPDATE $table_alliances SET ".implode(', ', $out)." WHERE id = ".$this->id.";");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
$nombr = count(${$calc.'VAR'});
|
||||
for ($j = 0; $j < $nombr; $j++) {
|
||||
$bdd->escape($this->{$this->modif[$i]}[$j]);
|
||||
$out[] .= ${$calc.'VAR'}[$j]." = ".$this->{$this->modif[$i]}[$j]."";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($out)) {
|
||||
$plan = $bdd->unique_query("UPDATE $table_alliances SET ".implode(', ', $out)." WHERE id = ".$this->id.";");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -11,375 +11,359 @@ include_once("Class/surface.php");
|
|||
***************************************************************************/
|
||||
class Asteroide extends Surface
|
||||
{
|
||||
var $fondateur,
|
||||
$sante,
|
||||
$nom_alliance,
|
||||
$tag,
|
||||
$wing,
|
||||
$nom_asteroide,
|
||||
$image_asteroide,
|
||||
$position = 5,
|
||||
$cap = 123456789,
|
||||
$credits_alliance,
|
||||
$points_alliance,
|
||||
$url_chat,
|
||||
$url_forum,
|
||||
$details = array();
|
||||
public $fondateur;
|
||||
public $sante;
|
||||
public $nom_alliance;
|
||||
public $tag;
|
||||
public $wing;
|
||||
public $nom_asteroide;
|
||||
public $image_asteroide;
|
||||
public $position = 5;
|
||||
public $cap = 123456789;
|
||||
public $credits_alliance;
|
||||
public $points_alliance;
|
||||
public $url_chat;
|
||||
public $url_forum;
|
||||
public $details = array();
|
||||
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la planète à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function __construct($id = 0)
|
||||
{
|
||||
if (!empty($id)) {
|
||||
global $table_alliances, $SESS;
|
||||
global $alli_batimentsVAR, $spatialVAR;
|
||||
$bdd = new BDD();
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la planète à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function __construct($id = 0)
|
||||
{
|
||||
if (!empty($id)) {
|
||||
global $table_alliances, $SESS;
|
||||
global $alli_batimentsVAR, $spatialVAR;
|
||||
$bdd = new BDD();
|
||||
|
||||
//On traite le cas où l'on envoie les coordonnées
|
||||
if (is_numeric($id))
|
||||
{
|
||||
$plan = $bdd->unique_query("SELECT * FROM $table_alliances WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
elseif (preg_match('#^\[?([0-9]{1,2}):([0-9]{1,2}):?[Aa]?\]?$#', $id, $position))
|
||||
{
|
||||
$plan = $bdd->unique_query("SELECT * FROM $table_alliances WHERE galaxie = ".$position[1]." AND ss = ".$position[2].";");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else
|
||||
die('Erreur #04 : Format de recherche d\'asteroide incorrect !');
|
||||
//On traite le cas où l'on envoie les coordonnées
|
||||
if (is_numeric($id)) {
|
||||
$plan = $bdd->unique_query("SELECT * FROM $table_alliances WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
} elseif (preg_match('#^\[?([0-9]{1,2}):([0-9]{1,2}):?[Aa]?\]?$#', $id, $position)) {
|
||||
$plan = $bdd->unique_query("SELECT * FROM $table_alliances WHERE galaxie = ".$position[1]." AND ss = ".$position[2].";");
|
||||
$bdd->deconnexion();
|
||||
} else {
|
||||
die('Erreur #04 : Format de recherche d\'asteroide incorrect !');
|
||||
}
|
||||
|
||||
if (!empty($plan))
|
||||
{
|
||||
$this->id = $plan["id"];
|
||||
parent::User($SESS->values['id']); //On utilise le numéro d'utilisateur enregistré en session
|
||||
$this->galaxie = $plan["galaxie"];
|
||||
$this->ss = $plan["ss"];
|
||||
$this->points_alliance = @$plan["points_alliance"];
|
||||
$this->nom_asteroide = $plan["nom_asteroide"];
|
||||
$this->image = $this->image_asteroide = $plan["image_asteroide"];
|
||||
$this->debris_met = $plan["debris_met"];
|
||||
$this->debris_cri = $plan["debris_cri"];
|
||||
$this->metal = $plan["metal"];
|
||||
$this->cristal = $plan["cristal"];
|
||||
$this->hydrogene = $plan["hydrogene"];
|
||||
$this->credits_alliance = $plan["credits_alliance"];
|
||||
$this->fondateur = $plan["fondateur"];
|
||||
$this->nom_alliance = $plan["nom_alliance"];
|
||||
$this->wing = $plan["wing"];
|
||||
$this->tag = $plan["tag"];
|
||||
$this->url_forum = $plan["url_forum"];
|
||||
$this->url_chat = $plan["url_chat"];
|
||||
if (!empty($plan)) {
|
||||
$this->id = $plan["id"];
|
||||
parent::User($SESS->values['id']); //On utilise le numéro d'utilisateur enregistré en session
|
||||
$this->galaxie = $plan["galaxie"];
|
||||
$this->ss = $plan["ss"];
|
||||
$this->points_alliance = @$plan["points_alliance"];
|
||||
$this->nom_asteroide = $plan["nom_asteroide"];
|
||||
$this->image = $this->image_asteroide = $plan["image_asteroide"];
|
||||
$this->debris_met = $plan["debris_met"];
|
||||
$this->debris_cri = $plan["debris_cri"];
|
||||
$this->metal = $plan["metal"];
|
||||
$this->cristal = $plan["cristal"];
|
||||
$this->hydrogene = $plan["hydrogene"];
|
||||
$this->credits_alliance = $plan["credits_alliance"];
|
||||
$this->fondateur = $plan["fondateur"];
|
||||
$this->nom_alliance = $plan["nom_alliance"];
|
||||
$this->wing = $plan["wing"];
|
||||
$this->tag = $plan["tag"];
|
||||
$this->url_forum = $plan["url_forum"];
|
||||
$this->url_chat = $plan["url_chat"];
|
||||
|
||||
foreach($alli_batimentsVAR as $bat)
|
||||
$this->batiments[] = $plan[$bat];
|
||||
if (!empty($plan["file_bat"]))
|
||||
$this->file_bat = unserialize($plan["file_bat"]);
|
||||
else
|
||||
$this->file_bat = new FileAlliancesBatiments();
|
||||
foreach ($alli_batimentsVAR as $bat) {
|
||||
$this->batiments[] = $plan[$bat];
|
||||
}
|
||||
if (!empty($plan["file_bat"])) {
|
||||
$this->file_bat = unserialize($plan["file_bat"]);
|
||||
} else {
|
||||
$this->file_bat = new FileAlliancesBatiments();
|
||||
}
|
||||
|
||||
foreach($spatialVAR as $vais)
|
||||
$this->vaisseaux[] = $plan[$vais];
|
||||
if (!empty($plan["file_vais"]))
|
||||
$this->file_vais = unserialize($plan["file_vais"]);
|
||||
else
|
||||
$this->file_vais = new FileSpatial('vaisseaux');
|
||||
foreach ($spatialVAR as $vais) {
|
||||
$this->vaisseaux[] = $plan[$vais];
|
||||
}
|
||||
if (!empty($plan["file_vais"])) {
|
||||
$this->file_vais = unserialize($plan["file_vais"]);
|
||||
} else {
|
||||
$this->file_vais = new FileSpatial('vaisseaux');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public function loadDetails()
|
||||
{
|
||||
global $table_alliances, $table_user;
|
||||
$bdd = new bdd();
|
||||
$this->details = array_merge($bdd->unique_query("SELECT presentation, message_inscription, texte_interne, port_chat, chan_chat, image, etat_inscription, defcon, defcon_txt FROM $table_alliances WHERE id = ".$this->id.";"), $bdd->unique_query("SELECT COUNT(id) AS nb_membres FROM $table_user WHERE id_alliance = ".$this->id.";"));
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
|
||||
function loadDetails()
|
||||
{
|
||||
global $table_alliances, $table_user;
|
||||
$bdd = new bdd();
|
||||
$this->details = array_merge($bdd->unique_query("SELECT presentation, message_inscription, texte_interne, port_chat, chan_chat, image, etat_inscription, defcon, defcon_txt FROM $table_alliances WHERE id = ".$this->id.";"), $bdd->unique_query("SELECT COUNT(id) AS nb_membres FROM $table_user WHERE id_alliance = ".$this->id.";"));
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
public function actualiser($actuFile = true, $first = false)
|
||||
{
|
||||
//Actualisation des files d'attentes
|
||||
if ($actuFile) {
|
||||
$this->file_bat->ready($this);
|
||||
$this->file_vais->ready($this);
|
||||
}
|
||||
}
|
||||
|
||||
function actualiser($actuFile = true, $first = false)
|
||||
{
|
||||
//Actualisation des files d'attentes
|
||||
if ($actuFile)
|
||||
{
|
||||
$this->file_bat->ready($this);
|
||||
$this->file_vais->ready($this);
|
||||
}
|
||||
}
|
||||
public function checkAndRetireRessources($metal, $cristal, $hydrogene, $credits)
|
||||
{
|
||||
if ($this->metal >= $metal && $this->cristal >= $cristal && $this->hydrogene >= $hydrogene && $this->credits_alliance >= $credits) {
|
||||
$this->metal -= $metal;
|
||||
$this->cristal -= $cristal;
|
||||
$this->hydrogene -= $hydrogene;
|
||||
$this->credits -= $credits;
|
||||
|
||||
function checkAndRetireRessources($metal, $cristal, $hydrogene, $credits)
|
||||
{
|
||||
if ($this->metal >= $metal && $this->cristal >= $cristal && $this->hydrogene >= $hydrogene && $this->credits_alliance >= $credits)
|
||||
{
|
||||
$this->metal -= $metal;
|
||||
$this->cristal -= $cristal;
|
||||
$this->hydrogene -= $hydrogene;
|
||||
$this->credits -= $credits;
|
||||
$this->addModif("force");
|
||||
$this->addModif("credits_alliance");
|
||||
|
||||
$this->addModif("force");
|
||||
$this->addModif("credits_alliance");
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
public function addRessources($metal, $cristal, $hydrogene, $credits)
|
||||
{
|
||||
$perte = 0;
|
||||
|
||||
function addRessources($metal, $cristal, $hydrogene, $credits)
|
||||
{
|
||||
$perte = 0;
|
||||
$this->metal += $metal;
|
||||
if ($this->metal > $this->cap) {
|
||||
$perte += $this->metal - $this->cap;
|
||||
$this->metal = $this->cap;
|
||||
}
|
||||
|
||||
$this->metal += $metal;
|
||||
if ($this->metal > $this->cap)
|
||||
{
|
||||
$perte += $this->metal - $this->cap;
|
||||
$this->metal = $this->cap;
|
||||
}
|
||||
$this->cristal += $cristal;
|
||||
if ($this->cristal > $this->cap) {
|
||||
$perte += $this->cristal - $this->cap;
|
||||
$this->cristal = $this->cap;
|
||||
}
|
||||
|
||||
$this->cristal += $cristal;
|
||||
if ($this->cristal > $this->cap)
|
||||
{
|
||||
$perte += $this->cristal - $this->cap;
|
||||
$this->cristal = $this->cap;
|
||||
}
|
||||
$this->hydrogene += $hydrogene;
|
||||
if ($this->hydrogene > $this->cap) {
|
||||
$perte += $this->hydrogene - $this->cap;
|
||||
$this->hydrogene = $this->cap;
|
||||
}
|
||||
|
||||
$this->hydrogene += $hydrogene;
|
||||
if ($this->hydrogene > $this->cap)
|
||||
{
|
||||
$perte += $this->hydrogene - $this->cap;
|
||||
$this->hydrogene = $this->cap;
|
||||
}
|
||||
$this->hydrogecredits_alliancene += $credits;
|
||||
|
||||
$this->hydrogecredits_alliancene += $credits;
|
||||
$this->addModif("force");
|
||||
$this->addModif("credits_alliance");
|
||||
|
||||
$this->addModif("force");
|
||||
$this->addModif("credits_alliance");
|
||||
return $perte;
|
||||
}
|
||||
|
||||
return $perte;
|
||||
}
|
||||
public function addCreditsAlliance($credits)
|
||||
{
|
||||
$this->credits_alliance += $credits;
|
||||
$this->addModif("credits_alliance");
|
||||
|
||||
function addCreditsAlliance($credits)
|
||||
{
|
||||
$this->credits_alliance += $credits;
|
||||
$this->addModif("credits_alliance");
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
public function addPoints($metal, $cristal, $hydrogene, $credits = 0, $demolition = false)
|
||||
{
|
||||
global $table_bourse_ressources;
|
||||
//On charge les 3 valeurs boursières
|
||||
$bdd = new BDD();
|
||||
$bourse = $bdd->query("SELECT dispo FROM $table_bourse_ressources;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
function addPoints($metal, $cristal, $hydrogene, $credits = 0, $demolition = false)
|
||||
{
|
||||
global $table_bourse_ressources;
|
||||
//On charge les 3 valeurs boursières
|
||||
$bdd = new BDD();
|
||||
$bourse = $bdd->query("SELECT dispo FROM $table_bourse_ressources;");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($credits)) {
|
||||
//TODO Equivalence non prouvée entre $credits/bourse_calcPrixBase($bourse[0]["dispo"], 0.7); et $credits/bourse_calcPrixBase($bourse[0]["dispo"], 1) * 0.7; dans le but de ne donner que 70% des points
|
||||
$metal += $credits/bourse_calcPrixBase($bourse[0]["dispo"], 0.7);
|
||||
$cristal += $credits/bourse_calcPrixBase($bourse[1]["dispo"], 0.7);
|
||||
$hydrogene += $credits/bourse_calcPrixBase($bourse[2]["dispo"], 0.7);
|
||||
}
|
||||
|
||||
if (!empty($credits))
|
||||
{
|
||||
//TODO Equivalence non prouvée entre $credits/bourse_calcPrixBase($bourse[0]["dispo"], 0.7); et $credits/bourse_calcPrixBase($bourse[0]["dispo"], 1) * 0.7; dans le but de ne donner que 70% des points
|
||||
$metal += $credits/bourse_calcPrixBase($bourse[0]["dispo"], 0.7);
|
||||
$cristal += $credits/bourse_calcPrixBase($bourse[1]["dispo"], 0.7);
|
||||
$hydrogene += $credits/bourse_calcPrixBase($bourse[2]["dispo"], 0.7);
|
||||
}
|
||||
$points = bourse_calcPrixBase($bourse[0]["dispo"], $metal);
|
||||
$points += bourse_calcPrixBase($bourse[1]["dispo"], $cristal);
|
||||
$points += bourse_calcPrixBase($bourse[2]["dispo"], $hydrogene);
|
||||
|
||||
$points = bourse_calcPrixBase($bourse[0]["dispo"], $metal);
|
||||
$points += bourse_calcPrixBase($bourse[1]["dispo"], $cristal);
|
||||
$points += bourse_calcPrixBase($bourse[2]["dispo"], $hydrogene);
|
||||
if ($demolition) {
|
||||
$this->points_alliance -= intval($points);
|
||||
} else {
|
||||
$this->points_alliance += intval($points);
|
||||
}
|
||||
|
||||
if ($demolition)
|
||||
$this->points_alliance -= intval($points);
|
||||
else
|
||||
$this->points_alliance += intval($points);
|
||||
$this->addModif("points_alliance");
|
||||
}
|
||||
|
||||
$this->addModif("points_alliance");
|
||||
}
|
||||
public function creer($fondateur, $mere = false)
|
||||
{
|
||||
global $VAR, $table_alliances_creation;
|
||||
|
||||
function creer($fondateur, $mere = false)
|
||||
{
|
||||
global $VAR, $table_alliances_creation;
|
||||
$bdd = new BDD();
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE fondateur = ".$fondateur->id_user." LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$bdd = new BDD();
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE fondateur = ".$fondateur->id_user." LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
//On vérifie que l'alliance n'a pas déjà été créée
|
||||
if (empty($alliance)) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
//On vérifie que l'alliance n'a pas déjà été créée
|
||||
if (empty($alliance))
|
||||
return 1;
|
||||
//Définition des paramètres de l'utilisateur pour l'astéroide
|
||||
$this->fondateur = $alliance["fondateur"];
|
||||
$this->race = $fondateur->race;
|
||||
|
||||
//Définition des paramètres de l'utilisateur pour l'astéroide
|
||||
$this->fondateur = $alliance["fondateur"];
|
||||
$this->race = $fondateur->race;
|
||||
//Génération du nombre de case et de l'image en fonction de la position dans le système
|
||||
$this->sante = 1;
|
||||
$this->nom_alliance = $alliance["nom_alliance"];
|
||||
$this->tag = $alliance["tag"];
|
||||
$this->nom_asteroide = $alliance["nom_alliance"];
|
||||
$this->image_asteroide = mt_rand(1, 3);
|
||||
|
||||
//Génération du nombre de case et de l'image en fonction de la position dans le système
|
||||
$this->sante = 1;
|
||||
$this->nom_alliance = $alliance["nom_alliance"];
|
||||
$this->tag = $alliance["tag"];
|
||||
$this->nom_asteroide = $alliance["nom_alliance"];
|
||||
$this->image_asteroide = mt_rand(1,3);
|
||||
$this->modif = array("fondateur", "race", "nom_alliance", "galaxie", "ss", "tag", "nom_asteroide", "image_asteroide");
|
||||
}
|
||||
|
||||
$this->modif = array("fondateur", "race", "nom_alliance", "galaxie", "ss", "tag", "nom_asteroide", "image_asteroide");
|
||||
}
|
||||
/**
|
||||
* Destructeur
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
if (empty($this->ss) || empty($this->fondateur)) {
|
||||
return;
|
||||
}
|
||||
if (DEBUG) {
|
||||
var_dump($this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructeur
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function __destruct()
|
||||
{
|
||||
if (empty($this->ss) || empty($this->fondateur))
|
||||
return;
|
||||
if (DEBUG)
|
||||
var_dump($this);
|
||||
global $table_alliances;
|
||||
if (empty($this->id)) {
|
||||
$outNomChamps = array();
|
||||
$outValeurs = array();
|
||||
$bdd = new BDD();
|
||||
foreach ($this->modif as $modif) {
|
||||
//On gère les champs variables tableaux
|
||||
if (is_array($modif)) {
|
||||
if ($modif[0] == "batiments") {
|
||||
$calc = dDonnees::nameVAR("alli_batiments");
|
||||
} else {
|
||||
$calc = dDonnees::nameVAR($modif[0]);
|
||||
}
|
||||
|
||||
global $table_alliances;
|
||||
if (empty($this->id))
|
||||
{
|
||||
$outNomChamps = array(); $outValeurs = array();
|
||||
$bdd = new BDD();
|
||||
foreach($this->modif as $modif)
|
||||
{
|
||||
//On gère les champs variables tableaux
|
||||
if (is_array($modif))
|
||||
{
|
||||
if ($modif[0] == "batiments")
|
||||
$calc = dDonnees::nameVAR("alli_batiments");
|
||||
else
|
||||
$calc = dDonnees::nameVAR($modif[0]);
|
||||
if (!isset(${$calc.'VAR'})) {
|
||||
global ${$calc.'VAR'};
|
||||
}
|
||||
|
||||
if (!isset(${$calc.'VAR'}))
|
||||
global ${$calc.'VAR'};
|
||||
$outNomChamps[] = ${$calc.'VAR'}[$modif[1]];
|
||||
$outValeurs[] = $this->{$modif[0]}[$modif[1]];
|
||||
} elseif ($modif == "force") {
|
||||
$outNomChamps[] = "metal";
|
||||
$outNomChamps[] = "cristal";
|
||||
$outNomChamps[] = "hydrogene";
|
||||
|
||||
$outNomChamps[] = ${$calc.'VAR'}[$modif[1]];
|
||||
$outValeurs[] = $this->{$modif[0]}[$modif[1]];
|
||||
}
|
||||
elseif ($modif == "force")
|
||||
{
|
||||
$outNomChamps[] = "metal";
|
||||
$outNomChamps[] = "cristal";
|
||||
$outNomChamps[] = "hydrogene";
|
||||
$outValeurs[] = $this->metal;
|
||||
$outValeurs[] = $this->cristal;
|
||||
$outValeurs[] = $this->hydrogene;
|
||||
} elseif (!is_array($this->{$modif})) {
|
||||
$bdd->escape($this->{$modif});
|
||||
$outNomChamps[] = $modif;
|
||||
if (is_int($this->{$modif}) || is_float($this->{$modif})) {
|
||||
$outValeurs[] = $this->{$modif};
|
||||
} else {
|
||||
$outValeurs[] = "'".$this->{$modif}."'";
|
||||
}
|
||||
} else {
|
||||
if (is_array($this->{$modif}) && $modif != "coeff_bat" && $modif != "vaisseaux" && $modif != "terrestres" && $modif != "casernes" && $modif != "technologies" && $modif != "batiments") {
|
||||
$prep = serialize($this->{$modif});
|
||||
$bdd->escape($prep);
|
||||
$outNomChamps[] = $modif;
|
||||
$outValeurs[] = "'$prep'";
|
||||
} else {
|
||||
$calc = dDonnees::nameVAR($modif);
|
||||
|
||||
$outValeurs[] = $this->metal;
|
||||
$outValeurs[] = $this->cristal;
|
||||
$outValeurs[] = $this->hydrogene;
|
||||
}
|
||||
elseif (!is_array($this->{$modif}))
|
||||
{
|
||||
$bdd->escape($this->{$modif});
|
||||
$outNomChamps[] = $modif;
|
||||
if (is_int($this->{$modif}) || is_float($this->{$modif}))
|
||||
$outValeurs[] = $this->{$modif};
|
||||
else
|
||||
$outValeurs[] = "'".$this->{$modif}."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (is_array($this->{$modif}) && $modif != "coeff_bat" && $modif != "vaisseaux" && $modif != "terrestres" && $modif != "casernes" && $modif != "technologies" && $modif != "batiments")
|
||||
{
|
||||
$prep = serialize($this->{$modif});
|
||||
$bdd->escape($prep);
|
||||
$outNomChamps[] = $modif;
|
||||
$outValeurs[] = "'$prep'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$calc = dDonnees::nameVAR($modif);
|
||||
if (!isset(${$calc.'VAR'})) {
|
||||
global ${$calc.'VAR'};
|
||||
}
|
||||
|
||||
if (!isset(${$calc.'VAR'}))
|
||||
global ${$calc.'VAR'};
|
||||
foreach ($this->{$modif} as $j => $value) {
|
||||
$outNomChamps[] = ${$calc.'VAR'}[$j];
|
||||
$outValeurs[] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//On supprime le lien de construction de l'alliance
|
||||
$bdd->query("DELETE FROM $table_alliances_creation WHERE fondateur = ".$this->fondateur.";");
|
||||
if ($bdd->affected() != 1) {
|
||||
elog($bdd->affected()." champ(s) affecté(s) par la requête du fichier ".__FILE__." à la ligne ".__LINE__.", données : fondateur = ".$this->fondateur, 2);
|
||||
}
|
||||
//On ajout l'astéroide
|
||||
$bdd->query("INSERT INTO $table_alliances (".implode(', ', $outNomChamps).") VALUES (".implode(', ', $outValeurs).");");
|
||||
if ($bdd->affected() != 1) {
|
||||
elog($bdd->affected()." champ(s) affecté(s) par la requête du fichier ".__FILE__." à la ligne ".__LINE__.", données : outNomChamps = ".serialize($outNomChamps)." ; outValeurs = ".serialize($outValeurs), 2);
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
} else {
|
||||
$out = array();
|
||||
$bdd = new BDD();
|
||||
foreach ($this->modif as $modif) {
|
||||
//On gère les champs variables tableaux
|
||||
if (is_array($modif)) {
|
||||
if ($modif[0] == "batiments") {
|
||||
$calc = dDonnees::nameVAR("alli_batiments");
|
||||
} else {
|
||||
$calc = dDonnees::nameVAR($modif[0]);
|
||||
}
|
||||
|
||||
foreach($this->{$modif} as $j => $value)
|
||||
{
|
||||
$outNomChamps[] = ${$calc.'VAR'}[$j];
|
||||
$outValeurs[] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//On supprime le lien de construction de l'alliance
|
||||
$bdd->query("DELETE FROM $table_alliances_creation WHERE fondateur = ".$this->fondateur.";");
|
||||
if ($bdd->affected() != 1)
|
||||
elog($bdd->affected()." champ(s) affecté(s) par la requête du fichier ".__FILE__." à la ligne ".__LINE__.", données : fondateur = ".$this->fondateur, 2);
|
||||
//On ajout l'astéroide
|
||||
$bdd->query("INSERT INTO $table_alliances (".implode(', ', $outNomChamps).") VALUES (".implode(', ', $outValeurs).");");
|
||||
if ($bdd->affected() != 1)
|
||||
elog($bdd->affected()." champ(s) affecté(s) par la requête du fichier ".__FILE__." à la ligne ".__LINE__.", données : outNomChamps = ".serialize($outNomChamps)." ; outValeurs = ".serialize($outValeurs), 2);
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else
|
||||
{
|
||||
$out = array();
|
||||
$bdd = new BDD();
|
||||
foreach($this->modif as $modif)
|
||||
{
|
||||
//On gère les champs variables tableaux
|
||||
if (is_array($modif))
|
||||
{
|
||||
if ($modif[0] == "batiments")
|
||||
$calc = dDonnees::nameVAR("alli_batiments");
|
||||
else
|
||||
$calc = dDonnees::nameVAR($modif[0]);
|
||||
if (!isset(${$calc.'VAR'})) {
|
||||
global ${$calc.'VAR'};
|
||||
}
|
||||
if (empty(${$calc.'VAR'})) {
|
||||
trigger_error('Impossible de trouver les données pour '.$modif[0], E_USER_ERROR);
|
||||
}
|
||||
|
||||
if (!isset(${$calc.'VAR'}))
|
||||
global ${$calc.'VAR'};
|
||||
if (empty(${$calc.'VAR'}))
|
||||
trigger_error('Impossible de trouver les données pour '.$modif[0], E_USER_ERROR);
|
||||
$out[] = ${$calc.'VAR'}[$modif[1]]." = ".$this->{$modif[0]}[$modif[1]];
|
||||
} elseif ($modif == "force") {
|
||||
$out[] = "metal = ".$this->metal;
|
||||
$out[] = "cristal = ".$this->cristal;
|
||||
$out[] = "hydrogene = ".$this->hydrogene;
|
||||
} elseif (!is_array($this->{$modif}) && !is_object($this->{$modif})) {
|
||||
$bdd->escape($this->{$modif});
|
||||
if (is_int($this->{$modif}) || is_float($this->{$modif})) {
|
||||
$out[] = $modif." = ".$this->{$modif};
|
||||
} else {
|
||||
$out[] = $modif." = '".$this->{$modif}."'";
|
||||
}
|
||||
} else {
|
||||
if ($modif != "coeff_bat" && $modif != "vaisseaux" && $modif != "terrestres" && $modif != "casernes" && $modif != "technologies" && $modif != "batiments") {
|
||||
$prep = serialize($this->{$modif});
|
||||
$bdd->escape($prep);
|
||||
$out[] = $modif." = '$prep'";
|
||||
} else {
|
||||
$calc = dDonnees::nameVAR($modif);
|
||||
|
||||
$out[] = ${$calc.'VAR'}[$modif[1]]." = ".$this->{$modif[0]}[$modif[1]];
|
||||
}
|
||||
elseif ($modif == "force")
|
||||
{
|
||||
$out[] = "metal = ".$this->metal;
|
||||
$out[] = "cristal = ".$this->cristal;
|
||||
$out[] = "hydrogene = ".$this->hydrogene;
|
||||
}
|
||||
elseif (!is_array($this->{$modif}) && !is_object($this->{$modif}))
|
||||
{
|
||||
$bdd->escape($this->{$modif});
|
||||
if (is_int($this->{$modif}) || is_float($this->{$modif}))
|
||||
$out[] = $modif." = ".$this->{$modif};
|
||||
else
|
||||
$out[] = $modif." = '".$this->{$modif}."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($modif != "coeff_bat" && $modif != "vaisseaux" && $modif != "terrestres" && $modif != "casernes" && $modif != "technologies" && $modif != "batiments")
|
||||
{
|
||||
$prep = serialize($this->{$modif});
|
||||
$bdd->escape($prep);
|
||||
$out[] = $modif." = '$prep'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$calc = dDonnees::nameVAR($modif);
|
||||
if (!isset(${$calc.'VAR'})) {
|
||||
global ${$calc.'VAR'};
|
||||
}
|
||||
|
||||
if (!isset(${$calc.'VAR'}))
|
||||
global ${$calc.'VAR'};
|
||||
foreach ($this->{$modif} as $j => $value) {
|
||||
$out[] = ${$calc.'VAR'}[$j]." = ".$value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($out)) {
|
||||
$sql = "UPDATE $table_alliances SET ".implode(', ', $out)." WHERE id = ".$this->id.";";
|
||||
if (DEBUG) {
|
||||
echo '<br /><br />'.$sql;
|
||||
}
|
||||
$bdd->query($sql);
|
||||
if ($bdd->affected() != 1) {
|
||||
elog($bdd->affected()." champ(s) affecté(s) par la requête du fichier ".__FILE__." à la ligne ".__LINE__.", données : out = ".serialize($out), 2);
|
||||
}
|
||||
}
|
||||
|
||||
foreach($this->{$modif} as $j => $value)
|
||||
$out[] = ${$calc.'VAR'}[$j]." = ".$value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($out))
|
||||
{
|
||||
$sql = "UPDATE $table_alliances SET ".implode(', ', $out)." WHERE id = ".$this->id.";";
|
||||
if (DEBUG)
|
||||
echo '<br /><br />'.$sql;
|
||||
$bdd->query($sql);
|
||||
if ($bdd->affected() != 1)
|
||||
elog($bdd->affected()." champ(s) affecté(s) par la requête du fichier ".__FILE__." à la ligne ".__LINE__.", données : out = ".serialize($out), 2);
|
||||
}
|
||||
|
||||
$bdd->deconnexion();
|
||||
parent::__destruct();
|
||||
}
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
parent::__destruct();
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -6,37 +6,36 @@
|
|||
*/
|
||||
class Attaques
|
||||
{
|
||||
var $groupes = array();
|
||||
public $groupes = array();
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
public function addGroupe($groupe)
|
||||
{
|
||||
$this->groupes[] = $groupe;
|
||||
}
|
||||
|
||||
function addGroupe($groupe)
|
||||
{
|
||||
$this->groupes[] = $groupe;
|
||||
}
|
||||
public function checkAllGroupes()
|
||||
{
|
||||
foreach ($groupes as $key => $groupe) {
|
||||
$this->checkGroupe($key);
|
||||
}
|
||||
}
|
||||
|
||||
function checkAllGroupes()
|
||||
{
|
||||
foreach ($groupes as $key => $groupe)
|
||||
$this->checkGroupe($key);
|
||||
}
|
||||
|
||||
function checkGroupe($id)
|
||||
{
|
||||
if (is_a($this->groupes[$id], "Groupe"))
|
||||
{
|
||||
if ($this->groupes[$id]->)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
$groupes[$id]->
|
||||
}
|
||||
public function checkGroupe($id)
|
||||
{
|
||||
// if (is_a($this->groupes[$id], "Groupe"))
|
||||
// {
|
||||
// if ($this->groupes[$id]->)
|
||||
// {
|
||||
//
|
||||
// }
|
||||
// }
|
||||
// $groupes[$id]->
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -4,187 +4,224 @@
|
|||
* Dernière édition le 21 Juillet 2008
|
||||
* Copyright Halo-Battle Tous droits réservés
|
||||
*/
|
||||
class Bourse{
|
||||
var $bd;
|
||||
class Bourse
|
||||
{
|
||||
public $bd;
|
||||
|
||||
var $id;
|
||||
var $nom;
|
||||
var $taxeA = 1.1;
|
||||
var $taxeV = 1.5;
|
||||
var $metal;
|
||||
var $cristal;
|
||||
var $actionsUser;
|
||||
var $user;
|
||||
public $id;
|
||||
public $nom;
|
||||
public $taxeA = 1.1;
|
||||
public $taxeV = 1.5;
|
||||
public $metal;
|
||||
public $cristal;
|
||||
public $actionsUser;
|
||||
public $user;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param String $nom Nom de l'action
|
||||
* @param int $user ID du joueur à charger automatiquement
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
function Bourse($nom = "", $user = 0){
|
||||
global $var___db, $config;
|
||||
$db = new bdd();
|
||||
$db->connexion();
|
||||
$this->bd = $db;
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
* @param String $nom Nom de l'action
|
||||
* @param int $user ID du joueur à charger automatiquement
|
||||
*
|
||||
* @access protected
|
||||
*/
|
||||
public function Bourse($nom = "", $user = 0)
|
||||
{
|
||||
global $var___db, $config;
|
||||
$db = new bdd();
|
||||
$db->connexion();
|
||||
$this->bd = $db;
|
||||
|
||||
if (!empty($nom)) {
|
||||
$this->loadAction($nom, "id");
|
||||
if (!empty($user)) $this->loadUser($user);
|
||||
}
|
||||
}
|
||||
if (!empty($nom)) {
|
||||
$this->loadAction($nom, "id");
|
||||
if (!empty($user)) {
|
||||
$this->loadUser($user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function __destruct(){
|
||||
$this->bd->deconnexion();
|
||||
}
|
||||
public function __destruct()
|
||||
{
|
||||
$this->bd->deconnexion();
|
||||
}
|
||||
|
||||
function loadAction($nom, $type = "nom"){
|
||||
global $table_bourse;
|
||||
$this->bd->escape($nom);
|
||||
$act = $this->bd->unique_query("SELECT * FROM $table_bourse WHERE $type = '$nom';");
|
||||
if ($act) {
|
||||
$this->id = $act['id'];
|
||||
$this->nom = $act['nom'];
|
||||
$this->metal = $act['metal'];
|
||||
$this->cristal = $act['cristal'];
|
||||
}
|
||||
else erreur('Impossible de trouver cette action !', "red", '?p=bourse');
|
||||
}
|
||||
public function loadAction($nom, $type = "nom")
|
||||
{
|
||||
global $table_bourse;
|
||||
$this->bd->escape($nom);
|
||||
$act = $this->bd->unique_query("SELECT * FROM $table_bourse WHERE $type = '$nom';");
|
||||
if ($act) {
|
||||
$this->id = $act['id'];
|
||||
$this->nom = $act['nom'];
|
||||
$this->metal = $act['metal'];
|
||||
$this->cristal = $act['cristal'];
|
||||
} else {
|
||||
erreur('Impossible de trouver cette action !', "red", '?p=bourse');
|
||||
}
|
||||
}
|
||||
|
||||
function loadUser($user, $type = "id"){
|
||||
global $table_user;
|
||||
$this->bd->escape($user);
|
||||
$act = $this->bd->unique_query("SELECT id, bourse FROM $table_user WHERE $type = '$user';");
|
||||
$this->user = $act['id'];
|
||||
$this->traitUser($act['bourse']);
|
||||
}
|
||||
public function loadUser($user, $type = "id")
|
||||
{
|
||||
global $table_user;
|
||||
$this->bd->escape($user);
|
||||
$act = $this->bd->unique_query("SELECT id, bourse FROM $table_user WHERE $type = '$user';");
|
||||
$this->user = $act['id'];
|
||||
$this->traitUser($act['bourse']);
|
||||
}
|
||||
|
||||
function traitUser($start){
|
||||
$end = array();
|
||||
$start = explode(';', $start);
|
||||
$cnt = count($start);
|
||||
for($i = 0; $i < $cnt; $i++){
|
||||
$tmp = explode(':', $start[$i]);
|
||||
if (!empty($tmp[1])) $end[$tmp[0]] = explode(',', $tmp[1]);
|
||||
else $end[$tmp[0]] = array();
|
||||
}
|
||||
$this->actionsUser = $end;
|
||||
}
|
||||
public function traitUser($start)
|
||||
{
|
||||
$end = array();
|
||||
$start = explode(';', $start);
|
||||
$cnt = count($start);
|
||||
for ($i = 0; $i < $cnt; $i++) {
|
||||
$tmp = explode(':', $start[$i]);
|
||||
if (!empty($tmp[1])) {
|
||||
$end[$tmp[0]] = explode(',', $tmp[1]);
|
||||
} else {
|
||||
$end[$tmp[0]] = array();
|
||||
}
|
||||
}
|
||||
$this->actionsUser = $end;
|
||||
}
|
||||
|
||||
function prixAchat($nb){
|
||||
return array(floor($this->metal * $nb * $this->taxeA), floor($this->cristal * $nb * $this->taxeA));
|
||||
}
|
||||
public function prixAchat($nb)
|
||||
{
|
||||
return array(floor($this->metal * $nb * $this->taxeA), floor($this->cristal * $nb * $this->taxeA));
|
||||
}
|
||||
|
||||
function prixVente($nb){
|
||||
if ($this->action() < $nb) $nb = $this->action();
|
||||
public function prixVente($nb)
|
||||
{
|
||||
if ($this->action() < $nb) {
|
||||
$nb = $this->action();
|
||||
}
|
||||
|
||||
return array(floor($this->metal * $nb / $this->taxeV), floor($this->cristal * $nb / $this->taxeV));
|
||||
}
|
||||
return array(floor($this->metal * $nb / $this->taxeV), floor($this->cristal * $nb / $this->taxeV));
|
||||
}
|
||||
|
||||
function addAction($nb){
|
||||
$ret = array(floor($this->metal * $nb * $this->taxeA), floor($this->cristal * $nb * $this->taxeA));
|
||||
public function addAction($nb)
|
||||
{
|
||||
$ret = array(floor($this->metal * $nb * $this->taxeA), floor($this->cristal * $nb * $this->taxeA));
|
||||
|
||||
$this->metal *= pow(1.1, $nb);
|
||||
$this->cristal *= pow(1.1, $nb);
|
||||
$this->metal *= pow(1.1, $nb);
|
||||
$this->cristal *= pow(1.1, $nb);
|
||||
|
||||
for($i = 0; $i < $nb; $i++){
|
||||
$this->actionsUser[$this->id][] = time();
|
||||
}
|
||||
for ($i = 0; $i < $nb; $i++) {
|
||||
$this->actionsUser[$this->id][] = time();
|
||||
}
|
||||
|
||||
$this->maj();
|
||||
return $ret;
|
||||
}
|
||||
$this->maj();
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function delAction($nb){
|
||||
if ($this->action() < $nb) $nb = $this->action();
|
||||
public function delAction($nb)
|
||||
{
|
||||
if ($this->action() < $nb) {
|
||||
$nb = $this->action();
|
||||
}
|
||||
|
||||
$ret = array(floor($this->metal * $nb / $this->taxeV), floor($this->cristal * $nb / $this->taxeV));
|
||||
$ret = array(floor($this->metal * $nb / $this->taxeV), floor($this->cristal * $nb / $this->taxeV));
|
||||
|
||||
$this->metal /= pow(1.1, $nb);
|
||||
$this->cristal /= pow(1.1, $nb);
|
||||
$this->metal /= pow(1.1, $nb);
|
||||
$this->cristal /= pow(1.1, $nb);
|
||||
|
||||
for($i = 0; $i < $nb; $i++){
|
||||
unset($this->actionsUser[$this->id][$i]);
|
||||
}
|
||||
for ($i = 0; $i < $nb; $i++) {
|
||||
unset($this->actionsUser[$this->id][$i]);
|
||||
}
|
||||
|
||||
$this->maj();
|
||||
return $ret;
|
||||
}
|
||||
$this->maj();
|
||||
return $ret;
|
||||
}
|
||||
|
||||
function actionIn24Hours(){
|
||||
$nb = 0;
|
||||
if (isset($this->actionsUser[$this->id])) {
|
||||
$cnt = count($this->actionsUser[$this->id]);
|
||||
for($i = 0; $i < $cnt; $i++){
|
||||
if ($this->actionsUser[$this->id][$i] > time() - 86400) $nb++;
|
||||
}
|
||||
}
|
||||
return $nb;
|
||||
}
|
||||
public function actionIn24Hours()
|
||||
{
|
||||
$nb = 0;
|
||||
if (isset($this->actionsUser[$this->id])) {
|
||||
$cnt = count($this->actionsUser[$this->id]);
|
||||
for ($i = 0; $i < $cnt; $i++) {
|
||||
if ($this->actionsUser[$this->id][$i] > time() - 86400) {
|
||||
$nb++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $nb;
|
||||
}
|
||||
|
||||
function action(){
|
||||
if (isset($this->actionsUser[$this->id])) return count($this->actionsUser[$this->id]);
|
||||
else return 0;
|
||||
public function action()
|
||||
{
|
||||
if (isset($this->actionsUser[$this->id])) {
|
||||
return count($this->actionsUser[$this->id]);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
public function maj()
|
||||
{
|
||||
$this->majBourse();
|
||||
$this->majUser();
|
||||
$this->fileSave();
|
||||
}
|
||||
|
||||
function maj(){
|
||||
$this->majBourse();
|
||||
$this->majUser();
|
||||
$this->fileSave();
|
||||
}
|
||||
public function majBourse()
|
||||
{
|
||||
global $table_bourse;
|
||||
|
||||
function majBourse(){
|
||||
global $table_bourse;
|
||||
$this->bd->query("UPDATE $table_bourse SET nom = '".$this->nom."', metal = '".$this->metal."', cristal = '".$this->cristal."' WHERE id = ".$this->id.";");
|
||||
}
|
||||
|
||||
$this->bd->query("UPDATE $table_bourse SET nom = '".$this->nom."', metal = '".$this->metal."', cristal = '".$this->cristal."' WHERE id = ".$this->id.";");
|
||||
}
|
||||
public function majUser()
|
||||
{
|
||||
global $table_user;
|
||||
|
||||
function majUser(){
|
||||
global $table_user;
|
||||
$champ = '';
|
||||
foreach ($this->actionsUser as $key => $cell) {
|
||||
if (count($cell) > 0) {
|
||||
if (empty($champ)) {
|
||||
$champ .= $key.':'.implode(',', $cell);
|
||||
} else {
|
||||
$champ .= ';'.$key.':'.implode(',', $cell);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$champ = '';
|
||||
foreach($this->actionsUser as $key => $cell) {
|
||||
if (count($cell) > 0) {
|
||||
if (empty($champ)) $champ .= $key.':'.implode(',', $cell);
|
||||
else $champ .= ';'.$key.':'.implode(',', $cell);
|
||||
}
|
||||
}
|
||||
$this->bd->query("UPDATE $table_user SET bourse = '$champ' WHERE id = ".$this->user.";");
|
||||
}
|
||||
|
||||
$this->bd->query("UPDATE $table_user SET bourse = '$champ' WHERE id = ".$this->user.";");
|
||||
}
|
||||
public function delUser($id = "")
|
||||
{
|
||||
if (!empty($id)) {
|
||||
$this->loadUser($id);
|
||||
}
|
||||
|
||||
function delUser($id = ""){
|
||||
if (!empty($id)) $this->loadUser($id);
|
||||
|
||||
$champ = '';
|
||||
foreach($this->actionsUser as $key => $cell) {
|
||||
$cnt = count($cell);
|
||||
if ($cnt > 0) {
|
||||
$this->loadAction($key, "id");
|
||||
$this->delAction($cnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
$champ = '';
|
||||
foreach ($this->actionsUser as $key => $cell) {
|
||||
$cnt = count($cell);
|
||||
if ($cnt > 0) {
|
||||
$this->loadAction($key, "id");
|
||||
$this->delAction($cnt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function fileSave(){
|
||||
$fichier = fopen(_FCORE."../game/cache/bourse/".$this->id.".".strftime('%Y%m%d').".bourse",'a+');
|
||||
fwrite($fichier, time().';'.$this->metal.';'.$this->cristal."\n");
|
||||
fclose($fichier);
|
||||
}
|
||||
public function fileSave()
|
||||
{
|
||||
$fichier = fopen(_FCORE."../game/cache/bourse/".$this->id.".".strftime('%Y%m%d').".bourse", 'a+');
|
||||
fwrite($fichier, time().';'.$this->metal.';'.$this->cristal."\n");
|
||||
fclose($fichier);
|
||||
}
|
||||
|
||||
|
||||
function newGroupe($nom, $metal, $cristal, $description = ""){
|
||||
global $table_bourse;
|
||||
public function newGroupe($nom, $metal, $cristal, $description = "")
|
||||
{
|
||||
global $table_bourse;
|
||||
|
||||
$this->bd->query("INSERT INTO $table_bourse (nom, metal, cristal, description) VALUES('$nom', '$metal', '$cristal', '$description');");
|
||||
}
|
||||
$this->bd->query("INSERT INTO $table_bourse (nom, metal, cristal, description) VALUES('$nom', '$metal', '$cristal', '$description');");
|
||||
}
|
||||
|
||||
function editGroupe($description){
|
||||
//TODO toute cette fonction !!
|
||||
}
|
||||
public function editGroupe($description)
|
||||
{
|
||||
//TODO toute cette fonction !!
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -9,254 +9,262 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
class Donnee
|
||||
{
|
||||
public static function donneeTechnologie($branche, $idTechnologie, $retour, Planete $planete)
|
||||
{
|
||||
static function donneeTechnologie($branche, $idTechnologie, $retour, Planete $planete)
|
||||
{
|
||||
//TODO : Faire un switch pour ne renvoyer le tableau que de la branche plutôt que ce tableau avec l'intégralité des branches.
|
||||
$technologies_donnees = array(
|
||||
//Industrie
|
||||
array(
|
||||
array(1, 0, 1000, 54000),
|
||||
array(2, 1, 2000, 90000),
|
||||
array(4, 3, 4000, 126000),
|
||||
array(8, 1, 4000, 126000),
|
||||
array(16, 1, 2000, 72000),
|
||||
array(32, 17, 4000, 108000),
|
||||
array(64, 49, 8000, 144000),
|
||||
array(128, 1, 2000, 72000),
|
||||
array(256, 129, 4000, 108000),
|
||||
array(512, 385, 8000, 144000),
|
||||
array(1024, 1, 2000, 72000),
|
||||
array(2048, 1025, 4000, 108000),
|
||||
array(4096, 3073, 8000, 144000),
|
||||
array(8192, 9, 3000, 126000),
|
||||
array(16384, 8201, 6000, 162000),
|
||||
array(32768, 24585, 12000, 198000),
|
||||
array(65536, 1169, 3000, 126000),
|
||||
array(131072, 66705, 6000, 162000),
|
||||
array(262144, 197777, 12000, 198000)
|
||||
),
|
||||
//Ingénieurie
|
||||
array(
|
||||
array(1, 0, 1000, 54000),
|
||||
array(2, 1, 2000, 90000),
|
||||
array(4, 3, 4000, 126000),
|
||||
array(8, 1, 2000, 90000),
|
||||
array(16, 9, 4000, 126000),
|
||||
array(32, 25, 8000, 162000),
|
||||
array(64, 9, 3000, 126000),
|
||||
array(128, 73, 6000, 162000),
|
||||
array(256, 201, 12000, 198000),
|
||||
array(512, 73, 4000, 162000),
|
||||
array(1024, 585, 8000, 198000),
|
||||
array(2048, 1609, 16000, 234000),
|
||||
array(4096, 0, 1000, 54000),
|
||||
array(8192, 4096, 2000, 90000),
|
||||
array(16384, 12288, 4000, 126000),
|
||||
array(32768, 4096, 2000, 54000),
|
||||
array(65536, 36864, 4000, 90000),
|
||||
array(131072, 102400, 8000, 126000),
|
||||
array(262144, 12288, 2000, 72000),
|
||||
array(524288, 274432, 4000, 108000),
|
||||
array(1048576, 798720, 8000, 144000),
|
||||
array(2097152, 274432, 2000, 54000),
|
||||
array(4194304, 2371584, 4000, 90000),
|
||||
array(8388608, 6565888, 8000, 126000),
|
||||
array(16777216, 28672, 2000, 54000),
|
||||
array(33554432, 16805888, 4000, 90000),
|
||||
array(67108864, 50360320, 8000, 126000),
|
||||
array(134217728, 28672, 3000, 90000),
|
||||
array(268435456, 134246400, 6000, 126000),
|
||||
array(536870912, 402681856, 12000, 162000)
|
||||
),
|
||||
//Ingénieurie 2
|
||||
array(
|
||||
array(1, 0, 1000, 36000),
|
||||
array(2, 1, 2000, 72000),
|
||||
array(4, 3, 4000, 108000),
|
||||
array(8, 1, 4000, 126000),
|
||||
array(16, 1, 4000, 126000),
|
||||
array(32, 25, 4000, 126000),
|
||||
array(64, 57, 8000, 162000),
|
||||
array(128, 121, 16000, 198000)
|
||||
),
|
||||
//Politique
|
||||
array(
|
||||
array(1, 0, 1000, 36000),
|
||||
array(2, 1, 2000, 72000),
|
||||
array(4, 3, 4000, 108000),
|
||||
array(8, 1, 2000, 72000),
|
||||
array(16, 9, 4000, 108000),
|
||||
array(32, 25, 8000, 144000),
|
||||
array(64, 9, 4000, 126000),
|
||||
array(128, 8, 6000, 162000),
|
||||
array(256, 9, 6000, 162000),
|
||||
array(512, 0, 1000, 90000),
|
||||
array(1024, 512, 2000, 90000),
|
||||
array(2048, 1536, 4000, 90000),
|
||||
array(4096, 512, 2000, 72000),
|
||||
array(8192, 4608, 4000, 108000),
|
||||
array(16384, 12800, 8000, 144000)
|
||||
),
|
||||
//TODO : Faire un switch pour ne renvoyer le tableau que de la branche plutôt que ce tableau avec l'intégralité des branches.
|
||||
$technologies_donnees = array(
|
||||
//Industrie
|
||||
array(
|
||||
array(1, 0, 1000, 54000),
|
||||
array(2, 1, 2000, 90000),
|
||||
array(4, 3, 4000, 126000),
|
||||
array(8, 1, 4000, 126000),
|
||||
array(16, 1, 2000, 72000),
|
||||
array(32, 17, 4000, 108000),
|
||||
array(64, 49, 8000, 144000),
|
||||
array(128, 1, 2000, 72000),
|
||||
array(256, 129, 4000, 108000),
|
||||
array(512, 385, 8000, 144000),
|
||||
array(1024, 1, 2000, 72000),
|
||||
array(2048, 1025, 4000, 108000),
|
||||
array(4096, 3073, 8000, 144000),
|
||||
array(8192, 9, 3000, 126000),
|
||||
array(16384, 8201, 6000, 162000),
|
||||
array(32768, 24585, 12000, 198000),
|
||||
array(65536, 1169, 3000, 126000),
|
||||
array(131072, 66705, 6000, 162000),
|
||||
array(262144, 197777, 12000, 198000)
|
||||
),
|
||||
//Ingénieurie
|
||||
array(
|
||||
array(1, 0, 1000, 54000),
|
||||
array(2, 1, 2000, 90000),
|
||||
array(4, 3, 4000, 126000),
|
||||
array(8, 1, 2000, 90000),
|
||||
array(16, 9, 4000, 126000),
|
||||
array(32, 25, 8000, 162000),
|
||||
array(64, 9, 3000, 126000),
|
||||
array(128, 73, 6000, 162000),
|
||||
array(256, 201, 12000, 198000),
|
||||
array(512, 73, 4000, 162000),
|
||||
array(1024, 585, 8000, 198000),
|
||||
array(2048, 1609, 16000, 234000),
|
||||
array(4096, 0, 1000, 54000),
|
||||
array(8192, 4096, 2000, 90000),
|
||||
array(16384, 12288, 4000, 126000),
|
||||
array(32768, 4096, 2000, 54000),
|
||||
array(65536, 36864, 4000, 90000),
|
||||
array(131072, 102400, 8000, 126000),
|
||||
array(262144, 12288, 2000, 72000),
|
||||
array(524288, 274432, 4000, 108000),
|
||||
array(1048576, 798720, 8000, 144000),
|
||||
array(2097152, 274432, 2000, 54000),
|
||||
array(4194304, 2371584, 4000, 90000),
|
||||
array(8388608, 6565888, 8000, 126000),
|
||||
array(16777216, 28672, 2000, 54000),
|
||||
array(33554432, 16805888, 4000, 90000),
|
||||
array(67108864, 50360320, 8000, 126000),
|
||||
array(134217728, 28672, 3000, 90000),
|
||||
array(268435456, 134246400, 6000, 126000),
|
||||
array(536870912, 402681856, 12000, 162000)
|
||||
),
|
||||
//Ingénieurie 2
|
||||
array(
|
||||
array(1, 0, 1000, 36000),
|
||||
array(2, 1, 2000, 72000),
|
||||
array(4, 3, 4000, 108000),
|
||||
array(8, 1, 4000, 126000),
|
||||
array(16, 1, 4000, 126000),
|
||||
array(32, 25, 4000, 126000),
|
||||
array(64, 57, 8000, 162000),
|
||||
array(128, 121, 16000, 198000)
|
||||
),
|
||||
//Politique
|
||||
array(
|
||||
array(1, 0, 1000, 36000),
|
||||
array(2, 1, 2000, 72000),
|
||||
array(4, 3, 4000, 108000),
|
||||
array(8, 1, 2000, 72000),
|
||||
array(16, 9, 4000, 108000),
|
||||
array(32, 25, 8000, 144000),
|
||||
array(64, 9, 4000, 126000),
|
||||
array(128, 8, 6000, 162000),
|
||||
array(256, 9, 6000, 162000),
|
||||
array(512, 0, 1000, 90000),
|
||||
array(1024, 512, 2000, 90000),
|
||||
array(2048, 1536, 4000, 90000),
|
||||
array(4096, 512, 2000, 72000),
|
||||
array(8192, 4608, 4000, 108000),
|
||||
array(16384, 12800, 8000, 144000)
|
||||
),
|
||||
|
||||
//Armement
|
||||
array(
|
||||
array(1, 0, 1000, 36000),
|
||||
array(2, 1, 2000, 72000),
|
||||
array(4, 3, 4000, 108000),
|
||||
array(8, 1, 1000, 54000),
|
||||
array(16, 9, 2000, 90000),
|
||||
array(32, 25, 4000, 126000),
|
||||
array(64, 9, 2000, 72000),
|
||||
array(128, 73, 4000, 108000),
|
||||
array(256, 201, 8000, 144000),
|
||||
array(512, 73, 2000, 90000),
|
||||
array(1024, 585, 4000, 126000),
|
||||
array(2048, 1609, 8000, 162000),
|
||||
array(4096, 1, 3000, 108000),
|
||||
array(8192, 4097, 6000, 144000),
|
||||
array(16384, 12289, 12000, 180000),
|
||||
array(32768, 4097, 3000, 126000),
|
||||
array(65536, 36865, 6000, 162000),
|
||||
array(131072, 102401, 12000, 198000)
|
||||
),
|
||||
//Défense
|
||||
array(
|
||||
array(1, 0, 1000, 36000),
|
||||
array(2, 1, 2000, 72000),
|
||||
array(4, 3, 4000, 108000),
|
||||
array(8, 1, 2000, 72000),
|
||||
array(16, 9, 4000, 108000),
|
||||
array(32, 25, 8000, 144000),
|
||||
array(64, 9, 3000, 108000),
|
||||
array(128, 73, 6000, 144000),
|
||||
array(256, 201, 12000, 180000),
|
||||
array(512, 0, 1000, 36000),
|
||||
array(1024, 512, 2000, 72000),
|
||||
array(2048, 1536, 4000, 108000),
|
||||
array(4096, 512, 2000, 72000),
|
||||
array(8192, 4608, 4000, 108000),
|
||||
array(16384, 12800, 8000, 144000),
|
||||
array(32768, 4608, 3000, 108000),
|
||||
array(65536, 37376, 6000, 144000),
|
||||
array(131072, 102912, 12000, 180000),
|
||||
array(262144, 512, 1000, 54000),
|
||||
array(524288, 262656, 2000, 90000),
|
||||
array(1048576, 786944, 4000, 126000),
|
||||
array(2097152, 262656, 2000, 90000),
|
||||
array(4194304, 2359808, 4000, 126000),
|
||||
array(8388608, 6554112, 8000, 162000),
|
||||
array(16777216, 2359808, 3000, 126000),
|
||||
array(33554432, 19137024, 6000, 162000),
|
||||
array(67108864, 52691456, 12000, 198000)
|
||||
),
|
||||
//Défense 2
|
||||
array(
|
||||
array(1, 0, 2000, 72000),
|
||||
array(2, 1, 4000, 144000),
|
||||
array(4, 3, 6000, 216000),
|
||||
array(8, 0, 2000, 72000),
|
||||
array(16, 8, 4000, 144000),
|
||||
array(32, 24, 6000, 216000),
|
||||
array(64, 27, 8000, 288000)
|
||||
),
|
||||
//Projets expérimentaux
|
||||
array(
|
||||
array(1, 0, 2000, 36000),
|
||||
array(2, 1, 4000, 72000),
|
||||
array(4, 2, 4000, 108000),
|
||||
array(8, 4, 6000, 144000),
|
||||
array(16, 8, 6000, 144000),
|
||||
array(32, 8, 8000, 180000),
|
||||
array(64, 32, 10000, 216000),
|
||||
array(128, 64, 10000, 234000),
|
||||
array(256, 128, 12000, 288000),
|
||||
array(512, 256, 14000, 324000),
|
||||
array(1024, 64, 14000, 342000),
|
||||
array(2048, 256, 16000, 360000),
|
||||
array(4096, 576, 18000, 396000),
|
||||
array(8192, 4096, 20000, 432000),
|
||||
array(16384, 8192, 22000, 504000)
|
||||
),
|
||||
//Technologie expansion
|
||||
array(
|
||||
array(1, 0, 4000, 54000),
|
||||
array(2, 1, 6000, 72000),
|
||||
array(4, 3, 8000, 90000),
|
||||
array(8, 7, 10000, 108000),
|
||||
array(16, 15, 12000, 126000),
|
||||
array(32, 31, 14000, 144000),
|
||||
array(64, 63, 16000, 162000),
|
||||
array(128, 127, 18000, 180000),
|
||||
array(256, 255, 20000, 198000),
|
||||
array(512, 511, 22000, 216000),
|
||||
array(1024, 1023, 24000, 234000),
|
||||
array(2048, 2047, 26000, 252000),
|
||||
array(4096, 4095, 28000, 270000),
|
||||
array(8192, 8191, 30000, 288000),
|
||||
array(16384, 16383, 32000, 306000),
|
||||
array(32768, 32767, 34000, 324000),
|
||||
array(65536, 65535, 36000, 342000),
|
||||
array(131072, 131071, 38000, 360000)
|
||||
)
|
||||
);
|
||||
//Armement
|
||||
array(
|
||||
array(1, 0, 1000, 36000),
|
||||
array(2, 1, 2000, 72000),
|
||||
array(4, 3, 4000, 108000),
|
||||
array(8, 1, 1000, 54000),
|
||||
array(16, 9, 2000, 90000),
|
||||
array(32, 25, 4000, 126000),
|
||||
array(64, 9, 2000, 72000),
|
||||
array(128, 73, 4000, 108000),
|
||||
array(256, 201, 8000, 144000),
|
||||
array(512, 73, 2000, 90000),
|
||||
array(1024, 585, 4000, 126000),
|
||||
array(2048, 1609, 8000, 162000),
|
||||
array(4096, 1, 3000, 108000),
|
||||
array(8192, 4097, 6000, 144000),
|
||||
array(16384, 12289, 12000, 180000),
|
||||
array(32768, 4097, 3000, 126000),
|
||||
array(65536, 36865, 6000, 162000),
|
||||
array(131072, 102401, 12000, 198000)
|
||||
),
|
||||
//Défense
|
||||
array(
|
||||
array(1, 0, 1000, 36000),
|
||||
array(2, 1, 2000, 72000),
|
||||
array(4, 3, 4000, 108000),
|
||||
array(8, 1, 2000, 72000),
|
||||
array(16, 9, 4000, 108000),
|
||||
array(32, 25, 8000, 144000),
|
||||
array(64, 9, 3000, 108000),
|
||||
array(128, 73, 6000, 144000),
|
||||
array(256, 201, 12000, 180000),
|
||||
array(512, 0, 1000, 36000),
|
||||
array(1024, 512, 2000, 72000),
|
||||
array(2048, 1536, 4000, 108000),
|
||||
array(4096, 512, 2000, 72000),
|
||||
array(8192, 4608, 4000, 108000),
|
||||
array(16384, 12800, 8000, 144000),
|
||||
array(32768, 4608, 3000, 108000),
|
||||
array(65536, 37376, 6000, 144000),
|
||||
array(131072, 102912, 12000, 180000),
|
||||
array(262144, 512, 1000, 54000),
|
||||
array(524288, 262656, 2000, 90000),
|
||||
array(1048576, 786944, 4000, 126000),
|
||||
array(2097152, 262656, 2000, 90000),
|
||||
array(4194304, 2359808, 4000, 126000),
|
||||
array(8388608, 6554112, 8000, 162000),
|
||||
array(16777216, 2359808, 3000, 126000),
|
||||
array(33554432, 19137024, 6000, 162000),
|
||||
array(67108864, 52691456, 12000, 198000)
|
||||
),
|
||||
//Défense 2
|
||||
array(
|
||||
array(1, 0, 2000, 72000),
|
||||
array(2, 1, 4000, 144000),
|
||||
array(4, 3, 6000, 216000),
|
||||
array(8, 0, 2000, 72000),
|
||||
array(16, 8, 4000, 144000),
|
||||
array(32, 24, 6000, 216000),
|
||||
array(64, 27, 8000, 288000)
|
||||
),
|
||||
//Projets expérimentaux
|
||||
array(
|
||||
array(1, 0, 2000, 36000),
|
||||
array(2, 1, 4000, 72000),
|
||||
array(4, 2, 4000, 108000),
|
||||
array(8, 4, 6000, 144000),
|
||||
array(16, 8, 6000, 144000),
|
||||
array(32, 8, 8000, 180000),
|
||||
array(64, 32, 10000, 216000),
|
||||
array(128, 64, 10000, 234000),
|
||||
array(256, 128, 12000, 288000),
|
||||
array(512, 256, 14000, 324000),
|
||||
array(1024, 64, 14000, 342000),
|
||||
array(2048, 256, 16000, 360000),
|
||||
array(4096, 576, 18000, 396000),
|
||||
array(8192, 4096, 20000, 432000),
|
||||
array(16384, 8192, 22000, 504000)
|
||||
),
|
||||
//Technologie expansion
|
||||
array(
|
||||
array(1, 0, 4000, 54000),
|
||||
array(2, 1, 6000, 72000),
|
||||
array(4, 3, 8000, 90000),
|
||||
array(8, 7, 10000, 108000),
|
||||
array(16, 15, 12000, 126000),
|
||||
array(32, 31, 14000, 144000),
|
||||
array(64, 63, 16000, 162000),
|
||||
array(128, 127, 18000, 180000),
|
||||
array(256, 255, 20000, 198000),
|
||||
array(512, 511, 22000, 216000),
|
||||
array(1024, 1023, 24000, 234000),
|
||||
array(2048, 2047, 26000, 252000),
|
||||
array(4096, 4095, 28000, 270000),
|
||||
array(8192, 8191, 30000, 288000),
|
||||
array(16384, 16383, 32000, 306000),
|
||||
array(32768, 32767, 34000, 324000),
|
||||
array(65536, 65535, 36000, 342000),
|
||||
array(131072, 131071, 38000, 360000)
|
||||
)
|
||||
);
|
||||
|
||||
if ($retour == "metal") return 0;
|
||||
elseif ($retour == "cristal") return 0;
|
||||
elseif ($retour == "hydrogene") return 0;
|
||||
elseif ($retour == "credits") return $technologies_donnees[$branche][$idTechnologie][2];
|
||||
elseif ($retour == "temps") return $technologies_donnees[$branche][$idTechnologie][3]/VITESSE;
|
||||
elseif ($retour == "needed") return $technologies_donnees[$branche][$idTechnologie][1];
|
||||
elseif ($retour == "id") return $technologies_donnees[$branche][$idTechnologie][0];
|
||||
elseif ($retour == "array") return array(0, 0, 0, $technologies_donnees[$branche][$idTechnologie][2], $technologies_donnees[$branche][$idTechnologie][3]/VITESSE);
|
||||
}
|
||||
|
||||
static function metalTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "metal", $planete);
|
||||
}
|
||||
|
||||
static function cristalTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "cristal", $planete);
|
||||
}
|
||||
|
||||
static function hydrogeneTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "hydrogene", $planete);
|
||||
}
|
||||
|
||||
static function creditsTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "credits", $planete);
|
||||
}
|
||||
|
||||
static function tempsTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "temps", $planete);
|
||||
}
|
||||
|
||||
static function idTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "id", $planete);
|
||||
}
|
||||
|
||||
static function neededTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
$neededTechnologies = Donnee::donneeTechnologie($branche, $idTechnologie, "needed", $planete);
|
||||
if (empty($neededTechnologies)) return true;
|
||||
if (is_array($neededTechnologies))
|
||||
{
|
||||
//TODO prévoir le besoin de plus d'une technologie pour la validation, dans une autre branche, batiment (?) ...
|
||||
die('TODO '.__LINE__.' in '.__FILE__);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (((int)$planete->technologies[$branche]& $neededTechnologies) == $neededTechnologies)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if ($retour == "metal") {
|
||||
return 0;
|
||||
} elseif ($retour == "cristal") {
|
||||
return 0;
|
||||
} elseif ($retour == "hydrogene") {
|
||||
return 0;
|
||||
} elseif ($retour == "credits") {
|
||||
return $technologies_donnees[$branche][$idTechnologie][2];
|
||||
} elseif ($retour == "temps") {
|
||||
return $technologies_donnees[$branche][$idTechnologie][3]/VITESSE;
|
||||
} elseif ($retour == "needed") {
|
||||
return $technologies_donnees[$branche][$idTechnologie][1];
|
||||
} elseif ($retour == "id") {
|
||||
return $technologies_donnees[$branche][$idTechnologie][0];
|
||||
} elseif ($retour == "array") {
|
||||
return array(0, 0, 0, $technologies_donnees[$branche][$idTechnologie][2], $technologies_donnees[$branche][$idTechnologie][3]/VITESSE);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
public static function metalTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "metal", $planete);
|
||||
}
|
||||
|
||||
public static function cristalTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "cristal", $planete);
|
||||
}
|
||||
|
||||
public static function hydrogeneTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "hydrogene", $planete);
|
||||
}
|
||||
|
||||
public static function creditsTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "credits", $planete);
|
||||
}
|
||||
|
||||
public static function tempsTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "temps", $planete);
|
||||
}
|
||||
|
||||
public static function idTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
return Donnee::donneeTechnologie($branche, $idTechnologie, "id", $planete);
|
||||
}
|
||||
|
||||
public static function neededTechnologie($branche, $idTechnologie, Planete $planete)
|
||||
{
|
||||
$neededTechnologies = Donnee::donneeTechnologie($branche, $idTechnologie, "needed", $planete);
|
||||
if (empty($neededTechnologies)) {
|
||||
return true;
|
||||
}
|
||||
if (is_array($neededTechnologies)) {
|
||||
//TODO prévoir le besoin de plus d'une technologie pour la validation, dans une autre branche, batiment (?) ...
|
||||
die('TODO '.__LINE__.' in '.__FILE__);
|
||||
} else {
|
||||
if (((int)$planete->technologies[$branche]& $neededTechnologies) == $neededTechnologies) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -9,178 +9,166 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
class FlotteGroupee
|
||||
{
|
||||
var $id_flotte = 0,
|
||||
$nom,
|
||||
$end_planete,
|
||||
$time_end,
|
||||
$end_type,
|
||||
$ret_planete,
|
||||
$flottes = array(),
|
||||
$mission,
|
||||
$modifFlotte = array();
|
||||
{
|
||||
public $id_flotte = 0;
|
||||
public $nom;
|
||||
public $end_planete;
|
||||
public $time_end;
|
||||
public $end_type;
|
||||
public $ret_planete;
|
||||
public $flottes = array();
|
||||
public $mission;
|
||||
public $modifFlotte = array();
|
||||
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la flotte à importer
|
||||
* @param bool $verrou Booléen disant si la classe doit obtenir préalablement un verrou pour la flotte.
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function __construct($id = 0, $verrou = true)
|
||||
{
|
||||
if (!empty($id))
|
||||
{
|
||||
global $table_flottes_preparation;
|
||||
global $spatialVAR, $ressoVAR;
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la flotte à importer
|
||||
* @param bool $verrou Booléen disant si la classe doit obtenir préalablement un verrou pour la flotte.
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function __construct($id = 0, $verrou = true)
|
||||
{
|
||||
if (!empty($id)) {
|
||||
global $table_flottes_preparation;
|
||||
global $spatialVAR, $ressoVAR;
|
||||
|
||||
$id = intval($id);
|
||||
$bdd = new BDD();
|
||||
$flotte = $bdd->unique_query("SELECT * FROM $table_flottes_preparation WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
$id = intval($id);
|
||||
$bdd = new BDD();
|
||||
$flotte = $bdd->unique_query("SELECT * FROM $table_flottes_preparation WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($flotte))
|
||||
{
|
||||
$this->id_flotte = $flotte["id"];
|
||||
$this->nom = $flotte["nom"];
|
||||
$this->end_planete = $flotte["end_planete"];
|
||||
$this->end_type = $flotte["end_type"];
|
||||
$this->time_end = $flotte["time_end"];
|
||||
$this->mission = $flotte["mission"];
|
||||
if (!empty($flotte)) {
|
||||
$this->id_flotte = $flotte["id"];
|
||||
$this->nom = $flotte["nom"];
|
||||
$this->end_planete = $flotte["end_planete"];
|
||||
$this->end_type = $flotte["end_type"];
|
||||
$this->time_end = $flotte["time_end"];
|
||||
$this->mission = $flotte["mission"];
|
||||
|
||||
if (empty($this->flottes)
|
||||
$this->flottes = array();
|
||||
else
|
||||
$this->flottes = unserialize($flotte["flottes"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($this->flottes)) {
|
||||
$this->flottes = array();
|
||||
} else {
|
||||
$this->flottes = unserialize($flotte["flottes"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function load_planete()
|
||||
{
|
||||
if (is_numeric($this->end_planete) && !empty($this->end_planete))
|
||||
{
|
||||
//On traite l'importation en fonction des types fornis
|
||||
if ($this->end_type == 0 || $this->end_type == 1)
|
||||
{
|
||||
global $planete;
|
||||
//Si la planète est la même que celle du joueur actuel, on l'utilise, sinon, on la crée
|
||||
if (SURFACE == "planete" && $planete->id == $this->end_planete)
|
||||
$this->end_planete = $planete;
|
||||
else
|
||||
$this->end_planete = new Planete($this->end_planete);
|
||||
}
|
||||
else
|
||||
{
|
||||
global $planete;
|
||||
//Si la planète est la même que celle du joueur actuel, on l'utilise, sinon, on la crée
|
||||
if (SURFACE == "asteroide" && $planete->id == $this->end_planete)
|
||||
$this->end_planete = $planete;
|
||||
else
|
||||
$this->end_planete = new Asteroide($this->end_planete);
|
||||
}
|
||||
}
|
||||
}
|
||||
public function load_planete()
|
||||
{
|
||||
if (is_numeric($this->end_planete) && !empty($this->end_planete)) {
|
||||
//On traite l'importation en fonction des types fornis
|
||||
if ($this->end_type == 0 || $this->end_type == 1) {
|
||||
global $planete;
|
||||
//Si la planète est la même que celle du joueur actuel, on l'utilise, sinon, on la crée
|
||||
if (SURFACE == "planete" && $planete->id == $this->end_planete) {
|
||||
$this->end_planete = $planete;
|
||||
} else {
|
||||
$this->end_planete = new Planete($this->end_planete);
|
||||
}
|
||||
} else {
|
||||
global $planete;
|
||||
//Si la planète est la même que celle du joueur actuel, on l'utilise, sinon, on la crée
|
||||
if (SURFACE == "asteroide" && $planete->id == $this->end_planete) {
|
||||
$this->end_planete = $planete;
|
||||
} else {
|
||||
$this->end_planete = new Asteroide($this->end_planete);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addFlotte($start_planete, $vitesse, $vaisseaux, $contenu_metal, $contenu_cristal, $contenu_hydrogene)
|
||||
{
|
||||
$this->flottes[] = array($start_planete->id_user, $start_planete->id, $vitesse, $vaisseaux, $contenu_metal, $contenu_cristal, $contenu_hydrogene);
|
||||
addModifFlotte("flottes");
|
||||
}
|
||||
public function addFlotte($start_planete, $vitesse, $vaisseaux, $contenu_metal, $contenu_cristal, $contenu_hydrogene)
|
||||
{
|
||||
$this->flottes[] = array($start_planete->id_user, $start_planete->id, $vitesse, $vaisseaux, $contenu_metal, $contenu_cristal, $contenu_hydrogene);
|
||||
addModifFlotte("flottes");
|
||||
}
|
||||
|
||||
function lancer()
|
||||
{
|
||||
public function lancer()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
public function addModifFlotte($modif)
|
||||
{
|
||||
if (!in_array($modif, $this->modifFlotte)) {
|
||||
$this->modifFlotte[] = $modif;
|
||||
}
|
||||
}
|
||||
|
||||
function addModifFlotte($modif)
|
||||
{
|
||||
if (!in_array($modif, $this->modifFlotte))
|
||||
$this->modifFlotte[] = $modif;
|
||||
}
|
||||
/**
|
||||
* Destructeur
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
global $table_flottes;
|
||||
|
||||
/**
|
||||
* Destructeur
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function __destruct()
|
||||
{
|
||||
global $table_flottes;
|
||||
if ($this->modifFlotte === "DELETE") {
|
||||
$bdd = new BDD();
|
||||
$bdd->query("DELETE FROM $table_flottes WHERE id = ".$this->id_flotte.";");
|
||||
$bdd->deconnexion();
|
||||
} else {
|
||||
if (empty($this->id_flotte)) {
|
||||
if ($this->modifFlotte == "INSERT") {
|
||||
$out1 = '';
|
||||
$out2 = '';
|
||||
global $spatialVAR;
|
||||
foreach ($this->vaisseaux as $key => $vais) {
|
||||
$out1 .= ', '.$spatialVAR[$key];
|
||||
$out2 .= ', '.$vais;
|
||||
}
|
||||
$sql = "INSERT INTO $table_flottes (id_user, mission, start_time, start_type, start_planete, end_time, end_type, end_planete, vitesse, contenu_metal, contenu_cristal, contenu_hydrogene, tactique, nom, nb_vais$out1) VALUES ('".$this->start_planete->id_user."', '".$this->mission."', '".$this->start_time."', '".$this->start_type."', '".$this->start_planete->id."', '".$this->end_time."', '".$this->end_type."', '".$this->end_planete."', '".$this->vitesse."', '".$this->contenu[0]."', '".$this->contenu[1]."', '".$this->contenu[2]."', '".$this->tactique."', '".$this->nom."', ".$this->nb_vais."$out2);";
|
||||
if (DEBUG) {
|
||||
echo $sql;
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$bdd->query($sql);
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
} elseif (isset($this->modifFlotte[0])) {
|
||||
$out = array();
|
||||
$bdd = new BDD();
|
||||
foreach ($this->modifFlotte as $modif) {
|
||||
if (!is_array($this->{$modif})) {
|
||||
if (is_int($this->{$modif}) || is_float($this->{$modif})) {
|
||||
$out[] .= $modif." = ".$this->{$modif};
|
||||
} else {
|
||||
$bdd->escape($this->{$modif});
|
||||
$out[] .= $modif." = '".$this->{$modif}."'";
|
||||
}
|
||||
} else {
|
||||
if ($modif == "contenu") {
|
||||
$calc = "resso";
|
||||
} elseif ($modif == "vaisseaux") {
|
||||
$calc = "nomvaisn";
|
||||
}
|
||||
|
||||
if ($this->modifFlotte === "DELETE")
|
||||
{
|
||||
$bdd = new BDD();
|
||||
$bdd->query("DELETE FROM $table_flottes WHERE id = ".$this->id_flotte.";");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (empty($this->id_flotte))
|
||||
{
|
||||
if ($this->modifFlotte == "INSERT")
|
||||
{
|
||||
$out1 = ''; $out2 = '';
|
||||
global $spatialVAR;
|
||||
foreach ($this->vaisseaux as $key => $vais)
|
||||
{
|
||||
$out1 .= ', '.$spatialVAR[$key];
|
||||
$out2 .= ', '.$vais;
|
||||
}
|
||||
$sql = "INSERT INTO $table_flottes (id_user, mission, start_time, start_type, start_planete, end_time, end_type, end_planete, vitesse, contenu_metal, contenu_cristal, contenu_hydrogene, tactique, nom, nb_vais$out1) VALUES ('".$this->start_planete->id_user."', '".$this->mission."', '".$this->start_time."', '".$this->start_type."', '".$this->start_planete->id."', '".$this->end_time."', '".$this->end_type."', '".$this->end_planete."', '".$this->vitesse."', '".$this->contenu[0]."', '".$this->contenu[1]."', '".$this->contenu[2]."', '".$this->tactique."', '".$this->nom."', ".$this->nb_vais."$out2);";
|
||||
if (DEBUG) echo $sql;
|
||||
$bdd = new BDD();
|
||||
$bdd->query($sql);
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
}
|
||||
elseif(isset($this->modifFlotte[0]))
|
||||
{
|
||||
$out = array();
|
||||
$bdd = new BDD();
|
||||
foreach($this->modifFlotte as $modif)
|
||||
{
|
||||
if (!is_array($this->{$modif}))
|
||||
{
|
||||
if (is_int($this->{$modif}) || is_float($this->{$modif}))
|
||||
$out[] .= $modif." = ".$this->{$modif};
|
||||
else
|
||||
{
|
||||
$bdd->escape($this->{$modif});
|
||||
$out[] .= $modif." = '".$this->{$modif}."'";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($modif == "contenu")
|
||||
$calc = "resso";
|
||||
elseif ($modif == "vaisseaux")
|
||||
$calc = "nomvaisn";
|
||||
if (!isset(${$calc.'VAR'})) {
|
||||
global ${$calc.'VAR'};
|
||||
}
|
||||
|
||||
if (!isset(${$calc.'VAR'}))
|
||||
global ${$calc.'VAR'};
|
||||
foreach (${$calc.'VAR'} as $key => $var) {
|
||||
$bdd->escape($this->{$modif}[$key]);
|
||||
$out[] = ${$calc.'VAR'}[$key]." = ".$this->{$modif}[$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach(${$calc.'VAR'} as $key => $var)
|
||||
{
|
||||
$bdd->escape($this->{$modif}[$key]);
|
||||
$out[] = ${$calc.'VAR'}[$key]." = ".$this->{$modif}[$key];
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($out)) {
|
||||
$sql = "UPDATE $table_flottes SET ".implode(', ', $out).", last = 0 WHERE id = ".$this->id_flotte.";";
|
||||
if (DEBUG) {
|
||||
var_dump($sql);
|
||||
}
|
||||
$bdd->query($sql);
|
||||
}
|
||||
|
||||
if (!empty($out))
|
||||
{
|
||||
$sql = "UPDATE $table_flottes SET ".implode(', ', $out).", last = 0 WHERE id = ".$this->id_flotte.";";
|
||||
if (DEBUG) var_dump($sql);
|
||||
$bdd->query($sql);
|
||||
}
|
||||
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -9,145 +9,140 @@
|
|||
*
|
||||
***************************************************************************/
|
||||
|
||||
class ExceptionHB extends Exception {
|
||||
class ExceptionHB extends Exception
|
||||
{
|
||||
public function __construct($branche, $code = 0, $debug = true, $gerer = false)
|
||||
{
|
||||
if ($gerer) {
|
||||
parent::__construct($branche, $code);
|
||||
} else {
|
||||
if (is_numeric($branche)) {
|
||||
switch ($branche) {
|
||||
case 1:
|
||||
switch ($code) {
|
||||
case 0:
|
||||
$message = "La planète est pleine, vous ne pouvez plus construire de batiment dessus !";
|
||||
break;
|
||||
case 1:
|
||||
$message = "La file d'attente est pleine, vous ne pouvez pas rajouter plus de batiments.";
|
||||
break;
|
||||
case 2:
|
||||
$message = "Vous n'avez pas les bâtiments et/ou technologies nécessaires pour construire ce bâtiment.";
|
||||
break;
|
||||
case 3:
|
||||
$message = "Le bâtiment dont vous demandez la construction est actuellement en démolition. Annulez la démolition pour lui ajouter l'aggrandir.";
|
||||
break;
|
||||
case 4:
|
||||
$message = "Vous n'avez pas les ressources nécessaire pour construire ce bâtiment !";
|
||||
break;
|
||||
|
||||
public function __construct($branche, $code = 0, $debug = true, $gerer = false) {
|
||||
if ($gerer)
|
||||
parent::__construct($branche, $code);
|
||||
else
|
||||
{
|
||||
if (is_numeric($branche))
|
||||
{
|
||||
switch($branche)
|
||||
{
|
||||
case 1:
|
||||
switch($code)
|
||||
{
|
||||
case 0:
|
||||
$message = "La planète est pleine, vous ne pouvez plus construire de batiment dessus !";
|
||||
break;
|
||||
case 1:
|
||||
$message = "La file d'attente est pleine, vous ne pouvez pas rajouter plus de batiments.";
|
||||
break;
|
||||
case 2:
|
||||
$message = "Vous n'avez pas les bâtiments et/ou technologies nécessaires pour construire ce bâtiment.";
|
||||
break;
|
||||
case 3:
|
||||
$message = "Le bâtiment dont vous demandez la construction est actuellement en démolition. Annulez la démolition pour lui ajouter l'aggrandir.";
|
||||
break;
|
||||
case 4:
|
||||
$message = "Vous n'avez pas les ressources nécessaire pour construire ce bâtiment !";
|
||||
break;
|
||||
case 5:
|
||||
$message = "Impossible d'annuler la construction de ce bâtiment, il n'a pas été trouvé dans la file !";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$message = "Impossible d'annuler la construction de ce bâtiment, il n'a pas été trouvé dans la file !";
|
||||
break;
|
||||
case 6:
|
||||
$message = "Vous ne pouvez pas démolir ce batiment, il n'est pas encore construit !";
|
||||
break;
|
||||
case 7:
|
||||
$message = "Le bâtiment dont vous demandez la démolition est actuellement en travaux. Annulez les travaux en cours pour pouvoir le démolir.";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch ($code) {
|
||||
case 0:
|
||||
$message = "Cette technologie est déjà en file d'attente, soyez patient !";
|
||||
break;
|
||||
case 1:
|
||||
$message = "La file d'attente est pleine, vous ne pouvez pas rajouter plus de technologies.";
|
||||
break;
|
||||
case 2:
|
||||
$message = "Vous n'avez pas les bâtiments et/ou technologies nécessaires pour rechercher cette technologie.";
|
||||
break;
|
||||
case 3:
|
||||
$message = "Vous possédez déjà cette technologie !";
|
||||
break;
|
||||
case 4:
|
||||
$message = "Vous n'avez pas les crédits ou ressources nécessaires pour rechercher cette technologie !";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
$message = "Vous ne pouvez pas démolir ce batiment, il n'est pas encore construit !";
|
||||
break;
|
||||
case 7:
|
||||
$message = "Le bâtiment dont vous demandez la démolition est actuellement en travaux. Annulez les travaux en cours pour pouvoir le démolir.";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch($code)
|
||||
{
|
||||
case 0:
|
||||
$message = "Cette technologie est déjà en file d'attente, soyez patient !";
|
||||
break;
|
||||
case 1:
|
||||
$message = "La file d'attente est pleine, vous ne pouvez pas rajouter plus de technologies.";
|
||||
break;
|
||||
case 2:
|
||||
$message = "Vous n'avez pas les bâtiments et/ou technologies nécessaires pour rechercher cette technologie.";
|
||||
break;
|
||||
case 3:
|
||||
$message = "Vous possédez déjà cette technologie !";
|
||||
break;
|
||||
case 4:
|
||||
$message = "Vous n'avez pas les crédits ou ressources nécessaires pour rechercher cette technologie !";
|
||||
break;
|
||||
case 5:
|
||||
$message = "Impossible d'annuler la recherche de cette technologie, elle n'a pas été trouvée dans la file !";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch ($code) {
|
||||
case 1:
|
||||
$message = "La file d'attente est pleine, vous ne pouvez pas rajouter plus d'unités.";
|
||||
break;
|
||||
case 2:
|
||||
$message = "Vous n'avez pas les bâtiments et/ou technologies nécessaires pour entraîner ces unités.";
|
||||
break;
|
||||
case 3:
|
||||
$message = "L'unité dont vous demandez l'entraînement est actuellement en démentellement. Annulez le démentellement pour l'entraîner de nouveau.";
|
||||
break;
|
||||
case 4:
|
||||
$message = "Vous n'avez pas les ressources nécessaire pour entraîner cette unité !";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$message = "Impossible d'annuler la recherche de cette technologie, elle n'a pas été trouvée dans la file !";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch($code)
|
||||
{
|
||||
case 1:
|
||||
$message = "La file d'attente est pleine, vous ne pouvez pas rajouter plus d'unités.";
|
||||
break;
|
||||
case 2:
|
||||
$message = "Vous n'avez pas les bâtiments et/ou technologies nécessaires pour entraîner ces unités.";
|
||||
break;
|
||||
case 3:
|
||||
$message = "L'unité dont vous demandez l'entraînement est actuellement en démentellement. Annulez le démentellement pour l'entraîner de nouveau.";
|
||||
break;
|
||||
case 4:
|
||||
$message = "Vous n'avez pas les ressources nécessaire pour entraîner cette unité !";
|
||||
break;
|
||||
case 5:
|
||||
$message = "Impossible d'annuler l'entraînement de cette unité, elle n'a pas été trouvé dans la file !";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$message = "Impossible d'annuler l'entraînement de cette unité, elle n'a pas été trouvé dans la file !";
|
||||
break;
|
||||
case 6:
|
||||
$message = "Vous ne pouvez pas démenteler autant d'unités !";
|
||||
break;
|
||||
case 7:
|
||||
$message = "L'unité dont vous demandez le démentellement est actuellement en entraînement. Annulez l'entraînement en cours pour pouvoir la démenteller.";
|
||||
break;
|
||||
|
||||
case 6:
|
||||
$message = "Vous ne pouvez pas démenteler autant d'unités !";
|
||||
break;
|
||||
case 7:
|
||||
$message = "L'unité dont vous demandez le démentellement est actuellement en entraînement. Annulez l'entraînement en cours pour pouvoir la démenteller.";
|
||||
break;
|
||||
case 8:
|
||||
$message = "Dépassement de capacité.<br />Vous ne pouvez pas demander la construction d'autant d'unités en même temps.";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch ($code) {
|
||||
case 1:
|
||||
$message = "La file d'attente est pleine, vous ne pouvez pas rajouter plus de recherches.";
|
||||
break;
|
||||
case 2:
|
||||
$message = "Vous n'avez pas les bâtiments et/ou technologies nécessaires pour rechercher cette technologie.";
|
||||
break;
|
||||
case 4:
|
||||
$message = "Vous n'avez pas les ressources nécessaire pour rechercher cette technologie !";
|
||||
break;
|
||||
|
||||
case 8:
|
||||
$message = "Dépassement de capacité.<br />Vous ne pouvez pas demander la construction d'autant d'unités en même temps.";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch($code)
|
||||
{
|
||||
case 1:
|
||||
$message = "La file d'attente est pleine, vous ne pouvez pas rajouter plus de recherches.";
|
||||
break;
|
||||
case 2:
|
||||
$message = "Vous n'avez pas les bâtiments et/ou technologies nécessaires pour rechercher cette technologie.";
|
||||
break;
|
||||
case 4:
|
||||
$message = "Vous n'avez pas les ressources nécessaire pour rechercher cette technologie !";
|
||||
break;
|
||||
case 5:
|
||||
$message = "Impossible d'annuler la recherche de cette technologie, elle n'a pas été trouvé dans la file !";
|
||||
break;
|
||||
|
||||
case 5:
|
||||
$message = "Impossible d'annuler la recherche de cette technologie, elle n'a pas été trouvé dans la file !";
|
||||
break;
|
||||
case 6:
|
||||
$message = "Il n'est pas possible d'annuler une technologie connue";
|
||||
break;
|
||||
case 7:
|
||||
$message = "Vous recherchez déjà cette technologie !";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$message = $branche;
|
||||
}
|
||||
|
||||
case 6:
|
||||
$message = "Il n'est pas possible d'annuler une technologie connue";
|
||||
break;
|
||||
case 7:
|
||||
$message = "Vous recherchez déjà cette technologie !";
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
$message = $branche;
|
||||
if ($debug || empty($message)) {
|
||||
$message = "Erreur #".intval($branche)."/".$code." :<br />".$message;
|
||||
}
|
||||
|
||||
if ($debug || empty($message))
|
||||
$message = "Erreur #".intval($branche)."/".$code." :<br />".$message;
|
||||
|
||||
global $template, $page;
|
||||
if (!empty($page))
|
||||
$template->assign('page', $page);
|
||||
$template->assign('message', $message);
|
||||
$template->assign('couleur', 'red');
|
||||
$template->display('game/erreur.tpl');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
global $template, $page;
|
||||
if (!empty($page)) {
|
||||
$template->assign('page', $page);
|
||||
}
|
||||
$template->assign('message', $message);
|
||||
$template->assign('couleur', 'red');
|
||||
$template->display('game/erreur.tpl');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -5,32 +5,30 @@
|
|||
*/
|
||||
class Groupe
|
||||
{
|
||||
var $contenu = array(); //Tableau contenant les vaisseaux de l'utilisateur
|
||||
var $caracteristiques = array();
|
||||
var $example = array(
|
||||
array("somme boucliers", "somme pv", "nbVaisseauxInitiaux")
|
||||
);
|
||||
var $user; //Classe donnant des informations sur l'utilisateur de la flotte ou l'ID de l'utilisateur
|
||||
var $camp = 0; //Camp du groupe
|
||||
var $timestamp = 0; //TImestamp de la dernière attaque
|
||||
var $actions = array(); //Tableau des actions faite ou à faire
|
||||
var $action_encours = 0;
|
||||
public $contenu = array(); //Tableau contenant les vaisseaux de l'utilisateur
|
||||
public $caracteristiques = array();
|
||||
public $example = array(
|
||||
array("somme boucliers", "somme pv", "nbVaisseauxInitiaux")
|
||||
);
|
||||
public $user; //Classe donnant des informations sur l'utilisateur de la flotte ou l'ID de l'utilisateur
|
||||
public $camp = 0; //Camp du groupe
|
||||
public $timestamp = 0; //TImestamp de la dernière attaque
|
||||
public $actions = array(); //Tableau des actions faite ou à faire
|
||||
public $action_encours = 0;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
function __construct()
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function regenereBoucliers()
|
||||
{
|
||||
foreach ($this->caracteristiques as $caracteristique)
|
||||
{
|
||||
if ($this->actions[$action_encours][0] == 2)
|
||||
$
|
||||
}
|
||||
}
|
||||
public function regenereBoucliers()
|
||||
{
|
||||
// foreach ($this->caracteristiques as $caracteristique)
|
||||
// {
|
||||
// if ($this->actions[$action_encours][0] == 2)
|
||||
// $
|
||||
// }
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -20,4 +20,3 @@ $PHPMAILER_LANG["connect_host"] = 'Erreur SMTP: Impossible de se connecter au se
|
|||
$PHPMAILER_LANG["file_access"] = 'Accès au fichier impossible: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'File Error: Ne peut ouvrir le fichier: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Type d\'encodage inconnu : ';
|
||||
?>
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -7,397 +7,387 @@
|
|||
*/
|
||||
class Rapport
|
||||
{
|
||||
var $type = 0;
|
||||
var $var = array();
|
||||
var $utilA = 0;
|
||||
var $utilB = 0;
|
||||
var $timestamp = 0;
|
||||
public $type = 0;
|
||||
public $var = array();
|
||||
public $utilA = 0;
|
||||
public $utilB = 0;
|
||||
public $timestamp = 0;
|
||||
|
||||
var $titreA = "";
|
||||
var $titreB = "";
|
||||
var $rapportA = "";
|
||||
var $rapportB = "";
|
||||
public $titreA = "";
|
||||
public $titreB = "";
|
||||
public $rapportA = "";
|
||||
public $rapportB = "";
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @access protected
|
||||
*/
|
||||
function Rapport($type, $utilA, $utilB, $time)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->utilA = $utilA;
|
||||
$this->utilB = $utilB;
|
||||
$this->timestamp = $time;
|
||||
}
|
||||
/**
|
||||
* Constructor
|
||||
* @access protected
|
||||
*/
|
||||
public function Rapport($type, $utilA, $utilB, $time)
|
||||
{
|
||||
$this->type = $type;
|
||||
$this->utilA = $utilA;
|
||||
$this->utilB = $utilB;
|
||||
$this->timestamp = $time;
|
||||
}
|
||||
|
||||
function addInfo($info, $id)
|
||||
{
|
||||
$this->var[$id] = $info;
|
||||
}
|
||||
public function addInfo($info, $id)
|
||||
{
|
||||
$this->var[$id] = $info;
|
||||
}
|
||||
|
||||
function sendRapport()
|
||||
{
|
||||
if (!empty($this->utilA) && !empty($this->rapportA))
|
||||
send_mp($this->utilA->id_user, $this->titreA, $this->rapportA, $this->timestamp);
|
||||
if (!empty($this->utilB) && !empty($this->rapportB))
|
||||
send_mp($this->utilB->id_user, $this->titreB, $this->rapportB, $this->timestamp);
|
||||
}
|
||||
public function sendRapport()
|
||||
{
|
||||
if (!empty($this->utilA) && !empty($this->rapportA)) {
|
||||
send_mp($this->utilA->id_user, $this->titreA, $this->rapportA, $this->timestamp);
|
||||
}
|
||||
if (!empty($this->utilB) && !empty($this->rapportB)) {
|
||||
send_mp($this->utilB->id_user, $this->titreB, $this->rapportB, $this->timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
function send()
|
||||
{
|
||||
if ($this->type == '3')
|
||||
$this->sendCombat();
|
||||
elseif ($this->type == '1')
|
||||
$this->sendTransport();
|
||||
elseif ($this->type == '2')
|
||||
$this->sendColonisation();
|
||||
elseif ($this->type == '4')
|
||||
$this->sendRecyclage();
|
||||
elseif ($this->type == '5')
|
||||
$this->sendEspionnage();
|
||||
elseif ($this->type == '6')
|
||||
$this->sendAlliance();
|
||||
elseif ($this->type == '7')
|
||||
$this->sendAlliance2();
|
||||
}
|
||||
public function send()
|
||||
{
|
||||
if ($this->type == '3') {
|
||||
$this->sendCombat();
|
||||
} elseif ($this->type == '1') {
|
||||
$this->sendTransport();
|
||||
} elseif ($this->type == '2') {
|
||||
$this->sendColonisation();
|
||||
} elseif ($this->type == '4') {
|
||||
$this->sendRecyclage();
|
||||
} elseif ($this->type == '5') {
|
||||
$this->sendEspionnage();
|
||||
} elseif ($this->type == '6') {
|
||||
$this->sendAlliance();
|
||||
} elseif ($this->type == '7') {
|
||||
$this->sendAlliance2();
|
||||
}
|
||||
}
|
||||
|
||||
function sendEspionnage()
|
||||
{
|
||||
global $LANG;
|
||||
public function sendEspionnage()
|
||||
{
|
||||
global $LANG;
|
||||
|
||||
//Différentiation entre les planètes et les astéroides
|
||||
if (!isset($this->var[0]->nom_planete))
|
||||
{
|
||||
$this->titreA = "Rapport d'espionnage de ".$this->var[0]->nom_asteroide." [".$this->var[0]->galaxie.":".$this->var[0]->ss.":A".$this->var[0]->position."]";
|
||||
$this->rapportA = "<strong>Espionnage de ".$this->var[0]->pseudo." sur ".$this->var[0]->nom_asteroide."[".$this->var[0]->galaxie.":".$this->var[0]->ss.":A".$this->var[0]->position."]</strong><br /><br />";
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->titreA = "Rapport d'espionnage de ".$this->var[0]->nom_planete." [".$this->var[0]->galaxie.":".$this->var[0]->ss.":".$this->var[0]->position."]";
|
||||
$this->rapportA = "<strong>Espionnage de ".$this->var[0]->pseudo." sur ".$this->var[0]->nom_planete."[".$this->var[0]->galaxie.":".$this->var[0]->ss.":".$this->var[0]->position."]</strong><br /><br />";
|
||||
}
|
||||
//Différentiation entre les planètes et les astéroides
|
||||
if (!isset($this->var[0]->nom_planete)) {
|
||||
$this->titreA = "Rapport d'espionnage de ".$this->var[0]->nom_asteroide." [".$this->var[0]->galaxie.":".$this->var[0]->ss.":A".$this->var[0]->position."]";
|
||||
$this->rapportA = "<strong>Espionnage de ".$this->var[0]->pseudo." sur ".$this->var[0]->nom_asteroide."[".$this->var[0]->galaxie.":".$this->var[0]->ss.":A".$this->var[0]->position."]</strong><br /><br />";
|
||||
} else {
|
||||
$this->titreA = "Rapport d'espionnage de ".$this->var[0]->nom_planete." [".$this->var[0]->galaxie.":".$this->var[0]->ss.":".$this->var[0]->position."]";
|
||||
$this->rapportA = "<strong>Espionnage de ".$this->var[0]->pseudo." sur ".$this->var[0]->nom_planete."[".$this->var[0]->galaxie.":".$this->var[0]->ss.":".$this->var[0]->position."]</strong><br /><br />";
|
||||
}
|
||||
|
||||
if ($this->var[2] < 1)
|
||||
$this->rapportA .= "<em>Nos sondes n'ont pas pu récolter d'informations sur cette planète.</em>";
|
||||
else {
|
||||
//Ressources
|
||||
if ($this->var[2] > 1)
|
||||
$this->rapportA .= "<table style=\"margin: auto;\"><tr><th colspan=\"2\">Ressources sur la planète :</th></tr><tr><td>".$LANG[$this->var[0]->race]["ressources"]["noms"]["metal"]." :</td><td>".$this->var[0]->metal."</td></tr><tr><td>".$LANG[$this->var[0]->race]["ressources"]["noms"]["cristal"]." :</td><td>".$this->var[0]->cristal."</td></tr><tr><td>".$LANG[$this->var[0]->race]["ressources"]["noms"]["hydrogene"]." :</td><td>".$this->var[0]->hydrogene."</td></tr></table><br />";
|
||||
if ($this->var[2] < 1) {
|
||||
$this->rapportA .= "<em>Nos sondes n'ont pas pu récolter d'informations sur cette planète.</em>";
|
||||
} else {
|
||||
//Ressources
|
||||
if ($this->var[2] > 1) {
|
||||
$this->rapportA .= "<table style=\"margin: auto;\"><tr><th colspan=\"2\">Ressources sur la planète :</th></tr><tr><td>".$LANG[$this->var[0]->race]["ressources"]["noms"]["metal"]." :</td><td>".$this->var[0]->metal."</td></tr><tr><td>".$LANG[$this->var[0]->race]["ressources"]["noms"]["cristal"]." :</td><td>".$this->var[0]->cristal."</td></tr><tr><td>".$LANG[$this->var[0]->race]["ressources"]["noms"]["hydrogene"]." :</td><td>".$this->var[0]->hydrogene."</td></tr></table><br />";
|
||||
}
|
||||
|
||||
//Bâtiments
|
||||
if ($this->var[2] > 2)
|
||||
{
|
||||
$this->rapportA .= "<table style=\"margin: auto;\"><tr><th>Niveau</th><th>Bâtiment</th></tr>";
|
||||
foreach ($this->var[0]->batiments as $key => $batiment)
|
||||
{
|
||||
$this->rapportA .= "<tr><td>".rand($batiment * (1 - $this->var[1]), $batiment * (1 + $this->var[1]))."</td><td>".$LANG[$this->var[0]->race]["batiments"]["noms_sing"][$key]."</td></tr>";
|
||||
}
|
||||
$this->rapportA .= "</table><br />";
|
||||
}
|
||||
//Bâtiments
|
||||
if ($this->var[2] > 2) {
|
||||
$this->rapportA .= "<table style=\"margin: auto;\"><tr><th>Niveau</th><th>Bâtiment</th></tr>";
|
||||
foreach ($this->var[0]->batiments as $key => $batiment) {
|
||||
$this->rapportA .= "<tr><td>".rand($batiment * (1 - $this->var[1]), $batiment * (1 + $this->var[1]))."</td><td>".$LANG[$this->var[0]->race]["batiments"]["noms_sing"][$key]."</td></tr>";
|
||||
}
|
||||
$this->rapportA .= "</table><br />";
|
||||
}
|
||||
|
||||
//Flottes en orbite
|
||||
if ($this->var[2] > 3)
|
||||
{
|
||||
//Flottes en orbite
|
||||
if ($this->var[2] > 3) {
|
||||
}
|
||||
|
||||
}
|
||||
//Flottes au sol
|
||||
if ($this->var[2] > 5) {
|
||||
$this->rapportA .= "<table style=\"margin: auto;\"><tr><th>Nombre</th><th>Vaisseaux</th></tr>";
|
||||
foreach ($this->var[0]->vaisseaux as $key => $vaisseau) {
|
||||
$this->rapportA .= "<tr><td>".rand($vaisseau * (1 - $this->var[1]), $vaisseau * (1 + $this->var[1]))."</td><td>".$LANG[$this->var[0]->race]["vaisseaux"]["noms_sing"][$key]."</td></tr>";
|
||||
}
|
||||
$this->rapportA .= "</table><br />";
|
||||
}
|
||||
|
||||
//Flottes au sol
|
||||
if ($this->var[2] > 5)
|
||||
{
|
||||
$this->rapportA .= "<table style=\"margin: auto;\"><tr><th>Nombre</th><th>Vaisseaux</th></tr>";
|
||||
foreach ($this->var[0]->vaisseaux as $key => $vaisseau)
|
||||
{
|
||||
$this->rapportA .= "<tr><td>".rand($vaisseau * (1 - $this->var[1]), $vaisseau * (1 + $this->var[1]))."</td><td>".$LANG[$this->var[0]->race]["vaisseaux"]["noms_sing"][$key]."</td></tr>";
|
||||
}
|
||||
$this->rapportA .= "</table><br />";
|
||||
}
|
||||
//Défenses
|
||||
if ($this->var[2] > 4) {
|
||||
$this->rapportA .= "<table style=\"margin: auto;\"><tr><th>Nombre</th><th>Défenses</th></tr>";
|
||||
foreach ($this->var[0]->terrestres as $key => $unite) {
|
||||
if (!dTerrestre::type($key)) {
|
||||
$this->rapportA .= "<tr><td>".rand($unite * (1 - $this->var[1]), $unite * (1 + $this->var[1]))."</td><td>".$LANG[$this->var[0]->race]["terrestre"]["noms_sing"][$key]."</td></tr>";
|
||||
}
|
||||
}
|
||||
$this->rapportA .= "</table><br />";
|
||||
}
|
||||
}
|
||||
|
||||
//Défenses
|
||||
if ($this->var[2] > 4)
|
||||
{
|
||||
$this->rapportA .= "<table style=\"margin: auto;\"><tr><th>Nombre</th><th>Défenses</th></tr>";
|
||||
foreach ($this->var[0]->terrestres as $key => $unite)
|
||||
{
|
||||
if (!dTerrestre::type($key)) $this->rapportA .= "<tr><td>".rand($unite * (1 - $this->var[1]), $unite * (1 + $this->var[1]))."</td><td>".$LANG[$this->var[0]->race]["terrestre"]["noms_sing"][$key]."</td></tr>";
|
||||
}
|
||||
$this->rapportA .= "</table><br />";
|
||||
}
|
||||
}
|
||||
if ($this->var[3] >= 1) {
|
||||
$this->titreB = "Rapport de contre-espionnage";
|
||||
if (!isset($this->var[0]->nom_planete)) {
|
||||
$this->rapportB = "Nous venons d'apprendre que notre planète : ".$this->var[0]->nom_asteroide."[".$this->var[0]->galaxie.":".$this->var[0]->ss.":A] a été la cible d'un espionnage de la part de ".$this->utilA->pseudo;
|
||||
} else {
|
||||
$this->rapportB = "Nous venons d'apprendre que notre planète : ".$this->var[0]->nom_planete."[".$this->var[0]->galaxie.":".$this->var[0]->ss.":".$this->var[0]->position."] a été la cible d'un espionnage de la part de ".$this->utilA->pseudo;
|
||||
}
|
||||
}
|
||||
$this->rapportA = $this->rapportA;
|
||||
}
|
||||
|
||||
if ($this->var[3] >= 1)
|
||||
{
|
||||
$this->titreB = "Rapport de contre-espionnage";
|
||||
if (!isset($this->var[0]->nom_planete))
|
||||
$this->rapportB = "Nous venons d'apprendre que notre planète : ".$this->var[0]->nom_asteroide."[".$this->var[0]->galaxie.":".$this->var[0]->ss.":A] a été la cible d'un espionnage de la part de ".$this->utilA->pseudo;
|
||||
else
|
||||
$this->rapportB = "Nous venons d'apprendre que notre planète : ".$this->var[0]->nom_planete."[".$this->var[0]->galaxie.":".$this->var[0]->ss.":".$this->var[0]->position."] a été la cible d'un espionnage de la part de ".$this->utilA->pseudo;
|
||||
}
|
||||
$this->rapportA = $this->rapportA;
|
||||
}
|
||||
public function sendTransport()
|
||||
{
|
||||
global $LANG;
|
||||
if (!isset($this->var[0]->nom_planete)) {
|
||||
$titre = 'Transport vers '.$this->var[0]->nom_asteroide.' ['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]';
|
||||
$this->rapportA = 'Vos vaisseaux ont déposé '.$this->var[1][0].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["metal"].', '.$this->var[1][1].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["cristal"].' et '.$this->var[1][2].' d\''.$LANG[$this->utilA->race]["ressources"]["noms"]["hydrogene"].' sur '.$this->var[0]->nom_asteroide.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]</b><br /><br />';
|
||||
$this->rapportB = 'Les vaisseaux de '.$this->utilA->pseudo.' ont déposé '.$this->var[1][0].' de '.$LANG[$this->utilB->race]["ressources"]["noms"]["metal"].', '.$this->var[1][1].' de '.$LANG[$this->utilB->race]["ressources"]["noms"]["cristal"].' et '.$this->var[1][2].' d\''.$LANG[$this->utilB->race]["ressources"]["noms"]["hydrogene"].' sur '.$this->var[0]->nom_asteroide.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]</b><br /><br />';
|
||||
} else {
|
||||
$titre = 'Transport vers '.$this->var[0]->nom_planete.' ['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']';
|
||||
$this->rapportA = 'Vos vaisseaux ont déposé '.$this->var[1][0].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["metal"].', '.$this->var[1][1].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["cristal"].' et '.$this->var[1][2].' d\''.$LANG[$this->utilA->race]["ressources"]["noms"]["hydrogene"].' sur '.$this->var[0]->nom_planete.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']</b><br /><br />';
|
||||
$this->rapportB = 'Les vaisseaux de '.$this->utilA->pseudo.' ont déposé '.$this->var[1][0].' de '.$LANG[$this->utilB->race]["ressources"]["noms"]["metal"].', '.$this->var[1][1].' de '.$LANG[$this->utilB->race]["ressources"]["noms"]["cristal"].' et '.$this->var[1][2].' d\''.$LANG[$this->utilB->race]["ressources"]["noms"]["hydrogene"].' sur '.$this->var[0]->nom_planete.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']</b><br /><br />';
|
||||
}
|
||||
|
||||
function sendTransport()
|
||||
{
|
||||
global $LANG;
|
||||
if (!isset($this->var[0]->nom_planete))
|
||||
{
|
||||
$titre = 'Transport vers '.$this->var[0]->nom_asteroide.' ['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]';
|
||||
$this->rapportA = 'Vos vaisseaux ont déposé '.$this->var[1][0].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["metal"].', '.$this->var[1][1].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["cristal"].' et '.$this->var[1][2].' d\''.$LANG[$this->utilA->race]["ressources"]["noms"]["hydrogene"].' sur '.$this->var[0]->nom_asteroide.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]</b><br /><br />';
|
||||
$this->rapportB = 'Les vaisseaux de '.$this->utilA->pseudo.' ont déposé '.$this->var[1][0].' de '.$LANG[$this->utilB->race]["ressources"]["noms"]["metal"].', '.$this->var[1][1].' de '.$LANG[$this->utilB->race]["ressources"]["noms"]["cristal"].' et '.$this->var[1][2].' d\''.$LANG[$this->utilB->race]["ressources"]["noms"]["hydrogene"].' sur '.$this->var[0]->nom_asteroide.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]</b><br /><br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
$titre = 'Transport vers '.$this->var[0]->nom_planete.' ['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']';
|
||||
$this->rapportA = 'Vos vaisseaux ont déposé '.$this->var[1][0].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["metal"].', '.$this->var[1][1].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["cristal"].' et '.$this->var[1][2].' d\''.$LANG[$this->utilA->race]["ressources"]["noms"]["hydrogene"].' sur '.$this->var[0]->nom_planete.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']</b><br /><br />';
|
||||
$this->rapportB = 'Les vaisseaux de '.$this->utilA->pseudo.' ont déposé '.$this->var[1][0].' de '.$LANG[$this->utilB->race]["ressources"]["noms"]["metal"].', '.$this->var[1][1].' de '.$LANG[$this->utilB->race]["ressources"]["noms"]["cristal"].' et '.$this->var[1][2].' d\''.$LANG[$this->utilB->race]["ressources"]["noms"]["hydrogene"].' sur '.$this->var[0]->nom_planete.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']</b><br /><br />';
|
||||
$temps = $this->timestamp;
|
||||
$db = new BDD();
|
||||
$db->escape($titre);
|
||||
$db->escape($this->rapportA);
|
||||
$db->escape($this->rapportB);
|
||||
|
||||
}
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$titre', '$this->rapportA', '$temps');");
|
||||
if ($this->utilA->id_user != $this->utilB->id_user) {
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilB->id_user.", '$titre', '$this->rapportB', '$temps');");
|
||||
}
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
$temps = $this->timestamp;
|
||||
$db = new BDD();
|
||||
$db->escape($titre);
|
||||
$db->escape($this->rapportA);
|
||||
$db->escape($this->rapportB);
|
||||
public function sendColonisation()
|
||||
{
|
||||
$titre = 'Colonisation de ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].']';
|
||||
if (is_numeric($this->var[0][2])) {
|
||||
if ($this->var[1]) {
|
||||
$rapport = 'Votre vaisseau a atteint la planète ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].'] et commence la colonisation.';
|
||||
} else {
|
||||
$rapport = 'Nous n\'avons pas pu coloniser la planète ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].'] car lorsque nous sommes arrivé sur place, elle était déjà colonisée.';
|
||||
}
|
||||
} else {
|
||||
if ($this->var[1]) {
|
||||
$rapport = 'Votre vaisseau a atteint l\'astéroide ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].'] et commence la colonisation.';
|
||||
} else {
|
||||
$rapport = 'Nous n\'avons pas pu coloniser la planète ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].'] car lorsque nous sommes arrivé sur place, elle était déjà colonisée.';
|
||||
}
|
||||
}
|
||||
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$titre', '$this->rapportA', '$temps');");
|
||||
if ($this->utilA->id_user != $this->utilB->id_user) $db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilB->id_user.", '$titre', '$this->rapportB', '$temps');");
|
||||
$db->deconnexion();
|
||||
}
|
||||
$temps = $this->timestamp;
|
||||
$db = new BDD();
|
||||
$db->escape($titre);
|
||||
$db->escape($rapport);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$titre', '$rapport', '$temps');");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
function sendColonisation()
|
||||
{
|
||||
$titre = 'Colonisation de ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].']';
|
||||
if (is_numeric($this->var[0][2]))
|
||||
{
|
||||
if ($this->var[1])
|
||||
$rapport = 'Votre vaisseau a atteint la planète ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].'] et commence la colonisation.';
|
||||
else
|
||||
$rapport = 'Nous n\'avons pas pu coloniser la planète ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].'] car lorsque nous sommes arrivé sur place, elle était déjà colonisée.';
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->var[1])
|
||||
$rapport = 'Votre vaisseau a atteint l\'astéroide ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].'] et commence la colonisation.';
|
||||
else
|
||||
$rapport = 'Nous n\'avons pas pu coloniser la planète ['.$this->var[0][0].':'.$this->var[0][1].':'.$this->var[0][2].'] car lorsque nous sommes arrivé sur place, elle était déjà colonisée.';
|
||||
}
|
||||
public function sendRecyclage()
|
||||
{
|
||||
global $LANG;
|
||||
if (!isset($this->var[0]->nom_planete)) {
|
||||
$titre = 'Recyclage de '.$this->var[0]->nom_asteroide.' ['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]';
|
||||
$rapport = 'Vos vaisseaux récoltent '.$this->var[1][0].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["metal"].' et '.$this->var[1][1].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["cristal"].' sur '.$this->var[0]->nom_asteroide.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]</b><br /><br />';
|
||||
} else {
|
||||
$titre = 'Recyclage de '.$this->var[0]->nom_planete.' ['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']';
|
||||
$rapport = 'Vos vaisseaux récoltent '.$this->var[1][0].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["metal"].' et '.$this->var[1][1].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["cristal"].' sur '.$this->var[0]->nom_planete.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']</b><br /><br />';
|
||||
}
|
||||
|
||||
$temps = $this->timestamp;
|
||||
$db = new BDD();
|
||||
$db->escape($titre);
|
||||
$db->escape($rapport);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$titre', '$rapport', '$temps');");
|
||||
$db->deconnexion();
|
||||
}
|
||||
$temps = $this->timestamp;
|
||||
|
||||
function sendRecyclage()
|
||||
{
|
||||
global $LANG;
|
||||
if (!isset($this->var[0]->nom_planete))
|
||||
{
|
||||
$titre = 'Recyclage de '.$this->var[0]->nom_asteroide.' ['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]';
|
||||
$rapport = 'Vos vaisseaux récoltent '.$this->var[1][0].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["metal"].' et '.$this->var[1][1].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["cristal"].' sur '.$this->var[0]->nom_asteroide.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':A]</b><br /><br />';
|
||||
}
|
||||
else
|
||||
{
|
||||
$titre = 'Recyclage de '.$this->var[0]->nom_planete.' ['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']';
|
||||
$rapport = 'Vos vaisseaux récoltent '.$this->var[1][0].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["metal"].' et '.$this->var[1][1].' de '.$LANG[$this->utilA->race]["ressources"]["noms"]["cristal"].' sur '.$this->var[0]->nom_planete.'['.$this->var[0]->galaxie.':'.$this->var[0]->ss.':'.$this->var[0]->position.']</b><br /><br />';
|
||||
}
|
||||
$db = new BDD();
|
||||
$db->escape($titre);
|
||||
$db->escape($rapport);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$titre', '$rapport', '$temps');");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
$temps = $this->timestamp;
|
||||
public function sendCombat()
|
||||
{
|
||||
include(_FCORE."../game/vars.php");
|
||||
include_once(_FCORE."../game/function.php");
|
||||
require_once(SMARTY_DIR."Smarty.class.php");
|
||||
|
||||
$db = new BDD();
|
||||
$db->escape($titre);
|
||||
$db->escape($rapport);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$titre', '$rapport', '$temps');");
|
||||
$db->deconnexion();
|
||||
}
|
||||
$this->rapportA = new Smarty();
|
||||
$this->rapportB = new Smarty();
|
||||
|
||||
function sendCombat(){
|
||||
include(_FCORE."../game/vars.php");
|
||||
include_once(_FCORE."../game/function.php");
|
||||
require_once(SMARTY_DIR."Smarty.class.php");
|
||||
$this->rapportA->template_dir = _FCORE.'templates/templates/';
|
||||
$this->rapportA->compile_dir = _FCORE.'templates/templates_c/';
|
||||
$this->rapportA->config_dir = _FCORE.'templates/configs/';
|
||||
$this->rapportA->cache_dir = _FCORE.'templates/cache/';
|
||||
|
||||
$this->rapportA = new Smarty();
|
||||
$this->rapportB = new Smarty();
|
||||
$this->rapportB->template_dir = _FCORE.'templates/templates/';
|
||||
$this->rapportB->compile_dir = _FCORE.'templates/templates_c/';
|
||||
$this->rapportB->config_dir = _FCORE.'templates/configs/';
|
||||
$this->rapportB->cache_dir = _FCORE.'templates/cache/';
|
||||
|
||||
$this->rapportA->template_dir = _FCORE.'templates/templates/';
|
||||
$this->rapportA->compile_dir = _FCORE.'templates/templates_c/';
|
||||
$this->rapportA->config_dir = _FCORE.'templates/configs/';
|
||||
$this->rapportA->cache_dir = _FCORE.'templates/cache/';
|
||||
$this->var[4]['pseudo'] = trouvNom($this->var[4]['id_user']);
|
||||
$this->var[5]['pseudo'] = trouvNom($this->var[5]['id_user']);
|
||||
|
||||
$this->rapportB->template_dir = _FCORE.'templates/templates/';
|
||||
$this->rapportB->compile_dir = _FCORE.'templates/templates_c/';
|
||||
$this->rapportB->config_dir = _FCORE.'templates/configs/';
|
||||
$this->rapportB->cache_dir = _FCORE.'templates/cache/';
|
||||
$this->rapportA->assign('tour', $this->var[3]);
|
||||
$this->rapportA->assign('EN', $this->var[4]);
|
||||
$this->rapportA->assign('flotte', $this->var[5]);
|
||||
$this->rapportA->assign('vaisseaux1', $this->var[0]);
|
||||
$this->rapportA->assign('vaisseaux2', $this->var[1]);
|
||||
$this->rapportA->assign('defenses1', $this->var[2]);
|
||||
$this->rapportA->assign('vaisseaux3', $this->var[7]);
|
||||
$this->rapportA->assign('vaisseaux4', $this->var[8]);
|
||||
$this->rapportA->assign('defenses2', $this->var[9]);
|
||||
|
||||
$this->var[4]['pseudo'] = trouvNom($this->var[4]['id_user']);
|
||||
$this->var[5]['pseudo'] = trouvNom($this->var[5]['id_user']);
|
||||
$this->rapportA->assign('termine', $this->var[6][0]);
|
||||
$this->rapportA->assign('attaquantG', $this->var[6][1]);
|
||||
$this->rapportA->assign('pillage', $this->var[11]);
|
||||
|
||||
$this->rapportA->assign('tour', $this->var[3]);
|
||||
$this->rapportA->assign('EN', $this->var[4]);
|
||||
$this->rapportA->assign('flotte', $this->var[5]);
|
||||
$this->rapportA->assign('vaisseaux1', $this->var[0]);
|
||||
$this->rapportA->assign('vaisseaux2', $this->var[1]);
|
||||
$this->rapportA->assign('defenses1', $this->var[2]);
|
||||
$this->rapportA->assign('vaisseaux3', $this->var[7]);
|
||||
$this->rapportA->assign('vaisseaux4', $this->var[8]);
|
||||
$this->rapportA->assign('defenses2', $this->var[9]);
|
||||
$this->rapportA->assign('vaisBC', $nomvais_bc);
|
||||
$this->rapportA->assign('vaisPV', $nomvais_pv);
|
||||
$this->rapportA->assign('defBC', $defense_bc);
|
||||
$this->rapportA->assign('defPV', $defense_pv);
|
||||
$this->rapportA->assign('nextTour', $this->var[10]);
|
||||
|
||||
$this->rapportA->assign('termine', $this->var[6][0]);
|
||||
$this->rapportA->assign('attaquantG', $this->var[6][1]);
|
||||
$this->rapportA->assign('pillage', $this->var[11]);
|
||||
$race = trouvInfo($this->utilA, 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportA->assign('ressources', $ressourc);
|
||||
$this->rapportA->assign('nomvaisAT', $nomvaisa);
|
||||
|
||||
$this->rapportA->assign('vaisBC', $nomvais_bc);
|
||||
$this->rapportA->assign('vaisPV', $nomvais_pv);
|
||||
$this->rapportA->assign('defBC', $defense_bc);
|
||||
$this->rapportA->assign('defPV', $defense_pv);
|
||||
$this->rapportA->assign('nextTour', $this->var[10]);
|
||||
$race = trouvInfo($this->var[4]['id_user'], 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportA->assign('nomvaisEN', $nomvaisa);
|
||||
array_splice($nomterra, 0, 8);
|
||||
$this->rapportA->assign('nomdefEN', $nomterra);
|
||||
|
||||
$race = trouvInfo($this->utilA, 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportA->assign('ressources', $ressourc);
|
||||
$this->rapportA->assign('nomvaisAT', $nomvaisa);
|
||||
|
||||
$race = trouvInfo($this->var[4]['id_user'], 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportA->assign('nomvaisEN', $nomvaisa);
|
||||
array_splice($nomterra, 0, 8);
|
||||
$this->rapportA->assign('nomdefEN', $nomterra);
|
||||
|
||||
$this->rapportA = $this->rapportA->fetch('game/ATrapport_combat.tpl');
|
||||
$this->rapportA = $this->rapportA->fetch('game/ATrapport_combat.tpl');
|
||||
|
||||
|
||||
$this->rapportB->assign('tour', $this->var[3]);
|
||||
$this->rapportB->assign('EN', $this->var[4]);
|
||||
$this->rapportB->assign('flotte', $this->var[5]);
|
||||
$this->rapportB->assign('vaisseaux1', $this->var[0]);
|
||||
$this->rapportB->assign('vaisseaux2', $this->var[1]);
|
||||
$this->rapportB->assign('defenses1', $this->var[2]);
|
||||
$this->rapportB->assign('vaisseaux3', $this->var[7]);
|
||||
$this->rapportB->assign('vaisseaux4', $this->var[8]);
|
||||
$this->rapportB->assign('defenses2', $this->var[9]);
|
||||
$this->rapportB->assign('tour', $this->var[3]);
|
||||
$this->rapportB->assign('EN', $this->var[4]);
|
||||
$this->rapportB->assign('flotte', $this->var[5]);
|
||||
$this->rapportB->assign('vaisseaux1', $this->var[0]);
|
||||
$this->rapportB->assign('vaisseaux2', $this->var[1]);
|
||||
$this->rapportB->assign('defenses1', $this->var[2]);
|
||||
$this->rapportB->assign('vaisseaux3', $this->var[7]);
|
||||
$this->rapportB->assign('vaisseaux4', $this->var[8]);
|
||||
$this->rapportB->assign('defenses2', $this->var[9]);
|
||||
|
||||
$this->rapportB->assign('termine', $this->var[6][0]);
|
||||
$this->rapportB->assign('attaquantG', $this->var[6][1]);
|
||||
$this->rapportB->assign('matchnul', $this->var[6][2]);
|
||||
$this->rapportB->assign('pillage', $this->var[11]);
|
||||
$this->rapportB->assign('termine', $this->var[6][0]);
|
||||
$this->rapportB->assign('attaquantG', $this->var[6][1]);
|
||||
$this->rapportB->assign('matchnul', $this->var[6][2]);
|
||||
$this->rapportB->assign('pillage', $this->var[11]);
|
||||
|
||||
$this->rapportB->assign('vaisBC', $nomvais_bc);
|
||||
$this->rapportB->assign('vaisPV', $nomvais_pv);
|
||||
$this->rapportB->assign('defBC', $defense_bc);
|
||||
$this->rapportB->assign('defPV', $defense_pv);
|
||||
$this->rapportB->assign('nextTour', $this->var[10]);
|
||||
$this->rapportB->assign('vaisBC', $nomvais_bc);
|
||||
$this->rapportB->assign('vaisPV', $nomvais_pv);
|
||||
$this->rapportB->assign('defBC', $defense_bc);
|
||||
$this->rapportB->assign('defPV', $defense_pv);
|
||||
$this->rapportB->assign('nextTour', $this->var[10]);
|
||||
|
||||
$race = trouvInfo($this->utilA, 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportB->assign('ressources', $ressourc);
|
||||
$this->rapportB->assign('nomvaisAT', $nomvaisa);
|
||||
$race = trouvInfo($this->utilA, 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportB->assign('ressources', $ressourc);
|
||||
$this->rapportB->assign('nomvaisAT', $nomvaisa);
|
||||
|
||||
$race = trouvInfo($this->var[4]['id_user'], 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportB->assign('nomvaisEN', $nomvaisa);
|
||||
array_splice($nomterra, 0, 8);
|
||||
$this->rapportB->assign('nomdefEN', $nomterra);
|
||||
$race = trouvInfo($this->var[4]['id_user'], 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportB->assign('nomvaisEN', $nomvaisa);
|
||||
array_splice($nomterra, 0, 8);
|
||||
$this->rapportB->assign('nomdefEN', $nomterra);
|
||||
|
||||
$this->rapportB = $this->rapportB->fetch('game/ENrapport_combat.tpl');
|
||||
$this->rapportB = $this->rapportB->fetch('game/ENrapport_combat.tpl');
|
||||
|
||||
|
||||
$this->titreA = 'Combat contre '.$this->var[4]['pseudo'];
|
||||
$this->titreB = 'Combat contre '.$this->var[5]['pseudo'];
|
||||
$temps = $this->timestamp;
|
||||
$db = new bdd();
|
||||
$db->connexion();
|
||||
$db->escape($this->titreA);
|
||||
$db->escape($this->titreB);
|
||||
$db->escape($this->rapportA);
|
||||
$db->escape($this->rapportB);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$this->titreA', '$this->rapportA', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilB->id_user."', '$this->titreB', '$this->rapportB', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
$this->titreA = 'Combat contre '.$this->var[4]['pseudo'];
|
||||
$this->titreB = 'Combat contre '.$this->var[5]['pseudo'];
|
||||
$temps = $this->timestamp;
|
||||
$db = new bdd();
|
||||
$db->connexion();
|
||||
$db->escape($this->titreA);
|
||||
$db->escape($this->titreB);
|
||||
$db->escape($this->rapportA);
|
||||
$db->escape($this->rapportB);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$this->titreA', '$this->rapportA', '$temps')");
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilB->id_user."', '$this->titreB', '$this->rapportB', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
function show(){
|
||||
include(_FCORE."../game/vars.php");
|
||||
include_once(_FCORE."../game/function.php");
|
||||
require_once(SMARTY_DIR."Smarty.class.php");
|
||||
public function show()
|
||||
{
|
||||
include(_FCORE."../game/vars.php");
|
||||
include_once(_FCORE."../game/function.php");
|
||||
require_once(SMARTY_DIR."Smarty.class.php");
|
||||
|
||||
$this->rapportA = new Smarty();
|
||||
$this->rapportA = new Smarty();
|
||||
|
||||
$this->rapportA->template_dir = _FCORE.'templates/templates/';
|
||||
$this->rapportA->compile_dir = _FCORE.'templates/templates_c/';
|
||||
$this->rapportA->config_dir = _FCORE.'templates/configs/';
|
||||
$this->rapportA->cache_dir = _FCORE.'templates/cache/';
|
||||
$this->rapportA->template_dir = _FCORE.'templates/templates/';
|
||||
$this->rapportA->compile_dir = _FCORE.'templates/templates_c/';
|
||||
$this->rapportA->config_dir = _FCORE.'templates/configs/';
|
||||
$this->rapportA->cache_dir = _FCORE.'templates/cache/';
|
||||
|
||||
$this->rapportA->assign('tour', $this->var[3]);
|
||||
$this->rapportA->assign('EN', $this->var[4]);
|
||||
$this->rapportA->assign('flotte', $this->var[5]);
|
||||
$this->rapportA->assign('vaisseaux1', $this->var[0]);
|
||||
$this->rapportA->assign('vaisseaux2', $this->var[1]);
|
||||
$this->rapportA->assign('defenses1', $this->var[2]);
|
||||
$this->rapportA->assign('vaisseaux3', $this->var[7]);
|
||||
$this->rapportA->assign('vaisseaux4', $this->var[8]);
|
||||
$this->rapportA->assign('defenses2', $this->var[9]);
|
||||
$this->rapportA->assign('tour', $this->var[3]);
|
||||
$this->rapportA->assign('EN', $this->var[4]);
|
||||
$this->rapportA->assign('flotte', $this->var[5]);
|
||||
$this->rapportA->assign('vaisseaux1', $this->var[0]);
|
||||
$this->rapportA->assign('vaisseaux2', $this->var[1]);
|
||||
$this->rapportA->assign('defenses1', $this->var[2]);
|
||||
$this->rapportA->assign('vaisseaux3', $this->var[7]);
|
||||
$this->rapportA->assign('vaisseaux4', $this->var[8]);
|
||||
$this->rapportA->assign('defenses2', $this->var[9]);
|
||||
|
||||
$this->rapportA->assign('termine', $this->var[6][0]);
|
||||
$this->rapportA->assign('attaquantG', $this->var[6][1]);
|
||||
$this->rapportA->assign('pillage', $this->var[11]);
|
||||
$this->rapportA->assign('debris', $this->var[12]);
|
||||
$this->rapportA->assign('infoPLUS', $this->var[14]);
|
||||
//$this->rapportA->assign('infoPLUS2', $this->var[15]);
|
||||
$this->rapportA->assign('termine', $this->var[6][0]);
|
||||
$this->rapportA->assign('attaquantG', $this->var[6][1]);
|
||||
$this->rapportA->assign('pillage', $this->var[11]);
|
||||
$this->rapportA->assign('debris', $this->var[12]);
|
||||
$this->rapportA->assign('infoPLUS', $this->var[14]);
|
||||
//$this->rapportA->assign('infoPLUS2', $this->var[15]);
|
||||
|
||||
$this->rapportA->assign('page', 'simulation');
|
||||
$this->rapportA->assign('enligne', $this->var[13][0]);
|
||||
$this->rapportA->assign('infos', $this->var[13][1]);
|
||||
$this->rapportA->assign('nbinfos', $this->var[13][2]);
|
||||
$this->rapportA->assign('count', $this->var[13][3]);
|
||||
$this->rapportA->assign('version', $this->var[13][4]);
|
||||
$this->rapportA->assign('tpsdejeu', $this->var[13][5]);
|
||||
$this->rapportA->assign('page', 'simulation');
|
||||
$this->rapportA->assign('enligne', $this->var[13][0]);
|
||||
$this->rapportA->assign('infos', $this->var[13][1]);
|
||||
$this->rapportA->assign('nbinfos', $this->var[13][2]);
|
||||
$this->rapportA->assign('count', $this->var[13][3]);
|
||||
$this->rapportA->assign('version', $this->var[13][4]);
|
||||
$this->rapportA->assign('tpsdejeu', $this->var[13][5]);
|
||||
|
||||
$this->rapportA->assign('vaisBC', $nomvais_bc);
|
||||
$this->rapportA->assign('vaisPV', $nomvais_pv);
|
||||
$this->rapportA->assign('defBC', $defense_bc);
|
||||
$this->rapportA->assign('defPV', $defense_pv);
|
||||
$this->rapportA->assign('nextTour', $this->var[10]);
|
||||
$this->rapportA->assign('vaisBC', $nomvais_bc);
|
||||
$this->rapportA->assign('vaisPV', $nomvais_pv);
|
||||
$this->rapportA->assign('defBC', $defense_bc);
|
||||
$this->rapportA->assign('defPV', $defense_pv);
|
||||
$this->rapportA->assign('nextTour', $this->var[10]);
|
||||
|
||||
$race = trouvInfo($this->utilA, 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportA->assign('ressources', $ressourc);
|
||||
$this->rapportA->assign('nomvaisAT', $nomvaisa);
|
||||
$this->rapportA->assign('nomvaisEN', $nomvaisa);
|
||||
array_splice($nomterra, 0, 8);
|
||||
$this->rapportA->assign('nomdefEN', $nomterra);
|
||||
$this->rapportA->assign('race', $race);
|
||||
$race = trouvInfo($this->utilA, 'race');
|
||||
include(_FCORE."../game/noms.php");
|
||||
$this->rapportA->assign('ressources', $ressourc);
|
||||
$this->rapportA->assign('nomvaisAT', $nomvaisa);
|
||||
$this->rapportA->assign('nomvaisEN', $nomvaisa);
|
||||
array_splice($nomterra, 0, 8);
|
||||
$this->rapportA->assign('nomdefEN', $nomterra);
|
||||
$this->rapportA->assign('race', $race);
|
||||
|
||||
return $this->rapportA->fetch('game/SIMrapport_combat.tpl');
|
||||
return $this->rapportA;
|
||||
}
|
||||
return $this->rapportA->fetch('game/SIMrapport_combat.tpl');
|
||||
return $this->rapportA;
|
||||
}
|
||||
|
||||
function sendAlliance()
|
||||
{
|
||||
$this->titreA = 'Déclaration officielle de votre alliance !';
|
||||
$this->rapportA = 'Félicitations, votre alliance a recueilli suffisament de signature, sa déclaration est maintenant officielle !<br /><br />Vous pouvez dès maintenant administrer votre alliance en vous rendant sur la page Alliance.';
|
||||
public function sendAlliance()
|
||||
{
|
||||
$this->titreA = 'Déclaration officielle de votre alliance !';
|
||||
$this->rapportA = 'Félicitations, votre alliance a recueilli suffisament de signature, sa déclaration est maintenant officielle !<br /><br />Vous pouvez dès maintenant administrer votre alliance en vous rendant sur la page Alliance.';
|
||||
|
||||
$temps = $this->timestamp;
|
||||
$temps = $this->timestamp;
|
||||
|
||||
$db = new BDD();
|
||||
$db->escape($this->titreA);
|
||||
$db->escape($this->rapportA);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$this->titreA', '$this->rapportA', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
$db = new BDD();
|
||||
$db->escape($this->titreA);
|
||||
$db->escape($this->rapportA);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$this->titreA', '$this->rapportA', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
|
||||
function sendAlliance2()
|
||||
{
|
||||
$this->titreA = 'Fondation de votre alliance !';
|
||||
$this->rapportA = 'Pour terminer la création de votre alliance, trouvez 4 joueurs de cette galaxie sans alliance pour leur faire signer votre traité de fondation d\'alliance.<br /><br />Lien de signature : <a href="?p=alliances&q=signer&i='.$this->var[0].'">http://'.$_SERVER['HTTP_HOST'].'/?p=alliances&q=signer&i='.$this->var[0].'</a>';
|
||||
public function sendAlliance2()
|
||||
{
|
||||
$this->titreA = 'Fondation de votre alliance !';
|
||||
$this->rapportA = 'Pour terminer la création de votre alliance, trouvez 4 joueurs de cette galaxie sans alliance pour leur faire signer votre traité de fondation d\'alliance.<br /><br />Lien de signature : <a href="?p=alliances&q=signer&i='.$this->var[0].'">http://'.$_SERVER['HTTP_HOST'].'/?p=alliances&q=signer&i='.$this->var[0].'</a>';
|
||||
|
||||
$temps = $this->timestamp;
|
||||
$temps = $this->timestamp;
|
||||
|
||||
$db = new BDD();
|
||||
$db->escape($this->titreA);
|
||||
$db->escape($this->rapportA);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$this->titreA', '$this->rapportA', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
$db = new BDD();
|
||||
$db->escape($this->titreA);
|
||||
$db->escape($this->rapportA);
|
||||
$db->query("INSERT INTO ".$this->table." (destinataire, sujet, contenu, temps) VALUES(".$this->utilA->id_user.", '$this->titreA', '$this->rapportA', '$temps')");
|
||||
$db->deconnexion();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -27,26 +27,26 @@ class SMTP
|
|||
* SMTP server port
|
||||
* @var int
|
||||
*/
|
||||
var $SMTP_PORT = 25;
|
||||
public $SMTP_PORT = 25;
|
||||
|
||||
/**
|
||||
* SMTP reply line ending
|
||||
* @var string
|
||||
*/
|
||||
var $CRLF = "\r\n";
|
||||
public $CRLF = "\r\n";
|
||||
|
||||
/**
|
||||
* Sets whether debugging is turned on
|
||||
* @var bool
|
||||
*/
|
||||
var $do_debug; # the level of debug to perform
|
||||
public $do_debug; # the level of debug to perform
|
||||
|
||||
/**#@+
|
||||
* @access private
|
||||
*/
|
||||
var $smtp_conn; # the socket to the server
|
||||
var $error; # error if any on the last call
|
||||
var $helo_rply; # the reply the server sent to us for HELO
|
||||
public $smtp_conn; # the socket to the server
|
||||
public $error; # error if any on the last call
|
||||
public $helo_rply; # the reply the server sent to us for HELO
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
|
|
@ -54,7 +54,8 @@ class SMTP
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function SMTP() {
|
||||
public function SMTP()
|
||||
{
|
||||
$this->smtp_conn = 0;
|
||||
$this->error = null;
|
||||
$this->helo_rply = null;
|
||||
|
|
@ -79,12 +80,13 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Connect($host,$port=0,$tval=30) {
|
||||
public function Connect($host, $port=0, $tval=30)
|
||||
{
|
||||
# set the error val to null so there is no confusion
|
||||
$this->error = null;
|
||||
|
||||
# make sure we are __not__ connected
|
||||
if($this->connected()) {
|
||||
if ($this->connected()) {
|
||||
# ok we are connected! what should we do?
|
||||
# for now we will just give an error saying we
|
||||
# are already connected
|
||||
|
|
@ -93,7 +95,7 @@ class SMTP
|
|||
return false;
|
||||
}
|
||||
|
||||
if(empty($port)) {
|
||||
if (empty($port)) {
|
||||
$port = $this->SMTP_PORT;
|
||||
}
|
||||
|
||||
|
|
@ -104,11 +106,11 @@ class SMTP
|
|||
$errstr, # error message if any
|
||||
$tval); # give up after ? secs
|
||||
# verify we connected properly
|
||||
if(empty($this->smtp_conn)) {
|
||||
if (empty($this->smtp_conn)) {
|
||||
$this->error = array("error" => "Failed to connect to server",
|
||||
"errno" => $errno,
|
||||
"errstr" => $errstr);
|
||||
if($this->do_debug >= 1) {
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": $errstr ($errno)" . $this->CRLF;
|
||||
}
|
||||
|
|
@ -118,8 +120,9 @@ class SMTP
|
|||
# sometimes the SMTP server takes a little longer to respond
|
||||
# so we will give it a longer timeout for the first read
|
||||
// Windows still does not have support for this timeout function
|
||||
if(substr(PHP_OS, 0, 3) != "WIN")
|
||||
socket_set_timeout($this->smtp_conn, $tval, 0);
|
||||
if (substr(PHP_OS, 0, 3) != "WIN") {
|
||||
socket_set_timeout($this->smtp_conn, $tval, 0);
|
||||
}
|
||||
|
||||
# get any announcement stuff
|
||||
$announce = $this->get_lines();
|
||||
|
|
@ -128,7 +131,7 @@ class SMTP
|
|||
//if(function_exists("socket_set_timeout"))
|
||||
// socket_set_timeout($this->smtp_conn, 0, 100000);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce;
|
||||
}
|
||||
|
||||
|
|
@ -141,19 +144,20 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Authenticate($username, $password) {
|
||||
public function Authenticate($username, $password)
|
||||
{
|
||||
// Start authentication
|
||||
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
|
||||
fputs($this->smtp_conn, "AUTH LOGIN" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($code != 334) {
|
||||
if ($code != 334) {
|
||||
$this->error =
|
||||
array("error" => "AUTH not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -164,14 +168,14 @@ class SMTP
|
|||
fputs($this->smtp_conn, base64_encode($username) . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($code != 334) {
|
||||
if ($code != 334) {
|
||||
$this->error =
|
||||
array("error" => "Username not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -182,14 +186,14 @@ class SMTP
|
|||
fputs($this->smtp_conn, base64_encode($password) . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($code != 235) {
|
||||
if ($code != 235) {
|
||||
$this->error =
|
||||
array("error" => "Password not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -204,13 +208,14 @@ class SMTP
|
|||
* @access private
|
||||
* @return bool
|
||||
*/
|
||||
function Connected() {
|
||||
if(!empty($this->smtp_conn)) {
|
||||
public function Connected()
|
||||
{
|
||||
if (!empty($this->smtp_conn)) {
|
||||
$sock_status = socket_get_status($this->smtp_conn);
|
||||
if($sock_status["eof"]) {
|
||||
if ($sock_status["eof"]) {
|
||||
# hmm this is an odd situation... the socket is
|
||||
# valid but we aren't connected anymore
|
||||
if($this->do_debug >= 1) {
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> NOTICE:" . $this->CRLF .
|
||||
"EOF caught while checking if connected";
|
||||
}
|
||||
|
|
@ -229,10 +234,11 @@ class SMTP
|
|||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
function Close() {
|
||||
public function Close()
|
||||
{
|
||||
$this->error = null; # so there is no confusion
|
||||
$this->helo_rply = null;
|
||||
if(!empty($this->smtp_conn)) {
|
||||
if (!empty($this->smtp_conn)) {
|
||||
# close the connection and cleanup
|
||||
fclose($this->smtp_conn);
|
||||
$this->smtp_conn = 0;
|
||||
|
|
@ -263,30 +269,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Data($msg_data) {
|
||||
public function Data($msg_data)
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Data() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"DATA" . $this->CRLF);
|
||||
fputs($this->smtp_conn, "DATA" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 354) {
|
||||
if ($code != 354) {
|
||||
$this->error =
|
||||
array("error" => "DATA command not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -304,9 +311,9 @@ class SMTP
|
|||
# line. NOTE: this does not count towards are limit.
|
||||
|
||||
# normalize the line breaks so we know the explode works
|
||||
$msg_data = str_replace("\r\n","\n",$msg_data);
|
||||
$msg_data = str_replace("\r","\n",$msg_data);
|
||||
$lines = explode("\n",$msg_data);
|
||||
$msg_data = str_replace("\r\n", "\n", $msg_data);
|
||||
$msg_data = str_replace("\r", "\n", $msg_data);
|
||||
$lines = explode("\n", $msg_data);
|
||||
|
||||
# we need to find a good way to determine is headers are
|
||||
# in the msg_data or if it is a straight msg body
|
||||
|
|
@ -315,43 +322,42 @@ class SMTP
|
|||
# does not contain a space then it _should_ be a header
|
||||
# and we can process all lines before a blank "" line as
|
||||
# headers.
|
||||
$field = substr($lines[0],0,strpos($lines[0],":"));
|
||||
$field = substr($lines[0], 0, strpos($lines[0], ":"));
|
||||
$in_headers = false;
|
||||
if(!empty($field) && !strstr($field," ")) {
|
||||
if (!empty($field) && !strstr($field, " ")) {
|
||||
$in_headers = true;
|
||||
}
|
||||
|
||||
$max_line_length = 998; # used below; set here for ease in change
|
||||
|
||||
while(list(,$line) = @each($lines)) {
|
||||
while (list(, $line) = @each($lines)) {
|
||||
$lines_out = null;
|
||||
if($line == "" && $in_headers) {
|
||||
if ($line == "" && $in_headers) {
|
||||
$in_headers = false;
|
||||
}
|
||||
# ok we need to break this line up into several
|
||||
# smaller lines
|
||||
while(strlen($line) > $max_line_length) {
|
||||
$pos = strrpos(substr($line,0,$max_line_length)," ");
|
||||
$lines_out[] = substr($line,0,$pos);
|
||||
$line = substr($line,$pos + 1);
|
||||
while (strlen($line) > $max_line_length) {
|
||||
$pos = strrpos(substr($line, 0, $max_line_length), " ");
|
||||
$lines_out[] = substr($line, 0, $pos);
|
||||
$line = substr($line, $pos + 1);
|
||||
# if we are processing headers we need to
|
||||
# add a LWSP-char to the front of the new line
|
||||
# rfc 822 on long msg headers
|
||||
if($in_headers) {
|
||||
if ($in_headers) {
|
||||
$line = "\t" . $line;
|
||||
}
|
||||
}
|
||||
$lines_out[] = $line;
|
||||
|
||||
# now send the lines to the server
|
||||
while(list(,$line_out) = @each($lines_out)) {
|
||||
if(strlen($line_out) > 0)
|
||||
{
|
||||
if(substr($line_out, 0, 1) == ".") {
|
||||
while (list(, $line_out) = @each($lines_out)) {
|
||||
if (strlen($line_out) > 0) {
|
||||
if (substr($line_out, 0, 1) == ".") {
|
||||
$line_out = "." . $line_out;
|
||||
}
|
||||
}
|
||||
fputs($this->smtp_conn,$line_out . $this->CRLF);
|
||||
fputs($this->smtp_conn, $line_out . $this->CRLF);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -360,18 +366,18 @@ class SMTP
|
|||
fputs($this->smtp_conn, $this->CRLF . "." . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
if ($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "DATA not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -396,30 +402,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return string array
|
||||
*/
|
||||
function Expand($name) {
|
||||
public function Expand($name)
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Expand() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"EXPN " . $name . $this->CRLF);
|
||||
fputs($this->smtp_conn, "EXPN " . $name . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
if ($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "EXPN not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -427,9 +434,9 @@ class SMTP
|
|||
}
|
||||
|
||||
# parse the reply and place in our array to return to user
|
||||
$entries = explode($this->CRLF,$rply);
|
||||
while(list(,$l) = @each($entries)) {
|
||||
$list[] = substr($l,4);
|
||||
$entries = explode($this->CRLF, $rply);
|
||||
while (list(, $l) = @each($entries)) {
|
||||
$list[] = substr($l, 4);
|
||||
}
|
||||
|
||||
return $list;
|
||||
|
|
@ -447,10 +454,11 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Hello($host="") {
|
||||
public function Hello($host="")
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Hello() without being connected");
|
||||
return false;
|
||||
|
|
@ -458,17 +466,17 @@ class SMTP
|
|||
|
||||
# if a hostname for the HELO wasn't specified determine
|
||||
# a suitable one to send
|
||||
if(empty($host)) {
|
||||
if (empty($host)) {
|
||||
# we need to determine some sort of appopiate default
|
||||
# to send to the server
|
||||
$host = "localhost";
|
||||
}
|
||||
|
||||
// Send extended hello first (RFC 2821)
|
||||
if(!$this->SendHello("EHLO", $host))
|
||||
{
|
||||
if(!$this->SendHello("HELO", $host))
|
||||
if (!$this->SendHello("EHLO", $host)) {
|
||||
if (!$this->SendHello("HELO", $host)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -479,22 +487,23 @@ class SMTP
|
|||
* @access private
|
||||
* @return bool
|
||||
*/
|
||||
function SendHello($hello, $host) {
|
||||
public function SendHello($hello, $host)
|
||||
{
|
||||
fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
if ($code != 250) {
|
||||
$this->error =
|
||||
array("error" => $hello . " not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -521,35 +530,36 @@ class SMTP
|
|||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
function Help($keyword="") {
|
||||
public function Help($keyword="")
|
||||
{
|
||||
$this->error = null; # to avoid confusion
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Help() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
$extra = "";
|
||||
if(!empty($keyword)) {
|
||||
if (!empty($keyword)) {
|
||||
$extra = " " . $keyword;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"HELP" . $extra . $this->CRLF);
|
||||
fputs($this->smtp_conn, "HELP" . $extra . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 211 && $code != 214) {
|
||||
if ($code != 211 && $code != 214) {
|
||||
$this->error =
|
||||
array("error" => "HELP not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -573,30 +583,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Mail($from) {
|
||||
public function Mail($from)
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Mail() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"MAIL FROM:<" . $from . ">" . $this->CRLF);
|
||||
fputs($this->smtp_conn, "MAIL FROM:<" . $from . ">" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
if ($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "MAIL not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -615,30 +626,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Noop() {
|
||||
public function Noop()
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Noop() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"NOOP" . $this->CRLF);
|
||||
fputs($this->smtp_conn, "NOOP" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
if ($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "NOOP not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -658,42 +670,43 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Quit($close_on_error=true) {
|
||||
public function Quit($close_on_error=true)
|
||||
{
|
||||
$this->error = null; # so there is no confusion
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Quit() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
# send the quit command to the server
|
||||
fputs($this->smtp_conn,"quit" . $this->CRLF);
|
||||
fputs($this->smtp_conn, "quit" . $this->CRLF);
|
||||
|
||||
# get any good-bye messages
|
||||
$byemsg = $this->get_lines();
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg;
|
||||
}
|
||||
|
||||
$rval = true;
|
||||
$e = null;
|
||||
|
||||
$code = substr($byemsg,0,3);
|
||||
if($code != 221) {
|
||||
$code = substr($byemsg, 0, 3);
|
||||
if ($code != 221) {
|
||||
# use e as a tmp var cause Close will overwrite $this->error
|
||||
$e = array("error" => "SMTP server rejected quit command",
|
||||
"smtp_code" => $code,
|
||||
"smtp_rply" => substr($byemsg,4));
|
||||
"smtp_rply" => substr($byemsg, 4));
|
||||
$rval = false;
|
||||
if($this->do_debug >= 1) {
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $e["error"] . ": " .
|
||||
$byemsg . $this->CRLF;
|
||||
}
|
||||
}
|
||||
|
||||
if(empty($e) || $close_on_error) {
|
||||
if (empty($e) || $close_on_error) {
|
||||
$this->Close();
|
||||
}
|
||||
|
||||
|
|
@ -712,30 +725,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Recipient($to) {
|
||||
public function Recipient($to)
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Recipient() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"RCPT TO:<" . $to . ">" . $this->CRLF);
|
||||
fputs($this->smtp_conn, "RCPT TO:<" . $to . ">" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250 && $code != 251) {
|
||||
if ($code != 250 && $code != 251) {
|
||||
$this->error =
|
||||
array("error" => "RCPT not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -756,30 +770,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Reset() {
|
||||
public function Reset()
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Reset() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"RSET" . $this->CRLF);
|
||||
fputs($this->smtp_conn, "RSET" . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
if ($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "RSET failed",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -805,30 +820,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Send($from) {
|
||||
public function Send($from)
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Send() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"SEND FROM:" . $from . $this->CRLF);
|
||||
fputs($this->smtp_conn, "SEND FROM:" . $from . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
if ($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "SEND not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -853,30 +869,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function SendAndMail($from) {
|
||||
public function SendAndMail($from)
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called SendAndMail() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"SAML FROM:" . $from . $this->CRLF);
|
||||
fputs($this->smtp_conn, "SAML FROM:" . $from . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
if ($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "SAML not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -901,30 +918,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function SendOrMail($from) {
|
||||
public function SendOrMail($from)
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called SendOrMail() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"SOML FROM:" . $from . $this->CRLF);
|
||||
fputs($this->smtp_conn, "SOML FROM:" . $from . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250) {
|
||||
if ($code != 250) {
|
||||
$this->error =
|
||||
array("error" => "SOML not accepted from server",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -946,10 +964,11 @@ class SMTP
|
|||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
function Turn() {
|
||||
public function Turn()
|
||||
{
|
||||
$this->error = array("error" => "This method, TURN, of the SMTP ".
|
||||
"is not implemented");
|
||||
if($this->do_debug >= 1) {
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -968,30 +987,31 @@ class SMTP
|
|||
* @access public
|
||||
* @return int
|
||||
*/
|
||||
function Verify($name) {
|
||||
public function Verify($name)
|
||||
{
|
||||
$this->error = null; # so no confusion is caused
|
||||
|
||||
if(!$this->connected()) {
|
||||
if (!$this->connected()) {
|
||||
$this->error = array(
|
||||
"error" => "Called Verify() without being connected");
|
||||
return false;
|
||||
}
|
||||
|
||||
fputs($this->smtp_conn,"VRFY " . $name . $this->CRLF);
|
||||
fputs($this->smtp_conn, "VRFY " . $name . $this->CRLF);
|
||||
|
||||
$rply = $this->get_lines();
|
||||
$code = substr($rply,0,3);
|
||||
$code = substr($rply, 0, 3);
|
||||
|
||||
if($this->do_debug >= 2) {
|
||||
if ($this->do_debug >= 2) {
|
||||
echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply;
|
||||
}
|
||||
|
||||
if($code != 250 && $code != 251) {
|
||||
if ($code != 250 && $code != 251) {
|
||||
$this->error =
|
||||
array("error" => "VRFY failed on name '$name'",
|
||||
"smtp_code" => $code,
|
||||
"smtp_msg" => substr($rply,4));
|
||||
if($this->do_debug >= 1) {
|
||||
"smtp_msg" => substr($rply, 4));
|
||||
if ($this->do_debug >= 1) {
|
||||
echo "SMTP -> ERROR: " . $this->error["error"] .
|
||||
": " . $rply . $this->CRLF;
|
||||
}
|
||||
|
|
@ -1013,27 +1033,26 @@ class SMTP
|
|||
* @access private
|
||||
* @return string
|
||||
*/
|
||||
function get_lines() {
|
||||
public function get_lines()
|
||||
{
|
||||
$data = "";
|
||||
while($str = fgets($this->smtp_conn,515)) {
|
||||
if($this->do_debug >= 4) {
|
||||
while ($str = fgets($this->smtp_conn, 515)) {
|
||||
if ($this->do_debug >= 4) {
|
||||
echo "SMTP -> get_lines(): \$data was \"$data\"" .
|
||||
$this->CRLF;
|
||||
echo "SMTP -> get_lines(): \$str is \"$str\"" .
|
||||
$this->CRLF;
|
||||
}
|
||||
$data .= $str;
|
||||
if($this->do_debug >= 4) {
|
||||
if ($this->do_debug >= 4) {
|
||||
echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF;
|
||||
}
|
||||
# if the 4th character is a space then we are done reading
|
||||
# so just break the loop
|
||||
if(substr($str,3,1) == " ") { break; }
|
||||
if (substr($str, 3, 1) == " ") {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -11,33 +11,33 @@ include_once("Class/user.php");
|
|||
***************************************************************************/
|
||||
class SURFACE extends User
|
||||
{
|
||||
var $id = 0,
|
||||
$galaxie,
|
||||
$ss,
|
||||
$image,
|
||||
$debris_met,
|
||||
$debris_cri,
|
||||
$metal,
|
||||
$cristal,
|
||||
$hydrogene,
|
||||
$alert_ressources = array(false, false, false),
|
||||
$timestamp,
|
||||
$file_bat,
|
||||
$file_vais,
|
||||
$isolement = false,
|
||||
$batiments = array(),
|
||||
$vaisseaux = array(),
|
||||
$modif = array();
|
||||
public $id = 0;
|
||||
public $galaxie;
|
||||
public $ss;
|
||||
public $image;
|
||||
public $debris_met;
|
||||
public $debris_cri;
|
||||
public $metal;
|
||||
public $cristal;
|
||||
public $hydrogene;
|
||||
public $alert_ressources = array(false, false, false);
|
||||
public $timestamp;
|
||||
public $file_bat;
|
||||
public $file_vais;
|
||||
public $isolement = false;
|
||||
public $batiments = array();
|
||||
public $vaisseaux = array();
|
||||
public $modif = array();
|
||||
|
||||
function isolement()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
public function isolement()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
function addModif($modif)
|
||||
{
|
||||
if (!in_array($modif, $this->modif))
|
||||
$this->modif[] = $modif;
|
||||
}
|
||||
public function addModif($modif)
|
||||
{
|
||||
if (!in_array($modif, $this->modif)) {
|
||||
$this->modif[] = $modif;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,46 +1,41 @@
|
|||
<?php
|
||||
class TinyAsteroide
|
||||
{
|
||||
var $id = 0,
|
||||
$galaxie,
|
||||
$ss,
|
||||
$nom_asteroide;
|
||||
{
|
||||
public $id = 0;
|
||||
public $galaxie;
|
||||
public $ss;
|
||||
public $nom_asteroide;
|
||||
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la planète à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function __construct($id)
|
||||
{
|
||||
//Récupération du nom des tables utilisées et connexion à la base de données
|
||||
global $table_alliances;
|
||||
$bdd = new BDD();
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la planète à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function __construct($id)
|
||||
{
|
||||
//Récupération du nom des tables utilisées et connexion à la base de données
|
||||
global $table_alliances;
|
||||
$bdd = new BDD();
|
||||
|
||||
//On traite le cas où l'on recoit l'ID ou les coordonnées de l'asteroide
|
||||
if (is_numeric($id))
|
||||
{
|
||||
$aste = $bdd->unique_query("SELECT id, galaxie, ss, nom_asteroide FROM $table_alliances WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
elseif (preg_match('#^\[?([0-9]{1,2}):([0-9]{1,2}):?[Aa]?\]?$#', $id, $position))
|
||||
{
|
||||
$aste = $bdd->unique_query("SELECT id, galaxie, ss, nom_asteroide FROM $table_alliances WHERE galaxie = ".$position[1]." AND ss = ".$position[2].";");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else
|
||||
trigger_error('Erreur #04 : Format de recherche d\'astéroide incorrect !', E_USER_ERROR);
|
||||
//On traite le cas où l'on recoit l'ID ou les coordonnées de l'asteroide
|
||||
if (is_numeric($id)) {
|
||||
$aste = $bdd->unique_query("SELECT id, galaxie, ss, nom_asteroide FROM $table_alliances WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
} elseif (preg_match('#^\[?([0-9]{1,2}):([0-9]{1,2}):?[Aa]?\]?$#', $id, $position)) {
|
||||
$aste = $bdd->unique_query("SELECT id, galaxie, ss, nom_asteroide FROM $table_alliances WHERE galaxie = ".$position[1]." AND ss = ".$position[2].";");
|
||||
$bdd->deconnexion();
|
||||
} else {
|
||||
trigger_error('Erreur #04 : Format de recherche d\'astéroide incorrect !', E_USER_ERROR);
|
||||
}
|
||||
|
||||
if (!empty($aste))
|
||||
{
|
||||
//Chargement des données depuis le résultat de la base de données
|
||||
$this->id = $aste["id"];
|
||||
$this->galaxie = $aste["galaxie"];
|
||||
$this->ss = $aste["ss"];
|
||||
$this->nom_asteroide = $aste["nom_asteroide"];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
if (!empty($aste)) {
|
||||
//Chargement des données depuis le résultat de la base de données
|
||||
$this->id = $aste["id"];
|
||||
$this->galaxie = $aste["galaxie"];
|
||||
$this->ss = $aste["ss"];
|
||||
$this->nom_asteroide = $aste["nom_asteroide"];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,47 +1,43 @@
|
|||
<?php
|
||||
class TinyPlanete{
|
||||
var $id = 0,
|
||||
$galaxie,
|
||||
$ss,
|
||||
$position,
|
||||
$nom_planete;
|
||||
<?php
|
||||
class TinyPlanete
|
||||
{
|
||||
public $id = 0;
|
||||
public $galaxie;
|
||||
public $ss;
|
||||
public $position;
|
||||
public $nom_planete;
|
||||
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la planète à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function __construct($id)
|
||||
{
|
||||
//Récupération du nom des tables utilisées et connexion à la base de données
|
||||
global $table_planete;
|
||||
$bdd = new bdd();
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la planète à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function __construct($id)
|
||||
{
|
||||
//Récupération du nom des tables utilisées et connexion à la base de données
|
||||
global $table_planete;
|
||||
$bdd = new bdd();
|
||||
|
||||
//On traite le cas où l'on recoit l'ID ou les coordonnées de la planète
|
||||
if (is_numeric($id))
|
||||
{
|
||||
$plan = $bdd->unique_query("SELECT id, galaxie, ss, position, nom_planete FROM $table_planete WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
elseif (preg_match('#^\[?([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})\]?$#', $id, $position))
|
||||
{
|
||||
$plan = $bdd->unique_query("SELECT id, galaxie, ss, position, nom_planete FROM $table_planete WHERE galaxie = ".$position[1]." AND ss = ".$position[2]." AND position = ".$position[3].";");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else
|
||||
trigger_error('Erreur #04 : Format de recherche de planete incorrect !', E_USER_ERROR);
|
||||
//On traite le cas où l'on recoit l'ID ou les coordonnées de la planète
|
||||
if (is_numeric($id)) {
|
||||
$plan = $bdd->unique_query("SELECT id, galaxie, ss, position, nom_planete FROM $table_planete WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
} elseif (preg_match('#^\[?([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})\]?$#', $id, $position)) {
|
||||
$plan = $bdd->unique_query("SELECT id, galaxie, ss, position, nom_planete FROM $table_planete WHERE galaxie = ".$position[1]." AND ss = ".$position[2]." AND position = ".$position[3].";");
|
||||
$bdd->deconnexion();
|
||||
} else {
|
||||
trigger_error('Erreur #04 : Format de recherche de planete incorrect !', E_USER_ERROR);
|
||||
}
|
||||
|
||||
if (!empty($plan))
|
||||
{
|
||||
//Chargement des données depuis le résultat de la base de données
|
||||
$this->id = $plan["id"];
|
||||
$this->galaxie = $plan["galaxie"];
|
||||
$this->ss = $plan["ss"];
|
||||
$this->position = $plan["position"];
|
||||
$this->nom_planete = $plan["nom_planete"];
|
||||
}
|
||||
}
|
||||
if (!empty($plan)) {
|
||||
//Chargement des données depuis le résultat de la base de données
|
||||
$this->id = $plan["id"];
|
||||
$this->galaxie = $plan["galaxie"];
|
||||
$this->ss = $plan["ss"];
|
||||
$this->position = $plan["position"];
|
||||
$this->nom_planete = $plan["nom_planete"];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -11,201 +11,210 @@ include_once("Class/tinyasteroide.php");
|
|||
*
|
||||
*
|
||||
***************************************************************************/
|
||||
class User{
|
||||
var $id_user,
|
||||
$pseudo,
|
||||
$auth_level,
|
||||
$options,
|
||||
$race,
|
||||
$alliance,
|
||||
$id_alliance,
|
||||
$id_grade_alliance,
|
||||
$permissions_alliance,
|
||||
$mv,
|
||||
$mail,
|
||||
$envoyerMail,
|
||||
$last_visite,
|
||||
$points,
|
||||
$place_points,
|
||||
$technologies = array(),
|
||||
$credits,
|
||||
$politique,
|
||||
$politique_lastchange,
|
||||
$destinationsFavoris,
|
||||
$amis = array(),
|
||||
$combatAT_tactique,
|
||||
$combatDE_tactique,
|
||||
$modifUser = array();
|
||||
class User
|
||||
{
|
||||
public $id_user;
|
||||
public $pseudo;
|
||||
public $auth_level;
|
||||
public $options;
|
||||
public $race;
|
||||
public $alliance;
|
||||
public $id_alliance;
|
||||
public $id_grade_alliance;
|
||||
public $permissions_alliance;
|
||||
public $mv;
|
||||
public $mail;
|
||||
public $envoyerMail;
|
||||
public $last_visite;
|
||||
public $points;
|
||||
public $place_points;
|
||||
public $technologies = array();
|
||||
public $credits;
|
||||
public $politique;
|
||||
public $politique_lastchange;
|
||||
public $destinationsFavoris;
|
||||
public $amis = array();
|
||||
public $combatAT_tactique;
|
||||
public $combatDE_tactique;
|
||||
public $modifUser = array();
|
||||
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la planète à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function User($id = 0){
|
||||
if (!empty($id)) {
|
||||
global $technologiesVAR, $table_user;
|
||||
$bdd = new bdd();
|
||||
$bdd->escape($id);
|
||||
$user = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($user)) {
|
||||
$this->id_user = $user["id"];
|
||||
$this->pseudo = $user["pseudo"];
|
||||
$this->auth_level = $user["auth_level"];
|
||||
$this->race = $user["race"];
|
||||
$this->options = @intval($user["options"]);
|
||||
$this->mv = $user["mv"];
|
||||
$this->id_alliance = $user["id_alliance"];
|
||||
$this->id_grade_alliance = $user["id_grade_alliance"];
|
||||
$this->mail = $user["mail"];
|
||||
$this->envoyerMail = $user["envoyerMail"];
|
||||
$this->last_visite = $user["last_visite"];
|
||||
$this->points = $user["points"];
|
||||
$this->place_points = $user["place_points"];
|
||||
$this->credits = $user["credits"];
|
||||
$this->politique = $user["politique"];
|
||||
$this->politique_lastchange = $user["politique_lastchange"];
|
||||
if (!empty($user["amis"])) $this->amis = unserialize($user["amis"]);
|
||||
else $this->amis = array();
|
||||
if (!empty($user["destinationsFavoris"])) $this->destinationsFavoris = unserialize($user["destinationsFavoris"]);
|
||||
else $this->destinationsFavoris = array();
|
||||
$this->combatAT_tactique = $user["combatAT_tactique"];
|
||||
$this->combatDE_tactique = $user["combatDE_tactique"];
|
||||
/**
|
||||
* Constructeur
|
||||
* @param int $id id de la planète à importer
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function User($id = 0)
|
||||
{
|
||||
if (!empty($id)) {
|
||||
global $technologiesVAR, $table_user;
|
||||
$bdd = new bdd();
|
||||
$bdd->escape($id);
|
||||
$user = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($user)) {
|
||||
$this->id_user = $user["id"];
|
||||
$this->pseudo = $user["pseudo"];
|
||||
$this->auth_level = $user["auth_level"];
|
||||
$this->race = $user["race"];
|
||||
$this->options = @intval($user["options"]);
|
||||
$this->mv = $user["mv"];
|
||||
$this->id_alliance = $user["id_alliance"];
|
||||
$this->id_grade_alliance = $user["id_grade_alliance"];
|
||||
$this->mail = $user["mail"];
|
||||
$this->envoyerMail = $user["envoyerMail"];
|
||||
$this->last_visite = $user["last_visite"];
|
||||
$this->points = $user["points"];
|
||||
$this->place_points = $user["place_points"];
|
||||
$this->credits = $user["credits"];
|
||||
$this->politique = $user["politique"];
|
||||
$this->politique_lastchange = $user["politique_lastchange"];
|
||||
if (!empty($user["amis"])) {
|
||||
$this->amis = unserialize($user["amis"]);
|
||||
} else {
|
||||
$this->amis = array();
|
||||
}
|
||||
if (!empty($user["destinationsFavoris"])) {
|
||||
$this->destinationsFavoris = unserialize($user["destinationsFavoris"]);
|
||||
} else {
|
||||
$this->destinationsFavoris = array();
|
||||
}
|
||||
$this->combatAT_tactique = $user["combatAT_tactique"];
|
||||
$this->combatDE_tactique = $user["combatDE_tactique"];
|
||||
|
||||
foreach($technologiesVAR as $tech){
|
||||
$this->technologies[] = intval($user[$tech]);
|
||||
}
|
||||
foreach ($technologiesVAR as $tech) {
|
||||
$this->technologies[] = intval($user[$tech]);
|
||||
}
|
||||
|
||||
//Si l'ID d'alliance est défini, on charge l'alliance
|
||||
if (!empty($this->id_alliance))
|
||||
$this->alliance = new TinyAsteroide($this->id_alliance);
|
||||
}
|
||||
else die('Erreur #01 : Utilisateur recherché introuvable dans la base de données. Contactez le support technique ('.$config['mail_support'].') au plus vite en précisant le code d\'erreur.');
|
||||
}
|
||||
}
|
||||
//Si l'ID d'alliance est défini, on charge l'alliance
|
||||
if (!empty($this->id_alliance)) {
|
||||
$this->alliance = new TinyAsteroide($this->id_alliance);
|
||||
}
|
||||
} else {
|
||||
die('Erreur #01 : Utilisateur recherché introuvable dans la base de données. Contactez le support technique ('.$config['mail_support'].') au plus vite en précisant le code d\'erreur.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadPermissions($fondateur = 0)
|
||||
{
|
||||
if ($fondateur == $this->id_user)
|
||||
$this->permissions_alliance = 1023;
|
||||
else
|
||||
{
|
||||
global $table_alliances_grade;
|
||||
$bdd = new BDD();
|
||||
$grade = $bdd->unique_query("SELECT * FROM $table_alliances_grade WHERE id = ".$this->id_grade_alliance.";");
|
||||
$bdd->deconnexion();
|
||||
public function loadPermissions($fondateur = 0)
|
||||
{
|
||||
if ($fondateur == $this->id_user) {
|
||||
$this->permissions_alliance = 1023;
|
||||
} else {
|
||||
global $table_alliances_grade;
|
||||
$bdd = new BDD();
|
||||
$grade = $bdd->unique_query("SELECT * FROM $table_alliances_grade WHERE id = ".$this->id_grade_alliance.";");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$this->permissions_alliance = intval($grade['auth']);
|
||||
}
|
||||
}
|
||||
$this->permissions_alliance = intval($grade['auth']);
|
||||
}
|
||||
}
|
||||
|
||||
function addPoints($metal, $cristal, $hydrogene, $credits = 0, $demolition = false)
|
||||
{
|
||||
global $table_bourse_ressources;
|
||||
//On charge les 3 valeurs boursières
|
||||
$bdd = new BDD();
|
||||
$bourse = $bdd->query("SELECT dispo FROM $table_bourse_ressources;");
|
||||
$bdd->deconnexion();
|
||||
public function addPoints($metal, $cristal, $hydrogene, $credits = 0, $demolition = false)
|
||||
{
|
||||
global $table_bourse_ressources;
|
||||
//On charge les 3 valeurs boursières
|
||||
$bdd = new BDD();
|
||||
$bourse = $bdd->query("SELECT dispo FROM $table_bourse_ressources;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($credits))
|
||||
{
|
||||
//TODO Equivalence non prouvée entre $credits/bourse_calcPrixBase($bourse[0]["dispo"], 0.7); et $credits/bourse_calcPrixBase($bourse[0]["dispo"], 1) * 0.7; dans le but de ne donner que 70% des points
|
||||
$metal += $credits/bourse_calcPrixBase($bourse[0]["dispo"], 0.7);
|
||||
$cristal += $credits/bourse_calcPrixBase($bourse[1]["dispo"], 0.7);
|
||||
$hydrogene += $credits/bourse_calcPrixBase($bourse[2]["dispo"], 0.7);
|
||||
}
|
||||
if (!empty($credits)) {
|
||||
//TODO Equivalence non prouvée entre $credits/bourse_calcPrixBase($bourse[0]["dispo"], 0.7); et $credits/bourse_calcPrixBase($bourse[0]["dispo"], 1) * 0.7; dans le but de ne donner que 70% des points
|
||||
$metal += $credits/bourse_calcPrixBase($bourse[0]["dispo"], 0.7);
|
||||
$cristal += $credits/bourse_calcPrixBase($bourse[1]["dispo"], 0.7);
|
||||
$hydrogene += $credits/bourse_calcPrixBase($bourse[2]["dispo"], 0.7);
|
||||
}
|
||||
|
||||
$points = bourse_calcPrixBase($bourse[0]["dispo"], $metal);
|
||||
$points += bourse_calcPrixBase($bourse[1]["dispo"], $cristal);
|
||||
$points += bourse_calcPrixBase($bourse[2]["dispo"], $hydrogene);
|
||||
$points = bourse_calcPrixBase($bourse[0]["dispo"], $metal);
|
||||
$points += bourse_calcPrixBase($bourse[1]["dispo"], $cristal);
|
||||
$points += bourse_calcPrixBase($bourse[2]["dispo"], $hydrogene);
|
||||
|
||||
if ($demolition)
|
||||
$this->points -= intval($points);
|
||||
else
|
||||
$this->points += intval($points);
|
||||
if ($demolition) {
|
||||
$this->points -= intval($points);
|
||||
} else {
|
||||
$this->points += intval($points);
|
||||
}
|
||||
|
||||
$this->addModifUser("points");
|
||||
}
|
||||
$this->addModifUser("points");
|
||||
}
|
||||
|
||||
function addCredits($credits)
|
||||
{
|
||||
$this->credits += $credits;
|
||||
$this->addModifUser("credits");
|
||||
public function addCredits($credits)
|
||||
{
|
||||
$this->credits += $credits;
|
||||
$this->addModifUser("credits");
|
||||
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function addModifUser($modif)
|
||||
{
|
||||
if (!in_array($modif, $this->modifUser))
|
||||
$this->modifUser[] = $modif;
|
||||
}
|
||||
public function addModifUser($modif)
|
||||
{
|
||||
if (!in_array($modif, $this->modifUser)) {
|
||||
$this->modifUser[] = $modif;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructeur
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
function __destruct(){
|
||||
global $table_user;
|
||||
$out = array();
|
||||
$bdd = new BDD();
|
||||
foreach($this->modifUser as $key => $modif)
|
||||
{
|
||||
//On gère les champs variables tableaux
|
||||
if (is_array($modif))
|
||||
{
|
||||
$calc = dDonnees::nameVAR($modif[0]);
|
||||
/**
|
||||
* Destructeur
|
||||
*
|
||||
* @return void
|
||||
* @access public
|
||||
*/
|
||||
public function __destruct()
|
||||
{
|
||||
global $table_user;
|
||||
$out = array();
|
||||
$bdd = new BDD();
|
||||
foreach ($this->modifUser as $key => $modif) {
|
||||
//On gère les champs variables tableaux
|
||||
if (is_array($modif)) {
|
||||
$calc = dDonnees::nameVAR($modif[0]);
|
||||
|
||||
if (!isset(${$calc.'VAR'}))
|
||||
global ${$calc.'VAR'};
|
||||
if (empty(${$calc.'VAR'}))
|
||||
trigger_error('Impossible de trouver les données pour '.$modif[0], E_USER_ERROR);
|
||||
if (!isset(${$calc.'VAR'})) {
|
||||
global ${$calc.'VAR'};
|
||||
}
|
||||
if (empty(${$calc.'VAR'})) {
|
||||
trigger_error('Impossible de trouver les données pour '.$modif[0], E_USER_ERROR);
|
||||
}
|
||||
|
||||
$out[] = ${$calc.'VAR'}[$modif[1]]." = ".$this->{$modif[0]}[$modif[1]];
|
||||
}
|
||||
elseif ($modif == "force")
|
||||
$out[] = " ";
|
||||
elseif (!is_array($this->{$modif}))
|
||||
{
|
||||
$bdd->escape($this->{$modif});
|
||||
if (is_int($this->{$modif}) || is_float($this->{$modif})) $out[] .= $modif." = ".$this->{$modif};
|
||||
else $out[] .= $modif." = '".$this->{$modif}."'";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($modif != "coeff_bat" && $modif != "vaisseaux" && $modif != "terrestres" && $modif != "casernes" && $modif != "technologies" && $modif != "batiments")
|
||||
{
|
||||
$prep = serialize($this->{$modif});
|
||||
$bdd->escape($prep);
|
||||
$out[] = $modif." = '$prep'";
|
||||
}
|
||||
else
|
||||
{
|
||||
$calc = dDonnees::nameVAR($modif);
|
||||
$out[] = ${$calc.'VAR'}[$modif[1]]." = ".$this->{$modif[0]}[$modif[1]];
|
||||
} elseif ($modif == "force") {
|
||||
$out[] = " ";
|
||||
} elseif (!is_array($this->{$modif})) {
|
||||
$bdd->escape($this->{$modif});
|
||||
if (is_int($this->{$modif}) || is_float($this->{$modif})) {
|
||||
$out[] .= $modif." = ".$this->{$modif};
|
||||
} else {
|
||||
$out[] .= $modif." = '".$this->{$modif}."'";
|
||||
}
|
||||
} else {
|
||||
if ($modif != "coeff_bat" && $modif != "vaisseaux" && $modif != "terrestres" && $modif != "casernes" && $modif != "technologies" && $modif != "batiments") {
|
||||
$prep = serialize($this->{$modif});
|
||||
$bdd->escape($prep);
|
||||
$out[] = $modif." = '$prep'";
|
||||
} else {
|
||||
$calc = dDonnees::nameVAR($modif);
|
||||
|
||||
if (!isset(${$calc.'VAR'}))
|
||||
global ${$calc.'VAR'};
|
||||
if (!isset(${$calc.'VAR'})) {
|
||||
global ${$calc.'VAR'};
|
||||
}
|
||||
|
||||
foreach($this->{$modif} as $j => $value)
|
||||
$out[] = ${$calc.'VAR'}[$j]." = ".$value;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($out))
|
||||
{
|
||||
$sql = "UPDATE $table_user SET ".implode(', ', $out)." WHERE id = ".$this->id_user.";";
|
||||
if (DEBUG)
|
||||
echo '<br /><br />'.$sql;
|
||||
$bdd->query($sql);
|
||||
if ($bdd->affected() != 1)
|
||||
elog($bdd->affected()." champ(s) affecté(s) par la requête du fichier ".__FILE__." à la ligne ".__LINE__.", données : out = ".serialize($out)." avec l'ID ".$this->id_user, 2);
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
foreach ($this->{$modif} as $j => $value) {
|
||||
$out[] = ${$calc.'VAR'}[$j]." = ".$value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($out)) {
|
||||
$sql = "UPDATE $table_user SET ".implode(', ', $out)." WHERE id = ".$this->id_user.";";
|
||||
if (DEBUG) {
|
||||
echo '<br /><br />'.$sql;
|
||||
}
|
||||
$bdd->query($sql);
|
||||
if ($bdd->affected() != 1) {
|
||||
elog($bdd->affected()." champ(s) affecté(s) par la requête du fichier ".__FILE__." à la ligne ".__LINE__.", données : out = ".serialize($out)." avec l'ID ".$this->id_user, 2);
|
||||
}
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
$pagea = 'accueil';
|
||||
$titre = 'Accueil administration';
|
||||
|
|
@ -13,4 +16,3 @@ $bdd->deconnexion();
|
|||
$template->assign('nbMail', $mail['nombre']);
|
||||
$template->assign('nbPilori', $pilori['nombre']);
|
||||
$template->assign('news', $news);
|
||||
?>
|
||||
|
|
@ -1,52 +1,51 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'print';
|
||||
$titre = 'Vérification alliance';
|
||||
|
||||
$template->assign('linkpage', 'valliances');
|
||||
$template->assign('linkpage', 'valliances');
|
||||
|
||||
if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id') {
|
||||
$pagea = 'print_key';
|
||||
$id_plan = $_GET['id'];
|
||||
$key = $_GET['key'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($id_plan);
|
||||
$chapeau->escape($key);
|
||||
$reqA = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
||||
$req = $chapeau->unique_query("DESCRIBE $table_alliances $key;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $reqA);
|
||||
$template->assign('type', explode('(', $req['Type']));
|
||||
$template->assign('idPlan', $id_plan);
|
||||
$template->assign('key', $_GET['key']);
|
||||
$pagea = 'print_key';
|
||||
$id_plan = $_GET['id'];
|
||||
$key = $_GET['key'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($id_plan);
|
||||
$chapeau->escape($key);
|
||||
$reqA = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
||||
$req = $chapeau->unique_query("DESCRIBE $table_alliances $key;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $reqA);
|
||||
$template->assign('type', explode('(', $req['Type']));
|
||||
$template->assign('idPlan', $id_plan);
|
||||
$template->assign('key', $_GET['key']);
|
||||
} elseif (!empty($_GET['id'])) {
|
||||
$id_plan = $_GET['id'];
|
||||
if (isset($_POST['key']) && isset($_POST['mod'])) {
|
||||
$key = $_POST['key'];
|
||||
$mod = $_POST['mod'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($mod);
|
||||
$chapeau->escape($id_plan);
|
||||
$chapeau->query("UPDATE $table_alliances SET $key = '$mod' WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
}
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
} elseif (!empty($_GET['name'])) {
|
||||
$name = $_GET['name'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($name);
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE nom = '$name';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=valliances&id='.$req['id']);
|
||||
exit;
|
||||
} else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
elseif (!empty($_GET['id'])) {
|
||||
$id_plan = $_GET['id'];
|
||||
if (isset($_POST['key']) && isset($_POST['mod'])) {
|
||||
$key = $_POST['key'];
|
||||
$mod = $_POST['mod'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($mod);
|
||||
$chapeau->escape($id_plan);
|
||||
$chapeau->query("UPDATE $table_alliances SET $key = '$mod' WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
}
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
}
|
||||
elseif (!empty($_GET['name'])) {
|
||||
$name = $_GET['name'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($name);
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE nom = '$name';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=valliances&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,74 +1,69 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'bandeau';
|
||||
$titre = 'Bandeau d\'information';
|
||||
|
||||
//Ajout d'une information
|
||||
if (!empty($_GET['i']) && $_GET['i'] == 'add' && !empty($_POST['texte']) && isset($_POST['color']))
|
||||
{
|
||||
$texte = gpc('texte', 'post');
|
||||
$color = gpc('color', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($texte);
|
||||
$bdd->escape($color);
|
||||
$bdd->query("INSERT INTO $table_infoshead (texte, color) VALUES ('$texte', '$color');");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($_GET['i']) && $_GET['i'] == 'add' && !empty($_POST['texte']) && isset($_POST['color'])) {
|
||||
$texte = gpc('texte', 'post');
|
||||
$color = gpc('color', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($texte);
|
||||
$bdd->escape($color);
|
||||
$bdd->query("INSERT INTO $table_infoshead (texte, color) VALUES ('$texte', '$color');");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
//Modification
|
||||
elseif (!empty($_GET['i']))
|
||||
{
|
||||
$id = intval(gpc('i'));
|
||||
if (!empty($_POST['texte']) && isset($_POST['color']))
|
||||
{
|
||||
$texte = gpc('texte', 'post');
|
||||
$color = gpc('color', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($texte);
|
||||
$bdd->escape($color);
|
||||
$bdd->query("UPDATE $table_infoshead SET texte = '$texte', color = '$color' WHERE id = '$id';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_infoshead WHERE id = '$id';");
|
||||
$reqTT = $bdd->query("SELECT * FROM $table_infoshead ORDER BY id ASC;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('mod', $req);
|
||||
$template->assign('tableau', $reqTT);
|
||||
$template->assign('id', $id);
|
||||
}
|
||||
elseif (!empty($_GET['i'])) {
|
||||
$id = intval(gpc('i'));
|
||||
if (!empty($_POST['texte']) && isset($_POST['color'])) {
|
||||
$texte = gpc('texte', 'post');
|
||||
$color = gpc('color', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($texte);
|
||||
$bdd->escape($color);
|
||||
$bdd->query("UPDATE $table_infoshead SET texte = '$texte', color = '$color' WHERE id = '$id';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_infoshead WHERE id = '$id';");
|
||||
$reqTT = $bdd->query("SELECT * FROM $table_infoshead ORDER BY id ASC;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('mod', $req);
|
||||
$template->assign('tableau', $reqTT);
|
||||
$template->assign('id', $id);
|
||||
}
|
||||
//Demande de suppression
|
||||
elseif (!empty($_GET['d']))
|
||||
{
|
||||
$id = intval(gpc('d'));
|
||||
$bdd = new BDD();
|
||||
$bdd->query("DELETE FROM $table_infoshead WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
elseif (!empty($_GET['d'])) {
|
||||
$id = intval(gpc('d'));
|
||||
$bdd = new BDD();
|
||||
$bdd->query("DELETE FROM $table_infoshead WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
//Demande de mise à jour du cache
|
||||
elseif (isset($_GET['actuCache']))
|
||||
{
|
||||
Cache::del('headerNB');
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Récupération des lignes du bandeau
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->query("SELECT * FROM $table_infoshead ORDER BY id ASC;");
|
||||
$bdd->deconnexion();
|
||||
elseif (isset($_GET['actuCache'])) {
|
||||
Cache::del('headerNB');
|
||||
|
||||
header('Location: admin.php?p=bandeau');
|
||||
exit;
|
||||
} else {
|
||||
//Récupération des lignes du bandeau
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->query("SELECT * FROM $table_infoshead ORDER BY id ASC;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('id', "add");
|
||||
}
|
||||
?>
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('id', "add");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,22 +1,26 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!empty($_POST["req"]))
|
||||
$req = stripslashes(gpc("req", "post"));
|
||||
elseif (!empty($_GET["req"]))
|
||||
$req = gpc("req");
|
||||
else
|
||||
$req = "SHOW TABLES;";
|
||||
if (!empty($_POST["req"])) {
|
||||
$req = stripslashes(gpc("req", "post"));
|
||||
} elseif (!empty($_GET["req"])) {
|
||||
$req = gpc("req");
|
||||
} else {
|
||||
$req = "SHOW TABLES;";
|
||||
}
|
||||
|
||||
$bdd = new BDD();
|
||||
$template->assign("reponses", $bdd->query($req));
|
||||
$template->assign("erreur", $bdd->erreur());
|
||||
$template->assign("affected", $bdd->affected());
|
||||
$bdd->deconnexion();
|
||||
$bdd = new BDD();
|
||||
$template->assign("reponses", $bdd->query($req));
|
||||
$template->assign("erreur", $bdd->erreur());
|
||||
$template->assign("affected", $bdd->affected());
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (preg_match("#show tables#i", $req))
|
||||
$template->assign("lien", "SELECT * FROM ");
|
||||
if (preg_match("#show tables#i", $req)) {
|
||||
$template->assign("lien", "SELECT * FROM ");
|
||||
}
|
||||
|
||||
$pagea = 'bdd';
|
||||
$titre = 'Administration de la base de données';
|
||||
?>
|
||||
|
|
@ -1,73 +1,68 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'demarrage';
|
||||
$titre = 'Page de démarrage';
|
||||
|
||||
if (!empty($_GET['i']) && $_GET['i'] == 'add' && !empty($_POST['contenu']) && isset($_POST['titre']))
|
||||
{
|
||||
$titre = gpc('titre', 'post');
|
||||
$contenu = gpc('contenu', 'post');
|
||||
$time = time();
|
||||
$bdd = new BDD();
|
||||
$bdd ->escape($titre);
|
||||
$bdd ->escape($contenu);
|
||||
$bdd ->query("INSERT INTO $table_messages_demarrage (titre, contenu, time) VALUES ('$titre', '$contenu', $time);");
|
||||
$bdd ->deconnexion();
|
||||
if (!empty($_GET['i']) && $_GET['i'] == 'add' && !empty($_POST['contenu']) && isset($_POST['titre'])) {
|
||||
$titre = gpc('titre', 'post');
|
||||
$contenu = gpc('contenu', 'post');
|
||||
$time = time();
|
||||
$bdd = new BDD();
|
||||
$bdd ->escape($titre);
|
||||
$bdd ->escape($contenu);
|
||||
$bdd ->query("INSERT INTO $table_messages_demarrage (titre, contenu, time) VALUES ('$titre', '$contenu', $time);");
|
||||
$bdd ->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
}
|
||||
elseif (!empty($_GET['i']))
|
||||
{
|
||||
$id = intval(gpc('i'));
|
||||
if (!empty($_POST['contenu']) && isset($_POST['titre']))
|
||||
{
|
||||
$titre = gpc('titre', 'post');
|
||||
$texte = gpc('contenu', 'post');
|
||||
$time = time();
|
||||
$reset = gpc('reset', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($titre);
|
||||
$bdd->escape($texte);
|
||||
if (!empty($reset))
|
||||
$bdd->query("UPDATE $table_messages_demarrage SET contenu = '$texte', titre = '$titre', time = $time WHERE id = $id;");
|
||||
else
|
||||
$bdd->query("UPDATE $table_messages_demarrage SET contenu = '$texte', titre = '$titre' WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
} elseif (!empty($_GET['i'])) {
|
||||
$id = intval(gpc('i'));
|
||||
if (!empty($_POST['contenu']) && isset($_POST['titre'])) {
|
||||
$titre = gpc('titre', 'post');
|
||||
$texte = gpc('contenu', 'post');
|
||||
$time = time();
|
||||
$reset = gpc('reset', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($titre);
|
||||
$bdd->escape($texte);
|
||||
if (!empty($reset)) {
|
||||
$bdd->query("UPDATE $table_messages_demarrage SET contenu = '$texte', titre = '$titre', time = $time WHERE id = $id;");
|
||||
} else {
|
||||
$bdd->query("UPDATE $table_messages_demarrage SET contenu = '$texte', titre = '$titre' WHERE id = $id;");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$template->assign('mod', $bdd->unique_query("SELECT * FROM $table_messages_demarrage WHERE id = '$id';"));
|
||||
$template->assign('tableau', $bdd->query("SELECT * FROM $table_messages_demarrage;"));
|
||||
$bdd->deconnexion();
|
||||
$template->assign('id', $id);
|
||||
}
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$template->assign('mod', $bdd->unique_query("SELECT * FROM $table_messages_demarrage WHERE id = '$id';"));
|
||||
$template->assign('tableau', $bdd->query("SELECT * FROM $table_messages_demarrage;"));
|
||||
$bdd->deconnexion();
|
||||
$template->assign('id', $id);
|
||||
}
|
||||
//Suppression d'un message
|
||||
elseif (!empty($_GET['d']))
|
||||
{
|
||||
$id = intval(gpc('d'));
|
||||
$bdd = new BDD();
|
||||
$bdd->query("DELETE FROM $table_messages_demarrage WHERE id = '$id';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
}
|
||||
elseif (!empty($_GET['d'])) {
|
||||
$id = intval(gpc('d'));
|
||||
$bdd = new BDD();
|
||||
$bdd->query("DELETE FROM $table_messages_demarrage WHERE id = '$id';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
}
|
||||
//Demande de mise à jour du cache
|
||||
elseif (isset($_GET['actuCache']))
|
||||
{
|
||||
Cache::del('headerNB');
|
||||
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd = new BDD();
|
||||
$template->assign('tableau', $bdd->query("SELECT * FROM $table_messages_demarrage;"));
|
||||
$bdd->deconnexion();
|
||||
$template->assign('id', 'add');
|
||||
}
|
||||
?>
|
||||
elseif (isset($_GET['actuCache'])) {
|
||||
Cache::del('headerNB');
|
||||
|
||||
header('Location: admin.php?p=demarrage');
|
||||
exit;
|
||||
} else {
|
||||
$bdd = new BDD();
|
||||
$template->assign('tableau', $bdd->query("SELECT * FROM $table_messages_demarrage;"));
|
||||
$bdd->deconnexion();
|
||||
$template->assign('id', 'add');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,23 +1,32 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'vflotte';
|
||||
$titre = 'Vérification flottes';
|
||||
|
||||
//Vérification des flottes
|
||||
if (!isset($_GET['ceil'])) $_GET['ceil'] = 5000;
|
||||
if (!isset($_GET['ceil'])) {
|
||||
$_GET['ceil'] = 5000;
|
||||
}
|
||||
|
||||
$bdd = new BDD();
|
||||
$res = $bdd->query("SELECT * FROM `$table_flottes` ORDER BY `start_time` DESC");
|
||||
$bdd->deconnexion();
|
||||
$tableau = array();
|
||||
if (isset($resultat))
|
||||
foreach($resultat as $res) {
|
||||
$user_source = infoPlan($resultat['end_galaxie'], $resultat['end_ss'], $resultat['end_position'], 'id_user');
|
||||
if ($resultat['contenu_metal'] + $resultat['contenu_cristal'] + $resultat['contenu_hydrogene'] >= $_GET['ceil']) $color = 'FF0000';
|
||||
elseif ($user_source != $resultat['id_user']) $color = 'DFBF00';
|
||||
else $color = false;
|
||||
$tableau[] = array(trouvNom($user_source), trouvNom($resultat['id_user']), infoPlan($resultat['start_galaxie'], $resultat['start_ss'], $resultat['start_position'], 'nom_planete'), '['.$resultat['start_galaxie'].':'.$resultat['start_ss'].':'.$resultat['start_position'].']', infoPlan($resultat['end_galaxie'], $resultat['end_ss'], $resultat['end_position'], 'nom_planete'), '['.$resultat['end_galaxie'].':'.$resultat['end_ss'].':'.$resultat['end_position'].']', $resultat['start_time'], '<acronym title="!!!Détail vaisseaux">'.$resultat['nb_vais'].'</acronym>', $resultat['vitesse'], $resultat['contenu_metal'], $resultat['contenu_cristal'], $resultat['contenu_hydrogene'], $color);
|
||||
if (isset($resultat)) {
|
||||
foreach ($resultat as $res) {
|
||||
$user_source = infoPlan($resultat['end_galaxie'], $resultat['end_ss'], $resultat['end_position'], 'id_user');
|
||||
if ($resultat['contenu_metal'] + $resultat['contenu_cristal'] + $resultat['contenu_hydrogene'] >= $_GET['ceil']) {
|
||||
$color = 'FF0000';
|
||||
} elseif ($user_source != $resultat['id_user']) {
|
||||
$color = 'DFBF00';
|
||||
} else {
|
||||
$color = false;
|
||||
}
|
||||
$tableau[] = array(trouvNom($user_source), trouvNom($resultat['id_user']), infoPlan($resultat['start_galaxie'], $resultat['start_ss'], $resultat['start_position'], 'nom_planete'), '['.$resultat['start_galaxie'].':'.$resultat['start_ss'].':'.$resultat['start_position'].']', infoPlan($resultat['end_galaxie'], $resultat['end_ss'], $resultat['end_position'], 'nom_planete'), '['.$resultat['end_galaxie'].':'.$resultat['end_ss'].':'.$resultat['end_position'].']', $resultat['start_time'], '<acronym title="!!!Détail vaisseaux">'.$resultat['nb_vais'].'</acronym>', $resultat['vitesse'], $resultat['contenu_metal'], $resultat['contenu_cristal'], $resultat['contenu_hydrogene'], $color);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('flottes', $tableau);
|
||||
?>
|
||||
|
|
@ -1,30 +1,27 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$titre = "Création d'inscription";
|
||||
$pagea = "inscription";
|
||||
|
||||
if (!empty($_POST["HB_pseudo"]) && !empty($_POST["race"]))
|
||||
{
|
||||
if (empty($_POST["HB_conf"]) && empty($_POST["HB_mdp"]))
|
||||
$_POST["HB_mdp"] = $_POST["HB_conf"] = gen_mdp(9);
|
||||
if (!empty($_POST["HB_pseudo"]) && !empty($_POST["race"])) {
|
||||
if (empty($_POST["HB_conf"]) && empty($_POST["HB_mdp"])) {
|
||||
$_POST["HB_mdp"] = $_POST["HB_conf"] = gen_mdp(9);
|
||||
}
|
||||
|
||||
if ($_POST['HB_conf'] == $_POST['HB_mdp'] && !empty($_POST['HB_mdp']))
|
||||
{
|
||||
$_POST['HB_mdp'] = cxor(gpc("HB_mdp", "post"), sha1(gpc("HB_pseudo", "post").'£'.gpc("race", "post")));
|
||||
$cds = sha1(gpc("HB_pseudo", "post").'$'.gpc("race", "post").'£'.gpc("HB_mdp", "post").'#'.gpc("HB_mail", "post").'ß'.time().'Ó'.$_SERVER['HTTP_USER_AGENT'].'♀☻'.$_SERVER['REMOTE_ADDR'].gpc("HB_placement", "post"));
|
||||
if (empty($_POST['mailler']))
|
||||
erreur('MDP: <em>'.gpc("HB_conf", "post").'</em><br />URL : <a href="?p=njoueur&nom='.gpc("HB_pseudo", "post").'&race='.gpc("race", "post").'&mdp='.strhex(gpc("HB_mdp", "post")).'&mail='.gpc("HB_mail", "post").'&ti='.time().'&placement='.gpc("HB_placement", "post").'&cds='.$cds.'">Lien</a><br /><br />L\'inscription doit avoir lieu par vous même en raison des procédures de sécurités !', "white");
|
||||
else
|
||||
{
|
||||
if (send_mail(gpc("HB_mail", "post"), "Halo-Battle :: Inscription sur le serveur ".$VAR['serveur_name'], "Bonjour ".gpc("HB_pseudo", "post")." et bienvenue dans l'univers d'Halo-Battle !\n\nNous sommes ravi de vous annoncer qu'un opérateur vient de vous créer un compte sur le serveur ".$VAR['serveur_name'].".\n\nVoici le mot de passe qui vous servira à vous connecter à ce serveur : ".gpc("HB_conf", "post")."\n\nA bientôt,\nLe staff de Halo-Battle"))
|
||||
{
|
||||
|
||||
}
|
||||
header('Location: admin.php?p=njoueur&nom='.gpc("HB_pseudo", "post").'&race='.gpc("race", "post").'&mdp='.strhex(gpc("HB_mdp", "post")).'&mail='.gpc("HB_mail", "post").'&ti='.time().'&placement='.gpc("HB_placement", "post").'&cds='.$cds);
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
erreur('Mot de passe incorrect !');
|
||||
if ($_POST['HB_conf'] == $_POST['HB_mdp'] && !empty($_POST['HB_mdp'])) {
|
||||
$_POST['HB_mdp'] = cxor(gpc("HB_mdp", "post"), sha1(gpc("HB_pseudo", "post").'£'.gpc("race", "post")));
|
||||
$cds = sha1(gpc("HB_pseudo", "post").'$'.gpc("race", "post").'£'.gpc("HB_mdp", "post").'#'.gpc("HB_mail", "post").'ß'.time().'Ó'.$_SERVER['HTTP_USER_AGENT'].'♀☻'.$_SERVER['REMOTE_ADDR'].gpc("HB_placement", "post"));
|
||||
if (empty($_POST['mailler'])) {
|
||||
erreur('MDP: <em>'.gpc("HB_conf", "post").'</em><br />URL : <a href="?p=njoueur&nom='.gpc("HB_pseudo", "post").'&race='.gpc("race", "post").'&mdp='.strhex(gpc("HB_mdp", "post")).'&mail='.gpc("HB_mail", "post").'&ti='.time().'&placement='.gpc("HB_placement", "post").'&cds='.$cds.'">Lien</a><br /><br />L\'inscription doit avoir lieu par vous même en raison des procédures de sécurités !', "white");
|
||||
} else {
|
||||
if (send_mail(gpc("HB_mail", "post"), "Halo-Battle :: Inscription sur le serveur ".$VAR['serveur_name'], "Bonjour ".gpc("HB_pseudo", "post")." et bienvenue dans l'univers d'Halo-Battle !\n\nNous sommes ravi de vous annoncer qu'un opérateur vient de vous créer un compte sur le serveur ".$VAR['serveur_name'].".\n\nVoici le mot de passe qui vous servira à vous connecter à ce serveur : ".gpc("HB_conf", "post")."\n\nA bientôt,\nLe staff de Halo-Battle")) {
|
||||
}
|
||||
header('Location: admin.php?p=njoueur&nom='.gpc("HB_pseudo", "post").'&race='.gpc("race", "post").'&mdp='.strhex(gpc("HB_mdp", "post")).'&mail='.gpc("HB_mail", "post").'&ti='.time().'&placement='.gpc("HB_placement", "post").'&cds='.$cds);
|
||||
}
|
||||
} else {
|
||||
erreur('Mot de passe incorrect !');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,61 +1,63 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'vip';
|
||||
$titre = 'Vérification IP';
|
||||
|
||||
$timelimit = date('Y-m-d', mktime(0, 0, 0, date("m"), date("d"), date("Y"))); //2008-06-17 18:15:00
|
||||
$page = gpc('v');
|
||||
if (empty($page) || !is_numeric($page))
|
||||
$page = 0;
|
||||
if (empty($page) || !is_numeric($page)) {
|
||||
$page = 0;
|
||||
}
|
||||
|
||||
$act = gpc('act');
|
||||
if ($act == 'multiok')
|
||||
{
|
||||
$bdd = new BDD();
|
||||
$user = intval(gpc('util'));
|
||||
$bdd->query("UPDATE $table_user SET multi = '1' WHERE id = ".$user.";");
|
||||
$bdd->deconnexion();
|
||||
unset($user);
|
||||
if ($act == 'multiok') {
|
||||
$bdd = new BDD();
|
||||
$user = intval(gpc('util'));
|
||||
$bdd->query("UPDATE $table_user SET multi = '1' WHERE id = ".$user.";");
|
||||
$bdd->deconnexion();
|
||||
unset($user);
|
||||
}
|
||||
|
||||
$trace = 'absent pour plus de rapidité';
|
||||
|
||||
$bdd = new BDD();
|
||||
if (isset($_GET['ip']))
|
||||
{
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE ip = '".gpc('ip')."' ORDER BY ip ASC;");
|
||||
$trace = gethostbyaddr($req[0]['ip']);
|
||||
if (isset($_GET['ip'])) {
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE ip = '".gpc('ip')."' ORDER BY ip ASC;");
|
||||
$trace = gethostbyaddr($req[0]['ip']);
|
||||
} elseif (isset($_GET['util']) && isset($_GET['comp'])) {
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE id_util = ".intval(gpc('util'))." OR id_util = ".intval(gpc('comp'))." ORDER BY ip ASC;");
|
||||
} elseif (isset($_GET['util'])) {
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE id_util = '".intval(gpc('util'))."' ORDER BY ip ASC;");
|
||||
} elseif (isset($_GET['tri'])) {
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id ORDER BY ".gpc('tri')." ASC;");
|
||||
} else {
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE R.time > '$timelimit 00:00:00' ORDER BY R.ip ASC LIMIT ".($page*75).",75;");
|
||||
}
|
||||
elseif (isset($_GET['util']) && isset($_GET['comp']))
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE id_util = ".intval(gpc('util'))." OR id_util = ".intval(gpc('comp'))." ORDER BY ip ASC;");
|
||||
elseif (isset($_GET['util']))
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE id_util = '".intval(gpc('util'))."' ORDER BY ip ASC;");
|
||||
elseif (isset($_GET['tri']))
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id ORDER BY ".gpc('tri')." ASC;");
|
||||
else
|
||||
$req = $bdd->query("SELECT R.id, R.id_util, R.time, R.ip, U.pseudo, U.mv, U.multi FROM $table_registre_identification R INNER JOIN $table_user U ON R.id_util = U.id WHERE R.time > '$timelimit 00:00:00' ORDER BY R.ip ASC LIMIT ".($page*75).",75;");
|
||||
//SELECT last_ip,COUNT(*) FROM user GROUP BY last_ip HAVING COUNT(*)>1
|
||||
$nbpage = $bdd->unique_query("SELECT COUNT(id) AS nb FROM $table_registre_identification WHERE time > '$timelimit 00:00:00';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$anc = array('ip' => 0, 'id_util' => 0);
|
||||
$tableau = array();
|
||||
if (isset($resultat))
|
||||
foreach($req as $resultat)
|
||||
{
|
||||
if ($resultat['mv'] == 3)
|
||||
$color = 'DFBF00';
|
||||
elseif ($resultat['multi'] == 1 && $anc['ip'] == $resultat['ip'] && $anc['id_util'] != $resultat['id_util'])
|
||||
$color = 'EE66EE';
|
||||
elseif ($anc['ip'] == $resultat['ip'] && $anc['id_util'] != $resultat['id_util'])
|
||||
$color = 'FF0000';
|
||||
else
|
||||
$color = false;
|
||||
if (isset($resultat)) {
|
||||
foreach ($req as $resultat) {
|
||||
if ($resultat['mv'] == 3) {
|
||||
$color = 'DFBF00';
|
||||
} elseif ($resultat['multi'] == 1 && $anc['ip'] == $resultat['ip'] && $anc['id_util'] != $resultat['id_util']) {
|
||||
$color = 'EE66EE';
|
||||
} elseif ($anc['ip'] == $resultat['ip'] && $anc['id_util'] != $resultat['id_util']) {
|
||||
$color = 'FF0000';
|
||||
} else {
|
||||
$color = false;
|
||||
}
|
||||
|
||||
$tableau[] = array($resultat['ip'], $trace, $resultat['id_util'], $resultat['pseudo'], $resultat['time'], $resultat['mv'], $color);
|
||||
$anc = $resultat;
|
||||
$tableau[] = array($resultat['ip'], $trace, $resultat['id_util'], $resultat['pseudo'], $resultat['time'], $resultat['mv'], $color);
|
||||
$anc = $resultat;
|
||||
}
|
||||
}
|
||||
$template->assign('ips', $tableau);
|
||||
$template->assign('numpage', $page);
|
||||
$template->assign('nbpage', floor($nbpage['nb']/75));
|
||||
?>
|
||||
|
|
@ -1,98 +1,94 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'print';
|
||||
$titre = 'Vérification joueur';
|
||||
|
||||
$template->assign('linkpage', 'vjoueurs');
|
||||
$template->assign('linkpage', 'vjoueurs');
|
||||
|
||||
//Changement du nom d'utilisateur
|
||||
if (!empty($_GET['id']) && !empty($_POST['key']) && !empty($_POST['mod']) && $_POST['key'] == 'pseudo')
|
||||
{
|
||||
$id_plan = intval(gpc('id'));
|
||||
$mod = gpc('mod', 'post');
|
||||
if (!empty($_GET['id']) && !empty($_POST['key']) && !empty($_POST['mod']) && $_POST['key'] == 'pseudo') {
|
||||
$id_plan = intval(gpc('id'));
|
||||
$mod = gpc('mod', 'post');
|
||||
|
||||
$liste = "abcdefghijklmnopqrstuvwxyz./!*123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
$code = '';
|
||||
while(strlen($code) <= 8)
|
||||
$code .= $liste[rand(0,64)];
|
||||
$liste = "abcdefghijklmnopqrstuvwxyz./!*123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
$code = '';
|
||||
while (strlen($code) <= 8) {
|
||||
$code .= $liste[rand(0, 64)];
|
||||
}
|
||||
|
||||
$mdp = mdp($mod, $code);
|
||||
$mdp = mdp($mod, $code);
|
||||
|
||||
$bdd = new BDD();
|
||||
$reqMail = $bdd->unique_query("SELECT mail FROM $table_user WHERE id = $id_plan;");
|
||||
$bdd->escape($mod);
|
||||
$reqPseudo = $bdd->query("SELECT mail FROM $table_user WHERE pseudo = '$mod';");
|
||||
if ($reqPseudo !== NULL)
|
||||
erreur('Nom d\'utilisateur déjà utilisé. Impossible de faire le changement !');
|
||||
$bdd->query("UPDATE $table_user SET pseudo = '$mod', mdp = '".$mdp[0]."', mdp_var = '".$mdp[1]."' WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
$bdd = new BDD();
|
||||
$reqMail = $bdd->unique_query("SELECT mail FROM $table_user WHERE id = $id_plan;");
|
||||
$bdd->escape($mod);
|
||||
$reqPseudo = $bdd->query("SELECT mail FROM $table_user WHERE pseudo = '$mod';");
|
||||
if ($reqPseudo !== null) {
|
||||
erreur('Nom d\'utilisateur déjà utilisé. Impossible de faire le changement !');
|
||||
}
|
||||
$bdd->query("UPDATE $table_user SET pseudo = '$mod', mdp = '".$mdp[0]."', mdp_var = '".$mdp[1]."' WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if(send_mail($reqMail['mail'], "Nouveau nom d'utilisateur", "Bonjour ".$mod.",\n\nVous recevez ce mail suite au changement de votre nom d'utilisateur sur le serveur ".$VAR["serveur_name"].".\nCe changement a été effectué par un opérateur de la galaxie, sur votre demande ou dans le cadre des règles du jeu.\nDe plus, pour votre sécurité, un nouveau mot de passe vous a été automatiquement attribué.\n\nVos nouvelles informations personnelles sont les suivantes :\n\tNom d'utilisateur : ".$mod."\n\tMot de passe : '.$code.'\n\nVotre ancien nom d'utilisateur et mot de passe ne sont plus valide à partir de maintenant et vous devez utiliser les données ci-dessus pour vous connecter.\n\nSi vous rencontrez des problèmes suites à ce changement, n'hésitez pas à contacter l'opérateur qui suivit votre demande.\n\nPour votre sécurité, nous vous rappelons qu'il est dangeureux de conserver un mail contenant des données personnelles. Pensez donc à supprimer ce mail une fois que vous vous serez connecté au jeu.\n\nL'équipe d'Halo-Battle"))
|
||||
erreur("Nom d'utilisateur mis à jour avec succès. Un mail a été envoyé à l'utilisateur contenant un nouveau mot de passe.", "green");
|
||||
else
|
||||
erreur("Une erreur est survenue lors de l'envoie du mail.");
|
||||
}
|
||||
if (send_mail($reqMail['mail'], "Nouveau nom d'utilisateur", "Bonjour ".$mod.",\n\nVous recevez ce mail suite au changement de votre nom d'utilisateur sur le serveur ".$VAR["serveur_name"].".\nCe changement a été effectué par un opérateur de la galaxie, sur votre demande ou dans le cadre des règles du jeu.\nDe plus, pour votre sécurité, un nouveau mot de passe vous a été automatiquement attribué.\n\nVos nouvelles informations personnelles sont les suivantes :\n\tNom d'utilisateur : ".$mod."\n\tMot de passe : '.$code.'\n\nVotre ancien nom d'utilisateur et mot de passe ne sont plus valide à partir de maintenant et vous devez utiliser les données ci-dessus pour vous connecter.\n\nSi vous rencontrez des problèmes suites à ce changement, n'hésitez pas à contacter l'opérateur qui suivit votre demande.\n\nPour votre sécurité, nous vous rappelons qu'il est dangeureux de conserver un mail contenant des données personnelles. Pensez donc à supprimer ce mail une fois que vous vous serez connecté au jeu.\n\nL'équipe d'Halo-Battle")) {
|
||||
erreur("Nom d'utilisateur mis à jour avec succès. Un mail a été envoyé à l'utilisateur contenant un nouveau mot de passe.", "green");
|
||||
} else {
|
||||
erreur("Une erreur est survenue lors de l'envoie du mail.");
|
||||
}
|
||||
}
|
||||
//Changement du mot de passe
|
||||
elseif (!empty($_GET['id']) && !empty($_POST['key']) && !empty($_POST['mod']) && $_POST['key'] == 'mdp')
|
||||
{
|
||||
$id_plan = intval(gpc('id'));
|
||||
$mod = gpc('mod', 'post');
|
||||
elseif (!empty($_GET['id']) && !empty($_POST['key']) && !empty($_POST['mod']) && $_POST['key'] == 'mdp') {
|
||||
$id_plan = intval(gpc('id'));
|
||||
$mod = gpc('mod', 'post');
|
||||
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT pseudo, mdp_var FROM $table_user WHERE id = $id_plan;");
|
||||
$mdp = mdp($req["pseudo"], $mod, $req["mdp_var"]);
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT pseudo, mdp_var FROM $table_user WHERE id = $id_plan;");
|
||||
$mdp = mdp($req["pseudo"], $mod, $req["mdp_var"]);
|
||||
|
||||
$bdd->query("UPDATE $table_user SET mdp = '$mdp' WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->query("UPDATE $table_user SET mdp = '$mdp' WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
erreur("Mot de passe changé avec succès.<br />Pensez à avertir l'utilisateur de ce changement !", "green");
|
||||
}
|
||||
elseif (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id' && $_GET['key'] != 'mdpNOUV' && $_GET['key'] != 'auth_level' && $_GET['key'] != 'mdp_var')
|
||||
{
|
||||
$pagea = 'print_key';
|
||||
$id_plan = intval(gpc('id'));
|
||||
$key = gpc('key');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($key);
|
||||
$reqJ = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id_plan;");
|
||||
$req = $bdd->unique_query("DESCRIBE $table_user $key;");
|
||||
$bdd->deconnexion();
|
||||
erreur("Mot de passe changé avec succès.<br />Pensez à avertir l'utilisateur de ce changement !", "green");
|
||||
} elseif (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id' && $_GET['key'] != 'mdpNOUV' && $_GET['key'] != 'auth_level' && $_GET['key'] != 'mdp_var') {
|
||||
$pagea = 'print_key';
|
||||
$id_plan = intval(gpc('id'));
|
||||
$key = gpc('key');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($key);
|
||||
$reqJ = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id_plan;");
|
||||
$req = $bdd->unique_query("DESCRIBE $table_user $key;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('tableau', $reqJ);
|
||||
$template->assign('type', explode('(', $req['Type']));
|
||||
$template->assign('idPlan', $id_plan);
|
||||
$template->assign('key', $key);
|
||||
}
|
||||
elseif (!empty($_GET['id']))
|
||||
{
|
||||
$id_plan = intval(gpc('id'));
|
||||
if (isset($_POST['key']) && isset($_POST['mod']))
|
||||
{
|
||||
$key = gpc('key', 'post');
|
||||
$mod = gpc('mod', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($mod);
|
||||
$bdd->escape($key);
|
||||
$bdd->query("UPDATE $table_user SET $key = '$mod' WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('tableau', $reqJ);
|
||||
$template->assign('type', explode('(', $req['Type']));
|
||||
$template->assign('idPlan', $id_plan);
|
||||
$template->assign('key', $key);
|
||||
} elseif (!empty($_GET['id'])) {
|
||||
$id_plan = intval(gpc('id'));
|
||||
if (isset($_POST['key']) && isset($_POST['mod'])) {
|
||||
$key = gpc('key', 'post');
|
||||
$mod = gpc('mod', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($mod);
|
||||
$bdd->escape($key);
|
||||
$bdd->query("UPDATE $table_user SET $key = '$mod' WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
}
|
||||
elseif (!empty($_GET['name']))
|
||||
{
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_user WHERE pseudo = '$name';");
|
||||
$bdd->deconnexion();
|
||||
header('Location: admin.php?p=vjoueurs&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
$pagea = 'print_choixU';
|
||||
?>
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
} elseif (!empty($_GET['name'])) {
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_user WHERE pseudo = '$name';");
|
||||
$bdd->deconnexion();
|
||||
header('Location: admin.php?p=vjoueurs&id='.$req['id']);
|
||||
exit;
|
||||
} else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,49 +1,57 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'mail_liste';
|
||||
$titre = 'Demandes et problèmes de la galaxie';
|
||||
|
||||
$template->assign('linkpage', 'courrier');
|
||||
$template->assign('linkpage', 'courrier');
|
||||
|
||||
if (!empty($_GET['w']) || !empty($_GET['x'])) {
|
||||
if (!empty($_GET['w'])) $id = $_GET['w'];
|
||||
else $id = $_GET['x'];
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($id);
|
||||
$req = $bdd->unique_query("SELECT $table_user.pseudo, $table_ope_mail.statut, $table_ope_mail.time, $table_ope_mail.titre, $table_ope_mail.contenu, $table_ope_mail.id FROM $table_ope_mail INNER JOIN $table_user ON $table_user.id = $table_ope_mail.id_user WHERE $table_ope_mail.id = '$id';");
|
||||
if ($req['statut'] >= 6) $bdd->query("UPDATE $table_ope_mail SET statut = '0' WHERE id = '$id';");
|
||||
else $bdd->query("UPDATE $table_ope_mail SET statut = statut + 1 WHERE id = '$id';");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($_GET['w'])) {
|
||||
$id = $_GET['w'];
|
||||
} else {
|
||||
$id = $_GET['x'];
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($id);
|
||||
$req = $bdd->unique_query("SELECT $table_user.pseudo, $table_ope_mail.statut, $table_ope_mail.time, $table_ope_mail.titre, $table_ope_mail.contenu, $table_ope_mail.id FROM $table_ope_mail INNER JOIN $table_user ON $table_user.id = $table_ope_mail.id_user WHERE $table_ope_mail.id = '$id';");
|
||||
if ($req['statut'] >= 6) {
|
||||
$bdd->query("UPDATE $table_ope_mail SET statut = '0' WHERE id = '$id';");
|
||||
} else {
|
||||
$bdd->query("UPDATE $table_ope_mail SET statut = statut + 1 WHERE id = '$id';");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (isset($_GET['x'])) header('Location: admin.php?p=courrier&v='.$id);
|
||||
else header('Location: admin.php?p=courrier');
|
||||
exit;
|
||||
}
|
||||
elseif (!empty($_GET['v'])) {
|
||||
$id = $_GET['v'];
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($id);
|
||||
$req = $bdd->unique_query("SELECT $table_user.pseudo, $table_ope_mail.statut, $table_ope_mail.time, $table_ope_mail.titre, $table_ope_mail.contenu, $table_ope_mail.id FROM $table_ope_mail INNER JOIN $table_user ON $table_user.id = $table_ope_mail.id_user WHERE $table_ope_mail.id = '$id';");
|
||||
$bdd->deconnexion();
|
||||
if (isset($_GET['x'])) {
|
||||
header('Location: admin.php?p=courrier&v='.$id);
|
||||
} else {
|
||||
header('Location: admin.php?p=courrier');
|
||||
}
|
||||
exit;
|
||||
} elseif (!empty($_GET['v'])) {
|
||||
$id = $_GET['v'];
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($id);
|
||||
$req = $bdd->unique_query("SELECT $table_user.pseudo, $table_ope_mail.statut, $table_ope_mail.time, $table_ope_mail.titre, $table_ope_mail.contenu, $table_ope_mail.id FROM $table_ope_mail INNER JOIN $table_user ON $table_user.id = $table_ope_mail.id_user WHERE $table_ope_mail.id = '$id';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('req', $req);
|
||||
$template->assign('id', $id);
|
||||
$pagea = 'mail_view';
|
||||
}
|
||||
elseif (!empty($_GET['d']) && $sess->level >= 5) {
|
||||
$id = $_GET['d'];
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($id);
|
||||
$bdd->query("DELETE FROM $table_ope_mail WHERE id = '$id';");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('req', $req);
|
||||
$template->assign('id', $id);
|
||||
$pagea = 'mail_view';
|
||||
} elseif (!empty($_GET['d']) && $sess->level >= 5) {
|
||||
$id = $_GET['d'];
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($id);
|
||||
$bdd->query("DELETE FROM $table_ope_mail WHERE id = '$id';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=courrier');
|
||||
exit;
|
||||
header('Location: admin.php?p=courrier');
|
||||
exit;
|
||||
} else {
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->query("SELECT $table_user.pseudo, $table_ope_mail.statut, $table_ope_mail.time, $table_ope_mail.titre, $table_ope_mail.contenu, $table_ope_mail.id FROM $table_ope_mail INNER JOIN $table_user ON $table_user.id = $table_ope_mail.id_user ORDER BY $table_ope_mail.time DESC;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('mails', $req);
|
||||
}
|
||||
else {
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->query("SELECT $table_user.pseudo, $table_ope_mail.statut, $table_ope_mail.time, $table_ope_mail.titre, $table_ope_mail.contenu, $table_ope_mail.id FROM $table_ope_mail INNER JOIN $table_user ON $table_user.id = $table_ope_mail.id_user ORDER BY $table_ope_mail.time DESC;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('mails', $req);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,24 +1,25 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'mail_mass';
|
||||
$titre = 'Envoie de mail en masse aux joueurs de la galaxie';
|
||||
|
||||
$template->assign('linkpage', 'mail_mass');
|
||||
$template->assign('linkpage', 'mail_mass');
|
||||
|
||||
if (!empty($_POST['sujet']) || !empty($_POST['message'])) {
|
||||
$sujet = "Halo-Battle :: ".gpc('sujet', 'post');
|
||||
$message = gpc('message', 'post');
|
||||
$bdd = new BDD();
|
||||
$users = $bdd->query("SELECT pseudo, mail FROM $table_user;");
|
||||
$bdd->deconnexion();
|
||||
$sujet = "Halo-Battle :: ".gpc('sujet', 'post');
|
||||
$message = gpc('message', 'post');
|
||||
$bdd = new BDD();
|
||||
$users = $bdd->query("SELECT pseudo, mail FROM $table_user;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
foreach($users as $user)
|
||||
{
|
||||
$messageJ = str_replace('$pseudo', $user["pseudo"], $message);
|
||||
send_mail($user["mail"], $sujet, $messageJ);
|
||||
//print 'Mail : '.$user["mail"].' ; sujet : '.$sujet.' ; message : '.$messageJ.'<br />';
|
||||
}
|
||||
foreach ($users as $user) {
|
||||
$messageJ = str_replace('$pseudo', $user["pseudo"], $message);
|
||||
send_mail($user["mail"], $sujet, $messageJ);
|
||||
//print 'Mail : '.$user["mail"].' ; sujet : '.$sujet.' ; message : '.$messageJ.'<br />';
|
||||
}
|
||||
|
||||
erreur("Tous les mails ont été envoyés avec succès.", "green");
|
||||
erreur("Tous les mails ont été envoyés avec succès.", "green");
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,77 +1,69 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'print';
|
||||
$titre = 'Vérification planète';
|
||||
|
||||
$template->assign('linkpage', 'vplanetes');
|
||||
$template->assign('linkpage', 'vplanetes');
|
||||
|
||||
if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] == 'hash_planete')
|
||||
{
|
||||
$id_plan = intval(gpc('id'));
|
||||
$bdd = new BDD();
|
||||
$bdd->query("UPDATE $table_planete SET hash_planete = SHA1(CONCAT('g',planete.galaxie,'s',planete.ss,'p',planete.position)) WHERE id = $id_plan;");
|
||||
if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] == 'hash_planete') {
|
||||
$id_plan = intval(gpc('id'));
|
||||
$bdd = new BDD();
|
||||
$bdd->query("UPDATE $table_planete SET hash_planete = SHA1(CONCAT('g',planete.galaxie,'s',planete.ss,'p',planete.position)) WHERE id = $id_plan;");
|
||||
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_planete WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
}
|
||||
elseif (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id')
|
||||
{
|
||||
$pagea = 'print_key';
|
||||
$id_plan = intval(gpc('id'));
|
||||
$key = intval(gpc('key'));
|
||||
$bdd = new BDD();
|
||||
$reqp = $bdd->unique_query("SELECT * FROM $table_planete WHERE id = $id_plan;");
|
||||
$req = $bdd->unique_query("DESCRIBE $table_planete $key;");
|
||||
$bdd->deconnexion();
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_planete WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
} elseif (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id') {
|
||||
$pagea = 'print_key';
|
||||
$id_plan = intval(gpc('id'));
|
||||
$key = intval(gpc('key'));
|
||||
$bdd = new BDD();
|
||||
$reqp = $bdd->unique_query("SELECT * FROM $table_planete WHERE id = $id_plan;");
|
||||
$req = $bdd->unique_query("DESCRIBE $table_planete $key;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('tableau', $reqp);
|
||||
$template->assign('type', explode('(', $req['Type']));
|
||||
$template->assign('idPlan', $id_plan);
|
||||
$template->assign('key', $_GET['key']);
|
||||
}
|
||||
elseif (!empty($_GET['id']))
|
||||
{
|
||||
$id_plan = intval(gpc('id'));
|
||||
if (isset($_POST['key']) && isset($_POST['mod']) && $_POST['key'] != 'id')
|
||||
{
|
||||
$key = gpc('key', 'post');
|
||||
$mod = gpc('mod', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($key);
|
||||
$bdd->escape($mod);
|
||||
$bdd->query("UPDATE $table_planete SET $key = '$mod' WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_planete WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
}
|
||||
elseif (isset($_GET['amas']) && isset($_GET['ss']) && !empty($_GET['pos']))
|
||||
{
|
||||
$amas = intval(gpc('amas'));
|
||||
$ss = intval(gpc('ss'));
|
||||
$pos = intval(gpc('pos'));
|
||||
$template->assign('tableau', $reqp);
|
||||
$template->assign('type', explode('(', $req['Type']));
|
||||
$template->assign('idPlan', $id_plan);
|
||||
$template->assign('key', $_GET['key']);
|
||||
} elseif (!empty($_GET['id'])) {
|
||||
$id_plan = intval(gpc('id'));
|
||||
if (isset($_POST['key']) && isset($_POST['mod']) && $_POST['key'] != 'id') {
|
||||
$key = gpc('key', 'post');
|
||||
$mod = gpc('mod', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($key);
|
||||
$bdd->escape($mod);
|
||||
$bdd->query("UPDATE $table_planete SET $key = '$mod' WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_planete WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
} elseif (isset($_GET['amas']) && isset($_GET['ss']) && !empty($_GET['pos'])) {
|
||||
$amas = intval(gpc('amas'));
|
||||
$ss = intval(gpc('ss'));
|
||||
$pos = intval(gpc('pos'));
|
||||
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_planete WHERE galaxie = $amas AND ss = $ss AND position = $pos;");
|
||||
$bdd->deconnexion();
|
||||
header('Location: '.$VAR["menu"]["vplanetes"].'&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
elseif (isset($_GET['format']))
|
||||
{
|
||||
preg_match('#^\[?([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})\]?$#', gpc('format'), $position);
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_planete WHERE galaxie = $amas AND ss = $ss AND position = $pos;");
|
||||
$bdd->deconnexion();
|
||||
header('Location: '.$VAR["menu"]["vplanetes"].'&id='.$req['id']);
|
||||
exit;
|
||||
} elseif (isset($_GET['format'])) {
|
||||
preg_match('#^\[?([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})\]?$#', gpc('format'), $position);
|
||||
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_planete WHERE galaxie = ".$position[1]." AND ss = ".$position[2]." AND position = ".$position[3].";");
|
||||
$bdd->deconnexion();
|
||||
header('Location: '.$VAR["menu"]["vplanetes"].'&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
$pagea = 'print_choixP';
|
||||
?>
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_planete WHERE galaxie = ".$position[1]." AND ss = ".$position[2]." AND position = ".$position[3].";");
|
||||
$bdd->deconnexion();
|
||||
header('Location: '.$VAR["menu"]["vplanetes"].'&id='.$req['id']);
|
||||
exit;
|
||||
} else {
|
||||
$pagea = 'print_choixP';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,42 +1,42 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$titre = 'Prise de contrôle d\'un joueur';
|
||||
$pagea = 'erreur';
|
||||
|
||||
$template->assign('linkpage', 'cjoueurs');
|
||||
$template->assign('linkpage', 'cjoueurs');
|
||||
|
||||
if ($SESS->level >= 5 && !empty($_GET['id']))
|
||||
{
|
||||
$name = intval(gpc('id'));
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT id, pseudo, auth_level FROM $table_user WHERE id = $name;");
|
||||
$bdd->deconnexion();
|
||||
if ($req['auth_level'] >= $SESS->level)
|
||||
$template->assign('message', 'Vous ne pouvez pas prendre le contrôle de cet utilisateur !');
|
||||
else
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$reqPl = $bdd->unique_query("SELECT id, nom_planete FROM $table_planete WHERE id_user = '".$req['id']."' LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
if ($SESS->level >= 5 && !empty($_GET['id'])) {
|
||||
$name = intval(gpc('id'));
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT id, pseudo, auth_level FROM $table_user WHERE id = $name;");
|
||||
$bdd->deconnexion();
|
||||
if ($req['auth_level'] >= $SESS->level) {
|
||||
$template->assign('message', 'Vous ne pouvez pas prendre le contrôle de cet utilisateur !');
|
||||
} else {
|
||||
$bdd->reconnexion();
|
||||
$reqPl = $bdd->unique_query("SELECT id, nom_planete FROM $table_planete WHERE id_user = '".$req['id']."' LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (empty($SESS->values['souscontrole'])) $SESS->values['souscontrole'] = array($SESS->values['id'], $SESS->values['idPlan']);
|
||||
$SESS->values['id'] = $req['id'];
|
||||
$SESS->values['idPlan'] = $reqPl['id'];
|
||||
$SESS->put();
|
||||
if (empty($SESS->values['souscontrole'])) {
|
||||
$SESS->values['souscontrole'] = array($SESS->values['id'], $SESS->values['idPlan']);
|
||||
}
|
||||
$SESS->values['id'] = $req['id'];
|
||||
$SESS->values['idPlan'] = $reqPl['id'];
|
||||
$SESS->put();
|
||||
|
||||
$template->assign('message', 'Vous contrôlez maintenant le joueur '.$req['pseudo'].'.<br />Planète '.$reqPl['nom_planete'].' sélectionnée !');
|
||||
}
|
||||
}
|
||||
elseif (!empty($_GET['name']))
|
||||
{
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_user WHERE pseudo = '$name';");
|
||||
$bdd->deconnexion();
|
||||
header('Location: admin.php?p=cjoueurs&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
$pagea = 'print_choixU';
|
||||
?>
|
||||
$template->assign('message', 'Vous contrôlez maintenant le joueur '.$req['pseudo'].'.<br />Planète '.$reqPl['nom_planete'].' sélectionnée !');
|
||||
}
|
||||
} elseif (!empty($_GET['name'])) {
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_user WHERE pseudo = '$name';");
|
||||
$bdd->deconnexion();
|
||||
header('Location: admin.php?p=cjoueurs&id='.$req['id']);
|
||||
exit;
|
||||
} else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,19 +1,22 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'vide';
|
||||
$titre = 'Mise à jour de la liste des proxys';
|
||||
|
||||
function traiterfichier($uri, &$list)
|
||||
{
|
||||
$fp = fopen($uri, "r");
|
||||
while (!feof($fp))
|
||||
{
|
||||
$buffer = fgets($fp);
|
||||
if (preg_match("#^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}#", $buffer, $match))
|
||||
$list[] = $match[0];
|
||||
//$list[] = substr($buffer, 0, strpos($buffer, ":"));
|
||||
}
|
||||
fclose($fp);
|
||||
$fp = fopen($uri, "r");
|
||||
while (!feof($fp)) {
|
||||
$buffer = fgets($fp);
|
||||
if (preg_match("#^[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}#", $buffer, $match)) {
|
||||
$list[] = $match[0];
|
||||
}
|
||||
//$list[] = substr($buffer, 0, strpos($buffer, ":"));
|
||||
}
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
$list = array();
|
||||
|
|
@ -39,4 +42,3 @@ $bdd->query("INSERT INTO proxy_list VALUES ('".implode("'),('", $list)."');");
|
|||
$bdd->deconnexion();
|
||||
|
||||
erreur("Procédure terminée, ".count($list)." proxys listés.", "green");
|
||||
?>
|
||||
|
|
@ -1,31 +1,31 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'rapports';
|
||||
$titre = 'Afficher les rapports d\'un joueur';
|
||||
|
||||
$template->assign('linkpage', 'vrapports');
|
||||
$template->assign('linkpage', 'vrapports');
|
||||
|
||||
if (!empty($_GET['id']))
|
||||
{
|
||||
$id_user = intval(gpc('id'));
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->query("SELECT * FROM $table_mail WHERE destinataire = $id_user AND expediteur = '' ORDER BY temps DESC;");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($_GET['id'])) {
|
||||
$id_user = intval(gpc('id'));
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->query("SELECT * FROM $table_mail WHERE destinataire = $id_user AND expediteur = '' ORDER BY temps DESC;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_user);
|
||||
$template->assign('script', '<script>for (j=0; document.getElementsByName(j)[0]; j++) hide(document.getElementsByName(j)[0]);</script>');
|
||||
}
|
||||
elseif (!empty($_GET['name'])) {
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_user WHERE pseudo = '".$name."';");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_user);
|
||||
$template->assign('script', '<script>for (j=0; document.getElementsByName(j)[0]; j++) hide(document.getElementsByName(j)[0]);</script>');
|
||||
} elseif (!empty($_GET['name'])) {
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_user WHERE pseudo = '".$name."';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=vrapports&id='.$req['id']);
|
||||
exit;
|
||||
header('Location: admin.php?p=vrapports&id='.$req['id']);
|
||||
exit;
|
||||
} else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
else
|
||||
$pagea = 'print_choixU';
|
||||
?>
|
||||
|
|
@ -1,45 +1,41 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$titre = 'Sanction joueur';
|
||||
$pagea = 'erreur';
|
||||
|
||||
$template->assign('linkpage', 'sjoueurs');
|
||||
$template->assign('linkpage', 'sjoueurs');
|
||||
|
||||
if (!empty($_GET['id']) && !empty($_GET['sanc']) && (!empty($_GET['raisonmv']) || $_GET['sanc'] < 0))
|
||||
{
|
||||
$raisonmv = gpc('raisonmv');
|
||||
$id_plan = intval(gpc('id'));
|
||||
$sanc = gpc('sanc');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($raisonmv);
|
||||
|
||||
if ($sanc == 'definitif' || $sanc== 'définitif' || $sanc == 'd')
|
||||
{
|
||||
$bdd->query("UPDATE $table_user SET mv = '3', raisonmv = '$raisonmv', operateurmv = $id_user WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($_GET['id']) && !empty($_GET['sanc']) && (!empty($_GET['raisonmv']) || $_GET['sanc'] < 0)) {
|
||||
$raisonmv = gpc('raisonmv');
|
||||
$id_plan = intval(gpc('id'));
|
||||
$sanc = gpc('sanc');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($raisonmv);
|
||||
|
||||
if ($sanc == 'definitif' || $sanc== 'définitif' || $sanc == 'd') {
|
||||
$bdd->query("UPDATE $table_user SET mv = '3', raisonmv = '$raisonmv', operateurmv = $id_user WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('message', 'Le joueur a été banni définitivement !');
|
||||
}
|
||||
else
|
||||
{
|
||||
$time = time() + $sanc * 86400 - 259200;
|
||||
$bdd->query("UPDATE $table_user SET mv = '2', last_visite = $time, raisonmv = '$raisonmv', operateurmv = $id_user WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('message', 'Le joueur a été banni définitivement !');
|
||||
} else {
|
||||
$time = time() + $sanc * 86400 - 259200;
|
||||
$bdd->query("UPDATE $table_user SET mv = '2', last_visite = $time, raisonmv = '$raisonmv', operateurmv = $id_user WHERE id = $id_plan;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('message', 'Le joueur a été placé en mode vacances !');
|
||||
}
|
||||
}
|
||||
elseif (!empty($_GET['name']) && !empty($_GET['sanc']) && isset($_GET['raisonmv']))
|
||||
{
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_user WHERE pseudo = '$name';");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('message', 'Le joueur a été placé en mode vacances !');
|
||||
}
|
||||
} elseif (!empty($_GET['name']) && !empty($_GET['sanc']) && isset($_GET['raisonmv'])) {
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_user WHERE pseudo = '$name';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: '.$VAR["menu"]["sjoueur"].'&sanc='.gpc('sanc').'&raisonmv='.gpc('raisonmv').'&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
$pagea = 'sanctionU_choix';
|
||||
?>
|
||||
header('Location: '.$VAR["menu"]["sjoueur"].'&sanc='.gpc('sanc').'&raisonmv='.gpc('raisonmv').'&id='.$req['id']);
|
||||
exit;
|
||||
} else {
|
||||
$pagea = 'sanctionU_choix';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,54 +1,53 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'print';
|
||||
$titre = 'Vue des futurs alliances';
|
||||
|
||||
$template->assign('linkpage', 'snalliances');
|
||||
$template->assign('linkpage', 'snalliances');
|
||||
|
||||
//TODO tout est à faire
|
||||
|
||||
if (!empty($_GET['id']) && !empty($_GET['key']) && $_GET['key'] != 'id') {
|
||||
$pagea = 'print_key';
|
||||
$id_plan = $_GET['id'];
|
||||
$key = $_GET['key'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($id_plan);
|
||||
$chapeau->escape($key);
|
||||
$reqA = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
||||
$req = $chapeau->unique_query("DESCRIBE $table_alliances $key;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $reqA);
|
||||
$template->assign('type', explode('(', $req['Type']));
|
||||
$template->assign('idPlan', $id_plan);
|
||||
$template->assign('key', $_GET['key']);
|
||||
$pagea = 'print_key';
|
||||
$id_plan = $_GET['id'];
|
||||
$key = $_GET['key'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($id_plan);
|
||||
$chapeau->escape($key);
|
||||
$reqA = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
||||
$req = $chapeau->unique_query("DESCRIBE $table_alliances $key;");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $reqA);
|
||||
$template->assign('type', explode('(', $req['Type']));
|
||||
$template->assign('idPlan', $id_plan);
|
||||
$template->assign('key', $_GET['key']);
|
||||
} elseif (!empty($_GET['id'])) {
|
||||
$id_plan = $_GET['id'];
|
||||
if (isset($_POST['key']) && isset($_POST['mod'])) {
|
||||
$key = $_POST['key'];
|
||||
$mod = $_POST['mod'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($mod);
|
||||
$chapeau->escape($id_plan);
|
||||
$chapeau->query("UPDATE $table_alliances SET $key = '$mod' WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
}
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
} elseif (!empty($_GET['name'])) {
|
||||
$name = $_GET['name'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($name);
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE nom = '$name';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=valliances&id='.$req['id']);
|
||||
exit;
|
||||
} else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
elseif (!empty($_GET['id'])) {
|
||||
$id_plan = $_GET['id'];
|
||||
if (isset($_POST['key']) && isset($_POST['mod'])) {
|
||||
$key = $_POST['key'];
|
||||
$mod = $_POST['mod'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($mod);
|
||||
$chapeau->escape($id_plan);
|
||||
$chapeau->query("UPDATE $table_alliances SET $key = '$mod' WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
}
|
||||
$chapeau->connexion();
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE id = '$id_plan';");
|
||||
$chapeau->deconnexion();
|
||||
$template->assign('tableau', $req);
|
||||
$template->assign('idPlan', $id_plan);
|
||||
}
|
||||
elseif (!empty($_GET['name'])) {
|
||||
$name = $_GET['name'];
|
||||
$chapeau->connexion();
|
||||
$chapeau->escape($name);
|
||||
$req = $chapeau->unique_query("SELECT * FROM $table_alliances WHERE nom = '$name';");
|
||||
$chapeau->deconnexion();
|
||||
header('Location: admin.php?p=valliances&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,41 +1,37 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$titre = '!!! Supprimer joueur !!!';
|
||||
$pagea = 'erreur';
|
||||
|
||||
$template->assign('linkpage', 'djoueurs');
|
||||
$template->assign('linkpage', 'djoueurs');
|
||||
|
||||
if ($SESS->level >= 5 && !empty($_GET['id']))
|
||||
{
|
||||
$id = intval(gpc('id'));
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id;");
|
||||
if ($req && $req["auth_level"] < 4)
|
||||
{
|
||||
$bdd->query("DELETE FROM $table_mail WHERE destinataire = $id;");
|
||||
$bdd->query("DELETE FROM $table_user WHERE id = $id;");
|
||||
$bdd->query("DELETE FROM $table_flottes WHERE id_user = $id;");
|
||||
$bdd->query("DELETE FROM $table_planete WHERE id_user = $id;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('message', 'Le joueur '.$id.' ('.$req['pseudo'].') a été supprimé du jeu ainsi que toutes les données le concernant !<br />Vérifiez qu\'il ne soit pas fondateur d\'une alliance ou d\'une mission groupée.');
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
$template->assign('message', 'Le joueur n\'a pas été trouvé ou vous n\'avez pas les permissions de le supprimer !');
|
||||
}
|
||||
}
|
||||
elseif (!empty($_GET['name']))
|
||||
{
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_user WHERE pseudo = '$name';");
|
||||
$bdd->deconnexion();
|
||||
if ($SESS->level >= 5 && !empty($_GET['id'])) {
|
||||
$id = intval(gpc('id'));
|
||||
$bdd = new BDD();
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_user WHERE id = $id;");
|
||||
if ($req && $req["auth_level"] < 4) {
|
||||
$bdd->query("DELETE FROM $table_mail WHERE destinataire = $id;");
|
||||
$bdd->query("DELETE FROM $table_user WHERE id = $id;");
|
||||
$bdd->query("DELETE FROM $table_flottes WHERE id_user = $id;");
|
||||
$bdd->query("DELETE FROM $table_planete WHERE id_user = $id;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('message', 'Le joueur '.$id.' ('.$req['pseudo'].') a été supprimé du jeu ainsi que toutes les données le concernant !<br />Vérifiez qu\'il ne soit pas fondateur d\'une alliance ou d\'une mission groupée.');
|
||||
} else {
|
||||
$bdd->deconnexion();
|
||||
$template->assign('message', 'Le joueur n\'a pas été trouvé ou vous n\'avez pas les permissions de le supprimer !');
|
||||
}
|
||||
} elseif (!empty($_GET['name'])) {
|
||||
$name = gpc('name');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($name);
|
||||
$req = $bdd->unique_query("SELECT * FROM $table_user WHERE pseudo = '$name';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: '.$VAR["menu"]["djoueurs"].'&id='.$req['id']);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
$pagea = 'print_choixU';
|
||||
?>
|
||||
header('Location: '.$VAR["menu"]["djoueurs"].'&id='.$req['id']);
|
||||
exit;
|
||||
} else {
|
||||
$pagea = 'print_choixU';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,71 +1,67 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$pagea = 'version';
|
||||
$titre = 'Versions';
|
||||
|
||||
//Ajout d'une version
|
||||
if (!empty($_GET['i']) && $_GET['i'] == 'add' && $SESS->level >= 7 && !empty($_POST['version']) && !empty($_POST['contenu']))
|
||||
{
|
||||
$version = gpc('version', 'post');
|
||||
$contenu = gpc('contenu', 'post');
|
||||
$temps = time();
|
||||
$nom_user = trouvNom($SESS->values['id']);
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($version);
|
||||
$bdd->escape($contenu);
|
||||
$bdd->escape($nom_user);
|
||||
$bdd->query("INSERT INTO $table_version (version, contenu, temps, pseudo) VALUES ('$version', '$contenu', $temps, '$nom_user');");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($_GET['i']) && $_GET['i'] == 'add' && $SESS->level >= 7 && !empty($_POST['version']) && !empty($_POST['contenu'])) {
|
||||
$version = gpc('version', 'post');
|
||||
$contenu = gpc('contenu', 'post');
|
||||
$temps = time();
|
||||
$nom_user = trouvNom($SESS->values['id']);
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($version);
|
||||
$bdd->escape($contenu);
|
||||
$bdd->escape($nom_user);
|
||||
$bdd->query("INSERT INTO $table_version (version, contenu, temps, pseudo) VALUES ('$version', '$contenu', $temps, '$nom_user');");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
//Modification d'une version
|
||||
elseif (!empty($_GET['i']))
|
||||
{
|
||||
$id = intval(gpc('i'));
|
||||
if (!empty($_POST['version']) && !empty($_POST['contenu'])) {
|
||||
$version = gpc('version', 'post');
|
||||
$contenu = gpc('contenu', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($version);
|
||||
$bdd->escape($contenu);
|
||||
$bdd->query("UPDATE $table_version SET version = '$version', contenu = '$contenu' WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
elseif (!empty($_GET['i'])) {
|
||||
$id = intval(gpc('i'));
|
||||
if (!empty($_POST['version']) && !empty($_POST['contenu'])) {
|
||||
$version = gpc('version', 'post');
|
||||
$contenu = gpc('contenu', 'post');
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($version);
|
||||
$bdd->escape($contenu);
|
||||
$bdd->query("UPDATE $table_version SET version = '$version', contenu = '$contenu' WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$template->assign('mod', $bdd->unique_query("SELECT * FROM $table_version WHERE id = '$id';"));
|
||||
$template->assign('tableau', $bdd->query("SELECT * FROM $table_version ORDER BY temps DESC;"));
|
||||
$bdd->deconnexion();
|
||||
$template->assign('id', $id);
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
$bdd = new BDD();
|
||||
$template->assign('mod', $bdd->unique_query("SELECT * FROM $table_version WHERE id = '$id';"));
|
||||
$template->assign('tableau', $bdd->query("SELECT * FROM $table_version ORDER BY temps DESC;"));
|
||||
$bdd->deconnexion();
|
||||
$template->assign('id', $id);
|
||||
}
|
||||
//Suppression d'une version
|
||||
elseif (!empty($_GET['d']) && $SESS->level >= 7)
|
||||
{
|
||||
$id = intval(gpc('d'));
|
||||
$bdd = new BDD();
|
||||
$bdd->query("DELETE FROM $table_version WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
elseif (!empty($_GET['d']) && $SESS->level >= 7) {
|
||||
$id = intval(gpc('d'));
|
||||
$bdd = new BDD();
|
||||
$bdd->query("DELETE FROM $table_version WHERE id = $id;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
//Demande de mise à jour du cache
|
||||
elseif (isset($_GET['actuCache']))
|
||||
{
|
||||
Cache::del('versionsDATA');
|
||||
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd = new BDD();
|
||||
$template->assign('tableau', $bdd->query("SELECT * FROM $table_version ORDER BY temps DESC;"));
|
||||
$bdd->deconnexion();
|
||||
$template->assign('id', 'add');
|
||||
}
|
||||
?>
|
||||
elseif (isset($_GET['actuCache'])) {
|
||||
Cache::del('versionsDATA');
|
||||
|
||||
header('Location: admin.php?p=version');
|
||||
exit;
|
||||
} else {
|
||||
$bdd = new BDD();
|
||||
$template->assign('tableau', $bdd->query("SELECT * FROM $table_version ORDER BY temps DESC;"));
|
||||
$bdd->deconnexion();
|
||||
$template->assign('id', 'add');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
<?php
|
||||
if(!defined('ONYX')) exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (empty($sess->values["connected"]) && !defined("xCSRF"))
|
||||
define("xCSRF", true);
|
||||
if (empty($sess->values["connected"]) && !defined("xCSRF")) {
|
||||
define("xCSRF", true);
|
||||
}
|
||||
|
||||
//A passer a True pour dev tranquillou (pas d'envois de mail, pas de https,...)
|
||||
define("DEV", getenv("DEV"));
|
||||
|
|
@ -21,22 +24,21 @@ $SESS = new Session();
|
|||
|
||||
//Extraction des données en cache pour le header, sinon création du cache
|
||||
$header = Cache::read("headerNB");
|
||||
if (empty($header))
|
||||
{
|
||||
$bdd = new BDD();
|
||||
if (empty($header)) {
|
||||
$bdd = new BDD();
|
||||
|
||||
$nbcovie = $bdd->unique_query("SELECT COUNT(id) AS covenants FROM $table_user WHERE race = 'covenant';");
|
||||
$nbhumain = $bdd->unique_query("SELECT COUNT(id) AS humains FROM $table_user WHERE race = 'humain';");
|
||||
$enligne = $bdd->unique_query("SELECT COUNT(session) AS enligne FROM sessions WHERE active = true AND var != '0';");
|
||||
$infos = $bdd->query("SELECT * FROM $table_infoshead ORDER BY id DESC;");
|
||||
$msgdem = $bdd->unique_query("SELECT titre FROM $table_messages_demarrage ORDER BY id DESC LIMIT 1;");
|
||||
$nbcovie = $bdd->unique_query("SELECT COUNT(id) AS covenants FROM $table_user WHERE race = 'covenant';");
|
||||
$nbhumain = $bdd->unique_query("SELECT COUNT(id) AS humains FROM $table_user WHERE race = 'humain';");
|
||||
$enligne = $bdd->unique_query("SELECT COUNT(session) AS enligne FROM sessions WHERE active = true AND var != '0';");
|
||||
$infos = $bdd->query("SELECT * FROM $table_infoshead ORDER BY id DESC;");
|
||||
$msgdem = $bdd->unique_query("SELECT titre FROM $table_messages_demarrage ORDER BY id DESC LIMIT 1;");
|
||||
|
||||
$bdd->deconnexion();
|
||||
$bdd->deconnexion();
|
||||
|
||||
Cache::set("headerNB", array("count" => array($nbcovie["covenants"], $nbhumain["humains"], "cette", $enligne["enligne"]), "infos" => $infos, "messagedemarrage" => $msgdem["titre"]));
|
||||
unset($nbcovie, $nbhumain, $enligne, $infos, $msgdem, $bdd);
|
||||
Cache::set("headerNB", array("count" => array($nbcovie["covenants"], $nbhumain["humains"], "cette", $enligne["enligne"]), "infos" => $infos, "messagedemarrage" => $msgdem["titre"]));
|
||||
unset($nbcovie, $nbhumain, $enligne, $infos, $msgdem, $bdd);
|
||||
|
||||
$header = Cache::read("headerNB");
|
||||
$header = Cache::read("headerNB");
|
||||
}
|
||||
$template->assign("header", $header);
|
||||
$template->assign("version", $VAR["version"]);
|
||||
|
|
@ -49,15 +51,18 @@ define("debut_d_univers", true); //Constante pour savoir si l'on offre ou pas un
|
|||
define("nb_signatures", 4);
|
||||
|
||||
//Si l'on est pas connecté, on garde le header pour comparer lors de la connexion
|
||||
if (!empty($sess->values["connected"]))
|
||||
unset($header);
|
||||
if (!empty($sess->values["connected"])) {
|
||||
unset($header);
|
||||
}
|
||||
|
||||
//Evite les attaques CSRF
|
||||
if (DEV) { $protocole = "http"; } else { $protocole = "https"; }
|
||||
if (!empty($_SERVER["HTTP_REFERER"]) && !(preg_match('#^'.$protocole.'://'.$_SERVER['HTTP_HOST'].'#', $_SERVER["HTTP_REFERER"]) && defined("xCSRF")))
|
||||
{
|
||||
elog("Possibilité d'attaque CSRF\n".var_export($_REQUEST, TRUE), 2);
|
||||
unset($_POST, $_GET);
|
||||
$_GET = $_POST = array();
|
||||
if (DEV) {
|
||||
$protocole = "http";
|
||||
} else {
|
||||
$protocole = "https";
|
||||
}
|
||||
if (!empty($_SERVER["HTTP_REFERER"]) && !(preg_match('#^'.$protocole.'://'.$_SERVER['HTTP_HOST'].'#', $_SERVER["HTTP_REFERER"]) && defined("xCSRF"))) {
|
||||
elog("Possibilité d'attaque CSRF\n".var_export($_REQUEST, true), 2);
|
||||
unset($_POST, $_GET);
|
||||
$_GET = $_POST = array();
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,25 +1,26 @@
|
|||
<?php
|
||||
if(!defined('ONYX')) exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!defined('INDEX') || INDEX != 2)
|
||||
{
|
||||
//On inclut les classes de données
|
||||
require_once("Class/Donnees/interface.php");
|
||||
require_once("Class/Donnees/alliances_batiments.php");
|
||||
require_once("Class/Donnees/batiments.php");
|
||||
require_once("Class/Donnees/caserne.php");
|
||||
require_once("Class/Donnees/technologies.php");
|
||||
require_once("Class/Donnees/terrestre.php");
|
||||
require_once("Class/Donnees/spatial.php");
|
||||
if (!defined('INDEX') || INDEX != 2) {
|
||||
//On inclut les classes de données
|
||||
require_once("Class/Donnees/interface.php");
|
||||
require_once("Class/Donnees/alliances_batiments.php");
|
||||
require_once("Class/Donnees/batiments.php");
|
||||
require_once("Class/Donnees/caserne.php");
|
||||
require_once("Class/Donnees/technologies.php");
|
||||
require_once("Class/Donnees/terrestre.php");
|
||||
require_once("Class/Donnees/spatial.php");
|
||||
|
||||
//On inclut les classes de file d'attente
|
||||
require_once("Class/File/interface.php");
|
||||
require_once("Class/File/alliances_batiments.php");
|
||||
require_once("Class/File/batiments.php");
|
||||
require_once("Class/File/caserne.php");
|
||||
require_once("Class/File/technologies.php");
|
||||
require_once("Class/File/terrestre.php");
|
||||
require_once("Class/File/spatial.php");
|
||||
//On inclut les classes de file d'attente
|
||||
require_once("Class/File/interface.php");
|
||||
require_once("Class/File/alliances_batiments.php");
|
||||
require_once("Class/File/batiments.php");
|
||||
require_once("Class/File/caserne.php");
|
||||
require_once("Class/File/technologies.php");
|
||||
require_once("Class/File/terrestre.php");
|
||||
require_once("Class/File/spatial.php");
|
||||
}
|
||||
|
||||
//On déffinit les constantes de correspondance Champs/Array
|
||||
|
|
@ -30,4 +31,3 @@ $caserneVAR = array("soldat1", "soldat2", "soldat3", "soldat4", "sniper", "spart
|
|||
$spatialVAR = array("vaisseau_1", "vaisseau_2", "vaisseau_3", "vaisseau_4", "vaisseau_5", "vaisseau_6", "vaisseau_7", "vaisseau_8", "vaisseau_9", "vaisseau_10", "vaisseau_11", "vaisseau_12", "vaisseau_13", "vaisseau_14");
|
||||
$terrestreVAR = array("vais_0", "vais_1", "vais_2", "vais_3", "vcl_1", "vcl_2", "vcl_3", "vcl_4", "def_1", "def_2", "def_3", "def_4", "def_5", "def_6", "def_7", "def_8");
|
||||
$coeffVAR = array("coeff_mine_m", "coeff_mine_c", "coeff_mine_h", "coeff_centrale_s", "coeff_centrale_f");
|
||||
?>
|
||||
|
|
@ -1,18 +1,18 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
$bdd->reconnexion();
|
||||
$flottes = $bdd->query("SELECT id FROM $table_flottes WHERE (id_user = ".$planete->id_user." OR end_planete = ".$planete->id." OR id_alliance = ".$planete->id_alliance." OR end_planete = ".$planete->id_alliance.") AND (start_time + end_time) <= ".time()." AND last < ".(time()-10).";");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($flottes))
|
||||
{
|
||||
foreach($flottes as $flotte)
|
||||
{
|
||||
$flotte = new Flotte($flotte['id']);
|
||||
$flotte->check_mission();
|
||||
}
|
||||
if (!empty($flottes)) {
|
||||
foreach ($flottes as $flotte) {
|
||||
$flotte = new Flotte($flotte['id']);
|
||||
$flotte->check_mission();
|
||||
}
|
||||
}
|
||||
|
||||
unset($flottes, $flotte);
|
||||
?>
|
||||
|
|
@ -1,312 +1,322 @@
|
|||
<?php
|
||||
function trouvNom($id_user)
|
||||
{
|
||||
global $table_user;
|
||||
$bdd = new BDD();
|
||||
$resultat = $bdd->unique_query("SELECT pseudo FROM $table_user WHERE id = $id_user;");
|
||||
$bdd->deconnexion();
|
||||
return $resultat['pseudo'];
|
||||
global $table_user;
|
||||
$bdd = new BDD();
|
||||
$resultat = $bdd->unique_query("SELECT pseudo FROM $table_user WHERE id = $id_user;");
|
||||
$bdd->deconnexion();
|
||||
return $resultat['pseudo'];
|
||||
}
|
||||
|
||||
function linkNom($id_user)
|
||||
{
|
||||
if (is_numeric($id_user)) $nom = trouvNom($id_user);
|
||||
else $id_user = trouvId($id_user);
|
||||
return '<a href="?p=util&i='.$id_user.'">'.$nom.'</a>';
|
||||
if (is_numeric($id_user)) {
|
||||
$nom = trouvNom($id_user);
|
||||
} else {
|
||||
$id_user = trouvId($id_user);
|
||||
}
|
||||
return '<a href="?p=util&i='.$id_user.'">'.$nom.'</a>';
|
||||
}
|
||||
|
||||
function trouvInfoUser($info, $type, $donnees)
|
||||
{
|
||||
global $table_user;
|
||||
$bdd = new BDD();
|
||||
$resultat = $bdd->unique_query("SELECT ".implode(',', $donnees)." FROM $table_user WHERE $type = '$info';");
|
||||
$bdd->deconnexion();
|
||||
global $table_user;
|
||||
$bdd = new BDD();
|
||||
$resultat = $bdd->unique_query("SELECT ".implode(',', $donnees)." FROM $table_user WHERE $type = '$info';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
return $resultat;
|
||||
return $resultat;
|
||||
}
|
||||
|
||||
function affTemp($secondes)
|
||||
{
|
||||
$heures = intval($secondes/3600);
|
||||
$minutes = intval($secondes/60-($heures*60));
|
||||
if ($minutes < 10) $minutes = '0'.$minutes;
|
||||
$seconde = $secondes-($heures*3600)-($minutes*60);
|
||||
if ($seconde < 10) $seconde = '0'.$seconde;
|
||||
$heures = intval($secondes/3600);
|
||||
$minutes = intval($secondes/60-($heures*60));
|
||||
if ($minutes < 10) {
|
||||
$minutes = '0'.$minutes;
|
||||
}
|
||||
$seconde = $secondes-($heures*3600)-($minutes*60);
|
||||
if ($seconde < 10) {
|
||||
$seconde = '0'.$seconde;
|
||||
}
|
||||
|
||||
return $heures.':'.$minutes.':'.$seconde;
|
||||
return $heures.':'.$minutes.':'.$seconde;
|
||||
}
|
||||
|
||||
function sec($time)
|
||||
{
|
||||
$output = '';
|
||||
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
|
||||
foreach ($tab as $key => $value) {
|
||||
$compteur = 0;
|
||||
while ($time > ($value-1)) {
|
||||
$time = $time - $value;
|
||||
$compteur++;
|
||||
}
|
||||
if ($compteur != 0) {
|
||||
$output .= $compteur.' '.$key;
|
||||
if ($compteur > 1) $output .= 's';
|
||||
if ($value != 1) $output .= ' ';
|
||||
}
|
||||
}
|
||||
if (empty($output)) return 'Instantané';
|
||||
else return $output;
|
||||
$output = '';
|
||||
$tab = array('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
|
||||
foreach ($tab as $key => $value) {
|
||||
$compteur = 0;
|
||||
while ($time > ($value-1)) {
|
||||
$time = $time - $value;
|
||||
$compteur++;
|
||||
}
|
||||
if ($compteur != 0) {
|
||||
$output .= $compteur.' '.$key;
|
||||
if ($compteur > 1) {
|
||||
$output .= 's';
|
||||
}
|
||||
if ($value != 1) {
|
||||
$output .= ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (empty($output)) {
|
||||
return 'Instantané';
|
||||
} else {
|
||||
return $output;
|
||||
}
|
||||
}
|
||||
|
||||
function txtmission($mission)
|
||||
{
|
||||
if ($mission == 0)
|
||||
return 'Stationner';
|
||||
elseif ($mission == 1)
|
||||
return 'Transporter';
|
||||
elseif ($mission == 2)
|
||||
return 'Coloniser';
|
||||
elseif ($mission == 3)
|
||||
return 'Attaquer';
|
||||
elseif ($mission == 4)
|
||||
return 'Recycler';
|
||||
elseif ($mission == 5)
|
||||
return 'Espionner';
|
||||
elseif ($mission == 6)
|
||||
return 'Retour';
|
||||
else
|
||||
return 'Erreur';
|
||||
if ($mission == 0) {
|
||||
return 'Stationner';
|
||||
} elseif ($mission == 1) {
|
||||
return 'Transporter';
|
||||
} elseif ($mission == 2) {
|
||||
return 'Coloniser';
|
||||
} elseif ($mission == 3) {
|
||||
return 'Attaquer';
|
||||
} elseif ($mission == 4) {
|
||||
return 'Recycler';
|
||||
} elseif ($mission == 5) {
|
||||
return 'Espionner';
|
||||
} elseif ($mission == 6) {
|
||||
return 'Retour';
|
||||
} else {
|
||||
return 'Erreur';
|
||||
}
|
||||
}
|
||||
|
||||
function pillage($metal, $cristal, $hydrogene, $vfm)
|
||||
{
|
||||
$Qm = $metal / $vfm;
|
||||
$Qc = $cristal / $vfm;
|
||||
$Qh = $hydrogene / $vfm;
|
||||
$Qm = $metal / $vfm;
|
||||
$Qc = $cristal / $vfm;
|
||||
$Qh = $hydrogene / $vfm;
|
||||
|
||||
$somme = $Qm + $Qc + $Qh;
|
||||
$somme = $Qm + $Qc + $Qh;
|
||||
|
||||
if ($somme < 2)
|
||||
{
|
||||
$Fm = $metal / 2;
|
||||
$Fc = $cristal / 2;
|
||||
$Fh = $hydrogene / 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
$Fm = $Qm / $somme * $vfm;
|
||||
$Fc = $Qc / $somme * $vfm;
|
||||
$Fh = $Qh / $somme * $vfm;
|
||||
}
|
||||
if ($somme < 2) {
|
||||
$Fm = $metal / 2;
|
||||
$Fc = $cristal / 2;
|
||||
$Fh = $hydrogene / 2;
|
||||
} else {
|
||||
$Fm = $Qm / $somme * $vfm;
|
||||
$Fc = $Qc / $somme * $vfm;
|
||||
$Fh = $Qh / $somme * $vfm;
|
||||
}
|
||||
|
||||
return array(floor($Fm), floor($Fc), floor($Fh));
|
||||
return array(floor($Fm), floor($Fc), floor($Fh));
|
||||
}
|
||||
|
||||
function send_mail($admail, $sujet, $corps)
|
||||
{
|
||||
require_once("Class/phpmailer.php");
|
||||
require_once("Class/phpmailer.php");
|
||||
|
||||
$mail = new PHPmailer();
|
||||
$mail->SetLanguage('fr', ONYX."/include/Class/");
|
||||
$mail->IsSMTP();
|
||||
$mail->CharSet = "utf-8";
|
||||
$mail->Host='mail2.power-heberg.net';
|
||||
$mail->From='no-reply@anomaly-concepts.com';
|
||||
$mail->FromName='Halo-Battle';
|
||||
$mail->SMTPAuth=true;
|
||||
$mail->Username='no-reply@anomaly-concepts.com';
|
||||
$mail->Password='balamb468';
|
||||
$mail = new PHPmailer();
|
||||
$mail->SetLanguage('fr', ONYX."/include/Class/");
|
||||
$mail->IsSMTP();
|
||||
$mail->CharSet = "utf-8";
|
||||
$mail->Host='mail2.power-heberg.net';
|
||||
$mail->From='no-reply@anomaly-concepts.com';
|
||||
$mail->FromName='Halo-Battle';
|
||||
$mail->SMTPAuth=true;
|
||||
$mail->Username='no-reply@anomaly-concepts.com';
|
||||
$mail->Password='balamb468';
|
||||
|
||||
$mail->AddAddress($admail);
|
||||
$mail->AddReplyTo('nemunaire@anomaly-concepts.com');
|
||||
$mail->Subject = $sujet;
|
||||
$mail->Body = $corps;
|
||||
$mail->AddAddress($admail);
|
||||
$mail->AddReplyTo('nemunaire@anomaly-concepts.com');
|
||||
$mail->Subject = $sujet;
|
||||
$mail->Body = $corps;
|
||||
|
||||
$return = $mail->Send();
|
||||
$mail->SmtpClose();
|
||||
$return = $mail->Send();
|
||||
$mail->SmtpClose();
|
||||
|
||||
return $return;
|
||||
return $return;
|
||||
}
|
||||
|
||||
function send_mailHTML($admail, $sujet, $corps)
|
||||
{
|
||||
require_once("Class/phpmailer.php");
|
||||
require_once("Class/phpmailer.php");
|
||||
|
||||
$mail = new PHPmailer();
|
||||
$mail->SetLanguage('fr', ONYX."/include/Class/");
|
||||
$mail->IsSMTP();
|
||||
$mail->IsHTML(true);
|
||||
$mail->Host='mail2.power-heberg.net';
|
||||
$mail->From='no-reply@anomaly-concepts.com';
|
||||
$mail->FromName='Halo-Battle';
|
||||
$mail->SMTPAuth=true;
|
||||
$mail->Username='no-reply@anomaly-concepts.com';
|
||||
$mail->Password='balamb468';
|
||||
$mail = new PHPmailer();
|
||||
$mail->SetLanguage('fr', ONYX."/include/Class/");
|
||||
$mail->IsSMTP();
|
||||
$mail->IsHTML(true);
|
||||
$mail->Host='mail2.power-heberg.net';
|
||||
$mail->From='no-reply@anomaly-concepts.com';
|
||||
$mail->FromName='Halo-Battle';
|
||||
$mail->SMTPAuth=true;
|
||||
$mail->Username='no-reply@anomaly-concepts.com';
|
||||
$mail->Password='balamb468';
|
||||
|
||||
$mail->AddAddress($admail);
|
||||
$mail->AddReplyTo('nemunaire@anomaly-concepts.com');
|
||||
$mail->Subject = 'Halo-Battle :: '.$sujet;
|
||||
$mail->Body = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Halo-Battle :: '.$sujet.'</title></head><body><p>'.$corps.'<br /><br />A bientôt dans Halo-Battle,<br />Le staff</p></body></html>';
|
||||
$mail->AddAddress($admail);
|
||||
$mail->AddReplyTo('nemunaire@anomaly-concepts.com');
|
||||
$mail->Subject = 'Halo-Battle :: '.$sujet;
|
||||
$mail->Body = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html><head><title>Halo-Battle :: '.$sujet.'</title></head><body><p>'.$corps.'<br /><br />A bientôt dans Halo-Battle,<br />Le staff</p></body></html>';
|
||||
|
||||
$return = $mail->Send();
|
||||
$mail->SmtpClose();
|
||||
$return = $mail->Send();
|
||||
$mail->SmtpClose();
|
||||
|
||||
return $return;
|
||||
return $return;
|
||||
}
|
||||
|
||||
function erreur($message, $color = "red", $lien = "", $temps = 2500)
|
||||
{
|
||||
global $template, $page, $SESS;
|
||||
global $template, $page, $SESS;
|
||||
|
||||
if (!empty($page))
|
||||
$template->assign('page', $page);
|
||||
if (!empty($page)) {
|
||||
$template->assign('page', $page);
|
||||
}
|
||||
|
||||
$template->assign('message', $message);
|
||||
$template->assign('couleur',$color);
|
||||
$template->assign('message', $message);
|
||||
$template->assign('couleur', $color);
|
||||
|
||||
if (!empty($lien))
|
||||
$template->assign('scripth','<meta http-equiv="refresh" content="'.($temps/1000).'; url='.$lien.'" />');
|
||||
if (!empty($lien)) {
|
||||
$template->assign('scripth', '<meta http-equiv="refresh" content="'.($temps/1000).'; url='.$lien.'" />');
|
||||
}
|
||||
|
||||
//Si le joueur est connecté, on affiche la page d'erreur du jeu, sinon on afficher la page du cms
|
||||
if (isset($SESS->values['connected']) && $SESS->values['connected'])
|
||||
$template->display('game/erreur.tpl');
|
||||
else
|
||||
$template->display('cms/erreur.tpl');
|
||||
exit;
|
||||
//Si le joueur est connecté, on affiche la page d'erreur du jeu, sinon on afficher la page du cms
|
||||
if (isset($SESS->values['connected']) && $SESS->values['connected']) {
|
||||
$template->display('game/erreur.tpl');
|
||||
} else {
|
||||
$template->display('cms/erreur.tpl');
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
function send_mp($joueur, $titre, $message, $temps = 0, $emetteur = 0, $type = 0)
|
||||
{
|
||||
global $table_mail, $VAR;
|
||||
if (empty($temps))
|
||||
$temps = time();
|
||||
$mail = false;
|
||||
if (!is_numeric($joueur))
|
||||
{
|
||||
$joueur = trouvInfoUser($joueur, "pseudo", array("id", "mail", "envoyerMail"));
|
||||
if (($emetteur == 0 && $joueur["envoyerMail"]& 1) || ($emetteur != 0 && $joueur["envoyerMail"]& 2))
|
||||
$mail = $joueur["mail"];
|
||||
else
|
||||
$mail = false;
|
||||
global $table_mail, $VAR;
|
||||
if (empty($temps)) {
|
||||
$temps = time();
|
||||
}
|
||||
$mail = false;
|
||||
if (!is_numeric($joueur)) {
|
||||
$joueur = trouvInfoUser($joueur, "pseudo", array("id", "mail", "envoyerMail"));
|
||||
if (($emetteur == 0 && $joueur["envoyerMail"]& 1) || ($emetteur != 0 && $joueur["envoyerMail"]& 2)) {
|
||||
$mail = $joueur["mail"];
|
||||
} else {
|
||||
$mail = false;
|
||||
}
|
||||
|
||||
$joueur = $joueur["id"];
|
||||
}
|
||||
else
|
||||
{
|
||||
$joueur = trouvInfoUser($joueur, "id", array("id", "mail", "envoyerMail"));
|
||||
if (($emetteur == 0 && $joueur["envoyerMail"]& 1) || ($emetteur != 0 && $joueur["envoyerMail"]& 2))
|
||||
$mail = $joueur["mail"];
|
||||
else
|
||||
$mail = false;
|
||||
$joueur = $joueur["id"];
|
||||
} else {
|
||||
$joueur = trouvInfoUser($joueur, "id", array("id", "mail", "envoyerMail"));
|
||||
if (($emetteur == 0 && $joueur["envoyerMail"]& 1) || ($emetteur != 0 && $joueur["envoyerMail"]& 2)) {
|
||||
$mail = $joueur["mail"];
|
||||
} else {
|
||||
$mail = false;
|
||||
}
|
||||
|
||||
$joueur = $joueur["id"];
|
||||
}
|
||||
if (!is_numeric($emetteur))
|
||||
{
|
||||
$emetteur = trouvInfoUser($emetteur, "pseudo", array("id"));
|
||||
$emetteur = $emetteur['id'];
|
||||
}
|
||||
if (!empty($joueur))
|
||||
{
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($joueur);
|
||||
$bdd->escape($titre);
|
||||
$bdd->escape($message);
|
||||
$bdd->query("INSERT INTO $table_mail (destinataire, expediteur, type, sujet, contenu, temps) VALUES($joueur, $emetteur, $type, '$titre', '$message', $temps);");
|
||||
$bdd->deconnexion();
|
||||
$joueur = $joueur["id"];
|
||||
}
|
||||
if (!is_numeric($emetteur)) {
|
||||
$emetteur = trouvInfoUser($emetteur, "pseudo", array("id"));
|
||||
$emetteur = $emetteur['id'];
|
||||
}
|
||||
if (!empty($joueur)) {
|
||||
$bdd = new BDD();
|
||||
$bdd->escape($joueur);
|
||||
$bdd->escape($titre);
|
||||
$bdd->escape($message);
|
||||
$bdd->query("INSERT INTO $table_mail (destinataire, expediteur, type, sujet, contenu, temps) VALUES($joueur, $emetteur, $type, '$titre', '$message', $temps);");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if ($mail)
|
||||
{
|
||||
if ($emetteur == 0)
|
||||
send_mail($mail, "Halo-Battle :: Nouveau rapport", "Bonjour,\n\nVous recevez ce courriel suite à l'arrivée d'un nouveau rapport reçu sur votre compte de jeu du serveur ".$VAR['serveur_name'].". Le rapport concerne : \"".$titre."\". Vous pouvez utiliser le lien suivant pour voir le message ou vous connecter.\n\nhttp://".$_SERVER['HTTP_HOST']."/".$VAR["first_page"].$VAR["menu"]["messages"]."&n=recus\n\nVous pouvez désactiver ses notifications via les options de votre compte dans l'onglet \"notifications\"\n\nA bientôt dans Halo-Battle,\nLe Staff");
|
||||
else
|
||||
send_mail($mail, "Halo-Battle :: Nouveau message privé", "Bonjour,\n\nVous recevez ce courriel suite à l'arrivée d'un nouveau message privé reçu sur votre compte de jeu du serveur ".$VAR['serveur_name'].". Le sujet de ce message est : \"".$titre."\". Vous pouvez utiliser le lien suivant pour voir le message ou vous connecter.\n\nhttp://".$_SERVER['HTTP_HOST']."/".$VAR["first_page"].$VAR["menu"]["messages"]."&n=recus\n\nVous pouvez désactiver ses notifications via les options de votre compte dans l'onglet \"notifications\"\n\nA bientôt dans Halo-Battle,\nLe Staff");
|
||||
}
|
||||
}
|
||||
if ($mail) {
|
||||
if ($emetteur == 0) {
|
||||
send_mail($mail, "Halo-Battle :: Nouveau rapport", "Bonjour,\n\nVous recevez ce courriel suite à l'arrivée d'un nouveau rapport reçu sur votre compte de jeu du serveur ".$VAR['serveur_name'].". Le rapport concerne : \"".$titre."\". Vous pouvez utiliser le lien suivant pour voir le message ou vous connecter.\n\nhttp://".$_SERVER['HTTP_HOST']."/".$VAR["first_page"].$VAR["menu"]["messages"]."&n=recus\n\nVous pouvez désactiver ses notifications via les options de votre compte dans l'onglet \"notifications\"\n\nA bientôt dans Halo-Battle,\nLe Staff");
|
||||
} else {
|
||||
send_mail($mail, "Halo-Battle :: Nouveau message privé", "Bonjour,\n\nVous recevez ce courriel suite à l'arrivée d'un nouveau message privé reçu sur votre compte de jeu du serveur ".$VAR['serveur_name'].". Le sujet de ce message est : \"".$titre."\". Vous pouvez utiliser le lien suivant pour voir le message ou vous connecter.\n\nhttp://".$_SERVER['HTTP_HOST']."/".$VAR["first_page"].$VAR["menu"]["messages"]."&n=recus\n\nVous pouvez désactiver ses notifications via les options de votre compte dans l'onglet \"notifications\"\n\nA bientôt dans Halo-Battle,\nLe Staff");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function gen_mdp($nbchar)
|
||||
{
|
||||
$liste = "abcdefghijklmnopqrstuvwxyz123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
$code = "";
|
||||
for($i = 0; $i < $nbchar; $i++)
|
||||
{
|
||||
$code .= $liste[rand(0,60)];
|
||||
}
|
||||
$liste = "abcdefghijklmnopqrstuvwxyz123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
$code = "";
|
||||
for ($i = 0; $i < $nbchar; $i++) {
|
||||
$code .= $liste[rand(0, 60)];
|
||||
}
|
||||
|
||||
return $code;
|
||||
return $code;
|
||||
}
|
||||
|
||||
function check_mdp($mdp, $pseudo = null, $conf=null)
|
||||
{
|
||||
if (isset($conf) && $conf !== $mdp)
|
||||
return "Le mot de passe et sa confirmation sont différent";
|
||||
elseif (strlen($mdp) < 7)
|
||||
return "Mot de passe trop court, il doit faire au moins 7 caractères.";
|
||||
elseif (ctype_digit($mdp))
|
||||
return "Le mot de passe ne doit pas contenir que des chiffres";
|
||||
elseif (!empty($pseudo) && strpos($mdp, $pseudo))
|
||||
return "Votre mot de passe ne doit pas être une partie de votre nom d'utilisateur";
|
||||
elseif (!empty($pseudo) && strpos($pseudo, $mdp))
|
||||
return "Votre nom d'utilisateur ne doit pas être une partie de votre mot de passe";
|
||||
elseif (strpos($mdp, "halo"))
|
||||
return "Le mot de passe ne peut pas contenir le mot halo !";
|
||||
elseif (preg_match("#azer|qwer|zert|wert|erty|rtyu|tyui|yuio|uiop|poiu|oiuy|iuyt|uytr|ytre|trez|trew|reza|rewq|qsdf|asdf|sdfg|dfgh|fghj|ghjk|hjkl|jklm|mlkj|lkjh|kjhg|jhgf|hgfd|gfds|fdsq|fdsa|wxcv|vcxw|xcvb|bvcx|cvbn|nbvc|vbnm|mnbv|123|234|345|456|567|678|789|987|876|765|654|543|432|321|210|012#iU", $mdp, $osef))
|
||||
return "Ayez plus de créativité pour définir votre mot de passe, les lettres ou chiffres du clavier qui se suivent ne sont pas une bonne sécurité !";
|
||||
else
|
||||
return $mdp;
|
||||
if (isset($conf) && $conf !== $mdp) {
|
||||
return "Le mot de passe et sa confirmation sont différent";
|
||||
} elseif (strlen($mdp) < 7) {
|
||||
return "Mot de passe trop court, il doit faire au moins 7 caractères.";
|
||||
} elseif (ctype_digit($mdp)) {
|
||||
return "Le mot de passe ne doit pas contenir que des chiffres";
|
||||
} elseif (!empty($pseudo) && strpos($mdp, $pseudo)) {
|
||||
return "Votre mot de passe ne doit pas être une partie de votre nom d'utilisateur";
|
||||
} elseif (!empty($pseudo) && strpos($pseudo, $mdp)) {
|
||||
return "Votre nom d'utilisateur ne doit pas être une partie de votre mot de passe";
|
||||
} elseif (strpos($mdp, "halo")) {
|
||||
return "Le mot de passe ne peut pas contenir le mot halo !";
|
||||
} elseif (preg_match("#azer|qwer|zert|wert|erty|rtyu|tyui|yuio|uiop|poiu|oiuy|iuyt|uytr|ytre|trez|trew|reza|rewq|qsdf|asdf|sdfg|dfgh|fghj|ghjk|hjkl|jklm|mlkj|lkjh|kjhg|jhgf|hgfd|gfds|fdsq|fdsa|wxcv|vcxw|xcvb|bvcx|cvbn|nbvc|vbnm|mnbv|123|234|345|456|567|678|789|987|876|765|654|543|432|321|210|012#iU", $mdp, $osef)) {
|
||||
return "Ayez plus de créativité pour définir votre mot de passe, les lettres ou chiffres du clavier qui se suivent ne sont pas une bonne sécurité !";
|
||||
} else {
|
||||
return $mdp;
|
||||
}
|
||||
}
|
||||
|
||||
function mdp($nom, $mdp, $alea = null)
|
||||
{
|
||||
if (empty($alea))
|
||||
{
|
||||
$alea = substr(random(1024), 0, 255);
|
||||
return array(hash('whirlpool', cxor(strtoupper($nom).':'.$mdp.'♂♪',$alea)), $alea);
|
||||
}
|
||||
else
|
||||
return hash('whirlpool', cxor(strtoupper($nom).':'.$mdp.'♂♪',$alea));
|
||||
if (empty($alea)) {
|
||||
$alea = substr(random(1024), 0, 255);
|
||||
return array(hash('whirlpool', cxor(strtoupper($nom).':'.$mdp.'♂♪', $alea)), $alea);
|
||||
} else {
|
||||
return hash('whirlpool', cxor(strtoupper($nom).':'.$mdp.'♂♪', $alea));
|
||||
}
|
||||
}
|
||||
|
||||
function redirection($url)
|
||||
{
|
||||
header('Location: '.$url);
|
||||
print '<meta http-equiv="refresh" content="0; url='.$url.'" />';
|
||||
exit;
|
||||
header('Location: '.$url);
|
||||
print '<meta http-equiv="refresh" content="0; url='.$url.'" />';
|
||||
exit;
|
||||
}
|
||||
|
||||
function slots($id_user)
|
||||
{
|
||||
global $table_flottes, $table_planete;
|
||||
global $table_flottes, $table_planete;
|
||||
|
||||
$bdd = new BDD();
|
||||
$flottes = $bdd->unique_query("SELECT COUNT(id) AS cnt FROM $table_flottes WHERE id_user = $id_user;");
|
||||
$colonies = $bdd->unique_query("SELECT COUNT(id) AS cnt FROM $table_planete WHERE id_user = $id_user;");
|
||||
$bdd->deconnexion();
|
||||
$bdd = new BDD();
|
||||
$flottes = $bdd->unique_query("SELECT COUNT(id) AS cnt FROM $table_flottes WHERE id_user = $id_user;");
|
||||
$colonies = $bdd->unique_query("SELECT COUNT(id) AS cnt FROM $table_planete WHERE id_user = $id_user;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
return (ceil(count($colonies["cnt"])/2 + 1) - $flottes["cnt"]);
|
||||
return (ceil(count($colonies["cnt"])/2 + 1) - $flottes["cnt"]);
|
||||
}
|
||||
|
||||
function limite($txt, $limit)
|
||||
{
|
||||
if (strlen($txt) > $limit)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
if (strlen($txt) > $limit) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function bourse_calcPrixBase($dispo, $nb = 1000, $rate = 2)
|
||||
{
|
||||
if ($nb > 1000)
|
||||
{
|
||||
$prix = 0;
|
||||
for($i = 0; $i < $nb; $i+=1000)
|
||||
{
|
||||
$prix += bourse_calcPrixBase($dispo-$i, 1000, $rate);
|
||||
}
|
||||
$prix += bourse_calcPrixBase($dispo-$i, $dispo%1000, $rate);
|
||||
return $prix;
|
||||
}
|
||||
else
|
||||
return ceil(pow($dispo, -0.1) * $nb * $rate);
|
||||
//return pow($dispo, -0.1) * 200; //Prix de base ...
|
||||
if ($nb > 1000) {
|
||||
$prix = 0;
|
||||
for ($i = 0; $i < $nb; $i+=1000) {
|
||||
$prix += bourse_calcPrixBase($dispo-$i, 1000, $rate);
|
||||
}
|
||||
$prix += bourse_calcPrixBase($dispo-$i, $dispo%1000, $rate);
|
||||
return $prix;
|
||||
} else {
|
||||
return ceil(pow($dispo, -0.1) * $nb * $rate);
|
||||
}
|
||||
//return pow($dispo, -0.1) * 200; //Prix de base ...
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$page = 'accueil';
|
||||
$titre = 'Accueil';
|
||||
|
||||
|
|
@ -10,30 +13,26 @@ $bdd->reconnexion();
|
|||
//On regarde si le joueur a une flotte en vue
|
||||
$radar = array();
|
||||
$detect = 86400;
|
||||
foreach($queryPlanetes as $planeteJoueur)
|
||||
{
|
||||
$end_id = $planeteJoueur['id'];
|
||||
$radar[] = array($bdd->query("SELECT F.mission, F.start_planete, F.start_time, F.end_time, F.start_time + F.end_time - ".time()." AS arrive_time, P.nom_planete, P.galaxie as start_galaxie, P.ss as start_ss, P.position as start_position, U.pseudo FROM $table_flottes F INNER JOIN $table_planete P ON P.id = F.start_planete INNER JOIN $table_user U ON U.id = P.id_user WHERE F.statut != '1' AND F.end_planete = '$end_id' AND F.id_user != $id_user AND F.start_time + F.end_time - ".time()." <= $detect;"), array($planeteJoueur['nom_planete'], $planeteJoueur['galaxie'], $planeteJoueur['ss'], $planeteJoueur['position']));
|
||||
}
|
||||
foreach ($queryPlanetes as $planeteJoueur) {
|
||||
$end_id = $planeteJoueur['id'];
|
||||
$radar[] = array($bdd->query("SELECT F.mission, F.start_planete, F.start_time, F.end_time, F.start_time + F.end_time - ".time()." AS arrive_time, P.nom_planete, P.galaxie as start_galaxie, P.ss as start_ss, P.position as start_position, U.pseudo FROM $table_flottes F INNER JOIN $table_planete P ON P.id = F.start_planete INNER JOIN $table_user U ON U.id = P.id_user WHERE F.statut != '1' AND F.end_planete = '$end_id' AND F.id_user != $id_user AND F.start_time + F.end_time - ".time()." <= $detect;"), array($planeteJoueur['nom_planete'], $planeteJoueur['galaxie'], $planeteJoueur['ss'], $planeteJoueur['position']));
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
$template->assign('radar',$radar);
|
||||
$template->assign('radar', $radar);
|
||||
//$template->assign('alliance', $alli);
|
||||
unset($nbPlan, $end_id, $radar, $alli);
|
||||
|
||||
if (SURFACE == "planete") {
|
||||
//Affichage des informations sur la planète
|
||||
$template->assign('diametre', $planete->cases * 92);
|
||||
$template->assign('points', $planete->points);
|
||||
$template->assign('fileBat', $planete->file_bat->printFile($planete));
|
||||
$template->assign('fileCas', $planete->file_cas->printFile($planete));
|
||||
$template->assign('fileVais', $planete->file_vais->printFile($planete));
|
||||
$template->assign('fileTer', $planete->file_ter->printFile($planete));
|
||||
$template->assign('fileTech', $planete->file_tech->printFile($planete));
|
||||
//Affichage des informations sur la planète
|
||||
$template->assign('diametre', $planete->cases * 92);
|
||||
$template->assign('points', $planete->points);
|
||||
$template->assign('fileBat', $planete->file_bat->printFile($planete));
|
||||
$template->assign('fileCas', $planete->file_cas->printFile($planete));
|
||||
$template->assign('fileVais', $planete->file_vais->printFile($planete));
|
||||
$template->assign('fileTer', $planete->file_ter->printFile($planete));
|
||||
$template->assign('fileTech', $planete->file_tech->printFile($planete));
|
||||
} else {
|
||||
//On charge l'utilisateur pour récupérer son pseudo et l'afficher sur la page d'accueil
|
||||
$planete->fondateur = new User($planete->fondateur);
|
||||
$planete->loadDetails();
|
||||
}
|
||||
else
|
||||
{
|
||||
//On charge l'utilisateur pour récupérer son pseudo et l'afficher sur la page d'accueil
|
||||
$planete->fondateur = new User($planete->fondateur);
|
||||
$planete->loadDetails();
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,20 +1,20 @@
|
|||
<?php
|
||||
if(!defined('ONYX')) exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (!empty($_GET['v']))
|
||||
if (!empty($_GET['v'])) {
|
||||
include('game/alliances/voir.php');
|
||||
elseif (!empty($_GET['signer']))
|
||||
} elseif (!empty($_GET['signer'])) {
|
||||
include('game/alliances/signer.php');
|
||||
elseif (!empty($planete->id_alliance))
|
||||
{
|
||||
$SESS->values['idPlan'] = 0;
|
||||
$SESS->values['idAsteroide'] = $planete->id_alliance;
|
||||
$SESS->values['isolement'] = 0;
|
||||
$SESS->put();
|
||||
redirection("?p=accueil");
|
||||
}
|
||||
elseif (!empty($_GET['postuler']))
|
||||
} elseif (!empty($planete->id_alliance)) {
|
||||
$SESS->values['idPlan'] = 0;
|
||||
$SESS->values['idAsteroide'] = $planete->id_alliance;
|
||||
$SESS->values['isolement'] = 0;
|
||||
$SESS->put();
|
||||
redirection("?p=accueil");
|
||||
} elseif (!empty($_GET['postuler'])) {
|
||||
include('game/alliances/postuler.php');
|
||||
else
|
||||
} else {
|
||||
include('game/alliances/sans.php');
|
||||
?>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
$planete->loadDetails();
|
||||
if (!empty($planete->url_chat))
|
||||
{
|
||||
//On vérifie que le joueur ait les permissions requises
|
||||
if ($planete->permissions_alliance &256)
|
||||
$page = "alliance/chat_irc";
|
||||
else
|
||||
erreur("Vous n'avez pas le grade requis pour accéder au chat de l'alliance.");
|
||||
if (!empty($planete->url_chat)) {
|
||||
//On vérifie que le joueur ait les permissions requises
|
||||
if ($planete->permissions_alliance &256) {
|
||||
$page = "alliance/chat_irc";
|
||||
} else {
|
||||
erreur("Vous n'avez pas le grade requis pour accéder au chat de l'alliance.");
|
||||
}
|
||||
} else {
|
||||
$page = "alliance/chat_ajax";
|
||||
}
|
||||
else
|
||||
{
|
||||
$page = "alliance/chat_ajax";
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,310 +1,277 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
$gestion = strtolower(gpc("g"));
|
||||
if ($gestion == "grades")
|
||||
{
|
||||
$page = 'alliance/gestion_grades';
|
||||
if ($gestion == "grades") {
|
||||
$page = 'alliance/gestion_grades';
|
||||
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &128))
|
||||
erreur("Vous n'avez pas le grade nécessaire pour modifier les grades !");
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &128)) {
|
||||
erreur("Vous n'avez pas le grade nécessaire pour modifier les grades !");
|
||||
}
|
||||
|
||||
$id = intval(gpc("i"));
|
||||
$del = intval(gpc("d"));
|
||||
$id = intval(gpc("i"));
|
||||
$del = intval(gpc("d"));
|
||||
|
||||
if (!empty($id) && gpc("nom", "post"))
|
||||
{
|
||||
$nom = gpc("nom", "post");
|
||||
$auth = intval(gpc("gbats", "post")) + intval(gpc("gvais", "post"))*2 + intval(gpc("gflot", "post"))*4 + intval(gpc("gdipl", "post"))*8 + intval(gpc("gcred", "post"))*16 + intval(gpc("gmemb", "post"))*32 + intval(gpc("gwing", "post"))*64 + intval(gpc("galli", "post"))*128 + intval(gpc("gchat", "post"))*256 + intval(gpc("gmess", "post"))*512;
|
||||
if (!empty($id) && gpc("nom", "post")) {
|
||||
$nom = gpc("nom", "post");
|
||||
$auth = intval(gpc("gbats", "post")) + intval(gpc("gvais", "post"))*2 + intval(gpc("gflot", "post"))*4 + intval(gpc("gdipl", "post"))*8 + intval(gpc("gcred", "post"))*16 + intval(gpc("gmemb", "post"))*32 + intval(gpc("gwing", "post"))*64 + intval(gpc("galli", "post"))*128 + intval(gpc("gchat", "post"))*256 + intval(gpc("gmess", "post"))*512;
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($nom);
|
||||
$bdd->query("UPDATE $table_alliances_grade SET nom = '$nom', auth = $auth WHERE id = $id AND id_alliance = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($nom);
|
||||
$bdd->query("UPDATE $table_alliances_grade SET nom = '$nom', auth = $auth WHERE id = $id AND id_alliance = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: ?p=gestion&g=grades');
|
||||
exit;
|
||||
}
|
||||
elseif (gpc("nom", "post"))
|
||||
{
|
||||
$nom = gpc("nom", "post");
|
||||
$auth = intval(gpc("gbats", "post")) + intval(gpc("gvais", "post"))*2 + intval(gpc("gflot", "post"))*4 + intval(gpc("gdipl", "post"))*8 + intval(gpc("gcred", "post"))*16 + intval(gpc("gmemb", "post"))*32 + intval(gpc("gwing", "post"))*64 + intval(gpc("galli", "post"))*128;
|
||||
header('Location: ?p=gestion&g=grades');
|
||||
exit;
|
||||
} elseif (gpc("nom", "post")) {
|
||||
$nom = gpc("nom", "post");
|
||||
$auth = intval(gpc("gbats", "post")) + intval(gpc("gvais", "post"))*2 + intval(gpc("gflot", "post"))*4 + intval(gpc("gdipl", "post"))*8 + intval(gpc("gcred", "post"))*16 + intval(gpc("gmemb", "post"))*32 + intval(gpc("gwing", "post"))*64 + intval(gpc("galli", "post"))*128;
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($nom);
|
||||
$bdd->query("INSERT INTO $table_alliances_grade (id_alliance, nom, auth) VALUES (".$planete->id.", '$nom', $auth);");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($nom);
|
||||
$bdd->query("INSERT INTO $table_alliances_grade (id_alliance, nom, auth) VALUES (".$planete->id.", '$nom', $auth);");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: ?p=gestion&g=grades');
|
||||
exit;
|
||||
}
|
||||
elseif (!empty($id))
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$grade = $bdd->unique_query("SELECT id, nom, auth FROM $table_alliances_grade WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("grade_mod", $grade);
|
||||
}
|
||||
elseif (!empty($del))
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$grade = $bdd->query("DELETE FROM $table_alliances_grade WHERE id_alliance = ".$planete->id." AND id = $del;");
|
||||
$bdd->deconnexion();
|
||||
header('Location: ?p=gestion&g=grades');
|
||||
exit;
|
||||
} elseif (!empty($id)) {
|
||||
$bdd->reconnexion();
|
||||
$grade = $bdd->unique_query("SELECT id, nom, auth FROM $table_alliances_grade WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("grade_mod", $grade);
|
||||
} elseif (!empty($del)) {
|
||||
$bdd->reconnexion();
|
||||
$grade = $bdd->query("DELETE FROM $table_alliances_grade WHERE id_alliance = ".$planete->id." AND id = $del;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: ?p=gestion&g=grades');
|
||||
exit;
|
||||
}
|
||||
header('Location: ?p=gestion&g=grades');
|
||||
exit;
|
||||
}
|
||||
|
||||
$bdd->reconnexion();
|
||||
$grades = $bdd->query("SELECT id, id_alliance, nom, auth FROM $table_alliances_grade WHERE id_alliance = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("grades", $grades);
|
||||
$bdd->reconnexion();
|
||||
$grades = $bdd->query("SELECT id, id_alliance, nom, auth FROM $table_alliances_grade WHERE id_alliance = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("grades", $grades);
|
||||
|
||||
unset($grades, $id, $del);
|
||||
}
|
||||
unset($grades, $id, $del);
|
||||
} elseif ($gestion == "alliance" || ($gestion == "wings" && !empty($planete->wing))) {
|
||||
$page = 'alliance/gestion_alliance';
|
||||
|
||||
elseif ($gestion == "alliance" || ($gestion == "wings" && !empty($planete->wing)))
|
||||
{
|
||||
$page = 'alliance/gestion_alliance';
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &128)) {
|
||||
erreur("Vous n'avez pas le grade nécessaire pour modifier les paramètres de l'alliance !");
|
||||
}
|
||||
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &128))
|
||||
erreur("Vous n'avez pas le grade nécessaire pour modifier les paramètres de l'alliance !");
|
||||
if (isset($_POST["asteroide_name"])) {
|
||||
$asteroide_name = gpc("asteroide_name", "post");
|
||||
$planete->nom_asteroide = $asteroide_name;
|
||||
$planete->modif[] = "nom_asteroide";
|
||||
} elseif (isset($_POST["texte_interne"])) {
|
||||
$texte_interne = gpc("texte_interne", "post");
|
||||
$defcon = intval(gpc("defcon", "post"));
|
||||
$defcon_txt = gpc("defcon_txt", "post");
|
||||
|
||||
if (isset($_POST["asteroide_name"]))
|
||||
{
|
||||
$asteroide_name = gpc("asteroide_name", "post");
|
||||
$planete->nom_asteroide = $asteroide_name;
|
||||
$planete->modif[] = "nom_asteroide";
|
||||
}
|
||||
elseif (isset($_POST["texte_interne"]))
|
||||
{
|
||||
$texte_interne = gpc("texte_interne", "post");
|
||||
$defcon = intval(gpc("defcon", "post"));
|
||||
$defcon_txt = gpc("defcon_txt", "post");
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($texte_interne);
|
||||
$bdd->escape($defcon_txt);
|
||||
$bdd->query("UPDATE $table_alliances SET texte_interne = '$texte_interne', defcon = $defcon, defcon_txt = '$defcon_txt' WHERE id = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
} elseif (isset($_POST["url_forum"])) {
|
||||
$url_forum = gpc("url_forum", "post");
|
||||
$url_chat = gpc("url_chat", "post");
|
||||
$port_chat = intval(gpc("port_chat", "post"));
|
||||
$chan_chat = gpc("chan_chat", "post");
|
||||
$pass_chat = gpc("pass_chat", "post");
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($texte_interne);
|
||||
$bdd->escape($defcon_txt);
|
||||
$bdd->query("UPDATE $table_alliances SET texte_interne = '$texte_interne', defcon = $defcon, defcon_txt = '$defcon_txt' WHERE id = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
elseif (isset($_POST["url_forum"]))
|
||||
{
|
||||
$url_forum = gpc("url_forum", "post");
|
||||
$url_chat = gpc("url_chat", "post");
|
||||
$port_chat = intval(gpc("port_chat", "post"));
|
||||
$chan_chat = gpc("chan_chat", "post");
|
||||
$pass_chat = gpc("pass_chat", "post");
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($url_forum);
|
||||
$bdd->escape($url_chat);
|
||||
$bdd->escape($chan_chat);
|
||||
$bdd->escape($pass_chat);
|
||||
$bdd->query("UPDATE $table_alliances SET url_forum = '$url_forum', url_chat = '$url_chat', port_chat = $port_chat, chan_chat = '$chan_chat', pass_chat = '$pass_chat' WHERE id = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
} elseif (isset($_POST["message_inscription"])) {
|
||||
$etatinscriptions = intval(gpc("etatinscriptions", "post"));
|
||||
$message_inscription = gpc("message_inscription", "post");
|
||||
$presentation = gpc("presentation", "post");
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($url_forum);
|
||||
$bdd->escape($url_chat);
|
||||
$bdd->escape($chan_chat);
|
||||
$bdd->escape($pass_chat);
|
||||
$bdd->query("UPDATE $table_alliances SET url_forum = '$url_forum', url_chat = '$url_chat', port_chat = $port_chat, chan_chat = '$chan_chat', pass_chat = '$pass_chat' WHERE id = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
elseif (isset($_POST["message_inscription"]))
|
||||
{
|
||||
$etatinscriptions = intval(gpc("etatinscriptions", "post"));
|
||||
$message_inscription = gpc("message_inscription", "post");
|
||||
$presentation = gpc("presentation", "post");
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($url_forum);
|
||||
$bdd->escape($url_chat);
|
||||
$bdd->escape($chan_chat);
|
||||
$bdd->query("UPDATE $table_alliances SET etatinscriptions = '$etatinscriptions', message_inscription = '$message_inscription', presentation = '$presentation' WHERE id = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
} elseif (isset($_POST["newfondateur"]) && $planete->fondateur == $planete->id_user) {
|
||||
//On vérifie que le joueur demandé existe bien et fasse bien parti de l'alliance
|
||||
$bdd->reconnexion();
|
||||
$membre = $bdd->unique_query("SELECT id_alliance FROM $table_user WHERE id != ".intval(gpc('newfondateur', 'post')).";");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($url_forum);
|
||||
$bdd->escape($url_chat);
|
||||
$bdd->escape($chan_chat);
|
||||
$bdd->query("UPDATE $table_alliances SET etatinscriptions = '$etatinscriptions', message_inscription = '$message_inscription', presentation = '$presentation' WHERE id = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
elseif (isset($_POST["newfondateur"]) && $planete->fondateur == $planete->id_user)
|
||||
{
|
||||
//On vérifie que le joueur demandé existe bien et fasse bien parti de l'alliance
|
||||
$bdd->reconnexion();
|
||||
$membre = $bdd->unique_query("SELECT id_alliance FROM $table_user WHERE id != ".intval(gpc('newfondateur', 'post')).";");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($membre)) {
|
||||
$planete->fondateur = intval(gpc('newfondateur', 'post'));
|
||||
$planete->modif[] = "fondateur";
|
||||
erreur("Fondateur changé avec succès.", "green");
|
||||
} else {
|
||||
erreur("Impossible de donner les droits de fondateur à ce joueur !");
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($membre))
|
||||
{
|
||||
$planete->fondateur = intval(gpc('newfondateur', 'post'));
|
||||
$planete->modif[] = "fondateur";
|
||||
erreur("Fondateur changé avec succès.", "green");
|
||||
}
|
||||
else
|
||||
erreur("Impossible de donner les droits de fondateur à ce joueur !");
|
||||
}
|
||||
$planete->loadDetails();
|
||||
|
||||
$planete->loadDetails();
|
||||
//On charge la liste des utilisateurs de l'alliance si besoin
|
||||
$bdd->reconnexion();
|
||||
$membres = $bdd->query("SELECT id, pseudo FROM $table_user WHERE id_alliance = ".$planete->id." AND id != ".$planete->fondateur.";");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("membres", $membres);
|
||||
unset($membres);
|
||||
} elseif ($gestion == "wings") {
|
||||
$page = 'alliance/gestion_wing';
|
||||
|
||||
//On charge la liste des utilisateurs de l'alliance si besoin
|
||||
$bdd->reconnexion();
|
||||
$membres = $bdd->query("SELECT id, pseudo FROM $table_user WHERE id_alliance = ".$planete->id." AND id != ".$planete->fondateur.";");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("membres", $membres);
|
||||
unset($membres);
|
||||
}
|
||||
elseif ($gestion == "wings")
|
||||
{
|
||||
$page = 'alliance/gestion_wing';
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &64)) {
|
||||
erreur("Vous n'avez pas le grade nécessaire pour gérer les wings !");
|
||||
}
|
||||
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &64))
|
||||
erreur("Vous n'avez pas le grade nécessaire pour gérer les wings !");
|
||||
if (!empty($_POST["nom"])) {
|
||||
$fondateur = gpc("fondateur", "post");
|
||||
$nom = gpc("nom", "post");
|
||||
$tag = strtoupper(gpc("tag", "post"));
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($fondateur);
|
||||
$bdd->escape($nom);
|
||||
$bdd->escape($tag);
|
||||
$user = $bdd->unique_query("SELECT id, pseudo FROM $table_user WHERE pseudo = '$fondateur' AND id_alliance = 0;");
|
||||
$alliances = $bdd->query("SELECT id FROM $table_alliances WHERE nom_alliance = '$nom' OR tag = '$tag';");
|
||||
$wings = $bdd->unique_query("SELECT COUNT(id) AS nb FROM $table_alliances WHERE galaxie = ".$planete->galaxie." AND ss = ".$planete->ss.";");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($_POST["nom"]))
|
||||
{
|
||||
$fondateur = gpc("fondateur", "post");
|
||||
$nom = gpc("nom", "post");
|
||||
$tag = strtoupper(gpc("tag", "post"));
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($fondateur);
|
||||
$bdd->escape($nom);
|
||||
$bdd->escape($tag);
|
||||
$user = $bdd->unique_query("SELECT id, pseudo FROM $table_user WHERE pseudo = '$fondateur' AND id_alliance = 0;");
|
||||
$alliances = $bdd->query("SELECT id FROM $table_alliances WHERE nom_alliance = '$nom' OR tag = '$tag';");
|
||||
$wings = $bdd->unique_query("SELECT COUNT(id) AS nb FROM $table_alliances WHERE galaxie = ".$planete->galaxie." AND ss = ".$planete->ss.";");
|
||||
$bdd->deconnexion();
|
||||
if (!empty($alliances)) {
|
||||
erreur("Une alliance porte déjà ce nom ou ce tag. Veuillez en choisir un autre.");
|
||||
} elseif (!empty($user)) {
|
||||
$race = gpc("race", "post");
|
||||
if (!preg_match("#^[A-Za-z0-9èéàùûüôöç'_ -]{5,24}$#ui", $nom)) {
|
||||
erreur("Le nom d'alliance que vous avez choisi n'est pas valide :<br />il doit avoir entre 5 et 24 caractères (certains accents sont autorisés, mais aucun caractères spéciaux) !", "red");
|
||||
} elseif (!preg_match("#^[A-Za-z0-9]{3,5}$#ui", $tag)) {
|
||||
erreur("Le tag de wing que vous avez choisi n'est pas valide :<br />il doit avoir entre 3 et 5 lettres (sans accents) ou chiffres !", "red");
|
||||
} elseif ($race != "humain" && $race != "covenant") {
|
||||
erreur("La race de la wing est incorrecte !");
|
||||
}
|
||||
|
||||
if (!empty($alliances))
|
||||
erreur("Une alliance porte déjà ce nom ou ce tag. Veuillez en choisir un autre.");
|
||||
elseif (!empty($user))
|
||||
{
|
||||
$race = gpc("race", "post");
|
||||
if (!preg_match("#^[A-Za-z0-9èéàùûüôöç'_ -]{5,24}$#ui", $nom))
|
||||
erreur("Le nom d'alliance que vous avez choisi n'est pas valide :<br />il doit avoir entre 5 et 24 caractères (certains accents sont autorisés, mais aucun caractères spéciaux) !", "red");
|
||||
elseif (!preg_match("#^[A-Za-z0-9]{3,5}$#ui", $tag))
|
||||
erreur("Le tag de wing que vous avez choisi n'est pas valide :<br />il doit avoir entre 3 et 5 lettres (sans accents) ou chiffres !", "red");
|
||||
elseif ($race != "humain" && $race != "covenant")
|
||||
erreur("La race de la wing est incorrecte !");
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($race);
|
||||
$bdd->query("INSERT INTO $table_alliances (race, sante, nom_alliance, tag, galaxie, ss, wing) VALUES ('$race', 1, '$nom', '$tag', ".$planete->galaxie.", ".$planete->ss.", ".$wings['nb'].")");
|
||||
$affected = $bdd->affected();
|
||||
$bdd->deconnexion();
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($race);
|
||||
$bdd->query("INSERT INTO $table_alliances (race, sante, nom_alliance, tag, galaxie, ss, wing) VALUES ('$race', 1, '$nom', '$tag', ".$planete->galaxie.", ".$planete->ss.", ".$wings['nb'].")");
|
||||
$affected = $bdd->affected();
|
||||
$bdd->deconnexion();
|
||||
|
||||
if ($affected)
|
||||
{
|
||||
send_mp($user['id'], "Création d'une wing pour l'alliance [".$planete->tag."] ".$planete->nom_alliance, "L'alliance [".$planete->tag."] ".$planete->nom_alliance." vous propose de devenir capitaine de la wing [".$tag."] ".$nom.".<br /><br />Si vous acceptez le poste, cliquez sur le lien suivant : <a href=\"\">ce lien</a>");
|
||||
erreur("Un message vient d'être envoyé à ".$user["pseudo"].". Lorsqu'il aura accepté son poste, la création de la wing sera terminée et les premiers membres pourront s'y inscrire.", "green");
|
||||
}
|
||||
else
|
||||
erreur("Une erreur s'est produite lors de la création de la wing. Si le problème percisite, contacter un opérateur.");
|
||||
}
|
||||
else
|
||||
erreur("Impossible de trouver le nom de ce joueur. Vérifiez que celui-ci n'appartient actuellement à aucune alliance.<br />Impossible de créer une wing sans fondateur valide.");
|
||||
}
|
||||
if ($affected) {
|
||||
send_mp($user['id'], "Création d'une wing pour l'alliance [".$planete->tag."] ".$planete->nom_alliance, "L'alliance [".$planete->tag."] ".$planete->nom_alliance." vous propose de devenir capitaine de la wing [".$tag."] ".$nom.".<br /><br />Si vous acceptez le poste, cliquez sur le lien suivant : <a href=\"\">ce lien</a>");
|
||||
erreur("Un message vient d'être envoyé à ".$user["pseudo"].". Lorsqu'il aura accepté son poste, la création de la wing sera terminée et les premiers membres pourront s'y inscrire.", "green");
|
||||
} else {
|
||||
erreur("Une erreur s'est produite lors de la création de la wing. Si le problème percisite, contacter un opérateur.");
|
||||
}
|
||||
} else {
|
||||
erreur("Impossible de trouver le nom de ce joueur. Vérifiez que celui-ci n'appartient actuellement à aucune alliance.<br />Impossible de créer une wing sans fondateur valide.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//On charge la liste des wings
|
||||
$bdd->reconnexion();
|
||||
$wings = $bdd->query("SELECT A.id, A.race, A.nom_alliance, A.tag, COUNT(U.id) AS nbMembres, V.id AS id_fondateur, V.pseudo AS pseudo_fondateur FROM $table_alliances A LEFT JOIN $table_user U ON U.id_alliance = A.id LEFT JOIN $table_user V ON V.id = A.fondateur WHERE galaxie = ".$planete->galaxie." AND ss = ".$planete->ss." AND wing != 0 GROUP BY A.id;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("wings", $wings);
|
||||
unset($wings);
|
||||
}
|
||||
else
|
||||
{
|
||||
$page = 'alliance/gestion_membres';
|
||||
$gestion = "membres";
|
||||
//On charge la liste des wings
|
||||
$bdd->reconnexion();
|
||||
$wings = $bdd->query("SELECT A.id, A.race, A.nom_alliance, A.tag, COUNT(U.id) AS nbMembres, V.id AS id_fondateur, V.pseudo AS pseudo_fondateur FROM $table_alliances A LEFT JOIN $table_user U ON U.id_alliance = A.id LEFT JOIN $table_user V ON V.id = A.fondateur WHERE galaxie = ".$planete->galaxie." AND ss = ".$planete->ss." AND wing != 0 GROUP BY A.id;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("wings", $wings);
|
||||
unset($wings);
|
||||
} else {
|
||||
$page = 'alliance/gestion_membres';
|
||||
$gestion = "membres";
|
||||
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &32))
|
||||
erreur("Vous n'avez pas le grade nécessaire pour modifier les membres !");
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &32)) {
|
||||
erreur("Vous n'avez pas le grade nécessaire pour modifier les membres !");
|
||||
}
|
||||
|
||||
//Acceptation ou refus des postulants
|
||||
if (!empty($_GET["pa"]))
|
||||
{
|
||||
$id = intval(gpc("pa"));
|
||||
$bdd->reconnexion();
|
||||
$user = $bdd->unique_query("SELECT U.id_alliance, U.pseudo, U.id AS id_user FROM $table_alliances_attente A INNER JOIN $table_user U ON A.id_user = U.id WHERE A.id_alliance = ".$planete->id." AND A.id = $id;");
|
||||
//Acceptation ou refus des postulants
|
||||
if (!empty($_GET["pa"])) {
|
||||
$id = intval(gpc("pa"));
|
||||
$bdd->reconnexion();
|
||||
$user = $bdd->unique_query("SELECT U.id_alliance, U.pseudo, U.id AS id_user FROM $table_alliances_attente A INNER JOIN $table_user U ON A.id_user = U.id WHERE A.id_alliance = ".$planete->id." AND A.id = $id;");
|
||||
|
||||
if (empty($user))
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
erreur("Impossible de trouver la candidature. Si le problème perciste, contactez un opérateur.");
|
||||
}
|
||||
elseif (!empty($user['id_alliance']))
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
erreur("Le joueur pour lequel vous souhaitez valider la condidature est actuellement dans une autre alliance. Vous ne pouvez donc pas l'accepter immédiatement.");
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->query("UPDATE $table_user SET id_alliance = ".$planete->id.", id_grade_alliance = 0 WHERE id = ".$user["id_user"].";");
|
||||
if ($bdd->affected())
|
||||
{
|
||||
$bdd->query("DELETE FROM $table_alliances_attente WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
$bdd->deconnexion();
|
||||
send_mp($user["id_user"], "Candidature pour l'alliance [".$planete->tag."] ".$planete->nom_alliance, "Félicitations vous faites maintenant parti de l'alliance [".$planete->tag."] ".$planete->nom_alliance.".<br /><br />Après examen de votre candidature, le responsable du recrutement a jugé bon de vous accepter au sein de l'alliance.<br />Vous en faites donc désormais parti. Il ne vous reste plus qu'à vous démarquer pour monter dans les grades.<br /><br />Bon jeu !");
|
||||
erreur("Membre ajouté à l'alliance avec succès.<br />Un message privé vient de lui être envoyé afin de l'informer de la nouvelle.", "green");
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
erreur("Une erreur s'est produite lors de l'ajout du joueur dans les membres de l'alliance.<br />Si le problème perciste, contactez un opérateur.");
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif (!empty($_GET["pr"]))
|
||||
{
|
||||
$id = intval(gpc("pr"));
|
||||
$bdd->reconnexion();
|
||||
$user = $bdd->unique_query("SELECT U.id AS id_user FROM $table_alliances_attente A INNER JOIN $table_user U ON A.id_user = U.id WHERE A.id_alliance = ".$planete->id." AND A.id = $id;");
|
||||
$bdd->query("DELETE FROM $table_alliances_attente WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
$bdd->deconnexion();
|
||||
if (empty($user)) {
|
||||
$bdd->deconnexion();
|
||||
erreur("Impossible de trouver la candidature. Si le problème perciste, contactez un opérateur.");
|
||||
} elseif (!empty($user['id_alliance'])) {
|
||||
$bdd->deconnexion();
|
||||
erreur("Le joueur pour lequel vous souhaitez valider la condidature est actuellement dans une autre alliance. Vous ne pouvez donc pas l'accepter immédiatement.");
|
||||
} else {
|
||||
$bdd->query("UPDATE $table_user SET id_alliance = ".$planete->id.", id_grade_alliance = 0 WHERE id = ".$user["id_user"].";");
|
||||
if ($bdd->affected()) {
|
||||
$bdd->query("DELETE FROM $table_alliances_attente WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
$bdd->deconnexion();
|
||||
send_mp($user["id_user"], "Candidature pour l'alliance [".$planete->tag."] ".$planete->nom_alliance, "Félicitations vous faites maintenant parti de l'alliance [".$planete->tag."] ".$planete->nom_alliance.".<br /><br />Après examen de votre candidature, le responsable du recrutement a jugé bon de vous accepter au sein de l'alliance.<br />Vous en faites donc désormais parti. Il ne vous reste plus qu'à vous démarquer pour monter dans les grades.<br /><br />Bon jeu !");
|
||||
erreur("Membre ajouté à l'alliance avec succès.<br />Un message privé vient de lui être envoyé afin de l'informer de la nouvelle.", "green");
|
||||
} else {
|
||||
$bdd->deconnexion();
|
||||
erreur("Une erreur s'est produite lors de l'ajout du joueur dans les membres de l'alliance.<br />Si le problème perciste, contactez un opérateur.");
|
||||
}
|
||||
}
|
||||
} elseif (!empty($_GET["pr"])) {
|
||||
$id = intval(gpc("pr"));
|
||||
$bdd->reconnexion();
|
||||
$user = $bdd->unique_query("SELECT U.id AS id_user FROM $table_alliances_attente A INNER JOIN $table_user U ON A.id_user = U.id WHERE A.id_alliance = ".$planete->id." AND A.id = $id;");
|
||||
$bdd->query("DELETE FROM $table_alliances_attente WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
send_mp($user["id_user"], "Candidature pour l'alliance [".$planete->tag."] ".$planete->nom_alliance, "Nous avons le regret de vous annoncer que l'alliance [".$planete->tag."] ".$planete->nom_alliance." a refusé votre candidature.<br /><br />Après examen de votre candidature, le responsable du recrutement a jugé bon de vous écarter de l'alliance.<br />Pour plus d'informations, veuillez contacter directement le responsable du recrutement.");
|
||||
erreur("Candidature refusée.<br />Un message privé vient d'être envoyé au joueur afin de l'informer de la nouvelle.", "orange");
|
||||
}
|
||||
//Gestion des exclusions de l'alliance
|
||||
elseif (!empty($_GET["u"]))
|
||||
{
|
||||
$id = intval(gpc("u"));
|
||||
if ($planete->fondateur == $id)
|
||||
erreur("Vous ne pouvez pas exclure le fondateur de sa propre alliance.<br />En cas de problème avec le fondateur, veuillez contacter un opérateur.");
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("UPDATE $table_user SET id_alliance = 0, id_grade_alliance = 0 WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
$bdd->deconnexion();
|
||||
send_mp($user["id_user"], "Candidature pour l'alliance [".$planete->tag."] ".$planete->nom_alliance, "Nous avons le regret de vous annoncer que l'alliance [".$planete->tag."] ".$planete->nom_alliance." a refusé votre candidature.<br /><br />Après examen de votre candidature, le responsable du recrutement a jugé bon de vous écarter de l'alliance.<br />Pour plus d'informations, veuillez contacter directement le responsable du recrutement.");
|
||||
erreur("Candidature refusée.<br />Un message privé vient d'être envoyé au joueur afin de l'informer de la nouvelle.", "orange");
|
||||
}
|
||||
//Gestion des exclusions de l'alliance
|
||||
elseif (!empty($_GET["u"])) {
|
||||
$id = intval(gpc("u"));
|
||||
if ($planete->fondateur == $id) {
|
||||
erreur("Vous ne pouvez pas exclure le fondateur de sa propre alliance.<br />En cas de problème avec le fondateur, veuillez contacter un opérateur.");
|
||||
}
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("UPDATE $table_user SET id_alliance = 0, id_grade_alliance = 0 WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if ($bdd->affected())
|
||||
{
|
||||
send_mp($id, "Exclusion de votre alliance [".$planete->tag."] ".$planete->nom_alliance, "Vous vennez d'être exclus de votre alliance [".$planete->tag."] ".$planete->nom_alliance."<br />Pour plus d'informations, veuillez contacter directement le responsable du recrutement.");
|
||||
erreur("Membre renvoyé.<br />Un message privé vient de lui être envoyé afin de l'informer de la nouvelle.", "orange");
|
||||
}
|
||||
else
|
||||
erreur("Membre introuvable !");
|
||||
}
|
||||
if ($bdd->affected()) {
|
||||
send_mp($id, "Exclusion de votre alliance [".$planete->tag."] ".$planete->nom_alliance, "Vous vennez d'être exclus de votre alliance [".$planete->tag."] ".$planete->nom_alliance."<br />Pour plus d'informations, veuillez contacter directement le responsable du recrutement.");
|
||||
erreur("Membre renvoyé.<br />Un message privé vient de lui être envoyé afin de l'informer de la nouvelle.", "orange");
|
||||
} else {
|
||||
erreur("Membre introuvable !");
|
||||
}
|
||||
}
|
||||
|
||||
$id = intval(gpc("i"));
|
||||
if (!empty($id))
|
||||
{
|
||||
$grade = intval(gpc('grade', 'post'));
|
||||
$id = intval(gpc("i"));
|
||||
if (!empty($id)) {
|
||||
$grade = intval(gpc('grade', 'post'));
|
||||
|
||||
$bdd->reconnexion();
|
||||
$gradet = $bdd->unique_query("SELECT id FROM $table_alliances_grade WHERE id_alliance = ".$planete->id." AND id = $grade;");
|
||||
if (!empty($gradet) || $grade == 0)
|
||||
$bdd->query("UPDATE $table_user SET id_grade_alliance = $grade WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$gradet = $bdd->unique_query("SELECT id FROM $table_alliances_grade WHERE id_alliance = ".$planete->id." AND id = $grade;");
|
||||
if (!empty($gradet) || $grade == 0) {
|
||||
$bdd->query("UPDATE $table_user SET id_grade_alliance = $grade WHERE id_alliance = ".$planete->id." AND id = $id;");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: ?p=gestion&g=membres');
|
||||
exit;
|
||||
}
|
||||
header('Location: ?p=gestion&g=membres');
|
||||
exit;
|
||||
}
|
||||
|
||||
$bdd->reconnexion();
|
||||
$membres = $bdd->query("SELECT id, pseudo, race, last_visite, id_grade_alliance FROM $table_user WHERE id_alliance = ".$planete->id.";");
|
||||
$grades = $bdd->query("SELECT id, id_alliance, nom, auth FROM $table_alliances_grade WHERE id_alliance = ".$planete->id.";");
|
||||
$postulants = $bdd->query("SELECT A.id, A.timestamp, A.message, U.pseudo, U.id AS id_user FROM $table_alliances_attente A INNER JOIN $table_user U ON A.id_user = U.id WHERE A.id_alliance = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("membres", $membres);
|
||||
$template->assign("grades", $grades);
|
||||
$template->assign("postulants", $postulants);
|
||||
$bdd->reconnexion();
|
||||
$membres = $bdd->query("SELECT id, pseudo, race, last_visite, id_grade_alliance FROM $table_user WHERE id_alliance = ".$planete->id.";");
|
||||
$grades = $bdd->query("SELECT id, id_alliance, nom, auth FROM $table_alliances_grade WHERE id_alliance = ".$planete->id.";");
|
||||
$postulants = $bdd->query("SELECT A.id, A.timestamp, A.message, U.pseudo, U.id AS id_user FROM $table_alliances_attente A INNER JOIN $table_user U ON A.id_user = U.id WHERE A.id_alliance = ".$planete->id.";");
|
||||
$bdd->deconnexion();
|
||||
$template->assign("membres", $membres);
|
||||
$template->assign("grades", $grades);
|
||||
$template->assign("postulants", $postulants);
|
||||
|
||||
unset($membres, $grades, $grade, $id, $postulants);
|
||||
unset($membres, $grades, $grade, $id, $postulants);
|
||||
}
|
||||
|
||||
$template->assign("onglet", $gestion);
|
||||
unset($gestion);
|
||||
?>
|
||||
|
|
@ -1,94 +1,93 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$page = 'messagerie';
|
||||
$titre = 'Messagerie d\'alliance';
|
||||
$template->assign("link_P", "alli_messagerie");
|
||||
$template->assign("titreR", $titre);
|
||||
|
||||
//On interdit l'accès à la messagerie en cas de prise de contrôle d'un joueur
|
||||
if (!empty($sess->values['souscontrole'][0]))
|
||||
erreur('Vous êtes en mode prise de contrôle, vous ne pouvez pas accèder aux messages privés des joueurs.');
|
||||
if (!empty($sess->values['souscontrole'][0])) {
|
||||
erreur('Vous êtes en mode prise de contrôle, vous ne pouvez pas accèder aux messages privés des joueurs.');
|
||||
}
|
||||
|
||||
if ($id = intval(gpc('avertir')))
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("UPDATE $table_alliances_mail SET statut = 1 WHERE destinataire = ".$planete->id." AND id = $id;");
|
||||
if ($bdd->affected())
|
||||
erreur('La demande de vérification de contenu par les opérateurs a été transmise avec succès.', 'green', '?p=messagerie');
|
||||
else
|
||||
erreur('Une demande est déjà en cours ou vous n\'êtes pas autorisé à avertir ce message.', 'red', '?p=messagerie');
|
||||
$bdd->deconnexion();
|
||||
if ($id = intval(gpc('avertir'))) {
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("UPDATE $table_alliances_mail SET statut = 1 WHERE destinataire = ".$planete->id." AND id = $id;");
|
||||
if ($bdd->affected()) {
|
||||
erreur('La demande de vérification de contenu par les opérateurs a été transmise avec succès.', 'green', '?p=messagerie');
|
||||
} else {
|
||||
erreur('Une demande est déjà en cours ou vous n\'êtes pas autorisé à avertir ce message.', 'red', '?p=messagerie');
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
|
||||
//On récupére l'onglet demandé
|
||||
$onglet = gpc('n');
|
||||
$template->assign('onglet', $onglet);
|
||||
|
||||
if ($onglet == "rapports")
|
||||
{
|
||||
//Demande de supression des messages
|
||||
if (!empty($_POST))
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
foreach($_POST as $value)
|
||||
$bdd->query("UPDATE $table_alliances_mail SET vu = 's' WHERE destinataire = ".$planete->id." AND id = ".intval($value).";");
|
||||
$bdd->deconnexion();
|
||||
if ($onglet == "rapports") {
|
||||
//Demande de supression des messages
|
||||
if (!empty($_POST)) {
|
||||
$bdd->reconnexion();
|
||||
foreach ($_POST as $value) {
|
||||
$bdd->query("UPDATE $table_alliances_mail SET vu = 's' WHERE destinataire = ".$planete->id." AND id = ".intval($value).";");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: ?p=messagerie&n='.$onglet);
|
||||
exit;
|
||||
}
|
||||
header('Location: ?p=messagerie&n='.$onglet);
|
||||
exit;
|
||||
}
|
||||
|
||||
$bdd->reconnexion();
|
||||
$data = $bdd->query("SELECT * FROM $table_alliances_mail WHERE destinataire = ".$planete->id." AND expediteur = false AND vu != 's' ORDER BY id DESC;");
|
||||
$bdd->query("UPDATE $table_alliances_mail SET vu = 0 WHERE destinataire = ".$planete->id." AND expediteur = false AND vu != 's';");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$data = $bdd->query("SELECT * FROM $table_alliances_mail WHERE destinataire = ".$planete->id." AND expediteur = false AND vu != 's' ORDER BY id DESC;");
|
||||
$bdd->query("UPDATE $table_alliances_mail SET vu = 0 WHERE destinataire = ".$planete->id." AND expediteur = false AND vu != 's';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('messages', $data);
|
||||
}
|
||||
elseif ($onglet == "send")
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$data = $bdd->query("SELECT M.*, U.pseudo AS destinataire FROM $table_alliances_mail M INNER JOIN $table_user U ON U.id = M.destinataire WHERE M.expediteur = ".$planete->id." ORDER BY M.id DESC;");
|
||||
$bdd->deconnexion();
|
||||
$template->assign('messages', $data);
|
||||
} elseif ($onglet == "send") {
|
||||
$bdd->reconnexion();
|
||||
$data = $bdd->query("SELECT M.*, U.pseudo AS destinataire FROM $table_alliances_mail M INNER JOIN $table_user U ON U.id = M.destinataire WHERE M.expediteur = ".$planete->id." ORDER BY M.id DESC;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign('messages', $data);
|
||||
}
|
||||
elseif ($onglet == "envoyer")
|
||||
{
|
||||
$page = 'envoyer';
|
||||
$titre = 'Envoyer un message';
|
||||
$template->assign('messages', $data);
|
||||
} elseif ($onglet == "envoyer") {
|
||||
$page = 'envoyer';
|
||||
$titre = 'Envoyer un message';
|
||||
|
||||
if (!empty($_POST['objet']) && !empty($_POST['destinataire']) && !empty($_POST['message']))
|
||||
{
|
||||
$utils = explode(';', gpc('destinataire', 'post'));
|
||||
$nbutil = count($utils);
|
||||
if (!empty($_POST['objet']) && !empty($_POST['destinataire']) && !empty($_POST['message'])) {
|
||||
$utils = explode(';', gpc('destinataire', 'post'));
|
||||
$nbutil = count($utils);
|
||||
|
||||
$time = time();
|
||||
$message = htmlspecialchars(gpc('message', 'post'));
|
||||
$objet = htmlspecialchars(gpc('objet', 'post'));
|
||||
$time = time();
|
||||
$message = htmlspecialchars(gpc('message', 'post'));
|
||||
$objet = htmlspecialchars(gpc('objet', 'post'));
|
||||
|
||||
if (strlen($message) > 99999)
|
||||
erreur('Le contenu de votre message est trop long. Limite : 99 999 caractères.');
|
||||
if (empty($utils))
|
||||
erreur('Aucun utilisateur sélectionné.');
|
||||
if (strlen($message) > 99999) {
|
||||
erreur('Le contenu de votre message est trop long. Limite : 99 999 caractères.');
|
||||
}
|
||||
if (empty($utils)) {
|
||||
erreur('Aucun utilisateur sélectionné.');
|
||||
}
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($message);
|
||||
$bdd->escape($objet);
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($message);
|
||||
$bdd->escape($objet);
|
||||
|
||||
$introuv = array();
|
||||
foreach($utils as $util)
|
||||
{
|
||||
if (empty($util))
|
||||
continue;
|
||||
$util = trim($util);
|
||||
$bdd->escape($util);
|
||||
$introuv = array();
|
||||
foreach ($utils as $util) {
|
||||
if (empty($util)) {
|
||||
continue;
|
||||
}
|
||||
$util = trim($util);
|
||||
$bdd->escape($util);
|
||||
|
||||
if ($util != $planete->pseudo && $env = $bdd->unique_query("SELECT id, pseudo, mail, envoyerMail FROM $table_user WHERE pseudo = '$util';"))
|
||||
{
|
||||
$bdd->query("INSERT INTO $table_alliances_mail (destinataire, expediteur, sujet, contenu, temps) VALUES(".$env['id'].", ".$planete->id_user.", '$objet', '$message', $time);");
|
||||
if ($env["envoyerMail"]& 2 && !empty($env["mail"]))
|
||||
send_mail($env["mail"], "Halo-Battle :: Nouveau message privé", 'Bonjour '.$env["pseudo"].',
|
||||
if ($util != $planete->pseudo && $env = $bdd->unique_query("SELECT id, pseudo, mail, envoyerMail FROM $table_user WHERE pseudo = '$util';")) {
|
||||
$bdd->query("INSERT INTO $table_alliances_mail (destinataire, expediteur, sujet, contenu, temps) VALUES(".$env['id'].", ".$planete->id_user.", '$objet', '$message', $time);");
|
||||
if ($env["envoyerMail"]& 2 && !empty($env["mail"])) {
|
||||
send_mail($env["mail"], "Halo-Battle :: Nouveau message privé", 'Bonjour '.$env["pseudo"].',
|
||||
|
||||
Vous recevez ce courriel suite à l\'arrivée d\'un nouveau message privé reçu sur votre compte de jeu du serveur '.$VAR['serveur_name'].'. Le sujet de ce message est : "'.$objet.'" et a été envoyé par '.$planete->pseudo.'. Vous pouvez utiliser le lien suivant pour voir le message ou vous connecter.
|
||||
|
||||
|
|
@ -98,74 +97,76 @@ elseif ($onglet == "envoyer")
|
|||
|
||||
A bientôt dans Halo-Battle,
|
||||
Le Staff');
|
||||
}
|
||||
else
|
||||
$introuv[] = htmlentities($util);
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
} else {
|
||||
$introuv[] = htmlentities($util);
|
||||
}
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($introuv[0]))
|
||||
erreur('Impossible de trouver le/les destinataire(s) suivant(s) : '.implode(', ', $introuv).'.<br />Les autres ont bien reçu votre message.', "red", '?p=messagerie&n=envoyer');
|
||||
else
|
||||
erreur('Votre message a été envoyé avec succès.', "green", '?p=messagerie');
|
||||
}
|
||||
if (!empty($introuv[0])) {
|
||||
erreur('Impossible de trouver le/les destinataire(s) suivant(s) : '.implode(', ', $introuv).'.<br />Les autres ont bien reçu votre message.', "red", '?p=messagerie&n=envoyer');
|
||||
} else {
|
||||
erreur('Votre message a été envoyé avec succès.', "green", '?p=messagerie');
|
||||
}
|
||||
}
|
||||
|
||||
$amis = array();
|
||||
$amisn = array();
|
||||
$bdd->reconnexion();
|
||||
foreach($planete->amis as $ami) {
|
||||
$res = $bdd->unique_query("SELECT pseudo FROM $table_user WHERE id = ".$ami.";");
|
||||
if ($res != false) {
|
||||
$amis[] = $res['pseudo'];
|
||||
$amisn[] = $ami;
|
||||
}
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
$template->assign('amis', $amis);
|
||||
$template->assign('amisn', $amisn);
|
||||
$amis = array();
|
||||
$amisn = array();
|
||||
$bdd->reconnexion();
|
||||
foreach ($planete->amis as $ami) {
|
||||
$res = $bdd->unique_query("SELECT pseudo FROM $table_user WHERE id = ".$ami.";");
|
||||
if ($res != false) {
|
||||
$amis[] = $res['pseudo'];
|
||||
$amisn[] = $ami;
|
||||
}
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
$template->assign('amis', $amis);
|
||||
$template->assign('amisn', $amisn);
|
||||
|
||||
if (isset($_GET['d'])) $template->assign('destinataire', gpc('d'));
|
||||
if (isset($_GET['o'])) $template->assign('objet', gpc('o'));
|
||||
}
|
||||
else
|
||||
{
|
||||
//Demande de supression des messages
|
||||
if (!empty($_POST))
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
foreach($_POST as $value)
|
||||
$bdd->query("DELETE FROM $table_alliances_mail WHERE destinataire = ".$planete->id_user." AND id = ".intval($value).";");
|
||||
$bdd->deconnexion();
|
||||
if (isset($_GET['d'])) {
|
||||
$template->assign('destinataire', gpc('d'));
|
||||
}
|
||||
if (isset($_GET['o'])) {
|
||||
$template->assign('objet', gpc('o'));
|
||||
}
|
||||
} else {
|
||||
//Demande de supression des messages
|
||||
if (!empty($_POST)) {
|
||||
$bdd->reconnexion();
|
||||
foreach ($_POST as $value) {
|
||||
$bdd->query("DELETE FROM $table_alliances_mail WHERE destinataire = ".$planete->id_user." AND id = ".intval($value).";");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
header('Location: ?p=messagerie&n='.$onglet);
|
||||
exit;
|
||||
}
|
||||
header('Location: ?p=messagerie&n='.$onglet);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($SESS->level >= 3)
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$data = $bdd->query("SELECT M.*, U.pseudo AS expediteur FROM $table_alliances_mail M INNER JOIN $table_user U ON U.id = M.expediteur WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC;");
|
||||
$bdd->query("UPDATE $table_alliances_mail M SET vu = 0 WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
//Calcul du nombre total de message enregistré
|
||||
$nbmax = $bdd->query("SELECT COUNT(id) as nb FROM $table_alliances_mail M WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC;");
|
||||
$data = $bdd->query("SELECT M.*, U.pseudo AS expediteur FROM $table_alliances_mail M INNER JOIN $table_user U ON U.id = M.expediteur WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC LIMIT 50;");
|
||||
$bdd->query("UPDATE $table_alliances_mail M SET vu = 0 WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC LIMIT 50;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
if ($SESS->level >= 3) {
|
||||
$bdd->reconnexion();
|
||||
$data = $bdd->query("SELECT M.*, U.pseudo AS expediteur FROM $table_alliances_mail M INNER JOIN $table_user U ON U.id = M.expediteur WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC;");
|
||||
$bdd->query("UPDATE $table_alliances_mail M SET vu = 0 WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC;");
|
||||
$bdd->deconnexion();
|
||||
} else {
|
||||
$bdd->reconnexion();
|
||||
//Calcul du nombre total de message enregistré
|
||||
$nbmax = $bdd->query("SELECT COUNT(id) as nb FROM $table_alliances_mail M WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC;");
|
||||
$data = $bdd->query("SELECT M.*, U.pseudo AS expediteur FROM $table_alliances_mail M INNER JOIN $table_user U ON U.id = M.expediteur WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC LIMIT 50;");
|
||||
$bdd->query("UPDATE $table_alliances_mail M SET vu = 0 WHERE M.destinataire = ".$planete->id_user." AND M.expediteur != false ORDER BY M.id DESC LIMIT 50;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
|
||||
if ($SESS->level < 3 && $nbmax > $bdd->num_rows)
|
||||
$template->assign('avertissement', '<p style="color: red;"><b>Vous avez des messages en attente de réception. Libérez de la place dans votre messagerie pour les afficher.</b></p>');
|
||||
if ($SESS->level < 3 && $nbmax > $bdd->num_rows) {
|
||||
$template->assign('avertissement', '<p style="color: red;"><b>Vous avez des messages en attente de réception. Libérez de la place dans votre messagerie pour les afficher.</b></p>');
|
||||
}
|
||||
|
||||
$template->assign('messages', $data);
|
||||
$template->assign('messages', $data);
|
||||
}
|
||||
|
||||
unset($onglet, $data, $nbmax);
|
||||
|
||||
if ($bdd->num_rows)
|
||||
$template->assign('IM', $bdd->num_rows);
|
||||
?>
|
||||
if ($bdd->num_rows) {
|
||||
$template->assign('IM', $bdd->num_rows);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +1,39 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
$id = intval(gpc('postuler'));
|
||||
$message = gpc('motivation', 'post');
|
||||
$page = 'alliance/nm_postuler';
|
||||
|
||||
if (!empty($message))
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($message);
|
||||
$postul = $bdd->unique_query("SELECT id FROM $table_alliances_attente WHERE id_alliance = $id AND id_membre = ".$planete->id_user." LIMIT 1;");
|
||||
if (empty($postul))
|
||||
$bdd->query("INSERT INTO $table_alliances_attente (id_alliance, id_user, timestamp, message) VALUES ($id, ".$planete->id_user.", ".time().", '$message');");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (empty($postul))
|
||||
erreur("Votre demande d'adhésion a été envoyée avec succès, vous aurez une réponse dès qu'un dirigeant de l'alliance se connectera.", "green", $VAR["menu"]["alliance"]."&v=".$id, 5000);
|
||||
else
|
||||
redirection($VAR["menu"]["alliance"]."&postuler=".$id);
|
||||
if (!empty($message)) {
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($message);
|
||||
$postul = $bdd->unique_query("SELECT id FROM $table_alliances_attente WHERE id_alliance = $id AND id_membre = ".$planete->id_user." LIMIT 1;");
|
||||
if (empty($postul)) {
|
||||
$bdd->query("INSERT INTO $table_alliances_attente (id_alliance, id_user, timestamp, message) VALUES ($id, ".$planete->id_user.", ".time().", '$message');");
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances WHERE id = $id;");
|
||||
$postul = $bdd->unique_query("SELECT id FROM $table_alliances_attente WHERE id_alliance = $id AND id_membre = ".$planete->id_user." LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->deconnexion();
|
||||
|
||||
|
||||
if (!empty($postul))
|
||||
erreur("Vous avez déjà une candidature en cours pour cette alliance !", "red", $VAR["menu"]["alliance"]."&v=".$id, 3000);
|
||||
elseif (!empty($alliance))
|
||||
$template->assign("alliance", $alliance);
|
||||
else
|
||||
redirection($VAR["menu"]["alliance"]);
|
||||
if (empty($postul)) {
|
||||
erreur("Votre demande d'adhésion a été envoyée avec succès, vous aurez une réponse dès qu'un dirigeant de l'alliance se connectera.", "green", $VAR["menu"]["alliance"]."&v=".$id, 5000);
|
||||
} else {
|
||||
redirection($VAR["menu"]["alliance"]."&postuler=".$id);
|
||||
}
|
||||
?>
|
||||
} else {
|
||||
$bdd->reconnexion();
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances WHERE id = $id;");
|
||||
$postul = $bdd->unique_query("SELECT id FROM $table_alliances_attente WHERE id_alliance = $id AND id_membre = ".$planete->id_user." LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
|
||||
if (!empty($postul)) {
|
||||
erreur("Vous avez déjà une candidature en cours pour cette alliance !", "red", $VAR["menu"]["alliance"]."&v=".$id, 3000);
|
||||
} elseif (!empty($alliance)) {
|
||||
$template->assign("alliance", $alliance);
|
||||
} else {
|
||||
redirection($VAR["menu"]["alliance"]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,129 +1,120 @@
|
|||
<?php
|
||||
if(!defined('ONYX')) exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$act = gpc('q');
|
||||
|
||||
if ($act == "fonder")
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
//On regarde si le joueur n'est pas déjà en train de fonder une alliance
|
||||
if (!$alli = $bdd->query("SELECT id FROM $table_alliances_creation WHERE fondateur = ".$planete->id_user." OR signatures LIKE '%;".$planete->id_user.";%';"))
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
$page = 'alliance/nm_fonder';
|
||||
if ($act == "fonder") {
|
||||
$bdd->reconnexion();
|
||||
//On regarde si le joueur n'est pas déjà en train de fonder une alliance
|
||||
if (!$alli = $bdd->query("SELECT id FROM $table_alliances_creation WHERE fondateur = ".$planete->id_user." OR signatures LIKE '%;".$planete->id_user.";%';")) {
|
||||
$bdd->deconnexion();
|
||||
$page = 'alliance/nm_fonder';
|
||||
|
||||
$nom = gpc('nom', 'post');
|
||||
$tag = gpc('tag', 'post');
|
||||
if (!empty($nom) || !empty($tag))
|
||||
{
|
||||
//Vérifications
|
||||
if (!preg_match("#^[A-Za-z0-9èéàùûüôöç'_ -]{5,42}$#ui", $nom))
|
||||
erreur("Le nom d'alliance que vous avez choisi n'est pas valide :<br />il doit avoir entre 5 et 42 caractères (certains accents sont autorisés, mais aucun caractères spéciaux) !", "red");
|
||||
elseif (!preg_match("#^[A-Za-z0-9]{3,5}$#ui", $tag))
|
||||
erreur("Le tag d'alliance que vous avez choisi n'est pas valide :<br />il doit avoir entre 3 et 5 lettres (sans accents) ou chiffres !", "red");
|
||||
$nom = gpc('nom', 'post');
|
||||
$tag = gpc('tag', 'post');
|
||||
if (!empty($nom) || !empty($tag)) {
|
||||
//Vérifications
|
||||
if (!preg_match("#^[A-Za-z0-9èéàùûüôöç'_ -]{5,42}$#ui", $nom)) {
|
||||
erreur("Le nom d'alliance que vous avez choisi n'est pas valide :<br />il doit avoir entre 5 et 42 caractères (certains accents sont autorisés, mais aucun caractères spéciaux) !", "red");
|
||||
} elseif (!preg_match("#^[A-Za-z0-9]{3,5}$#ui", $tag)) {
|
||||
erreur("Le tag d'alliance que vous avez choisi n'est pas valide :<br />il doit avoir entre 3 et 5 lettres (sans accents) ou chiffres !", "red");
|
||||
}
|
||||
|
||||
$lien = sha1($tag.'Hb$'.$nom.'☺Ø'.$planete->id_user.'‘«'.$planete->race);
|
||||
$lien = sha1($tag.'Hb$'.$nom.'☺Ø'.$planete->id_user.'‘«'.$planete->race);
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($nom);
|
||||
$bdd->escape($tag);
|
||||
$utilise = $bdd->query("SELECT id FROM $table_alliances WHERE nom_alliance = '$nom' OR tag = '$tag' OR fondateur = ".$planete->id_user." UNION SELECT id FROM $table_alliances_creation WHERE nom_alliance = '$nom' OR tag = '$tag' OR fondateur = ".$planete->id_user.";");
|
||||
if (empty($utilise))
|
||||
$bdd->query("INSERT INTO $table_alliances_creation (tag, nom_alliance, fondateur, lien) VALUES ('$tag', '$nom', ".$planete->id_user.", '$lien');");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($nom);
|
||||
$bdd->escape($tag);
|
||||
$utilise = $bdd->query("SELECT id FROM $table_alliances WHERE nom_alliance = '$nom' OR tag = '$tag' OR fondateur = ".$planete->id_user." UNION SELECT id FROM $table_alliances_creation WHERE nom_alliance = '$nom' OR tag = '$tag' OR fondateur = ".$planete->id_user.";");
|
||||
if (empty($utilise)) {
|
||||
$bdd->query("INSERT INTO $table_alliances_creation (tag, nom_alliance, fondateur, lien) VALUES ('$tag', '$nom', ".$planete->id_user.", '$lien');");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($utilise))
|
||||
erreur("Le nom ou le tag que vous avez choisi est déjà utilisé par une alliance.", "red");
|
||||
else
|
||||
{
|
||||
send_mp($planete->id_user, "Fondation de votre alliance !", 'Pour terminer la création de votre alliance, trouvez au moins '.nb_signatures.' joueurs de cette galaxie sans alliance pour leur faire signer votre traité de fondation d\'alliance.<br /><br />Lien de signature :<br /><a href="'.$VAR["menu"]["alliance"].'&signer='.$lien.'">http://'.$_SERVER['HTTP_HOST'].'/'.$VAR["first_page"].''.$VAR["menu"]["alliance"].'&signer='.$lien.'</a>');
|
||||
erreur('Votre alliance a bien été créée.<br />Il ne vous reste plus qu\'à trouver au moins '.nb_signatures.' signatures pour finir la création de votre alliance.<br /><br />Le lien permettant à vos quatres personnes de signer est <a href="'.$VAR["menu"]["alliance"].'&signer='.$lien.'">http://'.$_SERVER['HTTP_HOST'].'/'.$VAR["first_page"].''.$VAR["menu"]["alliance"].'&signer='.$lien.'</a>', "green");
|
||||
}
|
||||
}
|
||||
unset($nom, $tag);
|
||||
}
|
||||
else
|
||||
{
|
||||
$page = 'alliance/nm_statut';
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE id = ".$alli[0]["id"].";");
|
||||
if (!empty($utilise)) {
|
||||
erreur("Le nom ou le tag que vous avez choisi est déjà utilisé par une alliance.", "red");
|
||||
} else {
|
||||
send_mp($planete->id_user, "Fondation de votre alliance !", 'Pour terminer la création de votre alliance, trouvez au moins '.nb_signatures.' joueurs de cette galaxie sans alliance pour leur faire signer votre traité de fondation d\'alliance.<br /><br />Lien de signature :<br /><a href="'.$VAR["menu"]["alliance"].'&signer='.$lien.'">http://'.$_SERVER['HTTP_HOST'].'/'.$VAR["first_page"].''.$VAR["menu"]["alliance"].'&signer='.$lien.'</a>');
|
||||
erreur('Votre alliance a bien été créée.<br />Il ne vous reste plus qu\'à trouver au moins '.nb_signatures.' signatures pour finir la création de votre alliance.<br /><br />Le lien permettant à vos quatres personnes de signer est <a href="'.$VAR["menu"]["alliance"].'&signer='.$lien.'">http://'.$_SERVER['HTTP_HOST'].'/'.$VAR["first_page"].''.$VAR["menu"]["alliance"].'&signer='.$lien.'</a>', "green");
|
||||
}
|
||||
}
|
||||
unset($nom, $tag);
|
||||
} else {
|
||||
$page = 'alliance/nm_statut';
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE id = ".$alli[0]["id"].";");
|
||||
|
||||
$signatures = explode(';', substr($alliance["signatures"], 1), -1);
|
||||
$signaturesExport = implode(' OR id = ', $signatures);
|
||||
$pseudos = $bdd->query("SELECT pseudo FROM $table_user WHERE id = ".$signaturesExport.";");
|
||||
$bdd->deconnexion();
|
||||
$signatures = explode(';', substr($alliance["signatures"], 1), -1);
|
||||
$signaturesExport = implode(' OR id = ', $signatures);
|
||||
$pseudos = $bdd->query("SELECT pseudo FROM $table_user WHERE id = ".$signaturesExport.";");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (gpc('r') == "quit")
|
||||
{
|
||||
if ($alliance["fondateur"] == $planete->id_user)
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("DELETE FROM $table_alliances_creation WHERE id = ".$alli[0]["id"].";");
|
||||
$bdd->deconnexion();
|
||||
if (gpc('r') == "quit") {
|
||||
if ($alliance["fondateur"] == $planete->id_user) {
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("DELETE FROM $table_alliances_creation WHERE id = ".$alli[0]["id"].";");
|
||||
$bdd->deconnexion();
|
||||
|
||||
foreach ($signatures as $id_user)
|
||||
{
|
||||
send_mp($id_user, "Annulation de la fondation de votre alliance !", "Le fondateur de l'alliance pour laquelle vous avez signée vient d'annuler sa création.");
|
||||
}
|
||||
foreach ($signatures as $id_user) {
|
||||
send_mp($id_user, "Annulation de la fondation de votre alliance !", "Le fondateur de l'alliance pour laquelle vous avez signée vient d'annuler sa création.");
|
||||
}
|
||||
|
||||
send_mp($planete->id_user, "Annulation de la fondation de votre alliance !", "Vous vennez d'annuler la création de votre alliance.");
|
||||
erreur("Votre alliance vient d'être supprimée", "green");
|
||||
}
|
||||
else
|
||||
{
|
||||
$keys = array_keys($signatures, $planete->id_user);
|
||||
foreach ($keys as $key)
|
||||
unset($signatures[$key]);
|
||||
send_mp($planete->id_user, "Annulation de la fondation de votre alliance !", "Vous vennez d'annuler la création de votre alliance.");
|
||||
erreur("Votre alliance vient d'être supprimée", "green");
|
||||
} else {
|
||||
$keys = array_keys($signatures, $planete->id_user);
|
||||
foreach ($keys as $key) {
|
||||
unset($signatures[$key]);
|
||||
}
|
||||
|
||||
$signatures = ";".implode(';', $signatures).";";
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($signatures);
|
||||
$bdd->query("UPDATE $table_alliances_creation SET signatures = '$signatures' WHERE id = ".$alliance["id"].";");
|
||||
$bdd->deconnexion();
|
||||
$signatures = ";".implode(';', $signatures).";";
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($signatures);
|
||||
$bdd->query("UPDATE $table_alliances_creation SET signatures = '$signatures' WHERE id = ".$alliance["id"].";");
|
||||
$bdd->deconnexion();
|
||||
|
||||
send_mp($planete->id_user, "Annulation de la signature pour votre alliance !", "Vous vennez d'annuler votre signature pour l'alliance ".$alliance["nom"]);
|
||||
erreur("Votre signature a été rayée.", "green");
|
||||
}
|
||||
}
|
||||
send_mp($planete->id_user, "Annulation de la signature pour votre alliance !", "Vous vennez d'annuler votre signature pour l'alliance ".$alliance["nom"]);
|
||||
erreur("Votre signature a été rayée.", "green");
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign("alliance", $alliance);
|
||||
$template->assign("signatures", $signatures);
|
||||
$template->assign("pseudos", $pseudos);
|
||||
$template->assign("nbSignatures", count($signatures));
|
||||
}
|
||||
$template->assign("alliance", $alliance);
|
||||
$template->assign("signatures", $signatures);
|
||||
$template->assign("pseudos", $pseudos);
|
||||
$template->assign("nbSignatures", count($signatures));
|
||||
}
|
||||
} elseif (!empty($_POST['search_tag']) || !empty($_POST['search_nom'])) {
|
||||
$page = 'alliance/nm_search';
|
||||
|
||||
$tag = gpc('search_tag', 'post');
|
||||
$nom = str_replace("*", "%", gpc('search_nom', 'post'));
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($tag);
|
||||
$bdd->escape($nom);
|
||||
$rech1 = $bdd->query("SELECT id, tag, nom_alliance, race, etat_inscription FROM $table_alliances WHERE tag LIKE '$tag%' AND nom_alliance LIKE '%$nom%';");
|
||||
$rech2 = $bdd->query("SELECT lien AS id, tag, nom_alliance, 0 AS race, 2 AS etat_inscription FROM $table_alliances_creation WHERE tag LIKE '$tag%' AND nom_alliance LIKE '%$nom%';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($rech1) && !empty($rech2)) {
|
||||
$recherche = array_merge($rech1, $rech2);
|
||||
} elseif (!empty($rech2)) {
|
||||
$recherche = $rech2;
|
||||
} else {
|
||||
$recherche = $rech1;
|
||||
}
|
||||
|
||||
if ($bdd->num_rows == 1) {
|
||||
redirection($VAR["menu"]["alliance"]."&v=".$recherche[0]['id']);
|
||||
} elseif ($bdd->num_rows == 0) {
|
||||
erreur("Aucune alliance ne correspond à ces critères de recherche", "", $VAR["menu"]["alliance"]);
|
||||
}
|
||||
|
||||
$template->assign("recherches", $recherche);
|
||||
unset($nom, $tag, $recherche);
|
||||
} else {
|
||||
$bdd->reconnexion();
|
||||
$template->assign("fondation", $bdd->query("SELECT id FROM $table_alliances_creation WHERE fondateur = ".$planete->id_user." OR signatures LIKE '%;".$planete->id_user.";%';"));
|
||||
$page = 'alliance/nm_accueil';
|
||||
}
|
||||
elseif (!empty($_POST['search_tag']) || !empty($_POST['search_nom']))
|
||||
{
|
||||
$page = 'alliance/nm_search';
|
||||
|
||||
$tag = gpc('search_tag', 'post');
|
||||
$nom = str_replace("*", "%", gpc('search_nom', 'post'));
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($tag);
|
||||
$bdd->escape($nom);
|
||||
$rech1 = $bdd->query("SELECT id, tag, nom_alliance, race, etat_inscription FROM $table_alliances WHERE tag LIKE '$tag%' AND nom_alliance LIKE '%$nom%';");
|
||||
$rech2 = $bdd->query("SELECT lien AS id, tag, nom_alliance, 0 AS race, 2 AS etat_inscription FROM $table_alliances_creation WHERE tag LIKE '$tag%' AND nom_alliance LIKE '%$nom%';");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($rech1) && !empty($rech2))
|
||||
$recherche = array_merge($rech1, $rech2);
|
||||
elseif (!empty($rech2))
|
||||
$recherche = $rech2;
|
||||
else
|
||||
$recherche = $rech1;
|
||||
|
||||
if ($bdd->num_rows == 1)
|
||||
redirection($VAR["menu"]["alliance"]."&v=".$recherche[0]['id']);
|
||||
elseif ($bdd->num_rows == 0)
|
||||
erreur("Aucune alliance ne correspond à ces critères de recherche", "", $VAR["menu"]["alliance"]);
|
||||
|
||||
$template->assign("recherches", $recherche);
|
||||
unset($nom, $tag, $recherche);
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$template->assign("fondation", $bdd->query("SELECT id FROM $table_alliances_creation WHERE fondateur = ".$planete->id_user." OR signatures LIKE '%;".$planete->id_user.";%';"));
|
||||
$page = 'alliance/nm_accueil';
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,98 +1,93 @@
|
|||
<?php
|
||||
if(!defined('ONYX')) exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$hash = gpc('signer');
|
||||
|
||||
$page = 'alliance/nm_signer';
|
||||
if (!empty($planete->id_alliance))
|
||||
erreur("Vous êtes déjà dans une alliance, vous ne pouvez pas ratifier d'alliance !", "red");
|
||||
elseif (!empty($_POST["sign"]))
|
||||
{
|
||||
if (trim(strtolower(gpc("sign", "post"))) == "oui")
|
||||
{
|
||||
$hash = intval($hash);
|
||||
$bdd->reconnexion();
|
||||
$ratifier = $bdd->unique_query("SELECT id, fondateur, signatures FROM $table_alliances_creation WHERE signatures LIKE '%;".$planete->id_user.";%' LIMIT 1;");
|
||||
if (!empty($ratifier))
|
||||
{
|
||||
$ratifier["signatures"] = explode(';', substr($ratifier["signatures"], 1), -1);
|
||||
unset($ratifier["signatures"][array_search($planete->id_user, $ratifier["signatures"])]);
|
||||
if (count($ratifier["signatures"]) == 0)
|
||||
$ratifier["signatures"] = "";
|
||||
else
|
||||
$ratifier["signatures"] = ';'.implode(';', $ratifier["signatures"]).';';
|
||||
$bdd->escape($ratifier["signatures"]);
|
||||
$bdd->query("UPDATE $table_alliances_creation SET signatures = '".$ratifier["signatures"]."' WHERE id = ".$ratifier["id"].";");
|
||||
}
|
||||
if (!empty($planete->id_alliance)) {
|
||||
erreur("Vous êtes déjà dans une alliance, vous ne pouvez pas ratifier d'alliance !", "red");
|
||||
} elseif (!empty($_POST["sign"])) {
|
||||
if (trim(strtolower(gpc("sign", "post"))) == "oui") {
|
||||
$hash = intval($hash);
|
||||
$bdd->reconnexion();
|
||||
$ratifier = $bdd->unique_query("SELECT id, fondateur, signatures FROM $table_alliances_creation WHERE signatures LIKE '%;".$planete->id_user.";%' LIMIT 1;");
|
||||
if (!empty($ratifier)) {
|
||||
$ratifier["signatures"] = explode(';', substr($ratifier["signatures"], 1), -1);
|
||||
unset($ratifier["signatures"][array_search($planete->id_user, $ratifier["signatures"])]);
|
||||
if (count($ratifier["signatures"]) == 0) {
|
||||
$ratifier["signatures"] = "";
|
||||
} else {
|
||||
$ratifier["signatures"] = ';'.implode(';', $ratifier["signatures"]).';';
|
||||
}
|
||||
$bdd->escape($ratifier["signatures"]);
|
||||
$bdd->query("UPDATE $table_alliances_creation SET signatures = '".$ratifier["signatures"]."' WHERE id = ".$ratifier["id"].";");
|
||||
}
|
||||
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE id = $hash;");
|
||||
if (!empty($alliance["signatures"]))
|
||||
$alliance["signatures"] = explode(';', substr($alliance["signatures"], 1), -1);
|
||||
else
|
||||
$alliance["signatures"] = array();
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE id = $hash;");
|
||||
if (!empty($alliance["signatures"])) {
|
||||
$alliance["signatures"] = explode(';', substr($alliance["signatures"], 1), -1);
|
||||
} else {
|
||||
$alliance["signatures"] = array();
|
||||
}
|
||||
|
||||
$alliance["signatures"][] = $planete->id_user;
|
||||
$newnb = count($alliance["signatures"]);
|
||||
$alliance["signatures"] = ';'.implode(';', $alliance["signatures"]).';';
|
||||
$bdd->escape($alliance["signatures"]);
|
||||
$bdd->query("UPDATE $table_alliances_creation SET signatures = '".$alliance["signatures"]."' WHERE id = $hash;");
|
||||
if (debut_d_univers) //Si on est en début d'univers, on recherche une planète du joueur fondateur
|
||||
$planete_fondateur = $bdd->unique_query("SELECT id FROM $table_planete WHERE id_user = ".$alliance["fondateur"]." ORDER BY id ASC LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
if ($newnb >= nb_signatures)
|
||||
{
|
||||
if (debut_d_univers && $newnb == nb_signatures && empty($planete_fondateur->vaisseaux[2]))
|
||||
{
|
||||
//On donne un vaisseau de colonisation au fondateur
|
||||
$planete_fondateur = new Planete($planete_fondateur["id"]);
|
||||
$planete_fondateur->vaisseaux[2]++;
|
||||
unset($planete_fondateur);
|
||||
$alliance["signatures"][] = $planete->id_user;
|
||||
$newnb = count($alliance["signatures"]);
|
||||
$alliance["signatures"] = ';'.implode(';', $alliance["signatures"]).';';
|
||||
$bdd->escape($alliance["signatures"]);
|
||||
$bdd->query("UPDATE $table_alliances_creation SET signatures = '".$alliance["signatures"]."' WHERE id = $hash;");
|
||||
if (debut_d_univers) { //Si on est en début d'univers, on recherche une planète du joueur fondateur
|
||||
$planete_fondateur = $bdd->unique_query("SELECT id FROM $table_planete WHERE id_user = ".$alliance["fondateur"]." ORDER BY id ASC LIMIT 1;");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
if ($newnb >= nb_signatures) {
|
||||
if (debut_d_univers && $newnb == nb_signatures && empty($planete_fondateur->vaisseaux[2])) {
|
||||
//On donne un vaisseau de colonisation au fondateur
|
||||
$planete_fondateur = new Planete($planete_fondateur["id"]);
|
||||
$planete_fondateur->vaisseaux[2]++;
|
||||
unset($planete_fondateur);
|
||||
|
||||
send_mp($alliance["fondateur"], "Nouvelle signature pour votre alliance !", $planete->pseudo." vient de ratifier votre alliance, portant ainsi à ".$newnb." le nombre de signatures.<br /><br />Vous avez suffisamment de signatures pour coloniser un astéroïde. Pour vous féliciter, le conseil intergalactique a décidé de vous offrir un vaisseau de colonisation pour aller coloniser un astéroide afin d'implanter votre alliance.");
|
||||
}
|
||||
else
|
||||
//TODO refaire un message plus RP
|
||||
send_mp($alliance["fondateur"], "Nouvelle signature pour votre alliance !", $planete->pseudo." vient de ratifier votre alliance, portant ainsi à ".$newnb." le nombre de signatures.<br /><br />Vous avez suffisamment de signatures pour coloniser un astéroïde. Envoyez-en un dès maintenant !");
|
||||
}
|
||||
else
|
||||
send_mp($alliance["fondateur"], "Nouvelle signature pour votre alliance !", $planete->pseudo." vient de ratifier votre alliance, portant ainsi à ".$newnb." le nombre de signatures.");
|
||||
send_mp($alliance["fondateur"], "Nouvelle signature pour votre alliance !", $planete->pseudo." vient de ratifier votre alliance, portant ainsi à ".$newnb." le nombre de signatures.<br /><br />Vous avez suffisamment de signatures pour coloniser un astéroïde. Pour vous féliciter, le conseil intergalactique a décidé de vous offrir un vaisseau de colonisation pour aller coloniser un astéroide afin d'implanter votre alliance.");
|
||||
} else {
|
||||
//TODO refaire un message plus RP
|
||||
send_mp($alliance["fondateur"], "Nouvelle signature pour votre alliance !", $planete->pseudo." vient de ratifier votre alliance, portant ainsi à ".$newnb." le nombre de signatures.<br /><br />Vous avez suffisamment de signatures pour coloniser un astéroïde. Envoyez-en un dès maintenant !");
|
||||
}
|
||||
} else {
|
||||
send_mp($alliance["fondateur"], "Nouvelle signature pour votre alliance !", $planete->pseudo." vient de ratifier votre alliance, portant ainsi à ".$newnb." le nombre de signatures.");
|
||||
}
|
||||
|
||||
erreur("Votre signature a bien été prise en compte !", "green");
|
||||
}
|
||||
else
|
||||
redirection($VAR["menu"]["alliance"]);
|
||||
erreur("Votre signature a bien été prise en compte !", "green");
|
||||
} else {
|
||||
redirection($VAR["menu"]["alliance"]);
|
||||
}
|
||||
} else {
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($hash);
|
||||
$fonder = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE fondateur = ".$planete->id_user." LIMIT 1;");
|
||||
if (!empty($fonder)) {
|
||||
$bdd->deconnexion();
|
||||
erreur("Vous ne pouvez pas ratifier d'alliance car vous en fonder actuellement une !", "red");
|
||||
}
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE lien = '$hash';");
|
||||
$ratifier = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE signatures LIKE '%;".$planete->id_user.";%' LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($alliance) && sha1($alliance['tag'].'Hb$'.$alliance['nom_alliance'].'☺Ø'.$alliance['fondateur'].'‘«'.$planete->race) == $hash) {
|
||||
if (!empty($alliance["signatures"])) {
|
||||
$alliance["signatures"] = explode(';', substr($alliance["signatures"], 1), -1);
|
||||
if (in_array($planete->id_user, $alliance["signatures"])) {
|
||||
erreur("Vous avez déjà ratifier cette alliance !");
|
||||
}
|
||||
$alliance["nbsignatures"] = count($alliance["signatures"]);
|
||||
} else {
|
||||
$alliance["nbsignatures"] = 0;
|
||||
}
|
||||
$template->assign("alliance", $alliance);
|
||||
$template->assign("ratifier", $ratifier);
|
||||
} elseif (!empty($alliance)) {
|
||||
erreur("Impossible de ratifier cette alliance.<br />Vous n'êtes peut-être pas de la même race que le fondateur.", 'red', $VAR["menu"]["alliance"], 4000);
|
||||
} else {
|
||||
erreur("Vous ne pouvez plus signer pour cette alliance !", 'red', $_SERVER["HTTP_REFERER"], 4000);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($hash);
|
||||
$fonder = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE fondateur = ".$planete->id_user." LIMIT 1;");
|
||||
if (!empty($fonder))
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
erreur("Vous ne pouvez pas ratifier d'alliance car vous en fonder actuellement une !", "red");
|
||||
}
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE lien = '$hash';");
|
||||
$ratifier = $bdd->unique_query("SELECT * FROM $table_alliances_creation WHERE signatures LIKE '%;".$planete->id_user.";%' LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($alliance) && sha1($alliance['tag'].'Hb$'.$alliance['nom_alliance'].'☺Ø'.$alliance['fondateur'].'‘«'.$planete->race) == $hash)
|
||||
{
|
||||
if (!empty($alliance["signatures"]))
|
||||
{
|
||||
$alliance["signatures"] = explode(';', substr($alliance["signatures"], 1), -1);
|
||||
if (in_array($planete->id_user, $alliance["signatures"]))
|
||||
erreur("Vous avez déjà ratifier cette alliance !");
|
||||
$alliance["nbsignatures"] = count($alliance["signatures"]);
|
||||
}
|
||||
else
|
||||
$alliance["nbsignatures"] = 0;
|
||||
$template->assign("alliance", $alliance);
|
||||
$template->assign("ratifier", $ratifier);
|
||||
}
|
||||
elseif (!empty($alliance))
|
||||
erreur("Impossible de ratifier cette alliance.<br />Vous n'êtes peut-être pas de la même race que le fondateur.", 'red', $VAR["menu"]["alliance"], 4000);
|
||||
else
|
||||
erreur("Vous ne pouvez plus signer pour cette alliance !", 'red', $_SERVER["HTTP_REFERER"], 4000);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
$id = intval(gpc('v'));
|
||||
$page = 'alliance/view';
|
||||
|
|
@ -7,19 +10,19 @@ $page = 'alliance/view';
|
|||
$bdd->reconnexion();
|
||||
$alliance = $bdd->unique_query("SELECT * FROM $table_alliances WHERE id = $id;");
|
||||
$nbmembres = $bdd->unique_query("SELECT COUNT(id) AS nbmembres FROM $table_user WHERE id_alliance = $id;");
|
||||
if ($planete->id_alliance == $id)
|
||||
if ($planete->id_alliance == $id) {
|
||||
$grade = $bdd->unique_query("SELECT nom FROM $table_alliances_grade WHERE id = ".$planete->id_grade_alliance.";");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (!empty($alliance))
|
||||
{
|
||||
$template->assign("alliance", $alliance);
|
||||
$template->assign("nbmembres", $nbmembres['nbmembres']);
|
||||
if (empty($grade))
|
||||
$template->assign("grade", "Invité");
|
||||
else
|
||||
$template->assign("grade", $grade["nom"]);
|
||||
if (!empty($alliance)) {
|
||||
$template->assign("alliance", $alliance);
|
||||
$template->assign("nbmembres", $nbmembres['nbmembres']);
|
||||
if (empty($grade)) {
|
||||
$template->assign("grade", "Invité");
|
||||
} else {
|
||||
$template->assign("grade", $grade["nom"]);
|
||||
}
|
||||
else
|
||||
} else {
|
||||
redirection($VAR["menu"]["alliance"]);
|
||||
?>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,44 +1,46 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ./'.$VAR['first_page']); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ./'.$VAR['first_page']);
|
||||
exit;
|
||||
}
|
||||
$page = 'arbre';
|
||||
$titre = 'Arbre des technologies';
|
||||
|
||||
if (empty($_GET['q']))
|
||||
$_GET['q'] = '';
|
||||
if (empty($_GET['q'])) {
|
||||
$_GET['q'] = '';
|
||||
}
|
||||
$template->assign('defaut', gpc('q'));
|
||||
|
||||
//Récupération et vérification de la race voulue ou définition d'une race par défaut
|
||||
if (empty($_GET['r']) || (gpc('r') != 'humain' && gpc('r') != 'covenant'))
|
||||
$_GET['r'] = $planete->race;
|
||||
if (empty($_GET['r']) || (gpc('r') != 'humain' && gpc('r') != 'covenant')) {
|
||||
$_GET['r'] = $planete->race;
|
||||
}
|
||||
|
||||
$race = gpc('r');
|
||||
$template->assign('raceAff', $race);
|
||||
|
||||
if (SURFACE == "asteroide")
|
||||
{
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->batiments as $id => $batiment)
|
||||
{
|
||||
if (!empty($LANG[$race]["alli_batiments"]["noms_sing"][$id]))
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $batiment,
|
||||
'etat' => dAlliancesBatiments::needed($id, $planete, true)
|
||||
);
|
||||
}
|
||||
$template->assign('batiments', $TEMP_liste);
|
||||
}
|
||||
else
|
||||
{
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->batiments as $id => $batiment)
|
||||
{
|
||||
if (!empty($LANG[$race]["batiments"]["noms_sing"][$id]))
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $batiment,
|
||||
'etat' => dBatiments::needed($id, $planete, true)
|
||||
);
|
||||
}
|
||||
$template->assign('batiments', $TEMP_liste);
|
||||
if (SURFACE == "asteroide") {
|
||||
$TEMP_liste = array();
|
||||
foreach ($planete->batiments as $id => $batiment) {
|
||||
if (!empty($LANG[$race]["alli_batiments"]["noms_sing"][$id])) {
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $batiment,
|
||||
'etat' => dAlliancesBatiments::needed($id, $planete, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
$template->assign('batiments', $TEMP_liste);
|
||||
} else {
|
||||
$TEMP_liste = array();
|
||||
foreach ($planete->batiments as $id => $batiment) {
|
||||
if (!empty($LANG[$race]["batiments"]["noms_sing"][$id])) {
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $batiment,
|
||||
'etat' => dBatiments::needed($id, $planete, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
$template->assign('batiments', $TEMP_liste);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -55,37 +57,36 @@ else
|
|||
$template->assign('technologies',$TEMP_technologies);
|
||||
*/
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->casernes as $id => $unite)
|
||||
{
|
||||
if (!empty($LANG[$race]["caserne"]["noms_sing"][$id]))
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $unite,
|
||||
'etat' => dCaserne::needed($id, $planete, true)
|
||||
);
|
||||
foreach ($planete->casernes as $id => $unite) {
|
||||
if (!empty($LANG[$race]["caserne"]["noms_sing"][$id])) {
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $unite,
|
||||
'etat' => dCaserne::needed($id, $planete, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
$template->assign('caserne', $TEMP_liste);
|
||||
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->terrestres as $id => $unite)
|
||||
{
|
||||
if (!empty($LANG[$race]["terrestre"]["noms_sing"][$id]))
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $unite,
|
||||
'etat' => dTerrestre::needed($id, $planete, true)
|
||||
);
|
||||
foreach ($planete->terrestres as $id => $unite) {
|
||||
if (!empty($LANG[$race]["terrestre"]["noms_sing"][$id])) {
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $unite,
|
||||
'etat' => dTerrestre::needed($id, $planete, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
$template->assign('unites', $TEMP_liste);
|
||||
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->vaisseaux as $id => $unite)
|
||||
{
|
||||
if (!empty($LANG[$race]["vaisseaux"]["noms_sing"][$id]))
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $unite,
|
||||
'etat' => dSpatial::needed($id, $planete, true)
|
||||
);
|
||||
foreach ($planete->vaisseaux as $id => $unite) {
|
||||
if (!empty($LANG[$race]["vaisseaux"]["noms_sing"][$id])) {
|
||||
$TEMP_liste[$id] = array(
|
||||
'niveau' => $unite,
|
||||
'etat' => dSpatial::needed($id, $planete, true)
|
||||
);
|
||||
}
|
||||
}
|
||||
$template->assign('vaisseaux', $TEMP_liste);
|
||||
|
||||
unset($TEMP_liste, $id, $unite);
|
||||
?>
|
||||
|
|
@ -1,97 +1,92 @@
|
|||
<?php
|
||||
if(!defined('ONYX'))
|
||||
exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$titre = 'Bâtiments';
|
||||
|
||||
//Si l'on est sur un astéroide, on vérifie que le joueur ait les permissions nécessaire
|
||||
if (SURFACE == "asteroide" && !($planete->permissions_alliance &1))
|
||||
erreur("Vous n'avez pas le grade requis pour vous occuper des bâtiments de l'astéroide.");
|
||||
if (SURFACE == "asteroide" && !($planete->permissions_alliance &1)) {
|
||||
erreur("Vous n'avez pas le grade requis pour vous occuper des bâtiments de l'astéroide.");
|
||||
}
|
||||
|
||||
//Lancement d'une nouvelle construction
|
||||
if (isset($_GET['c']))
|
||||
{
|
||||
//On vérifie qu'il n'y ait pas de technologie en cours de recherche si l'on veut améliorer le centre de recherche
|
||||
if(gpc('c') == 6 && $planete->file_tech->hasObject())
|
||||
erreur('Une technologie est en cours de recherche dans votre laboratoire, vous ne pouvez pas faire de travaux !');
|
||||
if (isset($_GET['c'])) {
|
||||
//On vérifie qu'il n'y ait pas de technologie en cours de recherche si l'on veut améliorer le centre de recherche
|
||||
if (gpc('c') == 6 && $planete->file_tech->hasObject()) {
|
||||
erreur('Une technologie est en cours de recherche dans votre laboratoire, vous ne pouvez pas faire de travaux !');
|
||||
}
|
||||
|
||||
$planete->file_bat->addObjet(intval(gpc('c')), 1, $planete);
|
||||
$planete->file_bat->addObjet(intval(gpc('c')), 1, $planete);
|
||||
|
||||
redirection($VAR['menu']['batiments']);
|
||||
redirection($VAR['menu']['batiments']);
|
||||
}
|
||||
//Lancement d'une déconstruction
|
||||
if (isset($_GET['d']))
|
||||
{
|
||||
//On vérifie qu'il n'y ait pas de technologie en cours de recherche si l'on veut améliorer le centre de recherche
|
||||
if($_GET['d'] == 6 && $planete->file_tech->hasObject())
|
||||
erreur('Une technologie est en cours de recherche dans votre laboratoire, vous ne pouvez pas faire de travaux !');
|
||||
if (isset($_GET['d'])) {
|
||||
//On vérifie qu'il n'y ait pas de technologie en cours de recherche si l'on veut améliorer le centre de recherche
|
||||
if ($_GET['d'] == 6 && $planete->file_tech->hasObject()) {
|
||||
erreur('Une technologie est en cours de recherche dans votre laboratoire, vous ne pouvez pas faire de travaux !');
|
||||
}
|
||||
|
||||
$planete->file_bat->addDemolition(intval(gpc('d')), 1, $planete);
|
||||
$planete->file_bat->addDemolition(intval(gpc('d')), 1, $planete);
|
||||
|
||||
redirection($VAR['menu']['batiments']);
|
||||
redirection($VAR['menu']['batiments']);
|
||||
}
|
||||
//Annulation d'une nouvelle construction
|
||||
if (isset($_GET['a']) && isset($_GET['b']))
|
||||
{
|
||||
$planete->file_bat->delObjet(intval(gpc('b')), 1, intval(gpc('a')), $planete);
|
||||
if (isset($_GET['a']) && isset($_GET['b'])) {
|
||||
$planete->file_bat->delObjet(intval(gpc('b')), 1, intval(gpc('a')), $planete);
|
||||
|
||||
redirection($VAR['menu']['batiments']);
|
||||
redirection($VAR['menu']['batiments']);
|
||||
}
|
||||
|
||||
if (SURFACE == "planete")
|
||||
{
|
||||
$page = 'batiments';
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->batiments as $i => $niveau)
|
||||
{
|
||||
//On vérifie le type par rapport à l'onglet
|
||||
if (isset($_GET["n"]) && !(intval($_GET["n"])& dBatiments::type($i)))
|
||||
continue;
|
||||
if (SURFACE == "planete") {
|
||||
$page = 'batiments';
|
||||
$TEMP_liste = array();
|
||||
foreach ($planete->batiments as $i => $niveau) {
|
||||
//On vérifie le type par rapport à l'onglet
|
||||
if (isset($_GET["n"]) && !(intval($_GET["n"])& dBatiments::type($i))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
//Si l'on est pas sur la planète mère, on désactive le laboratoire
|
||||
if ($i == 6 && $queryPlanetes[0]['id'] != $planete->id)
|
||||
continue;
|
||||
//Si l'on est pas sur la planète mère, on désactive le laboratoire
|
||||
if ($i == 6 && $queryPlanetes[0]['id'] != $planete->id) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!empty($LANG[$planete->race]['batiments']['noms_sing'][$i]) && dBatiments::needed($i, $planete))
|
||||
{
|
||||
$TEMP_liste[] = array (
|
||||
'id' => $i,
|
||||
'image' => dBatiments::image($i, $planete),
|
||||
'niveau' => $niveau,
|
||||
'nec_metal' => dBatiments::metal($i, $niveau+1, $planete),
|
||||
'nec_cristal' => dBatiments::cristal($i, $niveau+1, $planete),
|
||||
'nec_hydrogene' => dBatiments::hydrogene($i, $niveau+1, $planete),
|
||||
'temps' => sec(dBatiments::temps($i, $niveau+1, $planete)),
|
||||
'enfile' => $planete->file_bat->objectInFile($i)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$page = 'batiments_alli';
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->batiments as $i => $niveau)
|
||||
{
|
||||
if (!empty($LANG[$planete->race]['alli_batiments']['noms_sing'][$i]) && dAlliancesBatiments::needed($i, $planete) && $niveau < 6)
|
||||
{
|
||||
$TEMP_liste[] = array (
|
||||
'id' => $i,
|
||||
'image' => dAlliancesBatiments::image($i, $planete),
|
||||
'niveau' => $niveau,
|
||||
'nec_metal' => dAlliancesBatiments::metal($i, $niveau+1, $planete),
|
||||
'nec_cristal' => dAlliancesBatiments::cristal($i, $niveau+1, $planete),
|
||||
'nec_hydrogene' => dAlliancesBatiments::hydrogene($i, $niveau+1, $planete),
|
||||
'nec_credits' => dAlliancesBatiments::credits($i, $niveau+1, $planete),
|
||||
'temps' => sec(dAlliancesBatiments::temps($i, $niveau+1, $planete)),
|
||||
'enfile' => $planete->file_bat->objectInFile($i)
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!empty($LANG[$planete->race]['batiments']['noms_sing'][$i]) && dBatiments::needed($i, $planete)) {
|
||||
$TEMP_liste[] = array(
|
||||
'id' => $i,
|
||||
'image' => dBatiments::image($i, $planete),
|
||||
'niveau' => $niveau,
|
||||
'nec_metal' => dBatiments::metal($i, $niveau+1, $planete),
|
||||
'nec_cristal' => dBatiments::cristal($i, $niveau+1, $planete),
|
||||
'nec_hydrogene' => dBatiments::hydrogene($i, $niveau+1, $planete),
|
||||
'temps' => sec(dBatiments::temps($i, $niveau+1, $planete)),
|
||||
'enfile' => $planete->file_bat->objectInFile($i)
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$page = 'batiments_alli';
|
||||
$TEMP_liste = array();
|
||||
foreach ($planete->batiments as $i => $niveau) {
|
||||
if (!empty($LANG[$planete->race]['alli_batiments']['noms_sing'][$i]) && dAlliancesBatiments::needed($i, $planete) && $niveau < 6) {
|
||||
$TEMP_liste[] = array(
|
||||
'id' => $i,
|
||||
'image' => dAlliancesBatiments::image($i, $planete),
|
||||
'niveau' => $niveau,
|
||||
'nec_metal' => dAlliancesBatiments::metal($i, $niveau+1, $planete),
|
||||
'nec_cristal' => dAlliancesBatiments::cristal($i, $niveau+1, $planete),
|
||||
'nec_hydrogene' => dAlliancesBatiments::hydrogene($i, $niveau+1, $planete),
|
||||
'nec_credits' => dAlliancesBatiments::credits($i, $niveau+1, $planete),
|
||||
'temps' => sec(dAlliancesBatiments::temps($i, $niveau+1, $planete)),
|
||||
'enfile' => $planete->file_bat->objectInFile($i)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
$template->assign('batiments', $TEMP_liste);
|
||||
$template->assign('onglet', gpc("n"));
|
||||
$template->assign('files', $planete->file_bat->printFile($planete));
|
||||
|
||||
unset($TEMP_liste, $niveau, $i);
|
||||
?>
|
||||
|
|
@ -1,63 +1,64 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$page = 'carte';
|
||||
$titre = 'Carte spatiale';
|
||||
|
||||
//Récupération d'un numéro d'amas à regarder
|
||||
if (isset($_GET['amas']))
|
||||
$g = intval(gpc('amas'));
|
||||
elseif (isset($_GET['galaxie']))
|
||||
$g = intval(gpc('galaxie'));
|
||||
else
|
||||
$g = $planete->galaxie;
|
||||
if (isset($_GET['amas'])) {
|
||||
$g = intval(gpc('amas'));
|
||||
} elseif (isset($_GET['galaxie'])) {
|
||||
$g = intval(gpc('galaxie'));
|
||||
} else {
|
||||
$g = $planete->galaxie;
|
||||
}
|
||||
|
||||
//Validation du numéro de l'amas
|
||||
if ($planete->auth_level >= 5 && $g <= 0)
|
||||
$g = 0;
|
||||
elseif ($g < 1)
|
||||
$g = 1;
|
||||
if ($g > $VAR['nb_amas'])
|
||||
$g = 1;
|
||||
if ($planete->auth_level >= 5 && $g <= 0) {
|
||||
$g = 0;
|
||||
} elseif ($g < 1) {
|
||||
$g = 1;
|
||||
}
|
||||
if ($g > $VAR['nb_amas']) {
|
||||
$g = 1;
|
||||
}
|
||||
|
||||
//Récupération d'un numéro de système à regarder
|
||||
if (isset($_GET['systeme']))
|
||||
$s = intval(gpc('systeme'));
|
||||
elseif (isset($_GET['ss']))
|
||||
$s = intval(gpc('ss'));
|
||||
else
|
||||
$s = $planete->ss;
|
||||
if (isset($_GET['systeme'])) {
|
||||
$s = intval(gpc('systeme'));
|
||||
} elseif (isset($_GET['ss'])) {
|
||||
$s = intval(gpc('ss'));
|
||||
} else {
|
||||
$s = $planete->ss;
|
||||
}
|
||||
|
||||
//Validation du numéro de système
|
||||
if ($s < 1)
|
||||
$s = 1;
|
||||
if ($s > $VAR['nb_systeme'])
|
||||
$s = $VAR['nb_systeme'];
|
||||
if ($s < 1) {
|
||||
$s = 1;
|
||||
}
|
||||
if ($s > $VAR['nb_systeme']) {
|
||||
$s = $VAR['nb_systeme'];
|
||||
}
|
||||
|
||||
//Calcul des prochains amas et systèmes
|
||||
if ($s == 1 && $g > 1)
|
||||
{
|
||||
$Gmu = $g - 1;
|
||||
$Smu = $VAR['nb_systeme'];
|
||||
if ($s == 1 && $g > 1) {
|
||||
$Gmu = $g - 1;
|
||||
$Smu = $VAR['nb_systeme'];
|
||||
} elseif ($s == 1) {
|
||||
$Gmu = 15;
|
||||
$Smu = $VAR['nb_systeme'];
|
||||
} else {
|
||||
$Gmu = $g;
|
||||
$Smu = $s - 1;
|
||||
}
|
||||
elseif ($s == 1)
|
||||
{
|
||||
$Gmu = 15;
|
||||
$Smu = $VAR['nb_systeme'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$Gmu = $g;
|
||||
$Smu = $s - 1;
|
||||
}
|
||||
if ($s == $VAR['nb_systeme'])
|
||||
{
|
||||
$Gpu = $g + 1;
|
||||
$Spu = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$Gpu = $g;
|
||||
$Spu = $s + 1;
|
||||
if ($s == $VAR['nb_systeme']) {
|
||||
$Gpu = $g + 1;
|
||||
$Spu = 1;
|
||||
} else {
|
||||
$Gpu = $g;
|
||||
$Spu = $s + 1;
|
||||
}
|
||||
|
||||
//Erreur au cas où la zone soit trop lointaine par rapport au niveau de la technologie
|
||||
|
|
@ -66,37 +67,32 @@ else
|
|||
|
||||
//Génération de la carte à afficher
|
||||
$TEMP_carte = array();
|
||||
for ($i = 1; $i <= $VAR['nb_planete']; $i++)
|
||||
{
|
||||
//Cas d'un système à astéroïde
|
||||
if ($s%5 == 2 && $i == ceil($VAR['nb_planete']/2))
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$d = $bdd->unique_query("SELECT race, nom_asteroide, debris_met, debris_cri, nom_alliance, image, tag, fondateur FROM $table_alliances WHERE galaxie = $g AND ss = $s;");
|
||||
$bdd->deconnexion();
|
||||
if($d)
|
||||
$TEMP_carte[] = array('A', $d['nom_asteroide'], $d['debris_met'], $d['debris_cri'], $d['race'], $d['nom_alliance'], $d['tag'], $d['image'], 0);
|
||||
else
|
||||
$TEMP_carte[] = array('A');
|
||||
}
|
||||
for ($i = 1; $i <= $VAR['nb_planete']; $i++) {
|
||||
//Cas d'un système à astéroïde
|
||||
if ($s%5 == 2 && $i == ceil($VAR['nb_planete']/2)) {
|
||||
$bdd->reconnexion();
|
||||
$d = $bdd->unique_query("SELECT race, nom_asteroide, debris_met, debris_cri, nom_alliance, image, tag, fondateur FROM $table_alliances WHERE galaxie = $g AND ss = $s;");
|
||||
$bdd->deconnexion();
|
||||
if ($d) {
|
||||
$TEMP_carte[] = array('A', $d['nom_asteroide'], $d['debris_met'], $d['debris_cri'], $d['race'], $d['nom_alliance'], $d['tag'], $d['image'], 0);
|
||||
} else {
|
||||
$TEMP_carte[] = array('A');
|
||||
}
|
||||
}
|
||||
|
||||
$bdd->reconnexion();
|
||||
$resultat = $bdd->query("SELECT id FROM $table_planete WHERE galaxie = $g AND ss = $s AND position = $i;");
|
||||
if($resultat)
|
||||
{
|
||||
$d = $bdd->unique_query("SELECT P.nom_planete, P.image, P.debris_met, P.debris_cri, U.pseudo, U.race, U.politique, U.id_alliance, A.tag FROM $table_planete P INNER JOIN $table_user U ON U.id = P.id_user LEFT OUTER JOIN $table_alliances A ON A.id = U.id_alliance WHERE P.galaxie = $g AND P.ss = $s AND P.position = $i;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$resultat = $bdd->query("SELECT id FROM $table_planete WHERE galaxie = $g AND ss = $s AND position = $i;");
|
||||
if ($resultat) {
|
||||
$d = $bdd->unique_query("SELECT P.nom_planete, P.image, P.debris_met, P.debris_cri, U.pseudo, U.race, U.politique, U.id_alliance, A.tag FROM $table_planete P INNER JOIN $table_user U ON U.id = P.id_user LEFT OUTER JOIN $table_alliances A ON A.id = U.id_alliance WHERE P.galaxie = $g AND P.ss = $s AND P.position = $i;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$TEMP_carte[] = array($i, $d['nom_planete'], $d['debris_met'], $d['debris_cri'], $d['race'], $d['pseudo'], $d['tag'], $d['image'], $d['politique']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
$TEMP_carte[] = array($i);
|
||||
}
|
||||
$TEMP_carte[] = array($i, $d['nom_planete'], $d['debris_met'], $d['debris_cri'], $d['race'], $d['pseudo'], $d['tag'], $d['image'], $d['politique']);
|
||||
} else {
|
||||
$bdd->deconnexion();
|
||||
$TEMP_carte[] = array($i);
|
||||
}
|
||||
}
|
||||
$template->assign('carte', $TEMP_carte);
|
||||
$template->assign('position', array($g, $s, $Gpu, $Spu, $Gmu, $Smu));
|
||||
|
||||
unset($TEMP_carte, $g, $s, $Gpu, $Spu, $Gmu, $Smu, $resultat, $d, $i);
|
||||
?>
|
||||
|
|
@ -1,51 +1,52 @@
|
|||
<?php
|
||||
if(!defined('ONYX'))
|
||||
exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$page = 'caserne';
|
||||
$titre = $LANG[$planete->race]['batiments']['noms_sing'][9];
|
||||
|
||||
//Vérification que le joueur ait bien une caserne avant d'afficher la page
|
||||
if ($planete->batiments[9] <= 0)
|
||||
erreur('Vous devez d\'abord construire une '.$LANG[$planete->race]['batiments']['noms_sing'][9], "red", '?p=batiments', 3500);
|
||||
if ($planete->batiments[9] <= 0) {
|
||||
erreur('Vous devez d\'abord construire une '.$LANG[$planete->race]['batiments']['noms_sing'][9], "red", '?p=batiments', 3500);
|
||||
}
|
||||
|
||||
$lieu = intval(gpc("k"));
|
||||
if ($lieu >= $planete->batiments[9] || $lieu < 0)
|
||||
$lieu = 0;
|
||||
if ($lieu >= $planete->batiments[9] || $lieu < 0) {
|
||||
$lieu = 0;
|
||||
}
|
||||
|
||||
//Lancement d'un nouvel entrainement
|
||||
if (isset($_GET['c']) && ($id = intval(gpc('c'))) >= 0 && $nbc = floor(gpc('cas'.$id, 'post')))
|
||||
{
|
||||
$planete->file_cas->addObjet($id, $nbc, $planete, $lieu);
|
||||
if (isset($_GET['c']) && ($id = intval(gpc('c'))) >= 0 && $nbc = floor(gpc('cas'.$id, 'post'))) {
|
||||
$planete->file_cas->addObjet($id, $nbc, $planete, $lieu);
|
||||
|
||||
redirection($VAR['menu']['caserne']."&k=".$lieu);
|
||||
redirection($VAR['menu']['caserne']."&k=".$lieu);
|
||||
}
|
||||
//Annulation d'un entrainement
|
||||
if (isset($_GET['a']) && isset($_GET['b']))
|
||||
{
|
||||
$n = intval(gpc('s'));
|
||||
if (empty($n)) $n = 1;
|
||||
$planete->file_cas->delObjet(intval(gpc('b')), $n, intval(gpc('a')), $planete);
|
||||
if (isset($_GET['a']) && isset($_GET['b'])) {
|
||||
$n = intval(gpc('s'));
|
||||
if (empty($n)) {
|
||||
$n = 1;
|
||||
}
|
||||
$planete->file_cas->delObjet(intval(gpc('b')), $n, intval(gpc('a')), $planete);
|
||||
|
||||
redirection($VAR['menu']['caserne']."&k=".$lieu);
|
||||
redirection($VAR['menu']['caserne']."&k=".$lieu);
|
||||
}
|
||||
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->casernes as $i => $nombre)
|
||||
{
|
||||
if (!empty($LANG[$planete->race]['caserne']['noms_sing'][$i]) && dCaserne::needed($i, $planete))
|
||||
{
|
||||
$TEMP_liste[] = array (
|
||||
'id' => $i,
|
||||
'image' => dCaserne::image($i, $planete),
|
||||
'nombre' => $nombre,
|
||||
'nec_metal' => dCaserne::metal($i, 1, $planete),
|
||||
'nec_cristal' => dCaserne::cristal($i, 1, $planete),
|
||||
'nec_hydrogene' => dCaserne::hydrogene($i, 1, $planete),
|
||||
'temps' => sec(dCaserne::temps($i, 1, $planete)),
|
||||
'enfile' => $planete->file_cas->objectInFile($i)
|
||||
);
|
||||
}
|
||||
foreach ($planete->casernes as $i => $nombre) {
|
||||
if (!empty($LANG[$planete->race]['caserne']['noms_sing'][$i]) && dCaserne::needed($i, $planete)) {
|
||||
$TEMP_liste[] = array(
|
||||
'id' => $i,
|
||||
'image' => dCaserne::image($i, $planete),
|
||||
'nombre' => $nombre,
|
||||
'nec_metal' => dCaserne::metal($i, 1, $planete),
|
||||
'nec_cristal' => dCaserne::cristal($i, 1, $planete),
|
||||
'nec_hydrogene' => dCaserne::hydrogene($i, 1, $planete),
|
||||
'temps' => sec(dCaserne::temps($i, 1, $planete)),
|
||||
'enfile' => $planete->file_cas->objectInFile($i)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('unites', $TEMP_liste);
|
||||
|
|
@ -53,4 +54,3 @@ $template->assign('lieu', $lieu);
|
|||
$template->assign('files', $planete->file_cas->printFile($planete));
|
||||
|
||||
unset($TEMP_liste, $i, $n, $niveau);
|
||||
?>
|
||||
|
|
@ -1,69 +1,70 @@
|
|||
<?php
|
||||
if(!defined('ONYX'))
|
||||
exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$page = 'chantierspatial';
|
||||
if (SURFACE == "planete")
|
||||
$titre = ucfirst($LANG[$planete->race]['batiments']['noms_sing'][8]);
|
||||
else
|
||||
$titre = ucfirst($LANG[$planete->race]['alli_batiments']['noms_sing'][3]);
|
||||
if (SURFACE == "planete") {
|
||||
$titre = ucfirst($LANG[$planete->race]['batiments']['noms_sing'][8]);
|
||||
} else {
|
||||
$titre = ucfirst($LANG[$planete->race]['alli_batiments']['noms_sing'][3]);
|
||||
}
|
||||
|
||||
//Si l'on est sur un astéroide, on vérifie que le joueur ait les permissions nécessaire
|
||||
if (SURFACE == "asteroide" && !($planete->permissions_alliance &2))
|
||||
erreur("Vous n'avez pas le grade requis pour vous occuper des vaisseaux de l'astéroide.");
|
||||
if (SURFACE == "asteroide" && !($planete->permissions_alliance &2)) {
|
||||
erreur("Vous n'avez pas le grade requis pour vous occuper des vaisseaux de l'astéroide.");
|
||||
}
|
||||
|
||||
//Vérification que le joueur ait bien un labo avant d'afficher la page
|
||||
if (SURFACE == "planete" && $planete->batiments[8] <= 0)
|
||||
erreur('Vous devez d\'abord construire un '.$LANG[$planete->race]['batiments']['noms_sing'][8], "red", '?p=batiments', 3500);
|
||||
elseif(SURFACE == "asteroide" && $planete->batiments[3] <= 0)
|
||||
erreur('Vous devez d\'abord construire une '.$LANG[$planete->race]['alli_batiments']['noms_sing'][3], "red", '?p=batiments', 3500);
|
||||
|
||||
if (SURFACE == "planete")
|
||||
{
|
||||
$lieu = intval(gpc("k"));
|
||||
if ($lieu >= $planete->batiments[8] || $lieu < 0)
|
||||
$lieu = 0;
|
||||
if (SURFACE == "planete" && $planete->batiments[8] <= 0) {
|
||||
erreur('Vous devez d\'abord construire un '.$LANG[$planete->race]['batiments']['noms_sing'][8], "red", '?p=batiments', 3500);
|
||||
} elseif (SURFACE == "asteroide" && $planete->batiments[3] <= 0) {
|
||||
erreur('Vous devez d\'abord construire une '.$LANG[$planete->race]['alli_batiments']['noms_sing'][3], "red", '?p=batiments', 3500);
|
||||
}
|
||||
elseif (SURFACE == "asteroide")
|
||||
{
|
||||
$lieu = intval(gpc("k"));
|
||||
if ($lieu >= $planete->batiments[3] || $lieu < 0)
|
||||
$lieu = 0;
|
||||
|
||||
if (SURFACE == "planete") {
|
||||
$lieu = intval(gpc("k"));
|
||||
if ($lieu >= $planete->batiments[8] || $lieu < 0) {
|
||||
$lieu = 0;
|
||||
}
|
||||
} elseif (SURFACE == "asteroide") {
|
||||
$lieu = intval(gpc("k"));
|
||||
if ($lieu >= $planete->batiments[3] || $lieu < 0) {
|
||||
$lieu = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//Lancement d'une nouvelle construction
|
||||
if (isset($_GET['v']) && ($id = intval(gpc('v'))) >= 0 && $nbv = floor(gpc('vais'.$id, 'post')))
|
||||
{
|
||||
$planete->file_vais->addObjet($id, $nbv, $planete, $lieu);
|
||||
if (isset($_GET['v']) && ($id = intval(gpc('v'))) >= 0 && $nbv = floor(gpc('vais'.$id, 'post'))) {
|
||||
$planete->file_vais->addObjet($id, $nbv, $planete, $lieu);
|
||||
|
||||
redirection($VAR['menu']['chantierspatial']."&k=".$lieu);
|
||||
redirection($VAR['menu']['chantierspatial']."&k=".$lieu);
|
||||
}
|
||||
//Annulation d'une nouvelle construction
|
||||
if (isset($_GET['a']) && isset($_GET['b']))
|
||||
{
|
||||
$n = intval(gpc('s'));
|
||||
if (empty($n)) $n = 1;
|
||||
$planete->file_vais->delObjet(intval(gpc('b')), $n, intval(gpc('a')), $planete);
|
||||
if (isset($_GET['a']) && isset($_GET['b'])) {
|
||||
$n = intval(gpc('s'));
|
||||
if (empty($n)) {
|
||||
$n = 1;
|
||||
}
|
||||
$planete->file_vais->delObjet(intval(gpc('b')), $n, intval(gpc('a')), $planete);
|
||||
|
||||
redirection($VAR['menu']['chantierspatial']."&k=".$lieu);
|
||||
redirection($VAR['menu']['chantierspatial']."&k=".$lieu);
|
||||
}
|
||||
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->vaisseaux as $i => $nombre)
|
||||
{
|
||||
if (!empty($LANG[$planete->race]['vaisseaux']['noms_sing'][$i]) && dSpatial::needed($i, $planete))
|
||||
{
|
||||
$TEMP_liste[] = array (
|
||||
'id' => $i,
|
||||
'image' => dSpatial::image($i, $planete),
|
||||
'nombre' => $nombre,
|
||||
'nec_metal' => dSpatial::metal($i, 1, $planete),
|
||||
'nec_cristal' => dSpatial::cristal($i, 1, $planete),
|
||||
'nec_hydrogene' => dSpatial::hydrogene($i, 1, $planete),
|
||||
'temps' => sec(dSpatial::temps($i, 1, $planete)),
|
||||
'enfile' => $planete->file_vais->objectInFile($i)
|
||||
);
|
||||
}
|
||||
foreach ($planete->vaisseaux as $i => $nombre) {
|
||||
if (!empty($LANG[$planete->race]['vaisseaux']['noms_sing'][$i]) && dSpatial::needed($i, $planete)) {
|
||||
$TEMP_liste[] = array(
|
||||
'id' => $i,
|
||||
'image' => dSpatial::image($i, $planete),
|
||||
'nombre' => $nombre,
|
||||
'nec_metal' => dSpatial::metal($i, 1, $planete),
|
||||
'nec_cristal' => dSpatial::cristal($i, 1, $planete),
|
||||
'nec_hydrogene' => dSpatial::hydrogene($i, 1, $planete),
|
||||
'temps' => sec(dSpatial::temps($i, 1, $planete)),
|
||||
'enfile' => $planete->file_vais->objectInFile($i)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('vaisseaux', $TEMP_liste);
|
||||
|
|
@ -71,4 +72,3 @@ $template->assign('lieu', $lieu);
|
|||
$template->assign('files', $planete->file_vais->printFile($planete));
|
||||
|
||||
unset($TEMP_liste, $i, $n, $niveau);
|
||||
?>
|
||||
|
|
@ -1,58 +1,60 @@
|
|||
<?php
|
||||
if(!defined('ONYX'))
|
||||
exit;
|
||||
if (!defined('ONYX')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
$page = $p;
|
||||
$onglet = gpc('n');
|
||||
if (!empty($onglet))
|
||||
$template->assign('onglet', $onglet);
|
||||
else
|
||||
$template->assign('onglet', "unites");
|
||||
if (!empty($onglet)) {
|
||||
$template->assign('onglet', $onglet);
|
||||
} else {
|
||||
$template->assign('onglet', "unites");
|
||||
}
|
||||
$titre = ucfirst($LANG[$planete->race]['batiments']['noms_sing'][7]);
|
||||
|
||||
//Vérification que le joueur ait bien un labo avant d'afficher la page
|
||||
if ($planete->batiments[7] <= 0)
|
||||
erreur('Vous devez d\'abord construire un '.$LANG[$planete->race]['batiments']['noms_sing'][7], "red", '?p=batiments', 3500);
|
||||
if ($planete->batiments[7] <= 0) {
|
||||
erreur('Vous devez d\'abord construire un '.$LANG[$planete->race]['batiments']['noms_sing'][7], "red", '?p=batiments', 3500);
|
||||
}
|
||||
|
||||
$lieu = intval(gpc("k"));
|
||||
if ($lieu >= $planete->batiments[7] || $lieu < 0)
|
||||
$lieu = 0;
|
||||
if ($lieu >= $planete->batiments[7] || $lieu < 0) {
|
||||
$lieu = 0;
|
||||
}
|
||||
|
||||
//Lancement d'une nouvelle construction
|
||||
if (isset($_GET['v']) && ($id = intval(gpc('v'))) >= 0 && $nbv = floor(gpc('terr'.$id, 'post')))
|
||||
{
|
||||
$planete->file_ter->addObjet($id, $nbv, $planete, $lieu);
|
||||
if (isset($_GET['v']) && ($id = intval(gpc('v'))) >= 0 && $nbv = floor(gpc('terr'.$id, 'post'))) {
|
||||
$planete->file_ter->addObjet($id, $nbv, $planete, $lieu);
|
||||
|
||||
redirection($VAR['menu'][$p].'&k='.$lieu.'&n='.$onglet);
|
||||
redirection($VAR['menu'][$p].'&k='.$lieu.'&n='.$onglet);
|
||||
}
|
||||
//Annulation d'une nouvelle construction
|
||||
if (isset($_GET['a']) && isset($_GET['b']))
|
||||
{
|
||||
$n = intval(gpc('s'));
|
||||
if (empty($n)) $n = 1;
|
||||
$planete->file_ter->delObjet(intval(gpc('b')), $n, intval(gpc('a')), $planete);
|
||||
if (isset($_GET['a']) && isset($_GET['b'])) {
|
||||
$n = intval(gpc('s'));
|
||||
if (empty($n)) {
|
||||
$n = 1;
|
||||
}
|
||||
$planete->file_ter->delObjet(intval(gpc('b')), $n, intval(gpc('a')), $planete);
|
||||
|
||||
redirection($VAR['menu'][$p].'&k='.$lieu.'&n='.$onglet);
|
||||
redirection($VAR['menu'][$p].'&k='.$lieu.'&n='.$onglet);
|
||||
}
|
||||
|
||||
$TEMP_liste = array();
|
||||
foreach($planete->terrestres as $i => $nombre)
|
||||
{
|
||||
$type = dTerrestre::type($i);
|
||||
foreach ($planete->terrestres as $i => $nombre) {
|
||||
$type = dTerrestre::type($i);
|
||||
|
||||
if (!empty($LANG[$planete->race]['terrestre']['noms_sing'][$i]) && (($onglet == "defenses" && !$type) || ($onglet != "defenses" && $type)) && dTerrestre::needed($i, $planete))
|
||||
{
|
||||
$TEMP_liste[] = array (
|
||||
'id' => $i,
|
||||
'image' => dTerrestre::image($i, $planete),
|
||||
'nombre' => $nombre,
|
||||
'nec_metal' => dTerrestre::metal($i, 1, $planete),
|
||||
'nec_cristal' => dTerrestre::cristal($i, 1, $planete),
|
||||
'nec_hydrogene' => dTerrestre::hydrogene($i, 1, $planete),
|
||||
'temps' => sec(dTerrestre::temps($i, 1, $planete)),
|
||||
'enfile' => $planete->file_ter->objectInFile($i)
|
||||
);
|
||||
}
|
||||
if (!empty($LANG[$planete->race]['terrestre']['noms_sing'][$i]) && (($onglet == "defenses" && !$type) || ($onglet != "defenses" && $type)) && dTerrestre::needed($i, $planete)) {
|
||||
$TEMP_liste[] = array(
|
||||
'id' => $i,
|
||||
'image' => dTerrestre::image($i, $planete),
|
||||
'nombre' => $nombre,
|
||||
'nec_metal' => dTerrestre::metal($i, 1, $planete),
|
||||
'nec_cristal' => dTerrestre::cristal($i, 1, $planete),
|
||||
'nec_hydrogene' => dTerrestre::hydrogene($i, 1, $planete),
|
||||
'temps' => sec(dTerrestre::temps($i, 1, $planete)),
|
||||
'enfile' => $planete->file_ter->objectInFile($i)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$template->assign('unites', $TEMP_liste);
|
||||
|
|
@ -60,4 +62,3 @@ $template->assign('lieu', $lieu);
|
|||
$template->assign('files', $planete->file_ter->printFile($planete));
|
||||
|
||||
unset($TEMP_liste, $i, $n, $niveau, $onglet, $type);
|
||||
?>
|
||||
|
|
@ -1,153 +1,133 @@
|
|||
<?php
|
||||
if(!defined('INDEX') || SURFACE != "planete") { header('Location: ./'.$VAR['first_page']); exit; }
|
||||
if (!defined('INDEX') || SURFACE != "planete") {
|
||||
header('Location: ./'.$VAR['first_page']);
|
||||
exit;
|
||||
}
|
||||
$page = 'description';
|
||||
$titre = 'Détails';
|
||||
|
||||
function tableauProd($ibat,$nivo)
|
||||
function tableauProd($ibat, $nivo)
|
||||
{
|
||||
$return = array();
|
||||
$c = $nivo-2 < 1 ? 1 : $nivo-2;
|
||||
$a = $c + 6;
|
||||
$return = array();
|
||||
$c = $nivo-2 < 1 ? 1 : $nivo-2;
|
||||
$a = $c + 6;
|
||||
|
||||
if ($ibat == 0)
|
||||
{
|
||||
for ($c; $c < $a; $c++)
|
||||
{
|
||||
$production = ceil(pow(1.1, $c) * 52 * $c);
|
||||
$production_diff = ceil(pow(1.1, $c) * 52 * $c) - ceil(pow(1.1, $nivo) * 52 * $nivo);
|
||||
if ($ibat == 0) {
|
||||
for ($c; $c < $a; $c++) {
|
||||
$production = ceil(pow(1.1, $c) * 52 * $c);
|
||||
$production_diff = ceil(pow(1.1, $c) * 52 * $c) - ceil(pow(1.1, $nivo) * 52 * $nivo);
|
||||
|
||||
$energie = ceil(exp(0.28*$c)*10);
|
||||
$energie_diff = ceil(exp(0.28*$c)*10) - ceil(exp(0.28*$nivo)*10);
|
||||
$energie = ceil(exp(0.28*$c)*10);
|
||||
$energie_diff = ceil(exp(0.28*$c)*10) - ceil(exp(0.28*$nivo)*10);
|
||||
|
||||
$return[] = array($c, $production, $energie, $production_diff, $energie_diff);
|
||||
}
|
||||
}
|
||||
elseif ($ibat == 1)
|
||||
{
|
||||
for ($c; $c < $a; $c++)
|
||||
{
|
||||
$production = ceil(pow(1.1, $c) * 34 * $c);
|
||||
$production_diff = ceil(pow(1.1, $c) * 34 * $c) - ceil(pow(1.1, $nivo) * 52 * $nivo);
|
||||
$return[] = array($c, $production, $energie, $production_diff, $energie_diff);
|
||||
}
|
||||
} elseif ($ibat == 1) {
|
||||
for ($c; $c < $a; $c++) {
|
||||
$production = ceil(pow(1.1, $c) * 34 * $c);
|
||||
$production_diff = ceil(pow(1.1, $c) * 34 * $c) - ceil(pow(1.1, $nivo) * 52 * $nivo);
|
||||
|
||||
$energie = ceil(exp(0.28*$c)*10);
|
||||
$energie_diff = ceil(exp(0.28*$c)*10) - ceil(exp(0.28*$nivo)*10);
|
||||
$energie = ceil(exp(0.28*$c)*10);
|
||||
$energie_diff = ceil(exp(0.28*$c)*10) - ceil(exp(0.28*$nivo)*10);
|
||||
|
||||
$return[] = array($c, $production, $energie, $production_diff, $energie_diff);
|
||||
}
|
||||
}
|
||||
elseif ($ibat == 2)
|
||||
{
|
||||
for ($c; $c < $a; $c++)
|
||||
{
|
||||
$production = ceil(pow(1.1, $c) * 21 * ($c + 0.7));
|
||||
$production_diff = ceil(pow(1.1, $c) * 21 * ($c + 0.7)) - ceil(pow(1.1, $nivo) * 21 * ($nivo + 0.7));
|
||||
$return[] = array($c, $production, $energie, $production_diff, $energie_diff);
|
||||
}
|
||||
} elseif ($ibat == 2) {
|
||||
for ($c; $c < $a; $c++) {
|
||||
$production = ceil(pow(1.1, $c) * 21 * ($c + 0.7));
|
||||
$production_diff = ceil(pow(1.1, $c) * 21 * ($c + 0.7)) - ceil(pow(1.1, $nivo) * 21 * ($nivo + 0.7));
|
||||
|
||||
$energie = ceil(exp(0.2849*$c)*13);
|
||||
$energie_diff = ceil(exp(0.2849*$c)*13) - ceil(exp(0.2849*$nivo)*13);
|
||||
$energie = ceil(exp(0.2849*$c)*13);
|
||||
$energie_diff = ceil(exp(0.2849*$c)*13) - ceil(exp(0.2849*$nivo)*13);
|
||||
|
||||
$return[] = array($c, $production, $energie, $production_diff, $energie_diff);
|
||||
}
|
||||
}
|
||||
elseif ($ibat == 3)
|
||||
{
|
||||
for ($c; $c < $a; $c++)
|
||||
{
|
||||
$production = ceil(exp(0.28*$c)*22);
|
||||
$production_diff = ceil(exp(0.28*$c)*22) - ceil(exp(0.28*$nivo)*22);
|
||||
$return[] = array($c, $production, $energie, $production_diff, $energie_diff);
|
||||
}
|
||||
} elseif ($ibat == 3) {
|
||||
for ($c; $c < $a; $c++) {
|
||||
$production = ceil(exp(0.28*$c)*22);
|
||||
$production_diff = ceil(exp(0.28*$c)*22) - ceil(exp(0.28*$nivo)*22);
|
||||
|
||||
$return[] = array($c, $production, 0, $production_diff, 0);
|
||||
}
|
||||
}
|
||||
elseif ($ibat == 4) {
|
||||
for ($c; $c < $a; $c++)
|
||||
{
|
||||
$production = ceil(exp(0.297*$c)*25);
|
||||
$production_diff = ceil(exp(0.297*$c)*25) - ceil(exp(0.297*$nivo)*25);
|
||||
$return[] = array($c, $production, 0, $production_diff, 0);
|
||||
}
|
||||
} elseif ($ibat == 4) {
|
||||
for ($c; $c < $a; $c++) {
|
||||
$production = ceil(exp(0.297*$c)*25);
|
||||
$production_diff = ceil(exp(0.297*$c)*25) - ceil(exp(0.297*$nivo)*25);
|
||||
|
||||
$energie = ceil(pow(1.34,($c-1)) * 9);
|
||||
$energie_diff = ceil(pow(1.34,($c-1)) * 9) - ceil(pow(1.34,($nivo-1)) * 9);
|
||||
$energie = ceil(pow(1.34, ($c-1)) * 9);
|
||||
$energie_diff = ceil(pow(1.34, ($c-1)) * 9) - ceil(pow(1.34, ($nivo-1)) * 9);
|
||||
|
||||
$return[] = array($c, $production, $energie, $production_diff, $energie_diff);
|
||||
}
|
||||
}
|
||||
else
|
||||
return false;
|
||||
$return[] = array($c, $production, $energie, $production_diff, $energie_diff);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $return;
|
||||
return $return;
|
||||
}
|
||||
|
||||
if (empty($_GET['r']) || ($_GET['r'] != 'humain' && $_GET['r'] != 'covenant'))
|
||||
$_GET['r'] = $planete->race;
|
||||
if (empty($_GET['r']) || ($_GET['r'] != 'humain' && $_GET['r'] != 'covenant')) {
|
||||
$_GET['r'] = $planete->race;
|
||||
}
|
||||
$race = gpc('r');
|
||||
$template->assign('raceAff', $race);
|
||||
|
||||
if (isset($_GET['t']) && is_numeric($_GET['t']) && !empty($LANG[$race]["technologies"]["noms_sing"][$_GET['b']][$_GET['t']]))
|
||||
{
|
||||
$template->assign('type', 'technologies');
|
||||
$b = intval(gpc('b'));
|
||||
$t = intval(gpc('t'));
|
||||
$template->assign('branche', $b);
|
||||
$template->assign('id', $t);
|
||||
if (isset($_GET['t']) && is_numeric($_GET['t']) && !empty($LANG[$race]["technologies"]["noms_sing"][$_GET['b']][$_GET['t']])) {
|
||||
$template->assign('type', 'technologies');
|
||||
$b = intval(gpc('b'));
|
||||
$t = intval(gpc('t'));
|
||||
$template->assign('branche', $b);
|
||||
$template->assign('id', $t);
|
||||
|
||||
$template->assign('ressourcesNext', array(Donnee::creditsTechnologie($b, $t, $planete), Donnee::tempsTechnologie($b, $t, $planete)));
|
||||
$template->assign('ressourcesNext', array(Donnee::creditsTechnologie($b, $t, $planete), Donnee::tempsTechnologie($b, $t, $planete)));
|
||||
|
||||
$template->assign('etat', Donnee::print_neededTechnologie($b, $t, $planete, $race));
|
||||
$template->assign('etat', Donnee::print_neededTechnologie($b, $t, $planete, $race));
|
||||
} elseif (isset($_GET['b']) && is_numeric($_GET['b']) && !empty($LANG[$race]["batiments"]["noms_sing"][$_GET['b']])) {
|
||||
$template->assign('type', 'batiments');
|
||||
$t = intval(gpc('b'));
|
||||
$template->assign('id', $t);
|
||||
$template->assign('image', dBatiments::image($t, $planete));
|
||||
$template->assign('tableau_prod', tableauProd($t, $planete->batiments[$t]));
|
||||
|
||||
$n = $planete->batiments[$t] + 1;
|
||||
$template->assign('ressourcesNext', array(dBatiments::metal($t, $n, $planete), dBatiments::cristal($t, $n, $planete), dBatiments::hydrogene($t, $n, $planete), dBatiments::temps($t, $n, $planete)));
|
||||
|
||||
$template->assign('etat', dBatiments::needed($t, $planete, true));
|
||||
} elseif (isset($_GET['v']) && is_numeric($_GET['v']) && !empty($LANG[$race]["vaisseaux"]["noms_sing"][$_GET['v']])) {
|
||||
$template->assign('type', 'vaisseaux');
|
||||
$t = intval(gpc('v'));
|
||||
$template->assign('id', $t);
|
||||
$template->assign('image', dSpatial::image($t, $planete));
|
||||
|
||||
$template->assign('ressourcesNext', array(dSpatial::metal($t, 1, $planete), dSpatial::cristal($t, 1, $planete), dSpatial::hydrogene($t, 1, $planete), dSpatial::temps($t, 1, $planete)));
|
||||
|
||||
$template->assign('etat', dSpatial::needed($t, $planete, $race));
|
||||
$template->assign('caract', array($nomvais_at[$t], $nomvais_bc[$t], $nomvais_pv[$t], $nomvais_rs[$t]));
|
||||
} elseif (isset($_GET['d']) && is_numeric($_GET['d']) && !empty($LANG[$race]["terrestre"]["noms_sing"][$_GET['d']])) {
|
||||
$template->assign('type', 'terrestre');
|
||||
$t = gpc('d');
|
||||
$template->assign('id', $t);
|
||||
$template->assign('image', dTerrestre::image($t, $planete));
|
||||
|
||||
$template->assign('ressourcesNext', array(dTerrestre::metal($t, 1, $planete), dTerrestre::cristal($t, 1, $planete), dTerrestre::hydrogene($t, 1, $planete), dTerrestre::temps($t, 1, $planete)));
|
||||
|
||||
$template->assign('etat', dTerrestre::needed($t, $planete, true));
|
||||
if ($t-8 >= 0) {
|
||||
$t -= 8;
|
||||
$template->assign('caract', array($defense_at[$t], $defense_bc[$t], $defense_pv[$t]));
|
||||
}
|
||||
} elseif (isset($_GET['c']) && is_numeric($_GET['c']) && !empty($LANG[$race]["caserne"]["noms_sing"][$_GET['c']])) {
|
||||
$template->assign('type', 'caserne');
|
||||
$t = gpc('c');
|
||||
$template->assign('id', $t);
|
||||
$template->assign('image', dCaserne::image($t, $planete));
|
||||
|
||||
$template->assign('ressourcesNext', array(dCaserne::metal($t, 1, $planete), dCaserne::cristal($t, 1, $planete), dCaserne::hydrogene($t, 1, $planete), dCaserne::temps($t, 1, $planete)));
|
||||
|
||||
$template->assign('etat', dCaserne::needed($t, $planete, true));
|
||||
$template->assign('caract', array('!!', '!!', '!!'));
|
||||
} else {
|
||||
redirection('?p=accueil');
|
||||
}
|
||||
elseif (isset($_GET['b']) && is_numeric($_GET['b']) && !empty($LANG[$race]["batiments"]["noms_sing"][$_GET['b']]))
|
||||
{
|
||||
$template->assign('type', 'batiments');
|
||||
$t = intval(gpc('b'));
|
||||
$template->assign('id', $t);
|
||||
$template->assign('image', dBatiments::image($t, $planete));
|
||||
$template->assign('tableau_prod', tableauProd($t, $planete->batiments[$t]));
|
||||
|
||||
$n = $planete->batiments[$t] + 1;
|
||||
$template->assign('ressourcesNext', array(dBatiments::metal($t, $n, $planete), dBatiments::cristal($t, $n, $planete), dBatiments::hydrogene($t, $n, $planete), dBatiments::temps($t, $n, $planete)));
|
||||
|
||||
$template->assign('etat', dBatiments::needed($t, $planete, true));
|
||||
}
|
||||
elseif (isset($_GET['v']) && is_numeric($_GET['v']) && !empty($LANG[$race]["vaisseaux"]["noms_sing"][$_GET['v']]))
|
||||
{
|
||||
$template->assign('type', 'vaisseaux');
|
||||
$t = intval(gpc('v'));
|
||||
$template->assign('id', $t);
|
||||
$template->assign('image', dSpatial::image($t, $planete));
|
||||
|
||||
$template->assign('ressourcesNext', array(dSpatial::metal($t, 1, $planete), dSpatial::cristal($t, 1, $planete), dSpatial::hydrogene($t, 1, $planete), dSpatial::temps($t, 1, $planete)));
|
||||
|
||||
$template->assign('etat', dSpatial::needed($t, $planete, $race));
|
||||
$template->assign('caract', array($nomvais_at[$t], $nomvais_bc[$t], $nomvais_pv[$t], $nomvais_rs[$t]));
|
||||
}
|
||||
elseif (isset($_GET['d']) && is_numeric($_GET['d']) && !empty($LANG[$race]["terrestre"]["noms_sing"][$_GET['d']]))
|
||||
{
|
||||
$template->assign('type', 'terrestre');
|
||||
$t = gpc('d');
|
||||
$template->assign('id', $t);
|
||||
$template->assign('image', dTerrestre::image($t, $planete));
|
||||
|
||||
$template->assign('ressourcesNext', array(dTerrestre::metal($t, 1, $planete), dTerrestre::cristal($t, 1, $planete), dTerrestre::hydrogene($t, 1, $planete), dTerrestre::temps($t, 1, $planete)));
|
||||
|
||||
$template->assign('etat', dTerrestre::needed($t, $planete, true));
|
||||
if ($t-8 >= 0)
|
||||
{
|
||||
$t -= 8;
|
||||
$template->assign('caract', array($defense_at[$t], $defense_bc[$t], $defense_pv[$t]));
|
||||
}
|
||||
}
|
||||
elseif (isset($_GET['c']) && is_numeric($_GET['c']) && !empty($LANG[$race]["caserne"]["noms_sing"][$_GET['c']]))
|
||||
{
|
||||
$template->assign('type', 'caserne');
|
||||
$t = gpc('c');
|
||||
$template->assign('id', $t);
|
||||
$template->assign('image', dCaserne::image($t, $planete));
|
||||
|
||||
$template->assign('ressourcesNext', array(dCaserne::metal($t, 1, $planete), dCaserne::cristal($t, 1, $planete), dCaserne::hydrogene($t, 1, $planete), dCaserne::temps($t, 1, $planete)));
|
||||
|
||||
$template->assign('etat', dCaserne::needed($t, $planete, true));
|
||||
$template->assign('caract', array('!!', '!!', '!!'));
|
||||
}
|
||||
else
|
||||
redirection('?p=accueil');
|
||||
|
||||
unset($t, $race);
|
||||
?>
|
||||
|
|
@ -1,199 +1,174 @@
|
|||
<?php
|
||||
if(!defined('INDEX') || SURFACE != "asteroide") { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX') || SURFACE != "asteroide") {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
$onglet = strtolower(gpc('o'));
|
||||
if ($onglet == "new")
|
||||
{
|
||||
$page = "diplomatie/nouveau";
|
||||
if ($onglet == "new") {
|
||||
$page = "diplomatie/nouveau";
|
||||
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &8))
|
||||
erreur("Vous n'avez pas le grade nécessaire pour créer des pactes !");
|
||||
//On vérifie que le joueur ait les permissions pour modifier les grades
|
||||
if (!($planete->permissions_alliance &8)) {
|
||||
erreur("Vous n'avez pas le grade nécessaire pour créer des pactes !");
|
||||
}
|
||||
|
||||
$type = intval(gpc("type", 'post'));
|
||||
$nom_alli = gpc("nom_alli", 'post');
|
||||
if (isset($_POST["type"]) && !empty($nom_alli) && $type >= 0 && $type < 5)
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($nom_alli);
|
||||
$alli = $bdd->unique_query("SELECT id FROM $table_alliances WHERE nom_alliance LIKE '$nom_alli';");
|
||||
if (empty($alli))
|
||||
erreur("Impossible de trouver cette alliance. Vérifiez le nom !");
|
||||
//On détecte tous les types de pactes en cas de guerre (pour éviter d'attaquer avec un pacte de non agression !
|
||||
if ($type)
|
||||
$pacte = $bdd->query("SELECT id FROM $table_alliances_pactes WHERE type = $type AND time_fin = 0 AND (accepte = 0 OR accepte = 1) AND ((id_alliance1 = ".$planete->id." AND id_alliance2 = ".$alli['id'].") OR (id_alliance2 = ".$planete->id." AND id_alliance1 = ".$alli['id']."));");
|
||||
else
|
||||
$pacte = $bdd->query("SELECT id FROM $table_alliances_pactes WHERE time_fin = 0 AND (accepte = 0 OR accepte = 1) AND ((id_alliance1 = ".$planete->id." AND id_alliance2 = ".$alli['id'].") OR (id_alliance2 = ".$planete->id." AND id_alliance1 = ".$alli['id']."));");
|
||||
$type = intval(gpc("type", 'post'));
|
||||
$nom_alli = gpc("nom_alli", 'post');
|
||||
if (isset($_POST["type"]) && !empty($nom_alli) && $type >= 0 && $type < 5) {
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($nom_alli);
|
||||
$alli = $bdd->unique_query("SELECT id FROM $table_alliances WHERE nom_alliance LIKE '$nom_alli';");
|
||||
if (empty($alli)) {
|
||||
erreur("Impossible de trouver cette alliance. Vérifiez le nom !");
|
||||
}
|
||||
//On détecte tous les types de pactes en cas de guerre (pour éviter d'attaquer avec un pacte de non agression !
|
||||
if ($type) {
|
||||
$pacte = $bdd->query("SELECT id FROM $table_alliances_pactes WHERE type = $type AND time_fin = 0 AND (accepte = 0 OR accepte = 1) AND ((id_alliance1 = ".$planete->id." AND id_alliance2 = ".$alli['id'].") OR (id_alliance2 = ".$planete->id." AND id_alliance1 = ".$alli['id']."));");
|
||||
} else {
|
||||
$pacte = $bdd->query("SELECT id FROM $table_alliances_pactes WHERE time_fin = 0 AND (accepte = 0 OR accepte = 1) AND ((id_alliance1 = ".$planete->id." AND id_alliance2 = ".$alli['id'].") OR (id_alliance2 = ".$planete->id." AND id_alliance1 = ".$alli['id']."));");
|
||||
}
|
||||
|
||||
if (!empty($pacte) && !$type)
|
||||
erreur("Avant de déclarer une guerre, veuillez abroger tous vos pactes de paix !");
|
||||
elseif (!empty($pacte))
|
||||
erreur("Vous avez déjà un pacte similaire avec cette alliance !");
|
||||
if (!empty($pacte) && !$type) {
|
||||
erreur("Avant de déclarer une guerre, veuillez abroger tous vos pactes de paix !");
|
||||
} elseif (!empty($pacte)) {
|
||||
erreur("Vous avez déjà un pacte similaire avec cette alliance !");
|
||||
}
|
||||
|
||||
if ($type)
|
||||
$bdd->query("INSERT INTO $table_alliances_pactes (id_alliance1, id_alliance2, type, time_creation) VALUES (".$planete->id.", ".$alli['id'].", $type, ".time().");");
|
||||
else
|
||||
$bdd->query("INSERT INTO $table_alliances_pactes (id_alliance1, id_alliance2, type, time_creation, accepte) VALUES (".$planete->id.", ".$alli['id'].", $type, ".time().", 1);");
|
||||
$bdd->deconnexion();
|
||||
if ($type) {
|
||||
$bdd->query("INSERT INTO $table_alliances_pactes (id_alliance1, id_alliance2, type, time_creation) VALUES (".$planete->id.", ".$alli['id'].", $type, ".time().");");
|
||||
} else {
|
||||
$bdd->query("INSERT INTO $table_alliances_pactes (id_alliance1, id_alliance2, type, time_creation, accepte) VALUES (".$planete->id.", ".$alli['id'].", $type, ".time().", 1);");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
if ($type)
|
||||
erreur("La demande de pacte a bien été enregistrée.", "green");
|
||||
else
|
||||
erreur("La déclaration a bien été enregistrée.", "green");
|
||||
}
|
||||
elseif(!empty($_GET['c']))
|
||||
{
|
||||
$id = intval(gpc('c'));
|
||||
$bdd->reconnexion();
|
||||
$demand = $bdd->unique_query("SELECT id_alliance1, id_alliance2, accepte FROM $table_alliances_pactes WHERE id = $id AND (id_alliance2 = ".$planete->id." OR id_alliance1 = ".$planete->id.") AND type = 0;");
|
||||
if (!isset($demand['accepte']) || ($demand['accepte'] == 1 && $planete->id == $demand['id_alliance2']) || ($demand['accepte'] == 2 && $planete->id == $demand['id_alliance1']))
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
erreur("Impossible de demander le cesser le feu, n'êtes-vous pas dans la position du demandeur !");
|
||||
}
|
||||
elseif ($demand['accepte'] == 0)
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
erreur("Une demande de cesser le feu est déjà en cours !");
|
||||
}
|
||||
elseif ($demand['accepte'] == 1)
|
||||
{
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 0 WHERE id = $id AND id_alliance1 = ".$planete->id." AND accepte = 1;");
|
||||
$bdd->deconnexion();
|
||||
if ($type) {
|
||||
erreur("La demande de pacte a bien été enregistrée.", "green");
|
||||
} else {
|
||||
erreur("La déclaration a bien été enregistrée.", "green");
|
||||
}
|
||||
} elseif (!empty($_GET['c'])) {
|
||||
$id = intval(gpc('c'));
|
||||
$bdd->reconnexion();
|
||||
$demand = $bdd->unique_query("SELECT id_alliance1, id_alliance2, accepte FROM $table_alliances_pactes WHERE id = $id AND (id_alliance2 = ".$planete->id." OR id_alliance1 = ".$planete->id.") AND type = 0;");
|
||||
if (!isset($demand['accepte']) || ($demand['accepte'] == 1 && $planete->id == $demand['id_alliance2']) || ($demand['accepte'] == 2 && $planete->id == $demand['id_alliance1'])) {
|
||||
$bdd->deconnexion();
|
||||
erreur("Impossible de demander le cesser le feu, n'êtes-vous pas dans la position du demandeur !");
|
||||
} elseif ($demand['accepte'] == 0) {
|
||||
$bdd->deconnexion();
|
||||
erreur("Une demande de cesser le feu est déjà en cours !");
|
||||
} elseif ($demand['accepte'] == 1) {
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 0 WHERE id = $id AND id_alliance1 = ".$planete->id." AND accepte = 1;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
erreur("La demande de cesser le feu a bien été transmise.", "green");
|
||||
}
|
||||
elseif ($demand['accepte'] == 2)
|
||||
{
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 0, id_alliance2 = id_alliance1, id_alliance1 = ".$planete->id." WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 2;");
|
||||
$bdd->deconnexion();
|
||||
erreur("La demande de cesser le feu a bien été transmise.", "green");
|
||||
} elseif ($demand['accepte'] == 2) {
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 0, id_alliance2 = id_alliance1, id_alliance1 = ".$planete->id." WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 2;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
erreur("La demande de cesser le feu a bien été transmise.", "green");
|
||||
}
|
||||
}
|
||||
}
|
||||
elseif ($onglet == "archives")
|
||||
{
|
||||
$page = "diplomatie/archives";
|
||||
erreur("La demande de cesser le feu a bien été transmise.", "green");
|
||||
}
|
||||
}
|
||||
} elseif ($onglet == "archives") {
|
||||
$page = "diplomatie/archives";
|
||||
|
||||
$bdd->reconnexion();
|
||||
$guerres = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 0 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND time_fin != 0
|
||||
$bdd->reconnexion();
|
||||
$guerres = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 0 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND time_fin != 0
|
||||
UNION SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.type = 0 AND P.id_alliance2 = ".$planete->id." AND accepte = 1 AND time_fin != 0 ORDER BY nom_alliance DESC;");
|
||||
$pna = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 1 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND time_fin != 0
|
||||
$pna = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 1 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND time_fin != 0
|
||||
UNION SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.type = 1 AND P.id_alliance2 = ".$planete->id." AND accepte = 1 AND time_fin != 0 ORDER BY nom_alliance DESC;");
|
||||
$pc = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 2 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND time_fin != 0
|
||||
$pc = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 2 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND time_fin != 0
|
||||
UNION SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.type = 2 AND P.id_alliance2 = ".$planete->id." AND accepte = 1 AND time_fin != 0 ORDER BY nom_alliance DESC;");
|
||||
$pm = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 3 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND time_fin != 0
|
||||
$pm = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 3 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND time_fin != 0
|
||||
UNION SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.type = 3 AND P.id_alliance2 = ".$planete->id." AND accepte = 1 AND time_fin != 0 ORDER BY nom_alliance DESC;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign("pnas", $pna);
|
||||
$template->assign("guerres", $guerres);
|
||||
$template->assign("pcs", $pc);
|
||||
$template->assign("pms", $pm);
|
||||
}
|
||||
elseif ($onglet == "encours")
|
||||
{
|
||||
$page = "diplomatie/encours";
|
||||
$template->assign("pnas", $pna);
|
||||
$template->assign("guerres", $guerres);
|
||||
$template->assign("pcs", $pc);
|
||||
$template->assign("pms", $pm);
|
||||
} elseif ($onglet == "encours") {
|
||||
$page = "diplomatie/encours";
|
||||
|
||||
$bdd->reconnexion();
|
||||
$guerres = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 0 AND P.id_alliance1 = ".$planete->id." AND (time_fin = 0 OR time_fin > ".time().")
|
||||
$bdd->reconnexion();
|
||||
$guerres = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 0 AND P.id_alliance1 = ".$planete->id." AND (time_fin = 0 OR time_fin > ".time().")
|
||||
UNION SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.type = 0 AND P.id_alliance2 = ".$planete->id." AND (time_fin = 0 OR time_fin > ".time().")
|
||||
ORDER BY nom_alliance DESC;");
|
||||
$pna = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 1 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND (time_fin = 0 OR time_fin > ".time().")
|
||||
$pna = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 1 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND (time_fin = 0 OR time_fin > ".time().")
|
||||
UNION SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.type = 1 AND P.id_alliance2 = ".$planete->id." AND accepte = 1 AND (time_fin = 0 OR time_fin > ".time().")
|
||||
ORDER BY nom_alliance DESC;");
|
||||
$pc = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 2 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND (time_fin = 0 OR time_fin > ".time().")
|
||||
$pc = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 2 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND (time_fin = 0 OR time_fin > ".time().")
|
||||
UNION SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.type = 2 AND P.id_alliance2 = ".$planete->id." AND accepte = 1 AND (time_fin = 0 OR time_fin > ".time().")
|
||||
ORDER BY nom_alliance DESC;");
|
||||
$pm = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 3 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND (time_fin = 0 OR time_fin > ".time().")
|
||||
$pm = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.type = 3 AND P.id_alliance1 = ".$planete->id." AND accepte = 1 AND (time_fin = 0 OR time_fin > ".time().")
|
||||
UNION SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.type = 3 AND P.id_alliance2 = ".$planete->id." AND accepte = 1 AND (time_fin = 0 OR time_fin > ".time().")
|
||||
ORDER BY nom_alliance DESC;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign("pnas", $pna);
|
||||
$template->assign("guerres", $guerres);
|
||||
$template->assign("pcs", $pc);
|
||||
$template->assign("pms", $pm);
|
||||
}
|
||||
else
|
||||
{
|
||||
$onglet = "actus";
|
||||
$page = "diplomatie/general";
|
||||
$template->assign("pnas", $pna);
|
||||
$template->assign("guerres", $guerres);
|
||||
$template->assign("pcs", $pc);
|
||||
$template->assign("pms", $pm);
|
||||
} else {
|
||||
$onglet = "actus";
|
||||
$page = "diplomatie/general";
|
||||
|
||||
if ($planete->permissions_alliance &8)
|
||||
{
|
||||
if (!empty($_GET['a']))
|
||||
{
|
||||
$id = intval(gpc('a'));
|
||||
$bdd->reconnexion();
|
||||
$demand = $bdd->unique_query("SELECT type FROM $table_alliances_pactes WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
if (!isset($demand['type']))
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
erreur("Impossible de trouver le pacte !");
|
||||
}
|
||||
elseif ($demand['type'] == 0)
|
||||
{
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 1, time_fin = ".time()." WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
$bdd->deconnexion();
|
||||
erreur("C'est la fin de la guerre, vous vennez d'accepter le cesser le feu !", "orange", $VAR['menu']['diplomatie']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 1, time_creation = ".time()." WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
$bdd->deconnexion();
|
||||
erreur("Le pacte a bien été accepté.", "green", $VAR['menu']['diplomatie']);
|
||||
}
|
||||
}
|
||||
elseif (!empty($_GET['r']))
|
||||
{
|
||||
$id = intval(gpc('r'));
|
||||
$bdd->reconnexion();
|
||||
$demand = $bdd->unique_query("SELECT type FROM $table_alliances_pactes WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
if (!isset($demand['type']))
|
||||
{
|
||||
$bdd->deconnexion();
|
||||
erreur("Impossible de trouver le pacte !");
|
||||
}
|
||||
elseif ($demand['type'] == 0)
|
||||
{
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 2 WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
$bdd->deconnexion();
|
||||
erreur("La guerre continue, vous vennez de refuser le cesser le feu !<br />Se sera désormais à vous de proposer un cesser le feu à la fin de la guerre.", "orange", $VAR['menu']['diplomatie']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 2 WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
$bdd->deconnexion();
|
||||
erreur("Le pacte a bien été refusé.", "orange", $VAR['menu']['diplomatie']);
|
||||
}
|
||||
}
|
||||
elseif (!empty($_GET['s']))
|
||||
{
|
||||
$id = intval(gpc('s'));
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET time_fin = ".time()." WHERE id = $id AND (id_alliance2 = ".$planete->id." OR id_alliance1 = ".$planete->id.") AND accepte = 1;");
|
||||
$bdd->deconnexion();
|
||||
if ($planete->permissions_alliance &8) {
|
||||
if (!empty($_GET['a'])) {
|
||||
$id = intval(gpc('a'));
|
||||
$bdd->reconnexion();
|
||||
$demand = $bdd->unique_query("SELECT type FROM $table_alliances_pactes WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
if (!isset($demand['type'])) {
|
||||
$bdd->deconnexion();
|
||||
erreur("Impossible de trouver le pacte !");
|
||||
} elseif ($demand['type'] == 0) {
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 1, time_fin = ".time()." WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
$bdd->deconnexion();
|
||||
erreur("C'est la fin de la guerre, vous vennez d'accepter le cesser le feu !", "orange", $VAR['menu']['diplomatie']);
|
||||
} else {
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 1, time_creation = ".time()." WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
$bdd->deconnexion();
|
||||
erreur("Le pacte a bien été accepté.", "green", $VAR['menu']['diplomatie']);
|
||||
}
|
||||
} elseif (!empty($_GET['r'])) {
|
||||
$id = intval(gpc('r'));
|
||||
$bdd->reconnexion();
|
||||
$demand = $bdd->unique_query("SELECT type FROM $table_alliances_pactes WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
if (!isset($demand['type'])) {
|
||||
$bdd->deconnexion();
|
||||
erreur("Impossible de trouver le pacte !");
|
||||
} elseif ($demand['type'] == 0) {
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 2 WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
$bdd->deconnexion();
|
||||
erreur("La guerre continue, vous vennez de refuser le cesser le feu !<br />Se sera désormais à vous de proposer un cesser le feu à la fin de la guerre.", "orange", $VAR['menu']['diplomatie']);
|
||||
} else {
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET accepte = 2 WHERE id = $id AND id_alliance2 = ".$planete->id." AND accepte = 0;");
|
||||
$bdd->deconnexion();
|
||||
erreur("Le pacte a bien été refusé.", "orange", $VAR['menu']['diplomatie']);
|
||||
}
|
||||
} elseif (!empty($_GET['s'])) {
|
||||
$id = intval(gpc('s'));
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("UPDATE $table_alliances_pactes SET time_fin = ".time()." WHERE id = $id AND (id_alliance2 = ".$planete->id." OR id_alliance1 = ".$planete->id.") AND accepte = 1;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
erreur("Le pacte a bien été abrogé.", "orange", $VAR['menu']['diplomatie']);
|
||||
}
|
||||
}
|
||||
erreur("Le pacte a bien été abrogé.", "orange", $VAR['menu']['diplomatie']);
|
||||
}
|
||||
}
|
||||
|
||||
$bdd->reconnexion();
|
||||
$demand = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.id_alliance2 = ".$planete->id." AND accepte = 0 ORDER BY time_demand DESC;");
|
||||
$actus_alli = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.id_alliance1 = ".$planete->id."
|
||||
$bdd->reconnexion();
|
||||
$demand = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.id_alliance2 = ".$planete->id." AND accepte = 0 ORDER BY time_demand DESC;");
|
||||
$actus_alli = $bdd->query("SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 WHERE P.id_alliance1 = ".$planete->id."
|
||||
UNION SELECT P.*, A.nom_alliance, A.tag, A.id AS alliance_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance1 WHERE P.id_alliance2 = ".$planete->id." AND P.accepte != 0
|
||||
ORDER BY time_demand DESC LIMIT 5;");
|
||||
$actus_world = $bdd->query("SELECT P.*, A.tag AS tag1, A.nom_alliance AS nom_alliance1, A.id AS alliance1_id, B.tag AS tag2, B.nom_alliance AS nom_alliance2, B.id AS alliance2_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 INNER JOIN $table_alliances B ON B.id = P.id_alliance1 WHERE P.accepte = 1 AND P.id_alliance1 != ".$planete->id." AND P.id_alliance2 != ".$planete->id." ORDER BY time_demand DESC LIMIT 5;");
|
||||
$bdd->deconnexion();
|
||||
$actus_world = $bdd->query("SELECT P.*, A.tag AS tag1, A.nom_alliance AS nom_alliance1, A.id AS alliance1_id, B.tag AS tag2, B.nom_alliance AS nom_alliance2, B.id AS alliance2_id FROM $table_alliances_pactes P INNER JOIN $table_alliances A ON A.id = P.id_alliance2 INNER JOIN $table_alliances B ON B.id = P.id_alliance1 WHERE P.accepte = 1 AND P.id_alliance1 != ".$planete->id." AND P.id_alliance2 != ".$planete->id." ORDER BY time_demand DESC LIMIT 5;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$template->assign("demandes", $demand);
|
||||
$template->assign("actus_alli", $actus_alli);
|
||||
$template->assign("actus_world", $actus_world);
|
||||
unset($demand);
|
||||
$template->assign("demandes", $demand);
|
||||
$template->assign("actus_alli", $actus_alli);
|
||||
$template->assign("actus_world", $actus_world);
|
||||
unset($demand);
|
||||
}
|
||||
|
||||
$template->assign("onglet", $onglet);
|
||||
unset($onglet);
|
||||
?>
|
||||
|
|
@ -1,22 +1,29 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$titre = 'Flottes';
|
||||
$page = 'flotte'; //Définition d'un nom de page inexistant, mais permet de passer le nom de l'onglet dans une erreur
|
||||
include_once("Class/flotte.php");
|
||||
|
||||
//Création de flotte : envoi final
|
||||
if (!empty($_POST['cds']) && !empty($SESS->values["prepFlottes"][$_POST['cds']]))
|
||||
require('game/flottes/envoyer.php');
|
||||
if (!empty($_POST['cds']) && !empty($SESS->values["prepFlottes"][$_POST['cds']])) {
|
||||
require('game/flottes/envoyer.php');
|
||||
}
|
||||
//Restauration d'une flotte sauvegardée
|
||||
elseif (isset($_GET['c']) && !empty($SESS->values["prepFlottes"][$_GET['c']]))
|
||||
require('game/flottes/restaure.php');
|
||||
elseif (isset($_GET['c']) && !empty($SESS->values["prepFlottes"][$_GET['c']])) {
|
||||
require('game/flottes/restaure.php');
|
||||
}
|
||||
//Création de flotte : page 2
|
||||
elseif (!empty($_POST['envoie']) || !empty($_POST['groupe']))
|
||||
require('game/flottes/preparer.php');
|
||||
elseif (!empty($_POST['envoie']) || !empty($_POST['groupe'])) {
|
||||
require('game/flottes/preparer.php');
|
||||
}
|
||||
//Affichage du détail d'une flotte
|
||||
elseif (!empty($_GET['n']))
|
||||
require('game/flottes/details.php');
|
||||
elseif (!empty($_GET['n'])) {
|
||||
require('game/flottes/details.php');
|
||||
}
|
||||
//Affichage de la page générale
|
||||
else
|
||||
require('game/flottes/principal.php');
|
||||
?>
|
||||
else {
|
||||
require('game/flottes/principal.php');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +1,46 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
$idN = intval(gpc('n'));
|
||||
$idN = intval(gpc('n'));
|
||||
|
||||
$flotteN = new Flotte($idN, false);
|
||||
$flotteN->load_planete();
|
||||
$flotteN = new Flotte($idN, false);
|
||||
$flotteN->load_planete();
|
||||
|
||||
if ($flotteN->id_flotte == 0 || $flotteN->start_planete->id_user != $planete->id_user)
|
||||
erreur('Impossible de trouver cette flotte !', "red", '?p=flotte', 1500);
|
||||
else
|
||||
{
|
||||
//Changement du nom de la flotte
|
||||
if (!empty($_POST['nomflotte']))
|
||||
{
|
||||
$nouvNom = gpc('nomflotte', 'post');
|
||||
$flotteN->nom = $nouvNom;
|
||||
$flotteN->addModifFlotte("nom");
|
||||
if ($flotteN->id_flotte == 0 || $flotteN->start_planete->id_user != $planete->id_user) {
|
||||
erreur('Impossible de trouver cette flotte !', "red", '?p=flotte', 1500);
|
||||
} else {
|
||||
//Changement du nom de la flotte
|
||||
if (!empty($_POST['nomflotte'])) {
|
||||
$nouvNom = gpc('nomflotte', 'post');
|
||||
$flotteN->nom = $nouvNom;
|
||||
$flotteN->addModifFlotte("nom");
|
||||
|
||||
redirection("?p=flotte&n=".$idN);
|
||||
}
|
||||
redirection("?p=flotte&n=".$idN);
|
||||
}
|
||||
|
||||
//Annulation de la mission
|
||||
if (isset($_GET['a']) && isset($SESS->values['ret_fleet']) && $_GET['a'] == $SESS->values['ret_fleet'])
|
||||
{
|
||||
//Calcul du temps passé depuis le lancement de la flotte
|
||||
$tpsDD = time() - $flotteN->start_time;
|
||||
if ($flotteN->mission == '6')
|
||||
erreur('Votre flotte est déjà en train de revenir !', 'red', '?p=flotte&n='.$idN, 1500);
|
||||
elseif ($flotteN->end_time > $tpsDD)
|
||||
{
|
||||
$bdd->query("UPDATE $table_flottes SET mission = '6', effectue = '1', end_time = $tpsDD, end_galaxie = start_galaxie, end_ss = start_ss, end_position = start_position WHERE id_user = ".$planete->id_user." AND id = $idN;");
|
||||
redirection("?p=flotte&n=".$idN);
|
||||
}
|
||||
else
|
||||
erreur('Impossible d\'annuler la mission, elle a déjà commencée.', "red", '?p=flotte&n='.$idN, 1500);
|
||||
}
|
||||
|
||||
$SESS->values['ret_fleet'] = md5('HB.fleet_'.rand().'☺ß☻');
|
||||
$SESS->put();
|
||||
|
||||
$template->assign('ret_fleet', $SESS->values['ret_fleet']);
|
||||
$template->assign('flotte', $flotteN);
|
||||
$page = 'flotten';
|
||||
}
|
||||
//Annulation de la mission
|
||||
if (isset($_GET['a']) && isset($SESS->values['ret_fleet']) && $_GET['a'] == $SESS->values['ret_fleet']) {
|
||||
//Calcul du temps passé depuis le lancement de la flotte
|
||||
$tpsDD = time() - $flotteN->start_time;
|
||||
if ($flotteN->mission == '6') {
|
||||
erreur('Votre flotte est déjà en train de revenir !', 'red', '?p=flotte&n='.$idN, 1500);
|
||||
} elseif ($flotteN->end_time > $tpsDD) {
|
||||
$bdd->query("UPDATE $table_flottes SET mission = '6', effectue = '1', end_time = $tpsDD, end_galaxie = start_galaxie, end_ss = start_ss, end_position = start_position WHERE id_user = ".$planete->id_user." AND id = $idN;");
|
||||
redirection("?p=flotte&n=".$idN);
|
||||
} else {
|
||||
erreur('Impossible d\'annuler la mission, elle a déjà commencée.', "red", '?p=flotte&n='.$idN, 1500);
|
||||
}
|
||||
}
|
||||
|
||||
$SESS->values['ret_fleet'] = md5('HB.fleet_'.rand().'☺ß☻');
|
||||
$SESS->put();
|
||||
|
||||
$template->assign('ret_fleet', $SESS->values['ret_fleet']);
|
||||
$template->assign('flotte', $flotteN);
|
||||
$page = 'flotten';
|
||||
}
|
||||
|
||||
unset($idN, $flotteN, $nouvNom, $tpsDD);
|
||||
?>
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
//Récupération des informations envoyées
|
||||
$idPrep = gpc("cds", "post");
|
||||
|
|
@ -8,10 +11,11 @@ $SESS->values["prepFlottes"][$idPrep]['nom'] = gpc('nomflotte', 'post');
|
|||
$SESS->values["prepFlottes"][$idPrep]['end_galaxie'] = $end_galaxie = intval(gpc('amas', 'post'));
|
||||
$SESS->values["prepFlottes"][$idPrep]['end_systeme'] = $end_ss = intval(gpc('ss', 'post'));
|
||||
$end_pos = gpc('pos', 'post');
|
||||
if ($end_pos != "A")
|
||||
$SESS->values["prepFlottes"][$idPrep]['end_position'] = floor($end_pos);
|
||||
else
|
||||
$SESS->values["prepFlottes"][$idPrep]['end_position'] = $end_pos;
|
||||
if ($end_pos != "A") {
|
||||
$SESS->values["prepFlottes"][$idPrep]['end_position'] = floor($end_pos);
|
||||
} else {
|
||||
$SESS->values["prepFlottes"][$idPrep]['end_position'] = $end_pos;
|
||||
}
|
||||
$SESS->values["prepFlottes"][$idPrep]['embarquer'] = array($EBmetal = floor(str_replace(' ', '', gpc('metal', 'post'))), $EBcristal = floor(str_replace(' ', '', gpc('cristal', 'post'))), $EBhydrogene = floor(str_replace(' ', '', gpc('hydrogene', 'post'))));
|
||||
$SESS->values["prepFlottes"][$idPrep]['mission'] = $mission = intval(gpc('mission', 'post'));
|
||||
$SESS->values["prepFlottes"][$idPrep]['vitesse'] = $vitesse = intval(gpc('vitesse', 'post'));
|
||||
|
|
@ -20,137 +24,140 @@ $SESS->values["prepFlottes"][$idPrep]['vitesse'] = $vitesse = intval(gpc('vitess
|
|||
$SESS->put();
|
||||
|
||||
//Vérification du nombre de vaisseaux sur la planète
|
||||
foreach ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'] as $key => $vaisseau)
|
||||
{
|
||||
//On vérifie qu'il y a suffisamment de vaisseaux sur la planète
|
||||
if ($planete->vaisseaux[$key] < $vaisseau)
|
||||
erreur('Vous n\'avez pas assez de vaisseaux sur cette planète pour envoyer cette flotte !', "red", $VAR["menu"]["flotte"]);
|
||||
foreach ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'] as $key => $vaisseau) {
|
||||
//On vérifie qu'il y a suffisamment de vaisseaux sur la planète
|
||||
if ($planete->vaisseaux[$key] < $vaisseau) {
|
||||
erreur('Vous n\'avez pas assez de vaisseaux sur cette planète pour envoyer cette flotte !', "red", $VAR["menu"]["flotte"]);
|
||||
}
|
||||
}
|
||||
|
||||
//Vérification des conditions de mission
|
||||
if ($mission <= 0 || $mission > 7 || ($SESS->values["prepFlottes"][$idPrep]['type'] == 3 && $mission != 3 && $mission != 2))
|
||||
erreur("La mission sélectionnée est incorrecte !", "red", $VAR["menu"]["flotte"]);
|
||||
if ($mission <= 0 || $mission > 7 || ($SESS->values["prepFlottes"][$idPrep]['type'] == 3 && $mission != 3 && $mission != 2)) {
|
||||
erreur("La mission sélectionnée est incorrecte !", "red", $VAR["menu"]["flotte"]);
|
||||
}
|
||||
|
||||
//Vérification que le nombre de slots ne soit pas dépassé
|
||||
if (slots($planete->id_user) <= 0)
|
||||
erreur('Vous ne pouvez pas envoyer plus de flottes simultanément.', "red", $VAR["menu"]["flotte"]);
|
||||
if (slots($planete->id_user) <= 0) {
|
||||
erreur('Vous ne pouvez pas envoyer plus de flottes simultanément.', "red", $VAR["menu"]["flotte"]);
|
||||
}
|
||||
|
||||
//Vérifications en cas de mission colonisation
|
||||
if ($mission == 2)
|
||||
{
|
||||
//On vérifie la mission, si elle est de coloniser, il faut qu'il y ait des vaisseaux de colonisation
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'][2] <= 0)
|
||||
erreur('Vous ne pouvez pas coloniser sans vaisseau de colonisation !', "red", $VAR["menu"]["flotte"]);
|
||||
if ($mission == 2) {
|
||||
//On vérifie la mission, si elle est de coloniser, il faut qu'il y ait des vaisseaux de colonisation
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'][2] <= 0) {
|
||||
erreur('Vous ne pouvez pas coloniser sans vaisseau de colonisation !', "red", $VAR["menu"]["flotte"]);
|
||||
}
|
||||
|
||||
//On vérifie qu'une colonisation d'asteroide soit bien faite par un fondateur d'alliance en cours de création
|
||||
if ($end_pos == "A")
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$resultat = $bdd->unique_query("SELECT id FROM $table_alliances_creation WHERE fondateur = ".$planete->id_user.";");
|
||||
$bdd->deconnexion();
|
||||
if (!$resultat)
|
||||
erreur('Fonder d\'abord une alliance avant de coloniser un astéroide !', "red", $VAR["menu"]["flotte"]);
|
||||
}
|
||||
//On vérifie qu'une colonisation d'asteroide soit bien faite par un fondateur d'alliance en cours de création
|
||||
if ($end_pos == "A") {
|
||||
$bdd->reconnexion();
|
||||
$resultat = $bdd->unique_query("SELECT id FROM $table_alliances_creation WHERE fondateur = ".$planete->id_user.";");
|
||||
$bdd->deconnexion();
|
||||
if (!$resultat) {
|
||||
erreur('Fonder d\'abord une alliance avant de coloniser un astéroide !', "red", $VAR["menu"]["flotte"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//On vérifie que les attaques soient bien activées
|
||||
if ($mission == 3 && !$VAR["attaques"])
|
||||
erreur('Les attaques sont désactivées pour le moment. Pour plus d\'informations, <a href="'.$VAR["menu"]["forums"].'">consultez le forum</a>.', "red", $VAR["menu"]["flotte"], 5000);
|
||||
if ($mission == 3 && !$VAR["attaques"]) {
|
||||
erreur('Les attaques sont désactivées pour le moment. Pour plus d\'informations, <a href="'.$VAR["menu"]["forums"].'">consultez le forum</a>.', "red", $VAR["menu"]["flotte"], 5000);
|
||||
}
|
||||
|
||||
//On vérifie la mission, si elle est de recycler, il faut qu'il y ait des reclycleurs
|
||||
if ($mission == 4 && $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][3] <= 0)
|
||||
erreur('Vous ne pouvez pas recycler sans recycleur !', "red", $VAR["menu"]["flotte"]);
|
||||
if ($mission == 4 && $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][3] <= 0) {
|
||||
erreur('Vous ne pouvez pas recycler sans recycleur !', "red", $VAR["menu"]["flotte"]);
|
||||
}
|
||||
|
||||
//On vérifie la mission, si elle est d'espionner, il faut qu'il y ait des sondes
|
||||
if ($mission == 5 && $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][6] <= 0 && $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][13] <= 0)
|
||||
erreur('Vous ne pouvez pas espionner sans sonde d\'espionnage !', "red", '?p=flotte');
|
||||
if ($mission == 5 && $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][6] <= 0 && $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][13] <= 0) {
|
||||
erreur('Vous ne pouvez pas espionner sans sonde d\'espionnage !', "red", '?p=flotte');
|
||||
}
|
||||
|
||||
//Vérification que la destination ne soit pas en dehors de la galaxie
|
||||
if ($end_galaxie > $VAR['nb_amas'] || $end_ss > $VAR['nb_systeme'] || $end_galaxie < 0 || $end_ss < 1 || (($end_pos > $VAR['nb_planete'] || $end_pos < 1) && $end_pos != "A") || ($end_galaxie < 1 && $SESS->level < 6))
|
||||
erreur('La destination de la flotte n\'est pas correcte.', "red", '?p=flotte');
|
||||
if ($end_galaxie > $VAR['nb_amas'] || $end_ss > $VAR['nb_systeme'] || $end_galaxie < 0 || $end_ss < 1 || (($end_pos > $VAR['nb_planete'] || $end_pos < 1) && $end_pos != "A") || ($end_galaxie < 1 && $SESS->level < 6)) {
|
||||
erreur('La destination de la flotte n\'est pas correcte.', "red", '?p=flotte');
|
||||
}
|
||||
|
||||
//On vérifie que l'on possède assez de ressources
|
||||
if ((!empty($EBmetal) && !$EBmetal > $planete->metal) || (!empty($EBcristal) && !$EBcristal > $planete->cristal) || (!empty($EBhydrogene) && !$EBhydrogene > $planete->hydrogene))
|
||||
erreur('Vous ne pouvez pas envoyer plus de ressources que vous n\'en posséder.', "red", '?p=flotte');
|
||||
if ((!empty($EBmetal) && !$EBmetal > $planete->metal) || (!empty($EBcristal) && !$EBcristal > $planete->cristal) || (!empty($EBhydrogene) && !$EBhydrogene > $planete->hydrogene)) {
|
||||
erreur('Vous ne pouvez pas envoyer plus de ressources que vous n\'en posséder.', "red", '?p=flotte');
|
||||
}
|
||||
|
||||
//On vérifie que l'on n'envoie pas des ressources négatives
|
||||
if ((!empty($EBmetal) && $EBmetal < 0) || (!empty($EBcristal) && $EBcristal < 0) || (!empty($EBhydrogene) && $EBhydrogene < 0))
|
||||
erreur('Vous avez spécifié des valeurs de ressources à embarquer incorrectes !', "red", '?p=flotte', 4000);
|
||||
if ((!empty($EBmetal) && $EBmetal < 0) || (!empty($EBcristal) && $EBcristal < 0) || (!empty($EBhydrogene) && $EBhydrogene < 0)) {
|
||||
erreur('Vous avez spécifié des valeurs de ressources à embarquer incorrectes !', "red", '?p=flotte', 4000);
|
||||
}
|
||||
|
||||
//On vérifie la vitesse de la flotte
|
||||
if (!is_numeric($vitesse) || $vitesse < 0 || $vitesse > 100)
|
||||
erreur('La vitesse de votre flotte est incorrecte !', "red", '?p=flotte');
|
||||
if (!is_numeric($vitesse) || $vitesse < 0 || $vitesse > 100) {
|
||||
erreur('La vitesse de votre flotte est incorrecte !', "red", '?p=flotte');
|
||||
}
|
||||
|
||||
|
||||
//Recherche de la planète ou de l'astéroïde
|
||||
if ($end_pos == "A")
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$resultat = $bdd->unique_query("SELECT id, id AS id_user, debris_met, debris_cri FROM $table_alliances WHERE galaxie = $end_galaxie AND ss = $end_ss;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$resultat = $bdd->unique_query("SELECT id, id_user, debris_met, debris_cri FROM $table_planete WHERE galaxie = $end_galaxie AND ss = $end_ss AND position = $end_pos;");
|
||||
$bdd->deconnexion();
|
||||
if ($end_pos == "A") {
|
||||
$bdd->reconnexion();
|
||||
$resultat = $bdd->unique_query("SELECT id, id AS id_user, debris_met, debris_cri FROM $table_alliances WHERE galaxie = $end_galaxie AND ss = $end_ss;");
|
||||
$bdd->deconnexion();
|
||||
} else {
|
||||
$bdd->reconnexion();
|
||||
$resultat = $bdd->unique_query("SELECT id, id_user, debris_met, debris_cri FROM $table_planete WHERE galaxie = $end_galaxie AND ss = $end_ss AND position = $end_pos;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
|
||||
//On vérifie qu'il n'y ait pas une interaction entre deux multi-comptes
|
||||
if (count($multi) > 1 && ($mission == 1 || $mission == 6 || $mission == 7))
|
||||
{
|
||||
foreach($multi as $test)
|
||||
{
|
||||
if ($test['id_util'] == $resultat['id_user'])
|
||||
erreur('Vous ne pouvez pas avoir d\'interaction avec ce joueur pour raison de multi-compte (voir page d\'accueil).');
|
||||
}
|
||||
if (count($multi) > 1 && ($mission == 1 || $mission == 6 || $mission == 7)) {
|
||||
foreach ($multi as $test) {
|
||||
if ($test['id_util'] == $resultat['id_user']) {
|
||||
erreur('Vous ne pouvez pas avoir d\'interaction avec ce joueur pour raison de multi-compte (voir page d\'accueil).');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($mission == 1 && !$resultat)
|
||||
erreur('Impossible de transporter des ressources vers la planète ['.$end_galaxie.':'.$end_ss.':'.$end_pos.'] car elle est inhabitée.', "red", '?p=flotte', 4000);
|
||||
elseif ($mission == 2 && $resultat)
|
||||
{
|
||||
if ($end_pos != "A")
|
||||
erreur('La planète que vous voulez coloniser est déjà habitée.', "red", '?p=flotte', 3000);
|
||||
else
|
||||
erreur('L\'astéroide que vous voulez coloniser est déjà habitée.', "red", '?p=flotte', 3000);
|
||||
if ($mission == 1 && !$resultat) {
|
||||
erreur('Impossible de transporter des ressources vers la planète ['.$end_galaxie.':'.$end_ss.':'.$end_pos.'] car elle est inhabitée.', "red", '?p=flotte', 4000);
|
||||
} elseif ($mission == 2 && $resultat) {
|
||||
if ($end_pos != "A") {
|
||||
erreur('La planète que vous voulez coloniser est déjà habitée.', "red", '?p=flotte', 3000);
|
||||
} else {
|
||||
erreur('L\'astéroide que vous voulez coloniser est déjà habitée.', "red", '?p=flotte', 3000);
|
||||
}
|
||||
}
|
||||
//Si la mission est d'attaquer, on vérifie que le joueur cible ne soit pas ne mode vacances ou qu'il soit tout jeune
|
||||
elseif ($mission == 3 && $end_pos != "A")
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$resultatu = $bdd->unique_query("SELECT mv, time_inscription FROM $table_user WHERE id = ".$resultat['id_user'].";");
|
||||
$bdd->deconnexion();
|
||||
elseif ($mission == 3 && $end_pos != "A") {
|
||||
$bdd->reconnexion();
|
||||
$resultatu = $bdd->unique_query("SELECT mv, time_inscription FROM $table_user WHERE id = ".$resultat['id_user'].";");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if ($resultatu['mv'] > 0)
|
||||
erreur('Le joueur que vous tentez d\'attaquer est actuellement en mode vacances, vous ne pouvez donc pas l\'attaquer avant son retour de vacances.', "red", '?p=flotte', 3000); //TODO Mettre le numéro du mode vacances et non > 0 !!!
|
||||
elseif ($resultatu['time_inscription'] + 604800 > time())
|
||||
erreur('Le joueur que vous tentez d\'attaquer s\'est inscrit récemment, laissez-lui le temps de se préparer au combat !', "red", '?p=flotte', 3000);
|
||||
elseif (!$resultat)
|
||||
erreur('La planète que vous tentez d\'attaquer est inhabitée.', "red", '?p=flotte');
|
||||
elseif ($resultat['id_user'] == $planete->id_user)
|
||||
erreur('La planète que vous tentez d\'attaquer vous appartient.', "red", '?p=flotte');
|
||||
}
|
||||
elseif ($mission == 4 && ($resultat['debris_met'] <= 0 || $resultat['debris_cri'] <= 0) && empty($SESS->values['forceFlotte']))
|
||||
{
|
||||
$SESS->values['forceFlotte'] = true;
|
||||
$SESS->put();
|
||||
erreur('Il n\'y a rien à recycler sur la planète ['.$end_galaxie.':'.$end_ss.':'.$end_pos.'].<br />Vous pouvez forcer le lancement de la flotte en rechargeant cette page.', "orange");
|
||||
if ($resultatu['mv'] > 0) {
|
||||
erreur('Le joueur que vous tentez d\'attaquer est actuellement en mode vacances, vous ne pouvez donc pas l\'attaquer avant son retour de vacances.', "red", '?p=flotte', 3000);
|
||||
} //TODO Mettre le numéro du mode vacances et non > 0 !!!
|
||||
elseif ($resultatu['time_inscription'] + 604800 > time()) {
|
||||
erreur('Le joueur que vous tentez d\'attaquer s\'est inscrit récemment, laissez-lui le temps de se préparer au combat !', "red", '?p=flotte', 3000);
|
||||
} elseif (!$resultat) {
|
||||
erreur('La planète que vous tentez d\'attaquer est inhabitée.', "red", '?p=flotte');
|
||||
} elseif ($resultat['id_user'] == $planete->id_user) {
|
||||
erreur('La planète que vous tentez d\'attaquer vous appartient.', "red", '?p=flotte');
|
||||
}
|
||||
} elseif ($mission == 4 && ($resultat['debris_met'] <= 0 || $resultat['debris_cri'] <= 0) && empty($SESS->values['forceFlotte'])) {
|
||||
$SESS->values['forceFlotte'] = true;
|
||||
$SESS->put();
|
||||
erreur('Il n\'y a rien à recycler sur la planète ['.$end_galaxie.':'.$end_ss.':'.$end_pos.'].<br />Vous pouvez forcer le lancement de la flotte en rechargeant cette page.', "orange");
|
||||
}
|
||||
//TODO Autoriser l'espionnage sur les planètes inhabités
|
||||
elseif ($mission == 5)
|
||||
{
|
||||
if (!$resultat)
|
||||
erreur('Impossible d\'espionner la planète ['.$end_galaxie.':'.$end_ss.':'.$end_pos.'] car elle est inhabitée.', "red", '?p=flotte', 4000);
|
||||
elseif ($end_pos != "A" && $resultat['id_user'] == $planete->id_user)
|
||||
erreur('La planète que vous désirez espionner vous appartient !', "red", '?p=flotte', 3000);
|
||||
elseif ($mission == 5) {
|
||||
if (!$resultat) {
|
||||
erreur('Impossible d\'espionner la planète ['.$end_galaxie.':'.$end_ss.':'.$end_pos.'] car elle est inhabitée.', "red", '?p=flotte', 4000);
|
||||
} elseif ($end_pos != "A" && $resultat['id_user'] == $planete->id_user) {
|
||||
erreur('La planète que vous désirez espionner vous appartient !', "red", '?p=flotte', 3000);
|
||||
}
|
||||
} elseif ($mission == 6 && $resultat['id_user'] != $planete->id_user && $resultat['id_user'] != $planete->id_alliance) {
|
||||
erreur('La planète sur laquelle vous désirez stationner ne vous appartient pas.', "red", '?p=flotte', 3000);
|
||||
} elseif ($mission == 7 && !$resultat) {
|
||||
erreur('La planète sur laquelle vous désirez donner vos vaisseaux n\'existe pas.', "red", '?p=flotte', 3000);
|
||||
}
|
||||
|
||||
elseif ($mission == 6 && $resultat['id_user'] != $planete->id_user && $resultat['id_user'] != $planete->id_alliance)
|
||||
erreur('La planète sur laquelle vous désirez stationner ne vous appartient pas.', "red", '?p=flotte', 3000);
|
||||
elseif ($mission == 7 && !$resultat)
|
||||
erreur('La planète sur laquelle vous désirez donner vos vaisseaux n\'existe pas.', "red", '?p=flotte', 3000);
|
||||
|
||||
|
||||
//Création de la flotte
|
||||
$flotte = new flotte();
|
||||
|
|
@ -159,4 +166,3 @@ $SESS->values["prepFlottes"][$idPrep]["statut"] = 2;
|
|||
$SESS->put();
|
||||
|
||||
erreur('Votre flotte a été envoyée avec succès.', "green", '?p=flotte', 4000);
|
||||
?>
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
//Génération d'un ID unique pour identifier la flotte durant sa création
|
||||
$idPrep = random();
|
||||
|
|
@ -9,29 +12,29 @@ $SESS->values["prepFlottes"][$idPrep] = array();
|
|||
|
||||
//On récupère les vaisseaux à envoyer
|
||||
$nombreVaisseau = 0;
|
||||
foreach ($planete->vaisseaux as $key => $vaisseau)
|
||||
{
|
||||
$v = gpc('v'.$key, 'post');
|
||||
if (!is_numeric($v) || $v < 0)
|
||||
$v = 0;
|
||||
foreach ($planete->vaisseaux as $key => $vaisseau) {
|
||||
$v = gpc('v'.$key, 'post');
|
||||
if (!is_numeric($v) || $v < 0) {
|
||||
$v = 0;
|
||||
}
|
||||
|
||||
$SESS->values["prepFlottes"][$idPrep]['vaisseaux'][$key] = $v;
|
||||
$nombreVaisseau += $v;
|
||||
$SESS->values["prepFlottes"][$idPrep]['vaisseaux'][$key] = $v;
|
||||
$nombreVaisseau += $v;
|
||||
}
|
||||
//On vérifie que l'utilisateur a bien envoyé plus d'un vaisseau
|
||||
if ($nombreVaisseau <= 0)
|
||||
{
|
||||
unset($SESS->values["prepFlottes"][$idPrep]);
|
||||
erreur('Vous devez envoyer au moins un vaisseau.', "red", '?p=flotte');
|
||||
if ($nombreVaisseau <= 0) {
|
||||
unset($SESS->values["prepFlottes"][$idPrep]);
|
||||
erreur('Vous devez envoyer au moins un vaisseau.', "red", '?p=flotte');
|
||||
}
|
||||
|
||||
//On définit le type de la flotte (utilisateur ou alliance)
|
||||
if (!empty($_POST['envoie']))
|
||||
$SESS->values["prepFlottes"][$idPrep]['type'] = 1;
|
||||
elseif (!empty($_POST['groupe']))
|
||||
$SESS->values["prepFlottes"][$idPrep]['type'] = 2;
|
||||
else
|
||||
die ('Erreur !');
|
||||
if (!empty($_POST['envoie'])) {
|
||||
$SESS->values["prepFlottes"][$idPrep]['type'] = 1;
|
||||
} elseif (!empty($_POST['groupe'])) {
|
||||
$SESS->values["prepFlottes"][$idPrep]['type'] = 2;
|
||||
} else {
|
||||
die('Erreur !');
|
||||
}
|
||||
|
||||
//On enregistre les paramètres en session
|
||||
$SESS->values["prepFlottes"][$idPrep]['nbVaisseaux'] = $nombreVaisseau;
|
||||
|
|
@ -44,4 +47,3 @@ unset($nombreVaisseau, $key, $vaisseau, $v);
|
|||
|
||||
header('Location: ?p=flotte&c='.$idPrep);
|
||||
exit;
|
||||
?>
|
||||
|
|
@ -1,87 +1,89 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
$page = 'flotte1';
|
||||
|
||||
//Demande de mise à jour des tactiques par défaut
|
||||
$attaque = gpc('attaque', 'post');
|
||||
$defense = gpc('defense', 'post');
|
||||
if (is_numeric($attaque) && is_numeric($defense))
|
||||
{
|
||||
$chang = false;
|
||||
if (($attaque != $planete->combatAT_tactique) && (($attaque == 1 && $planete->technologies[3] & 4096) || ($attaque == 2 && $planete->technologies[3] & 8192) || ($attaque == 3 && $planete->technologies[3] & 16384) || $attaque == 0))
|
||||
{
|
||||
$planete->combatAT_tactique = $attaque;
|
||||
$planete->addModifUser('combatAT_tactique');
|
||||
$chang = true;
|
||||
}
|
||||
if (($defense != $planete->combatDE_tactique) && (($defense == 1 && $planete->technologies[3] & 4096) || ($defense == 2 && $planete->technologies[3] & 8192) || ($defense == 3 && $planete->technologies[3] & 16384) || $defense == 0))
|
||||
{
|
||||
$planete->combatDE_tactique = $defense;
|
||||
$planete->addModifUser('combatDE_tactique');
|
||||
$chang = true;
|
||||
}
|
||||
|
||||
if ($chang)
|
||||
erreur('Tactiques mises à jour avec succès.', 'green', '?p=flotte', 1100);
|
||||
}
|
||||
unset($attaque, $defense, $chang);
|
||||
//Demande de mise à jour des tactiques par défaut
|
||||
$attaque = gpc('attaque', 'post');
|
||||
$defense = gpc('defense', 'post');
|
||||
if (is_numeric($attaque) && is_numeric($defense)) {
|
||||
$chang = false;
|
||||
if (($attaque != $planete->combatAT_tactique) && (($attaque == 1 && $planete->technologies[3] & 4096) || ($attaque == 2 && $planete->technologies[3] & 8192) || ($attaque == 3 && $planete->technologies[3] & 16384) || $attaque == 0)) {
|
||||
$planete->combatAT_tactique = $attaque;
|
||||
$planete->addModifUser('combatAT_tactique');
|
||||
$chang = true;
|
||||
}
|
||||
if (($defense != $planete->combatDE_tactique) && (($defense == 1 && $planete->technologies[3] & 4096) || ($defense == 2 && $planete->technologies[3] & 8192) || ($defense == 3 && $planete->technologies[3] & 16384) || $defense == 0)) {
|
||||
$planete->combatDE_tactique = $defense;
|
||||
$planete->addModifUser('combatDE_tactique');
|
||||
$chang = true;
|
||||
}
|
||||
|
||||
if ($chang) {
|
||||
erreur('Tactiques mises à jour avec succès.', 'green', '?p=flotte', 1100);
|
||||
}
|
||||
}
|
||||
unset($attaque, $defense, $chang);
|
||||
|
||||
//Affichage des flottes en cours dans la galaxie
|
||||
$bdd->reconnexion();
|
||||
if (SURFACE == "asteroide")
|
||||
$flottes = $bdd->query("SELECT id FROM $table_flottes WHERE id_alliance = ".$planete->id.";");
|
||||
else
|
||||
$flottes = $bdd->query("SELECT id FROM $table_flottes WHERE id_user = ".$planete->id_user.";");
|
||||
$bdd->deconnexion();
|
||||
//Affichage des flottes en cours dans la galaxie
|
||||
$bdd->reconnexion();
|
||||
if (SURFACE == "asteroide") {
|
||||
$flottes = $bdd->query("SELECT id FROM $table_flottes WHERE id_alliance = ".$planete->id.";");
|
||||
} else {
|
||||
$flottes = $bdd->query("SELECT id FROM $table_flottes WHERE id_user = ".$planete->id_user.";");
|
||||
}
|
||||
$bdd->deconnexion();
|
||||
|
||||
//Extraction des flottes en cours
|
||||
if ($flottes)
|
||||
{
|
||||
foreach ($flottes as $key => $flotte)
|
||||
{
|
||||
$flottes[$key] = new Flotte($flotte['id']);
|
||||
$flottes[$key]->load_planete();
|
||||
}
|
||||
$template->assign('flottesEC', $flottes);
|
||||
}
|
||||
//Extraction des flottes en cours
|
||||
if ($flottes) {
|
||||
foreach ($flottes as $key => $flotte) {
|
||||
$flottes[$key] = new Flotte($flotte['id']);
|
||||
$flottes[$key]->load_planete();
|
||||
}
|
||||
$template->assign('flottesEC', $flottes);
|
||||
}
|
||||
|
||||
//Calcul du nombre de slot disponible et vérouillage de l'envoie si besoin
|
||||
if ($flottes)
|
||||
$nbFlottes = count($flottes);
|
||||
else
|
||||
//Calcul du nombre de slot disponible et vérouillage de l'envoie si besoin
|
||||
if ($flottes) {
|
||||
$nbFlottes = count($flottes);
|
||||
} else {
|
||||
$nbFlottes = 0;
|
||||
if (SURFACE == "asteroide")
|
||||
{
|
||||
if ($planete->batiments[2] == 1)
|
||||
$slots = 1;
|
||||
elseif ($planete->batiments[2] == 2)
|
||||
$slots = 2;
|
||||
elseif ($planete->batiments[2] == 3)
|
||||
$slots = 4;
|
||||
elseif ($planete->batiments[2] == 4)
|
||||
$slots = 7;
|
||||
elseif ($planete->batiments[2] == 5)
|
||||
$slots = 14;
|
||||
else
|
||||
$slots = 0;
|
||||
}
|
||||
if (SURFACE == "asteroide") {
|
||||
if ($planete->batiments[2] == 1) {
|
||||
$slots = 1;
|
||||
} elseif ($planete->batiments[2] == 2) {
|
||||
$slots = 2;
|
||||
} elseif ($planete->batiments[2] == 3) {
|
||||
$slots = 4;
|
||||
} elseif ($planete->batiments[2] == 4) {
|
||||
$slots = 7;
|
||||
} elseif ($planete->batiments[2] == 5) {
|
||||
$slots = 14;
|
||||
} else {
|
||||
$slots = 0;
|
||||
}
|
||||
|
||||
$slots -= $nbFlottes;
|
||||
}
|
||||
else
|
||||
$slots = count($queryPlanetes)-$nbFlottes;
|
||||
$slots -= $nbFlottes;
|
||||
} else {
|
||||
$slots = count($queryPlanetes)-$nbFlottes;
|
||||
}
|
||||
|
||||
if ($slots > 0)
|
||||
//$template->assign('action', '<input class="submit" name="envoie" type="submit" value="Envoyer flotte" /> <input class="submit" name="groupe" type="submit" value="Envoye groupé" />');
|
||||
$template->assign('action', '<input class="submit" name="envoie" type="submit" value="Ok" />');
|
||||
else
|
||||
$template->assign('action', '<span class="lack">Nombre de flottes maximum simultanées atteint</span>');
|
||||
if ($slots > 0) {
|
||||
//$template->assign('action', '<input class="submit" name="envoie" type="submit" value="Envoyer flotte" /> <input class="submit" name="groupe" type="submit" value="Envoye groupé" />');
|
||||
$template->assign('action', '<input class="submit" name="envoie" type="submit" value="Ok" />');
|
||||
} else {
|
||||
$template->assign('action', '<span class="lack">Nombre de flottes maximum simultanées atteint</span>');
|
||||
}
|
||||
|
||||
$template->assign('nbflotte', $nbFlottes);
|
||||
$template->assign('nbflottemax', $slots + $nbFlottes);
|
||||
$template->assign('nbflotte', $nbFlottes);
|
||||
$template->assign('nbflottemax', $slots + $nbFlottes);
|
||||
|
||||
//Affichage des flottes en préparation
|
||||
if (isset($SESS->values["prepFlottes"]))
|
||||
$template->assign('flottesEP', $SESS->values["prepFlottes"]);
|
||||
//Affichage des flottes en préparation
|
||||
if (isset($SESS->values["prepFlottes"])) {
|
||||
$template->assign('flottesEP', $SESS->values["prepFlottes"]);
|
||||
}
|
||||
|
||||
unset($nbFlottes, $slots, $flottes, $flotte, $key);
|
||||
?>
|
||||
|
|
@ -1,33 +1,42 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
$idPrep = gpc('c');
|
||||
$template->assign('idPrep', $idPrep);
|
||||
$template->assign('restaure', $SESS->values["prepFlottes"][$idPrep]);
|
||||
|
||||
foreach ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'] as $key => $vaisseau)
|
||||
{
|
||||
//On vérifie qu'il y a suffisamment de vaisseaux sur la planète
|
||||
if ($planete->vaisseaux[$key] < $vaisseau)
|
||||
erreur('Vous n\'avez pas assez de vaisseaux sur cette planète pour envoyer cette flotte !', "red", '?p=flotte');
|
||||
foreach ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'] as $key => $vaisseau) {
|
||||
//On vérifie qu'il y a suffisamment de vaisseaux sur la planète
|
||||
if ($planete->vaisseaux[$key] < $vaisseau) {
|
||||
erreur('Vous n\'avez pas assez de vaisseaux sur cette planète pour envoyer cette flotte !', "red", '?p=flotte');
|
||||
}
|
||||
}
|
||||
|
||||
//Génération de la liste de mission possible avec les vaisseaux de la flotte
|
||||
$missions = array();
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['type'] == 1)
|
||||
$missions = array(6 => "Stationner", 7 => "Donner des vaisseaux", 1 => "Transporter");
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'][2])
|
||||
$missions[2] = "Coloniser";
|
||||
if ($planete->technologies[7]& 16 && $VAR["attaques"])
|
||||
$missions[3] = "Attaquer";
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['type'] == 1 && $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][3])
|
||||
$missions[4] = "Recycler";
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['type'] == 1 && ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'][6] || $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][13]))
|
||||
$missions[5] = "Espionner";
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['type'] == 1) {
|
||||
$missions = array(6 => "Stationner", 7 => "Donner des vaisseaux", 1 => "Transporter");
|
||||
}
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'][2]) {
|
||||
$missions[2] = "Coloniser";
|
||||
}
|
||||
if ($planete->technologies[7]& 16 && $VAR["attaques"]) {
|
||||
$missions[3] = "Attaquer";
|
||||
}
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['type'] == 1 && $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][3]) {
|
||||
$missions[4] = "Recycler";
|
||||
}
|
||||
if ($SESS->values["prepFlottes"][$idPrep]['type'] == 1 && ($SESS->values["prepFlottes"][$idPrep]['vaisseaux'][6] || $SESS->values["prepFlottes"][$idPrep]['vaisseaux'][13])) {
|
||||
$missions[5] = "Espionner";
|
||||
}
|
||||
|
||||
//S'il n'y a aucun choix de mission possible, on abandonne
|
||||
if (count($missions) == 0)
|
||||
erreur('Aucune mission disponible !', "red", '?p=flotte');
|
||||
if (count($missions) == 0) {
|
||||
erreur('Aucune mission disponible !', "red", '?p=flotte');
|
||||
}
|
||||
$template->assign('missions', $missions);
|
||||
|
||||
$template->assign('scripth', '<script src="js/prototype.js" type="text/javascript"></script>');
|
||||
|
|
@ -37,20 +46,23 @@ $page = 'flotte2';
|
|||
//Récupération des destinations favorites et des colonies
|
||||
$favoris = array();
|
||||
include_once("Class/tinyplanete.php");
|
||||
foreach ($planete->destinationsFavoris as $fav)
|
||||
{
|
||||
$fav_Planete = new TinyPlanete($fav);
|
||||
if (!empty($fav_Planete->nom_planete)) $favoris[$fav_Planete->id] = $fav_Planete->nom_planete;
|
||||
else $favoris[$fav_Planete->id] = '['.$fav_Planete->galaxie.':'.$fav_Planete->ss.':'.$fav_Planete->position.']';
|
||||
foreach ($planete->destinationsFavoris as $fav) {
|
||||
$fav_Planete = new TinyPlanete($fav);
|
||||
if (!empty($fav_Planete->nom_planete)) {
|
||||
$favoris[$fav_Planete->id] = $fav_Planete->nom_planete;
|
||||
} else {
|
||||
$favoris[$fav_Planete->id] = '['.$fav_Planete->galaxie.':'.$fav_Planete->ss.':'.$fav_Planete->position.']';
|
||||
}
|
||||
}
|
||||
$favorisC = array();
|
||||
foreach ($queryPlanetes as $fav)
|
||||
{
|
||||
if (!empty($fav['nom_planete'])) $favorisC[$fav['id']] = $fav['nom_planete'];
|
||||
else $favorisC[$fav['id']] = '['.$fav['galaxie'].':'.$fav['ss'].':'.$fav['position'].']';
|
||||
foreach ($queryPlanetes as $fav) {
|
||||
if (!empty($fav['nom_planete'])) {
|
||||
$favorisC[$fav['id']] = $fav['nom_planete'];
|
||||
} else {
|
||||
$favorisC[$fav['id']] = '['.$fav['galaxie'].':'.$fav['ss'].':'.$fav['position'].']';
|
||||
}
|
||||
}
|
||||
$template->assign('favoris', $favoris);
|
||||
$template->assign('favorisColonies', $favorisC);
|
||||
|
||||
unset($idPrep, $missions, $fav, $vaisseau, $key, $favorisC, $favoris);
|
||||
?>
|
||||
|
|
@ -1,56 +1,58 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ../'); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ../');
|
||||
exit;
|
||||
}
|
||||
|
||||
//Si l'on est sur un astéroïde, on charge la page de gestion d'alliance !
|
||||
if (SURFACE == "asteroide")
|
||||
include("game/alliances/gestion.php");
|
||||
else
|
||||
{
|
||||
$page = 'gestion';
|
||||
$titre = 'Gestion';
|
||||
if (SURFACE == "asteroide") {
|
||||
include("game/alliances/gestion.php");
|
||||
} else {
|
||||
$page = 'gestion';
|
||||
$titre = 'Gestion';
|
||||
|
||||
//Demande de changement de politique
|
||||
$politique = gpc('politique', 'post');
|
||||
if (is_numeric($politique))
|
||||
{
|
||||
//On annule le changement politique si le dernier a eu lieu dans la semaine.
|
||||
if ($planete->politique_lastchange > time() - 604800)
|
||||
erreur("La population de votre empire planètaire vient d'entrer dans une phase de révolution contre le changement de régime.<br />Pour ne pas perdre votre place au sommet de l'empire, le système politique n'a pas été changé.");
|
||||
if (($planete->technologies[3] & 2048 && ($politique == 3 || $politique == 2 || $politique == 1) || $politique == 0) && $planete->politique != $politique)
|
||||
{
|
||||
$planete->politique = $politique;
|
||||
$planete->politique_lastchange = time();
|
||||
$planete->addModifUser("politique");
|
||||
$planete->addModifUser("politique_lastchange");
|
||||
erreur("Le changement politique a bien été pris en compte par la population de vos différentes planètes.", "green");
|
||||
}
|
||||
elseif ($planete->politique == $politique)
|
||||
erreur("Ce système politique est actuellement en vigueur.", "orange");
|
||||
else
|
||||
erreur("Impossible de choisir ce système politique !");
|
||||
}
|
||||
//Demande de changement de politique
|
||||
$politique = gpc('politique', 'post');
|
||||
if (is_numeric($politique)) {
|
||||
//On annule le changement politique si le dernier a eu lieu dans la semaine.
|
||||
if ($planete->politique_lastchange > time() - 604800) {
|
||||
erreur("La population de votre empire planètaire vient d'entrer dans une phase de révolution contre le changement de régime.<br />Pour ne pas perdre votre place au sommet de l'empire, le système politique n'a pas été changé.");
|
||||
}
|
||||
if (($planete->technologies[3] & 2048 && ($politique == 3 || $politique == 2 || $politique == 1) || $politique == 0) && $planete->politique != $politique) {
|
||||
$planete->politique = $politique;
|
||||
$planete->politique_lastchange = time();
|
||||
$planete->addModifUser("politique");
|
||||
$planete->addModifUser("politique_lastchange");
|
||||
erreur("Le changement politique a bien été pris en compte par la population de vos différentes planètes.", "green");
|
||||
} elseif ($planete->politique == $politique) {
|
||||
erreur("Ce système politique est actuellement en vigueur.", "orange");
|
||||
} else {
|
||||
erreur("Impossible de choisir ce système politique !");
|
||||
}
|
||||
}
|
||||
|
||||
if (SURFACE == "planete")
|
||||
$template->assign('planeteEC', array(
|
||||
'id' => $planete->id,
|
||||
'metal' => $planete->metal,
|
||||
'cristal' => $planete->cristal,
|
||||
'hydrogene' => $planete->hydrogene,
|
||||
'energie' => $planete->energie,
|
||||
'population' => $planete->population,
|
||||
)
|
||||
);
|
||||
if (SURFACE == "planete") {
|
||||
$template->assign(
|
||||
'planeteEC',
|
||||
array(
|
||||
'id' => $planete->id,
|
||||
'metal' => $planete->metal,
|
||||
'cristal' => $planete->cristal,
|
||||
'hydrogene' => $planete->hydrogene,
|
||||
'energie' => $planete->energie,
|
||||
'population' => $planete->population,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$politiques = array('Anarchie');
|
||||
if ($planete->technologies[3] & 2048)
|
||||
{
|
||||
$politiques[] = 'Fascisme (Mouvement Frieden)';
|
||||
$politiques[] = 'Communisme (Mouvement Koslovic)';
|
||||
$politiques[] = 'Démocratie (Administration coloniale)';
|
||||
}
|
||||
$template->assign('politiques', $politiques);
|
||||
$template->assign('moraldetails', $politiques);
|
||||
$politiques = array('Anarchie');
|
||||
if ($planete->technologies[3] & 2048) {
|
||||
$politiques[] = 'Fascisme (Mouvement Frieden)';
|
||||
$politiques[] = 'Communisme (Mouvement Koslovic)';
|
||||
$politiques[] = 'Démocratie (Administration coloniale)';
|
||||
}
|
||||
$template->assign('politiques', $politiques);
|
||||
$template->assign('moraldetails', $politiques);
|
||||
|
||||
unset($politiques, $politiques, $politique);
|
||||
unset($politiques, $politiques, $politique);
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
<?php
|
||||
if(!defined('INDEX') || SURFACE != "planete") { header("Location: ./".$VAR["first_page"]); exit; }
|
||||
if (!defined('INDEX') || SURFACE != "planete") {
|
||||
header("Location: ./".$VAR["first_page"]);
|
||||
exit;
|
||||
}
|
||||
$page = "laboratoire";
|
||||
$titre = ucfirst($LANG[$race]["batiments"]["noms_sing"][6]);
|
||||
|
||||
|
|
@ -7,125 +10,130 @@ $titre = ucfirst($LANG[$race]["batiments"]["noms_sing"][6]);
|
|||
Transformation des niveaux XML en tableau//
|
||||
for($n = 0; $n < 7; $n++)
|
||||
{
|
||||
foreach ($LANG[$planete->race]["technologies"]["niveau"][$n] as $key => $b)
|
||||
{
|
||||
$LANG[$planete->race]["technologies"]["niveau"][$n][$key] = intval($b);
|
||||
}
|
||||
foreach ($LANG[$planete->race]["technologies"]["niveau"][$n] as $key => $b)
|
||||
{
|
||||
$LANG[$planete->race]["technologies"]["niveau"][$n][$key] = intval($b);
|
||||
}
|
||||
|
||||
print var_export($LANG[$planete->race]["technologies"]["niveau"][$n], true);
|
||||
print var_export($LANG[$planete->race]["technologies"]["niveau"][$n], true);
|
||||
}
|
||||
exit;
|
||||
//*/
|
||||
//Si l'on est pas sur la planète mère, on bloque le laboratoire
|
||||
if ($queryPlanetes[0]["id"] != $planete->id)
|
||||
erreur("Vous devez être sur votre planète mère pour faire des recherches dans le ".$LANG[$race]["batiments"]["noms_sing"][6]);
|
||||
if ($queryPlanetes[0]["id"] != $planete->id) {
|
||||
erreur("Vous devez être sur votre planète mère pour faire des recherches dans le ".$LANG[$race]["batiments"]["noms_sing"][6]);
|
||||
}
|
||||
|
||||
//Vérification que le joueur ait bien un labo avant d'afficher la page
|
||||
if ($planete->batiments[6] <= 0)
|
||||
erreur("Vous devez d'abord construire un ".$LANG[$race]["batiments"]["noms_sing"][6], "red", "?p=batiments", 3500);
|
||||
if ($planete->batiments[6] <= 0) {
|
||||
erreur("Vous devez d'abord construire un ".$LANG[$race]["batiments"]["noms_sing"][6], "red", "?p=batiments", 3500);
|
||||
}
|
||||
|
||||
//On vérifie la branche demandée
|
||||
if (isset($_GET["n"]) && is_numeric($_GET["n"]) && isset($planete->technologies[$_GET["n"]]))
|
||||
$onglet = gpc("n");
|
||||
else
|
||||
$onglet = 0;
|
||||
if (isset($_GET["n"]) && is_numeric($_GET["n"]) && isset($planete->technologies[$_GET["n"]])) {
|
||||
$onglet = gpc("n");
|
||||
} else {
|
||||
$onglet = 0;
|
||||
}
|
||||
|
||||
|
||||
//Lancement d'une nouvelle recherche
|
||||
if (isset($_GET["n"]) && isset($_GET["t"])) {
|
||||
//On vérifie que le laboratoire ne soit pas en construction
|
||||
if($planete->file_bat->objectInFile(6))
|
||||
erreur("Votre ".$LANG[$race]["batiments"]["noms_sing"][6]." est en travaux, vous ne pouvez pas faire de recherches pendant ce temps !");
|
||||
//On vérifie que le laboratoire ne soit pas en construction
|
||||
if ($planete->file_bat->objectInFile(6)) {
|
||||
erreur("Votre ".$LANG[$race]["batiments"]["noms_sing"][6]." est en travaux, vous ne pouvez pas faire de recherches pendant ce temps !");
|
||||
}
|
||||
|
||||
$planete->file_tech->addObjet(intval(gpc("n")), intval(gpc("t")), $planete);
|
||||
$planete->file_tech->addObjet(intval(gpc("n")), intval(gpc("t")), $planete);
|
||||
|
||||
redirection($VAR["menu"]["laboratoire"]);
|
||||
redirection($VAR["menu"]["laboratoire"]);
|
||||
}
|
||||
//Annulation d'une nouvelle recherche
|
||||
if (isset($_GET["a"]) && isset($_GET["b"]))
|
||||
{
|
||||
$planete->file_tech->delObjet(intval(gpc("b")), 1, intval(gpc("a")), $planete);
|
||||
if (isset($_GET["a"]) && isset($_GET["b"])) {
|
||||
$planete->file_tech->delObjet(intval(gpc("b")), 1, intval(gpc("a")), $planete);
|
||||
|
||||
redirection($VAR["menu"]["laboratoire"]);
|
||||
redirection($VAR["menu"]["laboratoire"]);
|
||||
}
|
||||
|
||||
function traiterBranche($onglet, $branche, $start = false)
|
||||
{
|
||||
global $LANG, $planete, $template;
|
||||
global $LANG, $planete, $template;
|
||||
|
||||
if ($start)
|
||||
$return = "<dl id=\"arbre\">";
|
||||
else
|
||||
$return = "<dl>";
|
||||
if ($start) {
|
||||
$return = "<dl id=\"arbre\">";
|
||||
} else {
|
||||
$return = "<dl>";
|
||||
}
|
||||
|
||||
foreach($branche as $key => $b)
|
||||
{
|
||||
if (is_array($b))
|
||||
{
|
||||
$return .= "<dd>";
|
||||
$return .= traiterBranche($onglet, $b);
|
||||
$return .= "</dd>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//On recherche s'il s'agit d'une technologie à niveau multiple
|
||||
if ((dTechnologies::idToBit($b) & $planete->technologies[$onglet]) && isset($LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+1]) && $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b] == $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+1])
|
||||
{
|
||||
if ((dTechnologies::idToBit($b+1) & $planete->technologies[$onglet]) && isset($LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+2]) && $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b] == $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+2])
|
||||
$b = $b + 2;
|
||||
else
|
||||
$b = $b + 1;
|
||||
}
|
||||
foreach ($branche as $key => $b) {
|
||||
if (is_array($b)) {
|
||||
$return .= "<dd>";
|
||||
$return .= traiterBranche($onglet, $b);
|
||||
$return .= "</dd>";
|
||||
} else {
|
||||
//On recherche s'il s'agit d'une technologie à niveau multiple
|
||||
if ((dTechnologies::idToBit($b) & $planete->technologies[$onglet]) && isset($LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+1]) && $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b] == $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+1]) {
|
||||
if ((dTechnologies::idToBit($b+1) & $planete->technologies[$onglet]) && isset($LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+2]) && $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b] == $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b+2]) {
|
||||
$b = $b + 2;
|
||||
} else {
|
||||
$b = $b + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ($key >= 1)
|
||||
$return .= "</dl><dl>";
|
||||
if ($key >= 1) {
|
||||
$return .= "</dl><dl>";
|
||||
}
|
||||
|
||||
if (dTechnologies::idToBit($b) & $planete->technologies[$onglet])
|
||||
$return .= '<dt><a href="#">';
|
||||
else
|
||||
$return .= '<dt class="lack"><a href="?p=laboratoire&n='.$onglet.'&t='.$b.'">';
|
||||
if (dTechnologies::idToBit($b) & $planete->technologies[$onglet]) {
|
||||
$return .= '<dt><a href="#">';
|
||||
} else {
|
||||
$return .= '<dt class="lack"><a href="?p=laboratoire&n='.$onglet.'&t='.$b.'">';
|
||||
}
|
||||
|
||||
$return .= $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b].'</a><div><img src="'.$template->get_template_vars("url_images").'images/technologies/'.dTechnologies::image(array($onglet, $b), $planete).'" width="50" height="50" alt="'.$LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b].'" /><p><strong>Niveau :</strong> ';
|
||||
if (($niv = dTechnologies::niveau($onglet, $b)) > 0)
|
||||
{
|
||||
if (dTechnologies::idToBit($b) & $planete->technologies[$onglet])
|
||||
$return .= $niv;
|
||||
else
|
||||
$return .= ($niv-1);
|
||||
}
|
||||
else
|
||||
$return .= "unique";
|
||||
$return .= $LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b].'</a><div><img src="'.$template->get_template_vars("url_images").'images/technologies/'.dTechnologies::image(array($onglet, $b), $planete).'" width="50" height="50" alt="'.$LANG[$planete->race]["technologies"]["noms_sing"][$onglet][$b].'" /><p><strong>Niveau :</strong> ';
|
||||
if (($niv = dTechnologies::niveau($onglet, $b)) > 0) {
|
||||
if (dTechnologies::idToBit($b) & $planete->technologies[$onglet]) {
|
||||
$return .= $niv;
|
||||
} else {
|
||||
$return .= ($niv-1);
|
||||
}
|
||||
} else {
|
||||
$return .= "unique";
|
||||
}
|
||||
|
||||
if (!(dTechnologies::idToBit($b) & $planete->technologies[$onglet]))
|
||||
{
|
||||
if (($r = dTechnologies::metal($onglet, $b, $planete)) > 0)
|
||||
$return .= "<br /><strong>Coût ".$LANG[$planete->race]["ressources"]["noms"][0]." :</strong> ".$r;
|
||||
if (($r = dTechnologies::cristal($onglet, $b, $planete)) > 0)
|
||||
$return .= "<br /><strong>Coût ".$LANG[$planete->race]["ressources"]["noms"][1]." :</strong> ".$r;
|
||||
if (($r = dTechnologies::hydrogene($onglet, $b, $planete)) > 0)
|
||||
$return .= "<br /><strong>Coût ".$LANG[$planete->race]["ressources"]["noms"][2]." :</strong> ".$r;
|
||||
if (($r = dTechnologies::credits($onglet, $b, $planete)) > 0)
|
||||
$return .= "<br /><strong>Coût ".$LANG[$planete->race]["ressources"]["noms"][4]." :</strong> ".$r;
|
||||
if (!(dTechnologies::idToBit($b) & $planete->technologies[$onglet])) {
|
||||
if (($r = dTechnologies::metal($onglet, $b, $planete)) > 0) {
|
||||
$return .= "<br /><strong>Coût ".$LANG[$planete->race]["ressources"]["noms"][0]." :</strong> ".$r;
|
||||
}
|
||||
if (($r = dTechnologies::cristal($onglet, $b, $planete)) > 0) {
|
||||
$return .= "<br /><strong>Coût ".$LANG[$planete->race]["ressources"]["noms"][1]." :</strong> ".$r;
|
||||
}
|
||||
if (($r = dTechnologies::hydrogene($onglet, $b, $planete)) > 0) {
|
||||
$return .= "<br /><strong>Coût ".$LANG[$planete->race]["ressources"]["noms"][2]." :</strong> ".$r;
|
||||
}
|
||||
if (($r = dTechnologies::credits($onglet, $b, $planete)) > 0) {
|
||||
$return .= "<br /><strong>Coût ".$LANG[$planete->race]["ressources"]["noms"][4]." :</strong> ".$r;
|
||||
}
|
||||
|
||||
$return .= "<br /><strong>Temps :</strong> ".sec(dTechnologies::temps($onglet, $b, $planete));
|
||||
}
|
||||
$return .= "<br /><strong>Temps :</strong> ".sec(dTechnologies::temps($onglet, $b, $planete));
|
||||
}
|
||||
|
||||
$return .= "</p></div></dt>";
|
||||
}
|
||||
}
|
||||
$return .= "</p></div></dt>";
|
||||
}
|
||||
}
|
||||
|
||||
return $return."</dl>";
|
||||
return $return."</dl>";
|
||||
}
|
||||
|
||||
if ($onglet == 1 || $onglet == 2)
|
||||
$template->assign("arbre", traiterBranche(1, dTechnologies::type(1, $planete->race), true)."<br />".traiterBranche(2, dTechnologies::type(2, $planete->race), true));
|
||||
elseif ($onglet == 5 || $onglet == 6)
|
||||
$template->assign("arbre", traiterBranche(5, dTechnologies::type(5, $planete->race), true)."<br />".traiterBranche(6, dTechnologies::type(6, $planete->race), true));
|
||||
else
|
||||
$template->assign("arbre", traiterBranche($onglet, dTechnologies::type($onglet, $planete->race), true));
|
||||
if ($onglet == 1 || $onglet == 2) {
|
||||
$template->assign("arbre", traiterBranche(1, dTechnologies::type(1, $planete->race), true)."<br />".traiterBranche(2, dTechnologies::type(2, $planete->race), true));
|
||||
} elseif ($onglet == 5 || $onglet == 6) {
|
||||
$template->assign("arbre", traiterBranche(5, dTechnologies::type(5, $planete->race), true)."<br />".traiterBranche(6, dTechnologies::type(6, $planete->race), true));
|
||||
} else {
|
||||
$template->assign("arbre", traiterBranche($onglet, dTechnologies::type($onglet, $planete->race), true));
|
||||
}
|
||||
|
||||
$template->assign("onglet", $onglet);
|
||||
$template->assign("files", $planete->file_tech->printFile($planete));
|
||||
|
||||
unset($TEMP_liste, $niveau, $i);
|
||||
?>
|
||||
|
|
@ -1,190 +1,199 @@
|
|||
<?php
|
||||
if(!defined('INDEX') || SURFACE != "planete") { header('Location: ./'.$VAR['first_page']); exit; }
|
||||
if (!defined('INDEX') || SURFACE != "planete") {
|
||||
header('Location: ./'.$VAR['first_page']);
|
||||
exit;
|
||||
}
|
||||
$titre = 'Bourse';
|
||||
|
||||
//Récupération des données
|
||||
$ressource = intval(gpc("ressource", "post"));
|
||||
|
||||
if ($ressource == 0)
|
||||
$var = 'metal';
|
||||
elseif ($ressource == 1)
|
||||
$var = 'cristal';
|
||||
elseif ($ressource == 2)
|
||||
$var = 'hydrogene';
|
||||
if ($ressource == 0) {
|
||||
$var = 'metal';
|
||||
} elseif ($ressource == 1) {
|
||||
$var = 'cristal';
|
||||
} elseif ($ressource == 2) {
|
||||
$var = 'hydrogene';
|
||||
}
|
||||
|
||||
//On gère les achats
|
||||
if ((isset($_POST["buy"]) || empty($_POST["nbs"])) && !empty($_POST["nbb"]) && $nb = intval($_POST["nbb"]))
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$action = $bdd->unique_query("SELECT dispo, graph FROM $table_bourse_ressources WHERE id = $ressource;");
|
||||
$bdd->deconnexion();
|
||||
if ((isset($_POST["buy"]) || empty($_POST["nbs"])) && !empty($_POST["nbb"]) && $nb = intval($_POST["nbb"])) {
|
||||
$bdd->reconnexion();
|
||||
$action = $bdd->unique_query("SELECT dispo, graph FROM $table_bourse_ressources WHERE id = $ressource;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (empty($action))
|
||||
erreur("Impossible de trouver l'action dans la bourse !");
|
||||
if (empty($action)) {
|
||||
erreur("Impossible de trouver l'action dans la bourse !");
|
||||
}
|
||||
|
||||
$nb = gpc("nbb", "post");
|
||||
$nb = gpc("nbb", "post");
|
||||
|
||||
if ($action['dispo'] <= $nb)
|
||||
erreur("Il n'y a pas assez de ressources dans la galaxie pour que vous puissiez en acheter autant.");
|
||||
if ($action['dispo'] <= $nb) {
|
||||
erreur("Il n'y a pas assez de ressources dans la galaxie pour que vous puissiez en acheter autant.");
|
||||
}
|
||||
|
||||
//On vérifie qu'il reste suffisamment de place dans les silos du joueur
|
||||
if ($planete->cap < $planete->$var + $nb)
|
||||
$nb = $planete->cap - $planete->$var;
|
||||
if ($nb <= 0)
|
||||
erreur("Vous n'avez pas assez de place pour stocker ces ressources !");
|
||||
//On vérifie qu'il reste suffisamment de place dans les silos du joueur
|
||||
if ($planete->cap < $planete->$var + $nb) {
|
||||
$nb = $planete->cap - $planete->$var;
|
||||
}
|
||||
if ($nb <= 0) {
|
||||
erreur("Vous n'avez pas assez de place pour stocker ces ressources !");
|
||||
}
|
||||
|
||||
//On calcul le prix
|
||||
$prix = bourse_calcPrixBase($action['dispo'], $nb, 2.2);
|
||||
//On calcul le prix
|
||||
$prix = bourse_calcPrixBase($action['dispo'], $nb, 2.2);
|
||||
|
||||
//On vérifie que le joueur ait assez de crédits pour acheter
|
||||
if ($prix <= $planete->credits)
|
||||
{
|
||||
$planete->addCredits(-1*$prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var += $nb;
|
||||
$planete->addModif('force');
|
||||
//On vérifie que le joueur ait assez de crédits pour acheter
|
||||
if ($prix <= $planete->credits) {
|
||||
$planete->addCredits(-1*$prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var += $nb;
|
||||
$planete->addModif('force');
|
||||
|
||||
if (empty($action['graph']))
|
||||
$action['graph'] = array();
|
||||
else
|
||||
$action['graph'] = unserialize($action['graph']);
|
||||
$action['graph'][date('w')] = $action['dispo'];
|
||||
$graph = serialize($action['graph']);
|
||||
if (empty($action['graph'])) {
|
||||
$action['graph'] = array();
|
||||
} else {
|
||||
$action['graph'] = unserialize($action['graph']);
|
||||
}
|
||||
$action['graph'][date('w')] = $action['dispo'];
|
||||
$graph = serialize($action['graph']);
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($graph);
|
||||
$bdd->query("UPDATE $table_bourse_ressources SET dispo = dispo - $nb, graph = '$graph' WHERE id = $ressource;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else
|
||||
erreur("Vous n'avez pas assez de crédits pour faire cet achat !");
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($graph);
|
||||
$bdd->query("UPDATE $table_bourse_ressources SET dispo = dispo - $nb, graph = '$graph' WHERE id = $ressource;");
|
||||
$bdd->deconnexion();
|
||||
} else {
|
||||
erreur("Vous n'avez pas assez de crédits pour faire cet achat !");
|
||||
}
|
||||
}
|
||||
//On gère les ventes
|
||||
elseif ((isset($_POST["sell"]) || empty($_POST["nbb"])) && !empty($_POST["nbs"]))
|
||||
{
|
||||
$nb = gpc("nbs", "post");
|
||||
if ($nb <= 1000 || $nb > 99999999)
|
||||
erreur("Nombre de ressource invalide !<br />Vous pouvez vendre au minimum 1000 ressources !");
|
||||
elseif ((isset($_POST["sell"]) || empty($_POST["nbb"])) && !empty($_POST["nbs"])) {
|
||||
$nb = gpc("nbs", "post");
|
||||
if ($nb <= 1000 || $nb > 99999999) {
|
||||
erreur("Nombre de ressource invalide !<br />Vous pouvez vendre au minimum 1000 ressources !");
|
||||
}
|
||||
|
||||
//On vérifie que le joueur ait assez de ressources pour vendre, sinon, on ajuste à son maximum
|
||||
if ($nb > $planete->$var)
|
||||
$nb = $planete->$var;
|
||||
//On vérifie que le joueur ait assez de ressources pour vendre, sinon, on ajuste à son maximum
|
||||
if ($nb > $planete->$var) {
|
||||
$nb = $planete->$var;
|
||||
}
|
||||
|
||||
if ($nb < 0)
|
||||
erreur("Vous n'avez pas assez de ressources en vendre autant !");
|
||||
if ($nb < 0) {
|
||||
erreur("Vous n'avez pas assez de ressources en vendre autant !");
|
||||
}
|
||||
|
||||
$bdd->reconnexion();
|
||||
$action = $bdd->unique_query("SELECT dispo, graph FROM $table_bourse_ressources WHERE id = $ressource;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$action = $bdd->unique_query("SELECT dispo, graph FROM $table_bourse_ressources WHERE id = $ressource;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
if (empty($action))
|
||||
erreur("Impossible de trouver l'action dans la bourse !");
|
||||
if (empty($action)) {
|
||||
erreur("Impossible de trouver l'action dans la bourse !");
|
||||
}
|
||||
|
||||
$prix = bourse_calcPrixBase($action['dispo'], $nb, 1.8);
|
||||
$planete->addCredits($prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var -= $nb;
|
||||
$planete->addModif('force');
|
||||
$prix = bourse_calcPrixBase($action['dispo'], $nb, 1.8);
|
||||
$planete->addCredits($prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var -= $nb;
|
||||
$planete->addModif('force');
|
||||
|
||||
if (empty($action['graph']))
|
||||
$action['graph'] = array();
|
||||
else
|
||||
$action['graph'] = unserialize($action['graph']);
|
||||
$action['graph'][date('w')] = $action['dispo'];
|
||||
$graph = serialize($action['graph']);
|
||||
if (empty($action['graph'])) {
|
||||
$action['graph'] = array();
|
||||
} else {
|
||||
$action['graph'] = unserialize($action['graph']);
|
||||
}
|
||||
$action['graph'][date('w')] = $action['dispo'];
|
||||
$graph = serialize($action['graph']);
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($graph);
|
||||
$bdd->query("UPDATE $table_bourse_ressources SET dispo = dispo + $nb, graph = '$graph' WHERE id = $ressource;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($graph);
|
||||
$bdd->query("UPDATE $table_bourse_ressources SET dispo = dispo + $nb, graph = '$graph' WHERE id = $ressource;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
/*
|
||||
if(is_numeric($a) && is_numeric(gpc('a'.$a, 'post')))
|
||||
{
|
||||
$nb = gpc('a'.$a, 'post');
|
||||
if ($nb <= 0 || $nb > 99999999) erreur("Nombre de ressources invalide !");
|
||||
$nb = gpc('a'.$a, 'post');
|
||||
if ($nb <= 0 || $nb > 99999999) erreur("Nombre de ressources invalide !");
|
||||
|
||||
if ($a == 0) $var = 'metal';
|
||||
elseif ($a == 1) $var = 'cristal';
|
||||
elseif ($a == 2) $var = 'hydrogene';
|
||||
if ($a == 0) $var = 'metal';
|
||||
elseif ($a == 1) $var = 'cristal';
|
||||
elseif ($a == 2) $var = 'hydrogene';
|
||||
|
||||
$bdd->reconnexion();
|
||||
$action = $bdd->unique_query("SELECT dispo, graph FROM $table_bourse_ressources WHERE id = $a;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$action = $bdd->unique_query("SELECT dispo, graph FROM $table_bourse_ressources WHERE id = $a;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
//On vérifie que la bourse ait suffisament de ressources à distribuer :
|
||||
if ($action['dispo'] <= $nb) erreur("Il n'y a pas assez de ressources dans la galaxie pour que vous puissiez en acheter autant.");
|
||||
//On vérifie que la bourse ait suffisament de ressources à distribuer :
|
||||
if ($action['dispo'] <= $nb) erreur("Il n'y a pas assez de ressources dans la galaxie pour que vous puissiez en acheter autant.");
|
||||
|
||||
//On vérifie qu'il reste suffisamment de place dans les silos du joueur
|
||||
if ($planete->cap < $planete->$var + $nb) $nb = $planete->cap - $planete->$var;
|
||||
if ($nb <= 0) erreur("Vous n'avez pas assez de place pour stocker ces ressources !");
|
||||
//On vérifie qu'il reste suffisamment de place dans les silos du joueur
|
||||
if ($planete->cap < $planete->$var + $nb) $nb = $planete->cap - $planete->$var;
|
||||
if ($nb <= 0) erreur("Vous n'avez pas assez de place pour stocker ces ressources !");
|
||||
|
||||
$prix = bourse_calcPrixBase($action['dispo'], $nb, 2.2);
|
||||
$prix = bourse_calcPrixBase($action['dispo'], $nb, 2.2);
|
||||
|
||||
//On vérifie que le joueur ait assez de crédits pour acheter
|
||||
if ($prix <= $planete->credits) {
|
||||
$planete->addCredits(-1*$prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var += $nb;
|
||||
$planete->addModif('force');
|
||||
//On vérifie que le joueur ait assez de crédits pour acheter
|
||||
if ($prix <= $planete->credits) {
|
||||
$planete->addCredits(-1*$prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var += $nb;
|
||||
$planete->addModif('force');
|
||||
|
||||
if (empty($action['graph'])) $action['graph'] = array();
|
||||
else $action['graph'] = unserialize($action['graph']);
|
||||
$action['graph'][date('w')] = $action['dispo'];
|
||||
$graph = serialize($action['graph']);
|
||||
if (empty($action['graph'])) $action['graph'] = array();
|
||||
else $action['graph'] = unserialize($action['graph']);
|
||||
$action['graph'][date('w')] = $action['dispo'];
|
||||
$graph = serialize($action['graph']);
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($graph);
|
||||
$bdd->query("UPDATE $table_bourse_ressources SET dispo = dispo - $nb, graph = '$graph' WHERE id = $a;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else erreur("Vous n'avez pas assez de crédits pour faire cet achat !");
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($graph);
|
||||
$bdd->query("UPDATE $table_bourse_ressources SET dispo = dispo - $nb, graph = '$graph' WHERE id = $a;");
|
||||
$bdd->deconnexion();
|
||||
}
|
||||
else erreur("Vous n'avez pas assez de crédits pour faire cet achat !");
|
||||
}
|
||||
elseif(is_numeric($v) && is_numeric(gpc('a'.$v, 'post')))
|
||||
{
|
||||
$nb = gpc('a'.$v, 'post');
|
||||
if ($nb <= 1000 || $nb > 99999999) erreur("Nombre de ressources invalide !<br />Vous pouvez vendre au minimum 1000 ressources !");
|
||||
$nb = gpc('a'.$v, 'post');
|
||||
if ($nb <= 1000 || $nb > 99999999) erreur("Nombre de ressources invalide !<br />Vous pouvez vendre au minimum 1000 ressources !");
|
||||
|
||||
if ($v == 0) $var = 'metal';
|
||||
elseif ($v == 1) $var = 'cristal';
|
||||
elseif ($v == 2) $var = 'hydrogene';
|
||||
if ($v == 0) $var = 'metal';
|
||||
elseif ($v == 1) $var = 'cristal';
|
||||
elseif ($v == 2) $var = 'hydrogene';
|
||||
|
||||
//On vérifie que le joueur ait assez de ressources pour vendre, sinon, on ajuste à son maximum
|
||||
if ($nb > $planete->$var) $nb = $planete->$var;
|
||||
//On vérifie que le joueur ait assez de ressources pour vendre, sinon, on ajuste à son maximum
|
||||
if ($nb > $planete->$var) $nb = $planete->$var;
|
||||
|
||||
$bdd->reconnexion();
|
||||
$action = $bdd->unique_query("SELECT dispo, graph FROM $table_bourse_ressources WHERE id = $v;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$action = $bdd->unique_query("SELECT dispo, graph FROM $table_bourse_ressources WHERE id = $v;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
$prix = bourse_calcPrixBase($action['dispo'], $nb, 1.8);
|
||||
$planete->addCredits($prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var -= $nb;
|
||||
$planete->addModif('force');
|
||||
$prix = bourse_calcPrixBase($action['dispo'], $nb, 1.8);
|
||||
$planete->addCredits($prix);
|
||||
$planete->addModifUser('credits');
|
||||
$planete->$var -= $nb;
|
||||
$planete->addModif('force');
|
||||
|
||||
if (empty($action['graph'])) $action['graph'] = array();
|
||||
else $action['graph'] = unserialize($action['graph']);
|
||||
$action['graph'][date('w')] = $action['dispo'];
|
||||
$graph = serialize($action['graph']);
|
||||
if (empty($action['graph'])) $action['graph'] = array();
|
||||
else $action['graph'] = unserialize($action['graph']);
|
||||
$action['graph'][date('w')] = $action['dispo'];
|
||||
$graph = serialize($action['graph']);
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($graph);
|
||||
$bdd->query("UPDATE $table_bourse_ressources SET dispo = dispo + $nb, graph = '$graph' WHERE id = $v;");
|
||||
$bdd->deconnexion();
|
||||
$bdd->reconnexion();
|
||||
$bdd->escape($graph);
|
||||
$bdd->query("UPDATE $table_bourse_ressources SET dispo = dispo + $nb, graph = '$graph' WHERE id = $v;");
|
||||
$bdd->deconnexion();
|
||||
}//*/
|
||||
|
||||
$bdd->reconnexion();
|
||||
$bourse = $bdd->query("SELECT id, dispo FROM $table_bourse_ressources;");
|
||||
$bdd->deconnexion();
|
||||
|
||||
foreach($bourse as $key => $action)
|
||||
{
|
||||
$bourse[$key]['prix'] = bourse_calcPrixBase($action['dispo']);
|
||||
$bourse[$key]['prixV'] = $bourse[$key]['prix'] * 0.9;
|
||||
$bourse[$key]['prixA'] = $bourse[$key]['prix'] * 1.07;
|
||||
foreach ($bourse as $key => $action) {
|
||||
$bourse[$key]['prix'] = bourse_calcPrixBase($action['dispo']);
|
||||
$bourse[$key]['prixV'] = $bourse[$key]['prix'] * 0.9;
|
||||
$bourse[$key]['prixA'] = $bourse[$key]['prix'] * 1.07;
|
||||
}
|
||||
|
||||
$page = 'marche';
|
||||
$template->assign('bourse', $bourse);
|
||||
unset($a, $v, $var, $bourse, $graph, $key, $action, $nb, $prix);
|
||||
?>
|
||||
|
|
@ -1,49 +1,46 @@
|
|||
<?php
|
||||
if(!defined('INDEX') || SURFACE != "planete") { header('Location: ./'.$VAR['first_page']); exit; }
|
||||
if (!defined('INDEX') || SURFACE != "planete") {
|
||||
header('Location: ./'.$VAR['first_page']);
|
||||
exit;
|
||||
}
|
||||
$page = 'rename';
|
||||
$titre = 'Renommer une planète';
|
||||
|
||||
if (isset($_POST['planete']))
|
||||
{
|
||||
$nouvNom = trim(str_replace(' ', ' ', $_POST['planete']));
|
||||
if (empty($nouvNom))
|
||||
erreur('Vous n\'avez indiqué aucun nom de planète.', "red", '?p=rename');
|
||||
elseif (limite($nouvNom, 18))
|
||||
erreur('Le nom de votre planète est trop long.', "red", '?p=rename');
|
||||
elseif (preg_match('#staf#', strtolower($nouvNom)) && $SESS->level < 4)
|
||||
erreur('Vous devez faire parti du staff pour afficher le nom "staff" dans le nom de votre planète !', "red", '?p=rename');
|
||||
else
|
||||
{
|
||||
$planete->nom_planete = $nouvNom;
|
||||
$planete->addModif("nom_planete");
|
||||
if (isset($_POST['planete'])) {
|
||||
$nouvNom = trim(str_replace(' ', ' ', $_POST['planete']));
|
||||
if (empty($nouvNom)) {
|
||||
erreur('Vous n\'avez indiqué aucun nom de planète.', "red", '?p=rename');
|
||||
} elseif (limite($nouvNom, 18)) {
|
||||
erreur('Le nom de votre planète est trop long.', "red", '?p=rename');
|
||||
} elseif (preg_match('#staf#', strtolower($nouvNom)) && $SESS->level < 4) {
|
||||
erreur('Vous devez faire parti du staff pour afficher le nom "staff" dans le nom de votre planète !', "red", '?p=rename');
|
||||
} else {
|
||||
$planete->nom_planete = $nouvNom;
|
||||
$planete->addModif("nom_planete");
|
||||
|
||||
header('Location: ?p=accueil');
|
||||
exit;
|
||||
//erreur('Le nom de votre planète a été modifié avec succès.', "green", '?p=accueil');
|
||||
}
|
||||
unset($nouvNom);
|
||||
}
|
||||
elseif(!empty($_GET['a']) && !empty($SESS->values['abandon']) && isset($_GET['i']) && $_GET['a'] == $SESS->values['abandon'] && $planete->id == $_GET['i'])
|
||||
{
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("DELETE FROM $table_planete WHERE id_user = ".$planete->id_user." AND id = ".$planete->id." AND galaxie = ".$planete->galaxie." AND ss = ".$planete->ss." AND position = ".$planete->position." LIMIT 1;");
|
||||
$bdd->query("DELETE FROM $table_flottes WHERE id_user = ".$planete->id_user." AND start_galaxie = ".$planete->galaxie." AND start_ss = ".$planete->ss." AND start_position = ".$planete->position.";");
|
||||
header('Location: ?p=accueil');
|
||||
exit;
|
||||
//erreur('Le nom de votre planète a été modifié avec succès.', "green", '?p=accueil');
|
||||
}
|
||||
unset($nouvNom);
|
||||
} elseif (!empty($_GET['a']) && !empty($SESS->values['abandon']) && isset($_GET['i']) && $_GET['a'] == $SESS->values['abandon'] && $planete->id == $_GET['i']) {
|
||||
$bdd->reconnexion();
|
||||
$bdd->query("DELETE FROM $table_planete WHERE id_user = ".$planete->id_user." AND id = ".$planete->id." AND galaxie = ".$planete->galaxie." AND ss = ".$planete->ss." AND position = ".$planete->position." LIMIT 1;");
|
||||
$bdd->query("DELETE FROM $table_flottes WHERE id_user = ".$planete->id_user." AND start_galaxie = ".$planete->galaxie." AND start_ss = ".$planete->ss." AND start_position = ".$planete->position.";");
|
||||
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_planete WHERE id_user = ".$planete->id_user." LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
$SESS->values['abandon'] = 0;
|
||||
unset($SESS->values['abandon']);
|
||||
$SESS->values['idPlan'] = $req['id'];
|
||||
$SESS->put();
|
||||
$req = $bdd->unique_query("SELECT id FROM $table_planete WHERE id_user = ".$planete->id_user." LIMIT 1;");
|
||||
$bdd->deconnexion();
|
||||
$SESS->values['abandon'] = 0;
|
||||
unset($SESS->values['abandon']);
|
||||
$SESS->values['idPlan'] = $req['id'];
|
||||
$SESS->put();
|
||||
|
||||
unset($req, $planete);
|
||||
erreur('Cette planète n\'est désormais plus sous votre contrôle.', "green", '?p=accueil');
|
||||
}
|
||||
unset($req, $planete);
|
||||
erreur('Cette planète n\'est désormais plus sous votre contrôle.', "green", '?p=accueil');
|
||||
}
|
||||
|
||||
if (count($queryPlanetes) > 1)
|
||||
{
|
||||
$template->assign('abandonH', $SESS->values['abandon'] = md5(rand(123456789,9876543210)));
|
||||
$SESS->put();
|
||||
}
|
||||
if (count($queryPlanetes) > 1) {
|
||||
$template->assign('abandonH', $SESS->values['abandon'] = md5(rand(123456789, 9876543210)));
|
||||
$SESS->put();
|
||||
}
|
||||
unset($queryPlanetes);
|
||||
?>
|
||||
|
|
@ -1,62 +1,63 @@
|
|||
<?php
|
||||
if(!defined('INDEX')) { header('Location: ./'.$VAR['first_page']); exit; }
|
||||
if (!defined('INDEX')) {
|
||||
header('Location: ./'.$VAR['first_page']);
|
||||
exit;
|
||||
}
|
||||
$titre = 'Ressources';
|
||||
|
||||
if (SURFACE == "planete")
|
||||
{
|
||||
$page = 'ressources';
|
||||
if (isset($_POST['anb']) && $planete->batiments[4])
|
||||
{
|
||||
$anb = gpc("anb", "post");
|
||||
if ($planete->checkAndRetireRessources(0, 0, $anb*(7000-$planete->batiments[4]*1250), $anb*(7000-$planete->batiments[4]*1250), 0))
|
||||
{
|
||||
$planete->energieCentrale += $anb;
|
||||
$planete->addModif("energieCentrale");
|
||||
}
|
||||
else
|
||||
erreur("Vous n'avez pas assez de ressources pour augmenter la capacité de votre ".$LANG[$race]["batiments"]["noms_sing"][4]." !");
|
||||
}
|
||||
elseif (isset($_POST['coeff_metal']) && isset($_POST['coeff_cs'])) {
|
||||
if (SURFACE == "planete") {
|
||||
$page = 'ressources';
|
||||
if (isset($_POST['anb']) && $planete->batiments[4]) {
|
||||
$anb = gpc("anb", "post");
|
||||
if ($planete->checkAndRetireRessources(0, 0, $anb*(7000-$planete->batiments[4]*1250), $anb*(7000-$planete->batiments[4]*1250), 0)) {
|
||||
$planete->energieCentrale += $anb;
|
||||
$planete->addModif("energieCentrale");
|
||||
} else {
|
||||
erreur("Vous n'avez pas assez de ressources pour augmenter la capacité de votre ".$LANG[$race]["batiments"]["noms_sing"][4]." !");
|
||||
}
|
||||
} elseif (isset($_POST['coeff_metal']) && isset($_POST['coeff_cs'])) {
|
||||
$planete->coeff_bat[0] = floor($_POST['coeff_metal'])/100;
|
||||
if (isset($_POST['coeff_cristal'])) {
|
||||
$planete->coeff_bat[1] = floor($_POST['coeff_cristal'])/100;
|
||||
}
|
||||
if (isset($_POST['coeff_hydrogene'])) {
|
||||
$planete->coeff_bat[2] = floor($_POST['coeff_hydrogene'])/100;
|
||||
}
|
||||
$planete->coeff_bat[3] = floor($_POST['coeff_cs'])/100;
|
||||
if (isset($_POST['coeff_ce'])) {
|
||||
$planete->coeff_bat[4] = floor($_POST['coeff_ce'])/100;
|
||||
}
|
||||
$planete->addModif("coeff_bat");
|
||||
|
||||
$planete->coeff_bat[0] = floor($_POST['coeff_metal'])/100;
|
||||
if (isset($_POST['coeff_cristal'])) $planete->coeff_bat[1] = floor($_POST['coeff_cristal'])/100;
|
||||
if (isset($_POST['coeff_hydrogene'])) $planete->coeff_bat[2] = floor($_POST['coeff_hydrogene'])/100;
|
||||
$planete->coeff_bat[3] = floor($_POST['coeff_cs'])/100;
|
||||
if (isset($_POST['coeff_ce'])) $planete->coeff_bat[4] = floor($_POST['coeff_ce'])/100;
|
||||
$planete->addModif("coeff_bat");
|
||||
redirection('?p=ressources');
|
||||
}
|
||||
|
||||
redirection('?p=ressources');
|
||||
}
|
||||
$tablo = $planete->production(3600, true);
|
||||
|
||||
$tablo = $planete->production(3600, true);
|
||||
$template->assign('ressources_prod', $tablo[1]);
|
||||
$template->assign('ressources_conso', $tablo[2]);
|
||||
$template->assign('ressources_coef', $tablo[0]);
|
||||
$template->assign('ressources_silo', array($planete->batiments[10], pow(2, $planete->batiments[10]) * 100000));
|
||||
$template->assign('ressources_toto', array($tablo[1][2] - $tablo[2][3], '(0)'));
|
||||
|
||||
$template->assign('ressources_prod', $tablo[1]);
|
||||
$template->assign('ressources_conso', $tablo[2]);
|
||||
$template->assign('ressources_coef', $tablo[0]);
|
||||
$template->assign('ressources_silo', array($planete->batiments[10], pow(2, $planete->batiments[10]) * 100000));
|
||||
$template->assign('ressources_toto', array($tablo[1][2] - $tablo[2][3], '(0)'));
|
||||
$template->assign('ressources_tab', array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100));
|
||||
|
||||
$template->assign('ressources_tab', array(0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100));
|
||||
unset($tablo);
|
||||
} else {
|
||||
$page = 'ressources_alli';
|
||||
|
||||
unset($tablo);
|
||||
$don_credits = intval(gpc("credits", "post"));
|
||||
if (!empty($don_credits) && $don_credits > 0) {
|
||||
//Si le joueur n'a pas assez de crédits
|
||||
if ($don_credits > $planete->credits) {
|
||||
erreur('Vous n\'avez pas suffisamment de crédits pour en donner autant.', 'red', $VAR['menu']['ressources']);
|
||||
}
|
||||
|
||||
$planete->addCreditsAlliance($don_credits);
|
||||
$planete->addCredits(-1 * $don_credits);
|
||||
|
||||
erreur('Votre don de '.$don_credits.' '.$LANG[$race]["ressources"]["noms"]["credits"].' a été effectué avec succès.', 'green', $VAR['menu']['ressources']);
|
||||
}
|
||||
|
||||
unset($don_credits);
|
||||
}
|
||||
else
|
||||
{
|
||||
$page = 'ressources_alli';
|
||||
|
||||
$don_credits = intval(gpc("credits", "post"));
|
||||
if (!empty($don_credits) && $don_credits > 0)
|
||||
{
|
||||
//Si le joueur n'a pas assez de crédits
|
||||
if ($don_credits > $planete->credits)
|
||||
erreur('Vous n\'avez pas suffisamment de crédits pour en donner autant.', 'red', $VAR['menu']['ressources']);
|
||||
|
||||
$planete->addCreditsAlliance($don_credits);
|
||||
$planete->addCredits(-1 * $don_credits);
|
||||
|
||||
erreur('Votre don de '.$don_credits.' '.$LANG[$race]["ressources"]["noms"]["credits"].' a été effectué avec succès.', 'green', $VAR['menu']['ressources']);
|
||||
}
|
||||
|
||||
unset($don_credits);
|
||||
}
|
||||
?>
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -8,7 +8,8 @@
|
|||
// Copyright (c) Aditus Consulting. All rights reserved.
|
||||
//========================================================================
|
||||
|
||||
class ImgData_Bevels extends ImgData {
|
||||
class ImgData_Bevels extends ImgData
|
||||
{
|
||||
protected $name = 'Round Bevels';
|
||||
protected $an = array(MARK_IMG_BEVEL => 'imgdata');
|
||||
|
||||
|
|
@ -18,87 +19,84 @@ class ImgData_Bevels extends ImgData {
|
|||
|
||||
protected $imgdata ;
|
||||
|
||||
function ImgData_Bevels() {
|
||||
//==========================================================
|
||||
// File: bullets_balls_red_013.png
|
||||
//==========================================================
|
||||
$this->imgdata[0][0]= 337 ;
|
||||
$this->imgdata[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////////27t/f3+LFwcmNxMuxm62DmqKth1VpZmIWg6fv'.
|
||||
'HCa7K0BwMEytCjFnIyUlEBg9vhQvAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAxcBNhk+pYJVAAAAl0lEQVR4nE2Q2xLDIAgFHUWBKJf//9'.
|
||||
'oekmbafVDZARRbK/pYTKP9WNcNv64zzUdd9BjmrgnsVXRNSzO3'.
|
||||
'CJ5ahdhy0XKQkxld1kxb45j7dp0x2lBNOyVgQpMaoadX7Hs7zr'.
|
||||
'P1yKj47DKBnKaBKiSAkNss7O6PkMx6kIgYXISQJpcZCqdY6KR+'.
|
||||
'J1PkS5Xob/h7MNz8x6D3fz5DKQjpkZOBYAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
public function ImgData_Bevels()
|
||||
{
|
||||
//==========================================================
|
||||
// File: bullets_balls_red_013.png
|
||||
//==========================================================
|
||||
$this->imgdata[0][0]= 337 ;
|
||||
$this->imgdata[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////////27t/f3+LFwcmNxMuxm62DmqKth1VpZmIWg6fv'.
|
||||
'HCa7K0BwMEytCjFnIyUlEBg9vhQvAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAxcBNhk+pYJVAAAAl0lEQVR4nE2Q2xLDIAgFHUWBKJf//9'.
|
||||
'oekmbafVDZARRbK/pYTKP9WNcNv64zzUdd9BjmrgnsVXRNSzO3'.
|
||||
'CJ5ahdhy0XKQkxld1kxb45j7dp0x2lBNOyVgQpMaoadX7Hs7zr'.
|
||||
'P1yKj47DKBnKaBKiSAkNss7O6PkMx6kIgYXISQJpcZCqdY6KR+'.
|
||||
'J1PkS5Xob/h7MNz8x6D3fz5DKQjpkZOBYAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bullets_balls_green_013.png
|
||||
//==========================================================
|
||||
$this->imgdata[1][0]= 344 ;
|
||||
$this->imgdata[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////////27t/e3+K3vriUub/Dm18j4xc3ob10k0ItqQlU'.
|
||||
'e5JBmwpxY1ENaKBgUh0iHgwsSre9AAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAxcBNTfJXtxZAAAAnklEQVR4nE2QWY4EMQhDUVhSIRC4/2'.
|
||||
'kbaqLp9p+f2AxAayAzDfiK9znPORuvH0x8Ss9z6I9sHp6tcxE9'.
|
||||
'nLmWmebmt5F5p2AR0+C9AWpLBjXRaZsCAT3SqklVp0YkAWaGtd'.
|
||||
'c5Z41/STYpPzW7BjyiRrwkVmQto/Cw9tNEMvsgcekyCyFPboIu'.
|
||||
'IsuXiKffYB4NK4r/h6d4g9HPPwCR7i8+GscIiiaonUAAAAAASU'.
|
||||
'VORK5CYII=' ;
|
||||
//==========================================================
|
||||
// File: bullets_balls_green_013.png
|
||||
//==========================================================
|
||||
$this->imgdata[1][0]= 344 ;
|
||||
$this->imgdata[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////////27t/e3+K3vriUub/Dm18j4xc3ob10k0ItqQlU'.
|
||||
'e5JBmwpxY1ENaKBgUh0iHgwsSre9AAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAxcBNTfJXtxZAAAAnklEQVR4nE2QWY4EMQhDUVhSIRC4/2'.
|
||||
'kbaqLp9p+f2AxAayAzDfiK9znPORuvH0x8Ss9z6I9sHp6tcxE9'.
|
||||
'nLmWmebmt5F5p2AR0+C9AWpLBjXRaZsCAT3SqklVp0YkAWaGtd'.
|
||||
'c5Z41/STYpPzW7BjyiRrwkVmQto/Cw9tNEMvsgcekyCyFPboIu'.
|
||||
'IsuXiKffYB4NK4r/h6d4g9HPPwCR7i8+GscIiiaonUAAAAAASU'.
|
||||
'VORK5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bullets_balls_oy_035.png
|
||||
//==========================================================
|
||||
$this->imgdata[2][0]= 341 ;
|
||||
$this->imgdata[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////////27t/f3+K5tbqNwcjnkjXjbxR2i5anfEoNkbis'.
|
||||
'PBxpU0sZbZejKgdqIRIlERIwYtkYAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAxcBNgK0wEu5AAAAm0lEQVR4nE3QVxIEIQgEUErAgTHA/U'.
|
||||
'+7zbipf9RXgoGo0liMmX6RdSPLPtZM9F4LuuSIaZtZWffiU6Iz'.
|
||||
'Y8SOMF0NogBj30ioGRGLZgiPvce1TbIRz6oBQEbOFGK0rIoxrn'.
|
||||
'5hDomMA1cfGRCaRVhjS3gkzheM+4HtnlkXcvdZhWG4qZawewe6'.
|
||||
'9Jnz/TKLB/ML6HUepn//QczazuwFO/0Ivpolhi4AAAAASUVORK'.
|
||||
'5CYII=' ;
|
||||
//==========================================================
|
||||
// File: bullets_balls_oy_035.png
|
||||
//==========================================================
|
||||
$this->imgdata[2][0]= 341 ;
|
||||
$this->imgdata[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////////27t/f3+K5tbqNwcjnkjXjbxR2i5anfEoNkbis'.
|
||||
'PBxpU0sZbZejKgdqIRIlERIwYtkYAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAxcBNgK0wEu5AAAAm0lEQVR4nE3QVxIEIQgEUErAgTHA/U'.
|
||||
'+7zbipf9RXgoGo0liMmX6RdSPLPtZM9F4LuuSIaZtZWffiU6Iz'.
|
||||
'Y8SOMF0NogBj30ioGRGLZgiPvce1TbIRz6oBQEbOFGK0rIoxrn'.
|
||||
'5hDomMA1cfGRCaRVhjS3gkzheM+4HtnlkXcvdZhWG4qZawewe6'.
|
||||
'9Jnz/TKLB/ML6HUepn//QczazuwFO/0Ivpolhi4AAAAASUVORK'.
|
||||
'5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bullets_balls_oy_036.png
|
||||
//==========================================================
|
||||
$this->imgdata[3][0]= 340 ;
|
||||
$this->imgdata[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////////27t/e3+LO3hfYzz65ubiNwci6uQ12ipadgVGa'.
|
||||
'fwsNkbhnVkcaZ5dwSA8lFg7CEepmAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElN'.
|
||||
'RQfTAxcCBySi1nevAAAAjElEQVR4nFXPWw7EIAgFUNMoCMhj/6'.
|
||||
'staKczc/2RkwjS2glQ+w3YytgXCXCZpRo8gJdGxZadJws13CUP'.
|
||||
'4SZI4MYiUxypeiGGw1XShVBTNN9kLXP2GRrZPFvKgd7z/sqGGV'.
|
||||
'7C7r7r3l09alYN3iA8Yn+ImdVrNoEeSRqJPAaHfhZzLYwXstdZ'.
|
||||
'rP3n2bvdAI4INwtihiwAAAAASUVORK5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bullets_balls_pp_019.png
|
||||
//==========================================================
|
||||
$this->imgdata[4][0]= 334 ;
|
||||
$this->imgdata[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////+/v7i4eO/w8eHxcvKroNVormtfkjrMN2BeXQrepPc'.
|
||||
'Esy4IL+OFaR7F25LHF8mFRh5XXtUAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAxcBNgkjEpIxAAAAlElEQVR4nE2QAQ7FIAhDDTAVndL7n3'.
|
||||
'ZV/7JfEwMvFIWUlkTMVNInbVv5ZeJqG7Smh2QTBwJBpsdizAZP'.
|
||||
'5NyW0awhK8kYodnZxS6ECvPRp2sI+y7PBv1mN02KH7h77QCJ8D'.
|
||||
'4VvY5NUgEmCwj6ZMzHtJRgRSXwC1gfcqJJH0GBnSnK1kUQ72DY'.
|
||||
'CPBv+MCS/e0jib77eQAJxwiEWm7hFwAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: bullets_balls_oy_036.png
|
||||
//==========================================================
|
||||
$this->imgdata[3][0]= 340 ;
|
||||
$this->imgdata[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////////27t/e3+LO3hfYzz65ubiNwci6uQ12ipadgVGa'.
|
||||
'fwsNkbhnVkcaZ5dwSA8lFg7CEepmAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxEAAAsRAX9kX5EAAAAHdElN'.
|
||||
'RQfTAxcCBySi1nevAAAAjElEQVR4nFXPWw7EIAgFUNMoCMhj/6'.
|
||||
'staKczc/2RkwjS2glQ+w3YytgXCXCZpRo8gJdGxZadJws13CUP'.
|
||||
'4SZI4MYiUxypeiGGw1XShVBTNN9kLXP2GRrZPFvKgd7z/sqGGV'.
|
||||
'7C7r7r3l09alYN3iA8Yn+ImdVrNoEeSRqJPAaHfhZzLYwXstdZ'.
|
||||
'rP3n2bvdAI4INwtihiwAAAAASUVORK5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bullets_balls_pp_019.png
|
||||
//==========================================================
|
||||
$this->imgdata[4][0]= 334 ;
|
||||
$this->imgdata[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABEAAAARCAMAAAAMs7fIAAAAM1'.
|
||||
'BMVEX////+/v7i4eO/w8eHxcvKroNVormtfkjrMN2BeXQrepPc'.
|
||||
'Esy4IL+OFaR7F25LHF8mFRh5XXtUAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAxcBNgkjEpIxAAAAlElEQVR4nE2QAQ7FIAhDDTAVndL7n3'.
|
||||
'ZV/7JfEwMvFIWUlkTMVNInbVv5ZeJqG7Smh2QTBwJBpsdizAZP'.
|
||||
'5NyW0awhK8kYodnZxS6ECvPRp2sI+y7PBv1mN02KH7h77QCJ8D'.
|
||||
'4VvY5NUgEmCwj6ZMzHtJRgRSXwC1gfcqJJH0GBnSnK1kUQ72DY'.
|
||||
'CPBv+MCS/e0jib77eQAJxwiEWm7hFwAAAABJRU5ErkJggg==' ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
|
@ -8,170 +8,170 @@
|
|||
// Copyright (c) Aditus Consulting. All rights reserved.
|
||||
//========================================================================
|
||||
|
||||
class ImgData_Diamonds extends ImgData {
|
||||
class ImgData_Diamonds extends ImgData
|
||||
{
|
||||
protected $name = 'Diamonds';
|
||||
protected $an = array(MARK_IMG_DIAMOND =>'imgdata');
|
||||
protected $colors = array('lightblue','darkblue','gray',
|
||||
'blue','pink','purple','red','yellow');
|
||||
protected $index = array('lightblue' =>7,'darkblue'=>2,'gray'=>6,
|
||||
'blue'=>4,'pink'=>1,'purple'=>5,'red'=>0,'yellow'=>3);
|
||||
protected $colors = array('lightblue','darkblue','gray',
|
||||
'blue','pink','purple','red','yellow');
|
||||
protected $index = array('lightblue' =>7,'darkblue'=>2,'gray'=>6,
|
||||
'blue'=>4,'pink'=>1,'purple'=>5,'red'=>0,'yellow'=>3);
|
||||
|
||||
protected $maxidx = 7 ;
|
||||
protected $imgdata ;
|
||||
|
||||
function ImgData_Diamonds() {
|
||||
//==========================================================
|
||||
// File: diam_red.png
|
||||
//==========================================================
|
||||
$this->imgdata[0][0]= 668 ;
|
||||
$this->imgdata[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'.
|
||||
'BMVEX///////+cAAD/AADOAABjAABrAADWGBjOCAj/CAj/GBj/'.
|
||||
'EBCcCAiMOTl7KSl7ISFzGBilGBjOEBBrCAjv5+eMQkK1QkKtMT'.
|
||||
'GtKSnWKSn/KSlzEBCcEBDexsb/tbXOe3ucWlqcUlKUSkr/e3vn'.
|
||||
'a2u9UlL/a2uEMTHeUlLeSkqtOTn/UlL/SkrWOTn/QkL/OTmlIS'.
|
||||
'H/MTH/ISH39/f/9/f35+fezs7/5+fvzs7WtbXOra3nvb3/zs7G'.
|
||||
'nJzvtbXGlJTepaW9jIy1hITWlJS1e3uta2ulY2P/lJTnhITne3'.
|
||||
'vGY2O9Wlr/c3PeY2O1Skr/Y2P/WlreQkLWISGlEBCglEUaAAAA'.
|
||||
'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'.
|
||||
'sSAdLdfvwAAAAHdElNRQfTAwsWEw5WI4qnAAABGUlEQVR4nHXQ'.
|
||||
'1XLDMBAFUKUCM1NiO8zcpIxpp8z0//9SWY7b2LHv6EU6s1qtAN'.
|
||||
'iMBAojLPkigpJvogKC4pxDuQipjanlICXof1RQDkYEF21mKIfg'.
|
||||
'/GGKtjAmOKt9oSyuCU7OhyiDCQnjowGfRnooCJIkiWJvv8NxnG'.
|
||||
'nyNAwFcekvZpPP3mu7Vrp8fOq8DYbTyjdnAvBj7Jbd7nP95urs'.
|
||||
'+MC2D6unF+Cu0VJULQBAlsOQuueN3Hrp2nGUvqppemBZ0aU7Se'.
|
||||
'SXvYZFMKaLJn7MH3btJmZEMEmGSOreqy0SI/4ffo3uiUOYEACy'.
|
||||
'OFopmNWlP5uZd9uPWmUoxvK9ilO9NtBo6mS7KkZD0fOJYqgGBU'.
|
||||
'S/T7OKCAA9tfsFOicXcbxt29cAAAAASUVORK5CYII=' ;
|
||||
public function ImgData_Diamonds()
|
||||
{
|
||||
//==========================================================
|
||||
// File: diam_red.png
|
||||
//==========================================================
|
||||
$this->imgdata[0][0]= 668 ;
|
||||
$this->imgdata[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'.
|
||||
'BMVEX///////+cAAD/AADOAABjAABrAADWGBjOCAj/CAj/GBj/'.
|
||||
'EBCcCAiMOTl7KSl7ISFzGBilGBjOEBBrCAjv5+eMQkK1QkKtMT'.
|
||||
'GtKSnWKSn/KSlzEBCcEBDexsb/tbXOe3ucWlqcUlKUSkr/e3vn'.
|
||||
'a2u9UlL/a2uEMTHeUlLeSkqtOTn/UlL/SkrWOTn/QkL/OTmlIS'.
|
||||
'H/MTH/ISH39/f/9/f35+fezs7/5+fvzs7WtbXOra3nvb3/zs7G'.
|
||||
'nJzvtbXGlJTepaW9jIy1hITWlJS1e3uta2ulY2P/lJTnhITne3'.
|
||||
'vGY2O9Wlr/c3PeY2O1Skr/Y2P/WlreQkLWISGlEBCglEUaAAAA'.
|
||||
'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'.
|
||||
'sSAdLdfvwAAAAHdElNRQfTAwsWEw5WI4qnAAABGUlEQVR4nHXQ'.
|
||||
'1XLDMBAFUKUCM1NiO8zcpIxpp8z0//9SWY7b2LHv6EU6s1qtAN'.
|
||||
'iMBAojLPkigpJvogKC4pxDuQipjanlICXof1RQDkYEF21mKIfg'.
|
||||
'/GGKtjAmOKt9oSyuCU7OhyiDCQnjowGfRnooCJIkiWJvv8NxnG'.
|
||||
'nyNAwFcekvZpPP3mu7Vrp8fOq8DYbTyjdnAvBj7Jbd7nP95urs'.
|
||||
'+MC2D6unF+Cu0VJULQBAlsOQuueN3Hrp2nGUvqppemBZ0aU7Se'.
|
||||
'SXvYZFMKaLJn7MH3btJmZEMEmGSOreqy0SI/4ffo3uiUOYEACy'.
|
||||
'OFopmNWlP5uZd9uPWmUoxvK9ilO9NtBo6mS7KkZD0fOJYqgGBU'.
|
||||
'S/T7OKCAA9tfsFOicXcbxt29cAAAAASUVORK5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
// File: diam_pink.png
|
||||
//==========================================================
|
||||
$this->imgdata[1][0]= 262 ;
|
||||
$this->imgdata[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
|
||||
'BMVEX///+AgID/M5n/Zpn/zMz/mZn1xELhAAAAAXRSTlMAQObY'.
|
||||
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
|
||||
'AHdElNRQfTAwsWEi3tX8qUAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
|
||||
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
|
||||
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
|
||||
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
//==========================================================
|
||||
// File: diam_pink.png
|
||||
//==========================================================
|
||||
$this->imgdata[1][0]= 262 ;
|
||||
$this->imgdata[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
|
||||
'BMVEX///+AgID/M5n/Zpn/zMz/mZn1xELhAAAAAXRSTlMAQObY'.
|
||||
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
|
||||
'AHdElNRQfTAwsWEi3tX8qUAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
|
||||
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
|
||||
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
|
||||
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: diam_blue.png
|
||||
//==========================================================
|
||||
$this->imgdata[2][0]= 662 ;
|
||||
$this->imgdata[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA+V'.
|
||||
'BMVEX///+AgIAAAJwAAP8AAM4AAGMAAGsQEP8YGHMQEHMYGP8Q'.
|
||||
'EKUICJwICM5KSpQxMYQpKXsYGNYQEM4ICGsICP97e85aWpw5OY'.
|
||||
'xSUv85ObVCQt4xMa0pKa0hIaUpKf+9vd6EhLVra+dzc/9SUr1r'.
|
||||
'a/9aWt5SUt5CQrVaWv9KSv8hIXs5Of8xMf8pKdYhIdYYGKUhIf'.
|
||||
'/Ozs739//v7/fn5+/v7//n5/fW1ufOzufOzu/W1v+trc69veel'.
|
||||
'pc6trd6UlMa9vf+MjL21tfe1tf+UlNZzc61ra6Wlpf+EhOeMjP'.
|
||||
'9ra8ZSUpyEhP9CQoxKSrVCQv85Od4xMdYQENZnJhlWAAAAAXRS'.
|
||||
'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'.
|
||||
'LdfvwAAAAHdElNRQfTAwsWEx3Snct5AAABFklEQVR4nHXR5XbD'.
|
||||
'IBgGYM6AuHsaqbvOfeuknev9X8xISbplSd5/8JyXwwcA/I0AKm'.
|
||||
'PFchVBdvKNKggKQx2VIoRwMZihMiQE49YUlWBCcPL0hYq4ITh+'.
|
||||
'qKECUoLDZWqoQNA766F/mJHlHXblPJJNiyURhM5eU9cNw5BlmS'.
|
||||
'IrLOLxhzfotF7vwO2j3ez2ap/TmW4AIM7DoN9+tu+vLk6Pdg9O'.
|
||||
'6ufXjfXLm6pxPACSJIpRFAa+/26DhuK6qjbiON40k0N3skjOvm'.
|
||||
'NijBmchF5mi+1jhQqDmWyIzPp1hUlrv8On5l+6mMm1tigFNyrt'.
|
||||
'5R97g+FKKyGKkTNKesXPJTZXOFIrUoKiypcTQVHjK4g8H2dWEQ'.
|
||||
'B8bvUDLSQXSr41rmEAAAAASUVORK5CYII=' ;
|
||||
//==========================================================
|
||||
// File: diam_blue.png
|
||||
//==========================================================
|
||||
$this->imgdata[2][0]= 662 ;
|
||||
$this->imgdata[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA+V'.
|
||||
'BMVEX///+AgIAAAJwAAP8AAM4AAGMAAGsQEP8YGHMQEHMYGP8Q'.
|
||||
'EKUICJwICM5KSpQxMYQpKXsYGNYQEM4ICGsICP97e85aWpw5OY'.
|
||||
'xSUv85ObVCQt4xMa0pKa0hIaUpKf+9vd6EhLVra+dzc/9SUr1r'.
|
||||
'a/9aWt5SUt5CQrVaWv9KSv8hIXs5Of8xMf8pKdYhIdYYGKUhIf'.
|
||||
'/Ozs739//v7/fn5+/v7//n5/fW1ufOzufOzu/W1v+trc69veel'.
|
||||
'pc6trd6UlMa9vf+MjL21tfe1tf+UlNZzc61ra6Wlpf+EhOeMjP'.
|
||||
'9ra8ZSUpyEhP9CQoxKSrVCQv85Od4xMdYQENZnJhlWAAAAAXRS'.
|
||||
'TlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAd'.
|
||||
'LdfvwAAAAHdElNRQfTAwsWEx3Snct5AAABFklEQVR4nHXR5XbD'.
|
||||
'IBgGYM6AuHsaqbvOfeuknev9X8xISbplSd5/8JyXwwcA/I0AKm'.
|
||||
'PFchVBdvKNKggKQx2VIoRwMZihMiQE49YUlWBCcPL0hYq4ITh+'.
|
||||
'qKECUoLDZWqoQNA766F/mJHlHXblPJJNiyURhM5eU9cNw5BlmS'.
|
||||
'IrLOLxhzfotF7vwO2j3ez2ap/TmW4AIM7DoN9+tu+vLk6Pdg9O'.
|
||||
'6ufXjfXLm6pxPACSJIpRFAa+/26DhuK6qjbiON40k0N3skjOvm'.
|
||||
'NijBmchF5mi+1jhQqDmWyIzPp1hUlrv8On5l+6mMm1tigFNyrt'.
|
||||
'5R97g+FKKyGKkTNKesXPJTZXOFIrUoKiypcTQVHjK4g8H2dWEQ'.
|
||||
'B8bvUDLSQXSr41rmEAAAAASUVORK5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
// File: diam_yellow.png
|
||||
//==========================================================
|
||||
$this->imgdata[3][0]= 262 ;
|
||||
$this->imgdata[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
|
||||
'BMVEX///+AgIBmMwCZZgD/zADMmQD/QLMZAAAAAXRSTlMAQObY'.
|
||||
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
|
||||
'AHdElNRQfTAwsWEwcv/zIDAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
|
||||
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
|
||||
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
|
||||
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
//==========================================================
|
||||
// File: diam_yellow.png
|
||||
//==========================================================
|
||||
$this->imgdata[3][0]= 262 ;
|
||||
$this->imgdata[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
|
||||
'BMVEX///+AgIBmMwCZZgD/zADMmQD/QLMZAAAAAXRSTlMAQObY'.
|
||||
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
|
||||
'AHdElNRQfTAwsWEwcv/zIDAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
|
||||
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
|
||||
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
|
||||
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: diam_lightblue.png
|
||||
//==========================================================
|
||||
$this->imgdata[4][0]= 671 ;
|
||||
$this->imgdata[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/1'.
|
||||
'BMVEX///+AgIAAnP8A//8Azv8AY/8Aa/8I//8Y1v8Izv8Y//8Q'.
|
||||
'//8InP8Qzv8Ypf85jP8he/8Yc/8Ia/8pe/8p//8p1v9Ctf8xrf'.
|
||||
'8prf8QnP8Qc/9CjP+1//97//9r//9S//9K//9C//85//8x//8h'.
|
||||
'//9r5/9K3v9S3v851v97zv9Svf85rf8hpf/G3v9SnP9anP9KlP'.
|
||||
'8xhP/n7//v7+f3///n///O//+U//9z//9j//9a//975/9C3v8h'.
|
||||
'1v+E5/+17/9j3v/O7//n9/+95/+l3v9jxv+U1v8Qpf9avf9Ktf'.
|
||||
'+Uxv+11v97tf9rrf+cxv+Mvf9jpf+tzv+Etf/O3v/39/8Akkxr'.
|
||||
'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'.
|
||||
'IAAAsSAdLdfvwAAAAHdElNRQfTAwsWEiHk6Ya/AAABGUlEQVR4'.
|
||||
'nHXQ13KDMBAF0J2o0E01GHDvJa7p3em95/+/JQJMYjDc0Yt0Zr'.
|
||||
'VaAaxHgtxwbSGPkGQpOIeQ2ORxJiJmNWYZyAhZR0WcgQGhViU0'.
|
||||
'nEGoedDHGxgRapRPcRpXhOr7XZzCmLjaXk9IIjvkOEmSRLG62+'.
|
||||
'F5XlEElhA5sW21GvXj6mGlDBfnJ51lr9svnvEKwH1hu2QPbwd3'.
|
||||
'N9eXVzuL7/Hn29frdKaamgcgy67L3HFG9gDefV+dm5qme4YRXL'.
|
||||
'oVR374mRqUELZYosf84XAxISFRQuMh4rrH8YxGSP6HX6H97NNQ'.
|
||||
'KEAaR08qCeuSnx2a8zIPWqUowtKHSRK91rAw0elmVYQFVc8mhq'.
|
||||
'7p5RD7Ps3IIwA9sfsFxFUX6eZ4Zh4AAAAASUVORK5CYII=' ;
|
||||
//==========================================================
|
||||
// File: diam_lightblue.png
|
||||
//==========================================================
|
||||
$this->imgdata[4][0]= 671 ;
|
||||
$this->imgdata[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/1'.
|
||||
'BMVEX///+AgIAAnP8A//8Azv8AY/8Aa/8I//8Y1v8Izv8Y//8Q'.
|
||||
'//8InP8Qzv8Ypf85jP8he/8Yc/8Ia/8pe/8p//8p1v9Ctf8xrf'.
|
||||
'8prf8QnP8Qc/9CjP+1//97//9r//9S//9K//9C//85//8x//8h'.
|
||||
'//9r5/9K3v9S3v851v97zv9Svf85rf8hpf/G3v9SnP9anP9KlP'.
|
||||
'8xhP/n7//v7+f3///n///O//+U//9z//9j//9a//975/9C3v8h'.
|
||||
'1v+E5/+17/9j3v/O7//n9/+95/+l3v9jxv+U1v8Qpf9avf9Ktf'.
|
||||
'+Uxv+11v97tf9rrf+cxv+Mvf9jpf+tzv+Etf/O3v/39/8Akkxr'.
|
||||
'AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACx'.
|
||||
'IAAAsSAdLdfvwAAAAHdElNRQfTAwsWEiHk6Ya/AAABGUlEQVR4'.
|
||||
'nHXQ13KDMBAF0J2o0E01GHDvJa7p3em95/+/JQJMYjDc0Yt0Zr'.
|
||||
'VaAaxHgtxwbSGPkGQpOIeQ2ORxJiJmNWYZyAhZR0WcgQGhViU0'.
|
||||
'nEGoedDHGxgRapRPcRpXhOr7XZzCmLjaXk9IIjvkOEmSRLG62+'.
|
||||
'F5XlEElhA5sW21GvXj6mGlDBfnJ51lr9svnvEKwH1hu2QPbwd3'.
|
||||
'N9eXVzuL7/Hn29frdKaamgcgy67L3HFG9gDefV+dm5qme4YRXL'.
|
||||
'oVR374mRqUELZYosf84XAxISFRQuMh4rrH8YxGSP6HX6H97NNQ'.
|
||||
'KEAaR08qCeuSnx2a8zIPWqUowtKHSRK91rAw0elmVYQFVc8mhq'.
|
||||
'7p5RD7Ps3IIwA9sfsFxFUX6eZ4Zh4AAAAASUVORK5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
// File: diam_purple.png
|
||||
//==========================================================
|
||||
$this->imgdata[5][0]= 657 ;
|
||||
$this->imgdata[5][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'.
|
||||
'BMVEX///////8xAP/OAP+cAP9jAP9rAP+cCP85CP/OEP9SKf/O'.
|
||||
'CP9CEP9zGP9rCP+lGP/WOf/WIf9KIf9jOf+MQv+EMf97If9zEP'.
|
||||
'+1Sv+lIf/ne//eUv/na//n5//Oxv/Wzv+chP9zUv97Wv9rQv9a'.
|
||||
'Mf9KGP/v5/+te/97Kf+9Y/+tOf+tKf+lEP/vtf/WMf/WKf/v7+'.
|
||||
'f39/+tnP+9rf9rSv9jQv9CGP+ljP+EY//Gtf+tlP+Ma/9zSv/e'.
|
||||
'zv+UUv+9lP+cWv+lY/+cUv+MOf+EKf+UQv/Opf/OhP/Ga/+1Qv'.
|
||||
'/Oe/+9Uv/ntf/eWv/eSv/WGP/3zv/vlP/WEP//9/+pL4oHAAAA'.
|
||||
'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'.
|
||||
'sSAdLdfvwAAAAHdElNRQfTAwsWEjX+M1LCAAABDklEQVR4nHXQ'.
|
||||
'1bLDIBAGYFqIEW+ksbr7cXd3ff93OUCamdOE/Mxw882yywLwPz'.
|
||||
'+gNKotlRFUVnNUQlCxTMRFCKEdE+MgpJaEiIOU4DKaoSIygtb3'.
|
||||
'FBUQrm3xjPK4JvXjK0A5hFniYSBtIilQVYUm+X0KTVNiYah+2q'.
|
||||
'ulFb8nUbSovD2+TCavwXQWmnMA6ro+di+uR5cPzfPhVqPV3N1p'.
|
||||
'n3b3+rimAWAYhP3xnXd7P6oc9vadPsa1wYEs00dFQRAFehlX21'.
|
||||
'25Sg9NOgwF5jeNTjVL9om0TjDc1lmeCKZ17nFPzhPtSRt6J06R'.
|
||||
'WKUoeG3MoXRa/wjLHGLodwZcotPqjsYngnWslRBZH91hWTbpD2'.
|
||||
'EdF1ECWW1SAAAAAElFTkSuQmCC' ;
|
||||
//==========================================================
|
||||
// File: diam_purple.png
|
||||
//==========================================================
|
||||
$this->imgdata[5][0]= 657 ;
|
||||
$this->imgdata[5][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbCAMAAAC6CgRnAAAA/F'.
|
||||
'BMVEX///////8xAP/OAP+cAP9jAP9rAP+cCP85CP/OEP9SKf/O'.
|
||||
'CP9CEP9zGP9rCP+lGP/WOf/WIf9KIf9jOf+MQv+EMf97If9zEP'.
|
||||
'+1Sv+lIf/ne//eUv/na//n5//Oxv/Wzv+chP9zUv97Wv9rQv9a'.
|
||||
'Mf9KGP/v5/+te/97Kf+9Y/+tOf+tKf+lEP/vtf/WMf/WKf/v7+'.
|
||||
'f39/+tnP+9rf9rSv9jQv9CGP+ljP+EY//Gtf+tlP+Ma/9zSv/e'.
|
||||
'zv+UUv+9lP+cWv+lY/+cUv+MOf+EKf+UQv/Opf/OhP/Ga/+1Qv'.
|
||||
'/Oe/+9Uv/ntf/eWv/eSv/WGP/3zv/vlP/WEP//9/+pL4oHAAAA'.
|
||||
'AXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAA'.
|
||||
'sSAdLdfvwAAAAHdElNRQfTAwsWEjX+M1LCAAABDklEQVR4nHXQ'.
|
||||
'1bLDIBAGYFqIEW+ksbr7cXd3ff93OUCamdOE/Mxw882yywLwPz'.
|
||||
'+gNKotlRFUVnNUQlCxTMRFCKEdE+MgpJaEiIOU4DKaoSIygtb3'.
|
||||
'FBUQrm3xjPK4JvXjK0A5hFniYSBtIilQVYUm+X0KTVNiYah+2q'.
|
||||
'ulFb8nUbSovD2+TCavwXQWmnMA6ro+di+uR5cPzfPhVqPV3N1p'.
|
||||
'n3b3+rimAWAYhP3xnXd7P6oc9vadPsa1wYEs00dFQRAFehlX21'.
|
||||
'25Sg9NOgwF5jeNTjVL9om0TjDc1lmeCKZ17nFPzhPtSRt6J06R'.
|
||||
'WKUoeG3MoXRa/wjLHGLodwZcotPqjsYngnWslRBZH91hWTbpD2'.
|
||||
'EdF1ECWW1SAAAAAElFTkSuQmCC' ;
|
||||
|
||||
//==========================================================
|
||||
// File: diam_gray.png
|
||||
//==========================================================
|
||||
$this->imgdata[6][0]= 262 ;
|
||||
$this->imgdata[6][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
|
||||
'BMVEX//////wAzMzNmZmbMzMyZmZlq4Qo5AAAAAXRSTlMAQObY'.
|
||||
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
|
||||
'AHdElNRQfTAwsWExZFTxLxAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
|
||||
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
|
||||
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
|
||||
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
//==========================================================
|
||||
// File: diam_gray.png
|
||||
//==========================================================
|
||||
$this->imgdata[6][0]= 262 ;
|
||||
$this->imgdata[6][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
|
||||
'BMVEX//////wAzMzNmZmbMzMyZmZlq4Qo5AAAAAXRSTlMAQObY'.
|
||||
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
|
||||
'AHdElNRQfTAwsWExZFTxLxAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
|
||||
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
|
||||
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
|
||||
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: diam_blgr.png
|
||||
//==========================================================
|
||||
$this->imgdata[7][0]= 262 ;
|
||||
$this->imgdata[7][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
|
||||
'BMVEX///+AgIBmzP9m///M//+Z//8hMmBVAAAAAXRSTlMAQObY'.
|
||||
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
|
||||
'AHdElNRQfTAwsWEwCxm6egAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
|
||||
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
|
||||
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
|
||||
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
//==========================================================
|
||||
// File: diam_blgr.png
|
||||
//==========================================================
|
||||
$this->imgdata[7][0]= 262 ;
|
||||
$this->imgdata[7][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABsAAAAbBAMAAAB/+ulmAAAAEl'.
|
||||
'BMVEX///+AgIBmzP9m///M//+Z//8hMmBVAAAAAXRSTlMAQObY'.
|
||||
'ZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAA'.
|
||||
'AHdElNRQfTAwsWEwCxm6egAAAAbUlEQVR4nFXJwQ3AMAhDUdRm'.
|
||||
'kKojuCswABf2X6UEEiC+WF+PyDfoGEuvwXogq3Rk1Y6W0tBSG8'.
|
||||
'6Uwpla6CmJnpoYKRsjjb/Y63vo9kIkLcZCCsbGYGwMRqIzEp1R'.
|
||||
'OBmFk9HQGA2N0ZEIz5HX+h/jailYpfz4dAAAAABJRU5ErkJggg'.
|
||||
'==' ;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -8,510 +8,511 @@
|
|||
// Copyright (c) Aditus Consulting. All rights reserved.
|
||||
//========================================================================
|
||||
|
||||
class ImgData_PushPins extends ImgData {
|
||||
class ImgData_PushPins extends ImgData
|
||||
{
|
||||
protected $name = 'Push pins';
|
||||
protected $an = array(MARK_IMG_PUSHPIN => 'imgdata_small',
|
||||
MARK_IMG_SPUSHPIN => 'imgdata_small',
|
||||
MARK_IMG_LPUSHPIN => 'imgdata_large');
|
||||
MARK_IMG_SPUSHPIN => 'imgdata_small',
|
||||
MARK_IMG_LPUSHPIN => 'imgdata_large');
|
||||
|
||||
protected $colors = array('blue','green','orange','pink','red');
|
||||
protected $index = array('red' => 0, 'orange' => 1, 'pink' => 2, 'blue' => 3, 'green' => 4 ) ;
|
||||
protected $maxidx = 4 ;
|
||||
protected $imgdata_large, $imgdata_small ;
|
||||
protected $imgdata_large;
|
||||
protected $imgdata_small ;
|
||||
|
||||
function ImgData_PushPins() {
|
||||
public function ImgData_PushPins()
|
||||
{
|
||||
|
||||
// The anchor should be where the needle "hits" the paper
|
||||
// (bottom left corner)
|
||||
$this->anchor_x = 0;
|
||||
$this->anchor_y = 1;
|
||||
// The anchor should be where the needle "hits" the paper
|
||||
// (bottom left corner)
|
||||
$this->anchor_x = 0;
|
||||
$this->anchor_y = 1;
|
||||
|
||||
//==========================================================
|
||||
// File: ppl_red.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[0][0]= 2490 ;
|
||||
$this->imgdata_large[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMKBh4Ryh89CgAACUdJREFUeJy9mNtTFFcexz+/7p'.
|
||||
'4Lw1wZJKDGCAwmDAqUySamcCq1ed6k9mn3UfMP7F+1T3nYqn2J'.
|
||||
'lZdoDEjpbq0KG8EBFBFBEJye6Zmenkv32Ydu5GYiUMmeqq6uqT'.
|
||||
'6Xz3zP73aOcIKmAQkIFyD3N/jrBPwlKjLQEglVlJKyUjR3u7cc'.
|
||||
'WLoP3/4dvv03LNrQ8I6x1rFbDML9kOmHvh7IRHU9JKmUSG8vpF'.
|
||||
'IoXX/TV0AiEM5A5jT0noFMFMJHXUt/d5f9TUAbhtQ3cPFruDog'.
|
||||
'8klHMnmO0dGYe/myOJGINEwTz3F2higFXgy8PpAkOC+h8hoaCt'.
|
||||
'4ppHFcQAWSgOQlyI/p+lUjmRxWAwNJd3xca/f34yoFi4tgmjtD'.
|
||||
'NIFkJ4xcgBCgVqEBFJ9DqcZea/gNAAVEg7AOGYnHe9XoaJd3+X'.
|
||||
'LISSSwnz6lsbKCZ9sHh4UVdBkwdA6cPwNnIfJPmC3Ctgft3wwQ'.
|
||||
'QPkvTZJJnbExzfvsM2nMzVG7e5fG48d4lnXwTwEYCjJxuHQBog'.
|
||||
'BHUfKkgAIIhiGk06hTp/Dm5qS1uYlXLvtWd4gPgIiCrAEcVckT'.
|
||||
'Ab5p7TaYJrK1hQaEenrwSiVfQdc91P0kSp7Ii89D5ksY/kAkLy'.
|
||||
'IZXFdXkQjS1YUSEbdcRu168V6+HTUNIKJDRwdE+sBIQmP9Ld59'.
|
||||
'bEBA3of4F/D+uXb7rGaaCSmXI3pPj64PDaHCYfEqFVSjgWo2D2'.
|
||||
'73XlJNQTgCyQykIuBWoNKEeh1aLXBPBCggGdBOgxZVSjoajVhH'.
|
||||
'o5HWlIpq4bCQSgm9vXhK4ZZKh5SUYygp4J1EQVUD9xlU18BJQD'.
|
||||
'bUbJ5T5XJStyxN9fSI099P3baxV1dRloW2h2ivx/yakg2ot6F1'.
|
||||
'EkCa4G1D+zVEq5ArKTWM42Q6HUczQV7U66w9e0ZpdRXlOIQ5vF'.
|
||||
'VHUXILKify4jiEzkOqC3peQMoBQymFlMt4Dx6wUSxSsm2UZXEK'.
|
||||
'P30QvOUt8/2Sd78CdWwFDTA+gsw3cOlPcPUD+CQB52oQ21RKXM'.
|
||||
'eRhGXhOg7VoKrx8KuS4ygZhVg3ZI8FGIfwR9BVgAtfwxdXdP3L'.
|
||||
'86nUR91dXelNXTeWWy10paQHX602YAP1ADASAL7LJvFtMpOCc0'.
|
||||
'cG3FHuGlz6Gr4YEpnoTCbzsdHRbOzy5RCRiLRMk5rjyOtAimwA'.
|
||||
'U4U3SurBN/0wnAASBCVDIKpB4kiAB5Ub0/UvO9LpPAMDGfn005'.
|
||||
'AxPCzxep3Q6iqPLUseBoufCZRsAE6g5g5kKIDfKUj3wnpAG8QB'.
|
||||
'/Z1OIqANQuI65AtwNScyYXR2XlAXL2YZHzcklRKWl5GVFXFtGx'.
|
||||
'MoAiV/EQaAGH6BUQNWgQpwFngv+Ca8KUAQEBcwgTJHyMV7679R'.
|
||||
'XS8YqdSI6u/PMD5ukMtJY3GR2uQkr5aXeWVZOEALmA8WsIAxfL'.
|
||||
'd0goVLAdCOd+/YpgqeVtBv4yiA++q/RKKXixe7GB8PSyoljcVF'.
|
||||
'yg8fyubyMpulEk2lyAIfAAvAC+B+oOQFoAt/+0rAejB/EzjNri'.
|
||||
'vvqNnCd64jxcE39V8spnP+vMbAgDSePKE2NcXm06dslMuUlcID'.
|
||||
'TuFvqwXMBU8N39bGgRR+ki0Dz4L5DSAe9NGD7zq+6kcN1L6H2b'.
|
||||
'ao5WWaQHllRTafPmWrVMJUimoAQrBYJFjQwre7B6A8YAi8LCgD'.
|
||||
'5DVo6/hbb/iHK1KggvFeD3hHziQKEMuiNTNDbXGRTdtmw7Iwla'.
|
||||
'KGH0oqwbscLOoG46rAY6AOzRhY74PT6QuUKEN4PegXxd/yEDTT'.
|
||||
'YMWOk+oEaLkuFdNk0zTZwjfkavDUArXWgGXgFb4dEShXhfYqlI'.
|
||||
'ow3w9rg3B6ED60IOOA5oEYQBrcpG+mj9bg0VG8GMJhVDZLyzAo'.
|
||||
'VSq8rFYxXXefcjVgG9+uisDrXUCApoKSBcUHMBmHhfcgNwhtD3'.
|
||||
'q9IG6Lr15b4OUTmPwBJt8JqGuapp05o0mhoHnptLQfPsR+8IBK'.
|
||||
'uYyNH3yr+B77LHheA3tK1Ta+IrMeTL2C6Xl48TOsNWDDgAz7s5'.
|
||||
'/r+krP/eddCsbj8fDQ4GBm9MqVvvRXX2VULBayRGRzaYn1SoWa'.
|
||||
'UjgB4PIB5QK4ZgBXBKaAHxQsrED1H7CRgCUPwgHZDqACmhWwXv'.
|
||||
'2aDRqGYeRyufS169cvThQKV88PDuYbW1vJ5VRK+5euqxWlPMdX'.
|
||||
'SRqgreHbZGN3ijfKBXBTAeh2Fdwi2MofshP/dvKwCmKhp4m83Y'.
|
||||
'vj8Xg4l8tlCoXC0MTExMTFkZE/1m37wvLGRvKRacoD1209E7Fc'.
|
||||
'pZwYREOQqEJ4z3HskHLsz4AoXykPIBSN0t3dTTQafROoHdumXC'.
|
||||
'4fjoMiog0ODiauX7+eLxQKV3O53ETdti88nJnJ3rl505ifmWm3'.
|
||||
'arWSodR8GNbycDoNHy5C5jFold1k8d+DyvELNwg93d18/vnn9P'.
|
||||
'X1oes6nufx/Plz7t+/fxhQKSWJRCI5NjaWHxkZKdj1+sjSwkJm'.
|
||||
'+uZN/dZ337VqCwullGUVdZjsgIUC5LqhrUPvCugWuApeApPAzY'.
|
||||
'PKHWyaphGNRunt7WVwcBARwfM8Ojo6sCzrMKBhGLphGFEF2Wq1'.
|
||||
'2jc7M5OZ/vHH0MPbt93awkJJmeZsC6ZaMK3DCwvWdNioQUb5B6'.
|
||||
'AdBR+9SzkAz/NwHIeXL18iIui6TjgcJplMMjY2th8wHo+Hh4aG'.
|
||||
'MsPDw6fddru7+Phxx51bt/RbN260qwsLpZhlFZsw9QJ+2Pbrga'.
|
||||
'oJG2FY2oKwuTtVEz9uV34NbqdtbW0xPT1NNBoF4MyZM1y5coWu'.
|
||||
'rq5dQBHRcrlc4tq1a/l8Pj9RMs38ndu3Ez//9JNXLRZNyuXZJk'.
|
||||
'xVYKoExQpsK/+IaAuYb7no8zjC/R+A4zisrq7u+53NZjl16tQ+'.
|
||||
'QIlEIslsNpuPRCJXZ2dnh2/duNFRW1oy07a96MKd575yxRqU1B'.
|
||||
'5vPMpF5HHa1tYW9+7do7Ozc/eQpZTSQ6FQt1Lq8pMnT/5w7969'.
|
||||
'nuLcXE1rNufO9fRMhlKpOyvt9qPtVmvb25fFfvvWbrepVCqHwo'.
|
||||
'xaX19vff/996ZhGC8qlkW9Wt1Onz073fXxxz+6MB+9e9dUjuO+'.
|
||||
'7ebq9wLdB9hoNCrr6+s/4wf3FCJW3fPmTZhXsNWCprjuW66Dfr'.
|
||||
'928KAfBhJAEgiJSLuzs7OSTqctoFkqlZRt26j/I+L/AGjPTN4d'.
|
||||
'Nqn4AAAAAElFTkSuQmCC' ;
|
||||
//==========================================================
|
||||
// File: ppl_red.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[0][0]= 2490 ;
|
||||
$this->imgdata_large[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMKBh4Ryh89CgAACUdJREFUeJy9mNtTFFcexz+/7p'.
|
||||
'4Lw1wZJKDGCAwmDAqUySamcCq1ed6k9mn3UfMP7F+1T3nYqn2J'.
|
||||
'lZdoDEjpbq0KG8EBFBFBEJye6Zmenkv32Ydu5GYiUMmeqq6uqT'.
|
||||
'6Xz3zP73aOcIKmAQkIFyD3N/jrBPwlKjLQEglVlJKyUjR3u7cc'.
|
||||
'WLoP3/4dvv03LNrQ8I6x1rFbDML9kOmHvh7IRHU9JKmUSG8vpF'.
|
||||
'IoXX/TV0AiEM5A5jT0noFMFMJHXUt/d5f9TUAbhtQ3cPFruDog'.
|
||||
'8klHMnmO0dGYe/myOJGINEwTz3F2higFXgy8PpAkOC+h8hoaCt'.
|
||||
'4ppHFcQAWSgOQlyI/p+lUjmRxWAwNJd3xca/f34yoFi4tgmjtD'.
|
||||
'NIFkJ4xcgBCgVqEBFJ9DqcZea/gNAAVEg7AOGYnHe9XoaJd3+X'.
|
||||
'LISSSwnz6lsbKCZ9sHh4UVdBkwdA6cPwNnIfJPmC3Ctgft3wwQ'.
|
||||
'QPkvTZJJnbExzfvsM2nMzVG7e5fG48d4lnXwTwEYCjJxuHQBog'.
|
||||
'BHUfKkgAIIhiGk06hTp/Dm5qS1uYlXLvtWd4gPgIiCrAEcVckT'.
|
||||
'Ab5p7TaYJrK1hQaEenrwSiVfQdc91P0kSp7Ii89D5ksY/kAkLy'.
|
||||
'IZXFdXkQjS1YUSEbdcRu168V6+HTUNIKJDRwdE+sBIQmP9Ld59'.
|
||||
'bEBA3of4F/D+uXb7rGaaCSmXI3pPj64PDaHCYfEqFVSjgWo2D2'.
|
||||
'73XlJNQTgCyQykIuBWoNKEeh1aLXBPBCggGdBOgxZVSjoajVhH'.
|
||||
'o5HWlIpq4bCQSgm9vXhK4ZZKh5SUYygp4J1EQVUD9xlU18BJQD'.
|
||||
'bUbJ5T5XJStyxN9fSI099P3baxV1dRloW2h2ivx/yakg2ot6F1'.
|
||||
'EkCa4G1D+zVEq5ArKTWM42Q6HUczQV7U66w9e0ZpdRXlOIQ5vF'.
|
||||
'VHUXILKify4jiEzkOqC3peQMoBQymFlMt4Dx6wUSxSsm2UZXEK'.
|
||||
'P30QvOUt8/2Sd78CdWwFDTA+gsw3cOlPcPUD+CQB52oQ21RKXM'.
|
||||
'eRhGXhOg7VoKrx8KuS4ygZhVg3ZI8FGIfwR9BVgAtfwxdXdP3L'.
|
||||
'86nUR91dXelNXTeWWy10paQHX602YAP1ADASAL7LJvFtMpOCc0'.
|
||||
'cG3FHuGlz6Gr4YEpnoTCbzsdHRbOzy5RCRiLRMk5rjyOtAimwA'.
|
||||
'U4U3SurBN/0wnAASBCVDIKpB4kiAB5Ub0/UvO9LpPAMDGfn005'.
|
||||
'AxPCzxep3Q6iqPLUseBoufCZRsAE6g5g5kKIDfKUj3wnpAG8QB'.
|
||||
'/Z1OIqANQuI65AtwNScyYXR2XlAXL2YZHzcklRKWl5GVFXFtGx'.
|
||||
'MoAiV/EQaAGH6BUQNWgQpwFngv+Ca8KUAQEBcwgTJHyMV7679R'.
|
||||
'XS8YqdSI6u/PMD5ukMtJY3GR2uQkr5aXeWVZOEALmA8WsIAxfL'.
|
||||
'd0goVLAdCOd+/YpgqeVtBv4yiA++q/RKKXixe7GB8PSyoljcVF'.
|
||||
'yg8fyubyMpulEk2lyAIfAAvAC+B+oOQFoAt/+0rAejB/EzjNri'.
|
||||
'vvqNnCd64jxcE39V8spnP+vMbAgDSePKE2NcXm06dslMuUlcID'.
|
||||
'TuFvqwXMBU8N39bGgRR+ki0Dz4L5DSAe9NGD7zq+6kcN1L6H2b'.
|
||||
'ao5WWaQHllRTafPmWrVMJUimoAQrBYJFjQwre7B6A8YAi8LCgD'.
|
||||
'5DVo6/hbb/iHK1KggvFeD3hHziQKEMuiNTNDbXGRTdtmw7Iwla'.
|
||||
'KGH0oqwbscLOoG46rAY6AOzRhY74PT6QuUKEN4PegXxd/yEDTT'.
|
||||
'YMWOk+oEaLkuFdNk0zTZwjfkavDUArXWgGXgFb4dEShXhfYqlI'.
|
||||
'ow3w9rg3B6ED60IOOA5oEYQBrcpG+mj9bg0VG8GMJhVDZLyzAo'.
|
||||
'VSq8rFYxXXefcjVgG9+uisDrXUCApoKSBcUHMBmHhfcgNwhtD3'.
|
||||
'q9IG6Lr15b4OUTmPwBJt8JqGuapp05o0mhoHnptLQfPsR+8IBK'.
|
||||
'uYyNH3yr+B77LHheA3tK1Ta+IrMeTL2C6Xl48TOsNWDDgAz7s5'.
|
||||
'/r+krP/eddCsbj8fDQ4GBm9MqVvvRXX2VULBayRGRzaYn1SoWa'.
|
||||
'UjgB4PIB5QK4ZgBXBKaAHxQsrED1H7CRgCUPwgHZDqACmhWwXv'.
|
||||
'2aDRqGYeRyufS169cvThQKV88PDuYbW1vJ5VRK+5euqxWlPMdX'.
|
||||
'SRqgreHbZGN3ijfKBXBTAeh2Fdwi2MofshP/dvKwCmKhp4m83Y'.
|
||||
'vj8Xg4l8tlCoXC0MTExMTFkZE/1m37wvLGRvKRacoD1209E7Fc'.
|
||||
'pZwYREOQqEJ4z3HskHLsz4AoXykPIBSN0t3dTTQafROoHdumXC'.
|
||||
'4fjoMiog0ODiauX7+eLxQKV3O53ETdti88nJnJ3rl505ifmWm3'.
|
||||
'arWSodR8GNbycDoNHy5C5jFold1k8d+DyvELNwg93d18/vnn9P'.
|
||||
'X1oes6nufx/Plz7t+/fxhQKSWJRCI5NjaWHxkZKdj1+sjSwkJm'.
|
||||
'+uZN/dZ337VqCwullGUVdZjsgIUC5LqhrUPvCugWuApeApPAzY'.
|
||||
'PKHWyaphGNRunt7WVwcBARwfM8Ojo6sCzrMKBhGLphGFEF2Wq1'.
|
||||
'2jc7M5OZ/vHH0MPbt93awkJJmeZsC6ZaMK3DCwvWdNioQUb5B6'.
|
||||
'AdBR+9SzkAz/NwHIeXL18iIui6TjgcJplMMjY2th8wHo+Hh4aG'.
|
||||
'MsPDw6fddru7+Phxx51bt/RbN260qwsLpZhlFZsw9QJ+2Pbrga'.
|
||||
'oJG2FY2oKwuTtVEz9uV34NbqdtbW0xPT1NNBoF4MyZM1y5coWu'.
|
||||
'rq5dQBHRcrlc4tq1a/l8Pj9RMs38ndu3Ez//9JNXLRZNyuXZJk'.
|
||||
'xVYKoExQpsK/+IaAuYb7no8zjC/R+A4zisrq7u+53NZjl16tQ+'.
|
||||
'QIlEIslsNpuPRCJXZ2dnh2/duNFRW1oy07a96MKd575yxRqU1B'.
|
||||
'5vPMpF5HHa1tYW9+7do7Ozc/eQpZTSQ6FQt1Lq8pMnT/5w7969'.
|
||||
'nuLcXE1rNufO9fRMhlKpOyvt9qPtVmvb25fFfvvWbrepVCqHwo'.
|
||||
'xaX19vff/996ZhGC8qlkW9Wt1Onz073fXxxz+6MB+9e9dUjuO+'.
|
||||
'7ebq9wLdB9hoNCrr6+s/4wf3FCJW3fPmTZhXsNWCprjuW66Dfr'.
|
||||
'928KAfBhJAEgiJSLuzs7OSTqctoFkqlZRt26j/I+L/AGjPTN4d'.
|
||||
'Nqn4AAAAAElFTkSuQmCC' ;
|
||||
|
||||
//==========================================================
|
||||
// File: ppl_orange.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[1][0]= 2753 ;
|
||||
$this->imgdata_large[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFQ0VCkHCzQAACk5JREFUeJytmGtzG0d2hp8zNw'.
|
||||
'AEcRdJ6EJK9FL0CqZUm9jWbkwq3vhDstl8dmLvz8rP2H8Q75ZT'.
|
||||
'pkRfpLgqsS6WIFEKGYkiSBCDO+banQ8DUpRWEkklXQUUqlCDfv'.
|
||||
'rp857pgfAOQ4AMOJdg4R/hX96Hf06bvDc5iT07i8yeg8ksiIAI'.
|
||||
'4TBi/ds9/vivD/njapNHvRBfHXMu410AM+BUoVSF05NQsi1sO4'.
|
||||
'8402AXwLQTuP31OAZO2aG0MEn14iSlnI1z3LnMk8IZYJyBwjIs'.
|
||||
'/TWsVIWPJkvMFS4zMfMhUp5BsoCpAAEBLYKaMFGn00jBxnvu02'.
|
||||
'35+JHmSJEnBpQEcPo38MmCxd/nS9Ry71Ga/g1W9a8gn0GsHkgA'.
|
||||
'6DGjxkqb5CoO+YxF3A3p+jGjQUzoK+L/V0ADzFMwtSR8eLbAr8'.
|
||||
'uXOTf9NzhTc0geSLUQcYHgYEH786RMg0zWJHV2Aitv4x/HpHVS'.
|
||||
'QA2YBqTTGIUq5qkPMWaWkVwPnPtAA/BevmZcjxaaUtHh8pJJGu'.
|
||||
'DpCB9FvT7A7YT7S3p5vFMNzmWo/O0MSx/Ms3TqI8r59zFTfUQe'.
|
||||
'I7SBODE3tnfoIxYnNHligwik0zAzDdVpyKbA8sff5YAeMEwgkV'.
|
||||
'cufQeTJzZoCsaFLKXPTnNpoUTNsSgJmNoGsuNQjIDwYD2HlnZy'.
|
||||
'k++yxTKXZfKTU8zOpjhneeQYkorSmGERtIlICBKRbLX+y98YN3'.
|
||||
'ADcNIm+bJD4U3pPnmbEaRgYVRTGBkDSSsmxKfY7ZLuDJA4hdjl'.
|
||||
'JEgyBB2SJOvQ9RzTpNKoEwNq0CNFvOXR3/HxMgYVPObaz8kPmh'.
|
||||
'hkEWMatAfRONGGvLizyOE9P8KkpwhPDAgQKJQbELUD0oOIhbbH'.
|
||||
'JeVTmowxjAgZutB5AoOngA+2DdYrcTyOyYZP9+QpBvI29vwEhb'.
|
||||
'It042BVQgDy9KTMfkwQG1A9ACCLlgBBGUwxxoc52WDh2ATyEPp'.
|
||||
'1hoaPvrEBh0Dq5an9OUsl/9hylk5b5c+mowLc4E2Jtw4Eoljyf'.
|
||||
'ogA/AGEAagNRjGyUxOmEycyVA5EWDBxrmUp3ytLIv/NJP69Goh'.
|
||||
'+9mFydIvS5PZYkvH1oY/RFtKymlwBFQAgQd+kAA6qSQ8pvn2mp'.
|
||||
'SkJkuVFHPHBnQMrEt5Sl+e4/Lvp51PF1PF5Xy6WMvOWZXMom8z'.
|
||||
'OZTQ8+j5sbQiMEwopsCIwRtBGIJSCdzbTGo9NimkDcgdC7Bg49'.
|
||||
'TG5n4/nfr0Si77WdYp1YzyZEkWPdteaEnB7pPqBTxuIf/VgciE'.
|
||||
'SgasCPwh+GNIkaNNag1RiPge5pEhMQVjfoLcF+eoXSvbKxedwn'.
|
||||
'LKzC3KWbOi5/sW5a44/SHFUSgVA7SCzRG0AvA9mPOgFIETgu4n'.
|
||||
'Ww0wNQWFAqRSL6D2ZQYBdDrQ7R7jXiwgRcvIL02makuTmWtpM/'.
|
||||
'+BlLMl5vuWzLVEuwH6oYnR1KS8kJINGXMM2YdfRlALoQoQQKeb'.
|
||||
'bDVwoMdxQMaLCwLo96HZTF5HbrEhmOftianfZisfzueKv7ZmrX'.
|
||||
'MsjhxKXZGBjzyeEHmSE3oWiggtyVGmE8DTIXTC5NxgAxOAGUM8'.
|
||||
'fun9mnSSLQ/CxNzOTgJ3LIMgoGwkKBiiMyaVviHVkdCO4FEKNv'.
|
||||
'LQzWBYHfITPa4UBVM0LR/WB7ARJsdDDTjA6deYFIFUOimJ3d0E'.
|
||||
'sNdLavYYgBpthqKcjiiJRO8K6CK0CsJTjfQAGaJtD9vQFAxNNQ'.
|
||||
'1FB0yBAfA8gdMAIagLoCVAen0M00zMOTYShNDtoHs9CAIUoI4E'.
|
||||
'1IBihCdNhsMhsj6NuV7BCC2IBpBqQaaFOENCCeiEsO1BO4RQgy'.
|
||||
'I5Hm4k4oIU9MrgZSAdBeTabZz+ODxKQRRBFBJo6IUc51anYRQo'.
|
||||
'dto+24FNxYCiaWKkQsj00KkO4gxRRkAngJ868M0u3OkkM+hxQA'.
|
||||
'cQ7YD7GO5XYSsPZybh/TCkFIYY+kWniTW4Q7jXgHvHMhiRpmuW'.
|
||||
'ca08GZkkZ/nY6TZMNhCnf2CuPoDVJvxpB+q9BHA8Ag1uH+oP4c'.
|
||||
'YEPCzDwmzSLquShHW/E0YRbG/BjZtw40hAy7aNzJlzRn75E6N0'.
|
||||
'qiwTzafI7kOU3gWrhzZC2iHcbsPqLlxvJnCt4KC1RYAL3I5hzY'.
|
||||
'Xv/huePYCtITQMKEnyB4KQvMURuJvw889HGSwUCs7CwkLpo6tX'.
|
||||
'Ty/+7nel6VLGDn/8N9m+eZuo1UP8iNhLau6b3RfmOsHBGTUYw9'.
|
||||
'WBNeDrGB4+h/4qNLKwTnLbHj9CJw/6GoIh9Jpvq0HHcayFhYXi'.
|
||||
'l3/4w9LK8vLKexfma3G/mb/3n1njTivS7tNQaaU1grQDjJ868D'.
|
||||
'Axx6vmxnBrY9C9IcSbSXbavNjb/S3eN6/0m1JcKBScixcvllZW'.
|
||||
'Vi6uLC8v12q1v/M8b/HxVjP//YYr32yE4dYWvShO0ogi14xwxq'.
|
||||
'F4rbnxZ3cMjtpvEEeMvwA0TdOYn5/PffHFF7Vr166tvPeLXyx7'.
|
||||
'nrd4+/btyg/frFo//Xgncnd67qCn78earQqcmYD3fSi1wPCTSV'.
|
||||
'3gzqvm9uFOMl5nUAqFQn5paal26dKla57vf7D+6FHph9VV88af'.
|
||||
'vgq79bo70e3VT2l9A3hYg4UiRALVHTCHSZvYBm4A//6quf8zoG'.
|
||||
'3bpuM4acMwKr1+//SDe/dK31+/bv90/Xrcq9fduNW6rbVeC+E7'.
|
||||
'gWdD2DKg4UEpBmPcm10RuScida31ntb62HAigoigDw6Gh0axWH'.
|
||||
'QWFhZKi4uLZ+I4PrVer2e+u37dXPvqq6hbr7tOp1NXWq89h6/b'.
|
||||
'8FBB34WGBesdcPrj38lkMkGlUuml0+mu53nR3t4eo9HoSLhMJk'.
|
||||
'OlUiGdTuN5Hq7rvgA0TdO4cOFC7vPPP6/VarXldqdTu7m2lrv7'.
|
||||
'7beq++BBO263b/tKrfWSXlbvwJ6CuAtDgTYiaBFMw6BSqfDxxx'.
|
||||
'+rarWqGo0GN2/eZGtrC6XenAkRoVKpcPXqVWZmZmg0Gty6desF'.
|
||||
'oIhIOp3Ol8vlmmVZK3fv3Lm09uc/Zwbr653ccPgoNIzvnmn99Z'.
|
||||
'7W9QG46lAaM5mM2l95GIYUi0VOnz7N7OwsWmsymQzyuse5Q8Mw'.
|
||||
'DNLpNDMzM5w/f/7A6AGgUkoajYa9urpayOXzUz/fvZutr68Pim'.
|
||||
'F4/2y1+n2o9Q/ru7uPesPhXnyo4A+vfHp6mmazybNnz9jZ2UFr'.
|
||||
'TbPZJAhe+8/aS0Mphed5NBoNABqNBqPR6MWBVWstvu/nnj9/Pv'.
|
||||
'vo0aPq5uZmPBgM/qcwPf39xV/9ajU1M3Nvq9PZaw8GoT50PjdN'.
|
||||
'k6mpKa5cucL58+eJ45j19XWePHnCzs4OnudhmiaWZRGGIVH05r'.
|
||||
'yEYYjrumxubrKxsfFyDQJ6NBp1Pc+7C4jWumBaVm+kVL2l1H2l'.
|
||||
'1G6otS+H6V6z8u3tbVzXpdFooJRicXGRqakptre3uXXr1ltrcT'.
|
||||
'Qa8ezZszemWAE9rfUdYBOwtVLRbrPZ+48ff+wDvuu6Sr3MB4Dr'.
|
||||
'uty6desgfa1WC3iRyrNnz4pSSmezWUzTfGtYtNYcdvC/9sMlgP'.
|
||||
'n5N4cAAAAASUVORK5CYII=' ;
|
||||
//==========================================================
|
||||
// File: ppl_orange.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[1][0]= 2753 ;
|
||||
$this->imgdata_large[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFQ0VCkHCzQAACk5JREFUeJytmGtzG0d2hp8zNw'.
|
||||
'AEcRdJ6EJK9FL0CqZUm9jWbkwq3vhDstl8dmLvz8rP2H8Q75ZT'.
|
||||
'pkRfpLgqsS6WIFEKGYkiSBCDO+banQ8DUpRWEkklXQUUqlCDfv'.
|
||||
'rp857pgfAOQ4AMOJdg4R/hX96Hf06bvDc5iT07i8yeg8ksiIAI'.
|
||||
'4TBi/ds9/vivD/njapNHvRBfHXMu410AM+BUoVSF05NQsi1sO4'.
|
||||
'8402AXwLQTuP31OAZO2aG0MEn14iSlnI1z3LnMk8IZYJyBwjIs'.
|
||||
'/TWsVIWPJkvMFS4zMfMhUp5BsoCpAAEBLYKaMFGn00jBxnvu02'.
|
||||
'35+JHmSJEnBpQEcPo38MmCxd/nS9Ry71Ga/g1W9a8gn0GsHkgA'.
|
||||
'6DGjxkqb5CoO+YxF3A3p+jGjQUzoK+L/V0ADzFMwtSR8eLbAr8'.
|
||||
'uXOTf9NzhTc0geSLUQcYHgYEH786RMg0zWJHV2Aitv4x/HpHVS'.
|
||||
'QA2YBqTTGIUq5qkPMWaWkVwPnPtAA/BevmZcjxaaUtHh8pJJGu'.
|
||||
'DpCB9FvT7A7YT7S3p5vFMNzmWo/O0MSx/Ms3TqI8r59zFTfUQe'.
|
||||
'I7SBODE3tnfoIxYnNHligwik0zAzDdVpyKbA8sff5YAeMEwgkV'.
|
||||
'cufQeTJzZoCsaFLKXPTnNpoUTNsSgJmNoGsuNQjIDwYD2HlnZy'.
|
||||
'k++yxTKXZfKTU8zOpjhneeQYkorSmGERtIlICBKRbLX+y98YN3'.
|
||||
'ADcNIm+bJD4U3pPnmbEaRgYVRTGBkDSSsmxKfY7ZLuDJA4hdjl'.
|
||||
'JEgyBB2SJOvQ9RzTpNKoEwNq0CNFvOXR3/HxMgYVPObaz8kPmh'.
|
||||
'hkEWMatAfRONGGvLizyOE9P8KkpwhPDAgQKJQbELUD0oOIhbbH'.
|
||||
'JeVTmowxjAgZutB5AoOngA+2DdYrcTyOyYZP9+QpBvI29vwEhb'.
|
||||
'It042BVQgDy9KTMfkwQG1A9ACCLlgBBGUwxxoc52WDh2ATyEPp'.
|
||||
'1hoaPvrEBh0Dq5an9OUsl/9hylk5b5c+mowLc4E2Jtw4Eoljyf'.
|
||||
'ogA/AGEAagNRjGyUxOmEycyVA5EWDBxrmUp3ytLIv/NJP69Goh'.
|
||||
'+9mFydIvS5PZYkvH1oY/RFtKymlwBFQAgQd+kAA6qSQ8pvn2mp'.
|
||||
'SkJkuVFHPHBnQMrEt5Sl+e4/Lvp51PF1PF5Xy6WMvOWZXMom8z'.
|
||||
'OZTQ8+j5sbQiMEwopsCIwRtBGIJSCdzbTGo9NimkDcgdC7Bg49'.
|
||||
'TG5n4/nfr0Si77WdYp1YzyZEkWPdteaEnB7pPqBTxuIf/VgciE'.
|
||||
'SgasCPwh+GNIkaNNag1RiPge5pEhMQVjfoLcF+eoXSvbKxedwn'.
|
||||
'LKzC3KWbOi5/sW5a44/SHFUSgVA7SCzRG0AvA9mPOgFIETgu4n'.
|
||||
'Ww0wNQWFAqRSL6D2ZQYBdDrQ7R7jXiwgRcvIL02makuTmWtpM/'.
|
||||
'+BlLMl5vuWzLVEuwH6oYnR1KS8kJINGXMM2YdfRlALoQoQQKeb'.
|
||||
'bDVwoMdxQMaLCwLo96HZTF5HbrEhmOftianfZisfzueKv7ZmrX'.
|
||||
'MsjhxKXZGBjzyeEHmSE3oWiggtyVGmE8DTIXTC5NxgAxOAGUM8'.
|
||||
'fun9mnSSLQ/CxNzOTgJ3LIMgoGwkKBiiMyaVviHVkdCO4FEKNv'.
|
||||
'LQzWBYHfITPa4UBVM0LR/WB7ARJsdDDTjA6deYFIFUOimJ3d0E'.
|
||||
'sNdLavYYgBpthqKcjiiJRO8K6CK0CsJTjfQAGaJtD9vQFAxNNQ'.
|
||||
'1FB0yBAfA8gdMAIagLoCVAen0M00zMOTYShNDtoHs9CAIUoI4E'.
|
||||
'1IBihCdNhsMhsj6NuV7BCC2IBpBqQaaFOENCCeiEsO1BO4RQgy'.
|
||||
'I5Hm4k4oIU9MrgZSAdBeTabZz+ODxKQRRBFBJo6IUc51anYRQo'.
|
||||
'dto+24FNxYCiaWKkQsj00KkO4gxRRkAngJ868M0u3OkkM+hxQA'.
|
||||
'cQ7YD7GO5XYSsPZybh/TCkFIYY+kWniTW4Q7jXgHvHMhiRpmuW'.
|
||||
'ca08GZkkZ/nY6TZMNhCnf2CuPoDVJvxpB+q9BHA8Ag1uH+oP4c'.
|
||||
'YEPCzDwmzSLquShHW/E0YRbG/BjZtw40hAy7aNzJlzRn75E6N0'.
|
||||
'qiwTzafI7kOU3gWrhzZC2iHcbsPqLlxvJnCt4KC1RYAL3I5hzY'.
|
||||
'Xv/huePYCtITQMKEnyB4KQvMURuJvw889HGSwUCs7CwkLpo6tX'.
|
||||
'Ty/+7nel6VLGDn/8N9m+eZuo1UP8iNhLau6b3RfmOsHBGTUYw9'.
|
||||
'WBNeDrGB4+h/4qNLKwTnLbHj9CJw/6GoIh9Jpvq0HHcayFhYXi'.
|
||||
'l3/4w9LK8vLKexfma3G/mb/3n1njTivS7tNQaaU1grQDjJ868D'.
|
||||
'Axx6vmxnBrY9C9IcSbSXbavNjb/S3eN6/0m1JcKBScixcvllZW'.
|
||||
'Vi6uLC8v12q1v/M8b/HxVjP//YYr32yE4dYWvShO0ogi14xwxq'.
|
||||
'F4rbnxZ3cMjtpvEEeMvwA0TdOYn5/PffHFF7Vr166tvPeLXyx7'.
|
||||
'nrd4+/btyg/frFo//Xgncnd67qCn78earQqcmYD3fSi1wPCTSV'.
|
||||
'3gzqvm9uFOMl5nUAqFQn5paal26dKla57vf7D+6FHph9VV88af'.
|
||||
'vgq79bo70e3VT2l9A3hYg4UiRALVHTCHSZvYBm4A//6quf8zoG'.
|
||||
'3bpuM4acMwKr1+//SDe/dK31+/bv90/Xrcq9fduNW6rbVeC+E7'.
|
||||
'gWdD2DKg4UEpBmPcm10RuScida31ntb62HAigoigDw6Gh0axWH'.
|
||||
'QWFhZKi4uLZ+I4PrVer2e+u37dXPvqq6hbr7tOp1NXWq89h6/b'.
|
||||
'8FBB34WGBesdcPrj38lkMkGlUuml0+mu53nR3t4eo9HoSLhMJk'.
|
||||
'OlUiGdTuN5Hq7rvgA0TdO4cOFC7vPPP6/VarXldqdTu7m2lrv7'.
|
||||
'7beq++BBO263b/tKrfWSXlbvwJ6CuAtDgTYiaBFMw6BSqfDxxx'.
|
||||
'+rarWqGo0GN2/eZGtrC6XenAkRoVKpcPXqVWZmZmg0Gty6desF'.
|
||||
'oIhIOp3Ol8vlmmVZK3fv3Lm09uc/Zwbr653ccPgoNIzvnmn99Z'.
|
||||
'7W9QG46lAaM5mM2l95GIYUi0VOnz7N7OwsWmsymQzyuse5Q8Mw'.
|
||||
'DNLpNDMzM5w/f/7A6AGgUkoajYa9urpayOXzUz/fvZutr68Pim'.
|
||||
'F4/2y1+n2o9Q/ru7uPesPhXnyo4A+vfHp6mmazybNnz9jZ2UFr'.
|
||||
'TbPZJAhe+8/aS0Mphed5NBoNABqNBqPR6MWBVWstvu/nnj9/Pv'.
|
||||
'vo0aPq5uZmPBgM/qcwPf39xV/9ajU1M3Nvq9PZaw8GoT50PjdN'.
|
||||
'k6mpKa5cucL58+eJ45j19XWePHnCzs4OnudhmiaWZRGGIVH05r'.
|
||||
'yEYYjrumxubrKxsfFyDQJ6NBp1Pc+7C4jWumBaVm+kVL2l1H2l'.
|
||||
'1G6otS+H6V6z8u3tbVzXpdFooJRicXGRqakptre3uXXr1ltrcT'.
|
||||
'Qa8ezZszemWAE9rfUdYBOwtVLRbrPZ+48ff+wDvuu6Sr3MB4Dr'.
|
||||
'uty6desgfa1WC3iRyrNnz4pSSmezWUzTfGtYtNYcdvC/9sMlgP'.
|
||||
'n5N4cAAAAASUVORK5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
// File: ppl_pink.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[2][0]= 2779 ;
|
||||
$this->imgdata_large[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFQolY9lkpgAACmhJREFUeJy9mOtzFNl5h5+3b9'.
|
||||
'Mz0kzPBWmEVtIiWYhIiC0HCDhB8lb8ISk7nzdZ5+/zJ/8BTmpT'.
|
||||
'660CZLwG1pVFgBkgGIHECEaa+/T9nHzQCCQuRpCNz6mp6g893U'.
|
||||
'8/c37ve3qEjxiC4OA4n/Lp/EUu/tsMM/+aEWduVBx7WhdkShcY'.
|
||||
'xUH2zo0Dwod/5N6vf8V//PoGdx8M8EOFPtK9jI8BdHCcMuVSmf'.
|
||||
'LxHLmSZdm2U8xIbmKETDGDZZnIy4dBbCynyGhphurEDBOlHFnn'.
|
||||
'qPcyPxTOwDCOccw7w5nlBRZWylI+ny/mZ6rL1dzUZ5/IWGZU3D'.
|
||||
'ZIOMQDDaJcHDVGWUbJBi9odVr0QoVSPzigIEaZ8vgSS/8wZU3/'.
|
||||
'k1fylipz5dLM2WlrZqHKaGCKbEbontq3KAKWQyZfZKTgYqc9Bp'.
|
||||
'2I2PcJ4ogk/UEBQcwipbFZmT13vDBx8fhnE1Ofnp9yJopFyT3X'.
|
||||
'yANfks0QHSQMDaL37pOxMLIu2UyVkjVKLjyKSeuD8dAYCFkso1'.
|
||||
'gYMaeWJ40T56cl8yAi/O4FSa2P6kYczIDsgVpAqcDImZPMuAB1'.
|
||||
'dkLQtcc8a/bwox8IUHAxZVxGZMouSLVYwKuMkD5IxN+JSdsRJB'.
|
||||
'pexuTVgYYM6EoGmxkmg3/hEhNUMr/hd7dqbOzExMn/GRDAxWZc'.
|
||||
'j3I8HiXfMjF2FQowKw7pjoN6E/Llw/GBJj8qxVOMlX4ipxc/lY'.
|
||||
'kl2zBLkmrTcEzMkoNoRLVidLi/9g+Z3I+1xRHX5EcAihxnbPRv'.
|
||||
'OTU9kZSmpKPy9FTGrLimPZ1H+UiyGaF67w6n7E1DwMngFDxGvc'.
|
||||
'w70v0xZUby5IxjlIyMssUJrJwVWkXBdbXvSvwEibcSdKCAFI16'.
|
||||
'4/sc0SRo9cGAGq1DwvQFzV6DVuBiV4zYnlEts6A2TSPcSiXoxo'.
|
||||
'QqJCEEFMbQ2b69o5qMiOOPqIMQkagu/aSL7waE8101WFShLjk9'.
|
||||
'yxgEvjRUiyYd+gwAjY2J9VpXfZ/JEXLhDp3OR6U4T97+hEnPwx'.
|
||||
'tv4HsRjy2tTQSFzQgDUnwSLBQRI+x1ZgcH87Vcv4SF19Kt0ezS'.
|
||||
'1h9s0Ma25pgr/YJfnLnEysok0+ezjM6EBLldGqKIJYuDRhOQEJ'.
|
||||
'Oih8X9Q0xmcXNjlCofBJgn78wxVz7L2YWf8tPPz1hnfjbjzfxN'.
|
||||
'qVwutq2etZXUQSXikcXGIgUiUkJSDIQMJgYGJsaB3c7b1qQ4GZ'.
|
||||
'xSkdGZIwMeNLfK6uezMnvJK3pLxeVixfvMsyVjSNSO6IV9adPG'.
|
||||
'AArkEEz8oUkFmBjYGO80qfd6pCWIayD59wIKcsjcKqufn7JO/S'.
|
||||
'xfyi+5c24pey5rZ09mJRNkiDdT/tzbkBr3SYkpMYpgEaIJSYhI'.
|
||||
'kSOY1GhilAQk5ntDIojxCZ/kf87Pl85xbuWEnLiUy+cW3NNuJX'.
|
||||
'MmY5meKf6mT7wZS+THdOjxlG06tIlIOMZxchSxcFFEGAwAGGME'.
|
||||
'jwyZYSnWL3cXWiIUbUI6hO/vxXuFOV84ycmlBWthNeflTjuzTi'.
|
||||
'lzJmM5s46Ej0J63/ZoPmoy6PYxtYVNhmfs0mbAND1mmKVMBY1L'.
|
||||
'mxA1LN7WgXQbCApNhKJHRIM+DQbv7yQGhjnJ5NgFuXBuxpu5mD'.
|
||||
'udm3LPuY7pmZLUE6L1SIJaIPFuDAqyw9lnwDYv6NFHkWJh4ZDB'.
|
||||
'wCBFD3uMxsTAwcBAiElpE/KcPg36dIiOvpsRxDCyhmlP2YY9ZU'.
|
||||
'v8NMb/1id+FGO0DTztkSXLOONUqeITsMkW2zwnJEIDFhYGx+A1'.
|
||||
'kwK4mASkvKDPc3p0iYhRRwYUhZLUTyV6Eu0t4s1Y4kcx6W6KaM'.
|
||||
'EZThcXH59RRhGEgIAddnBwNEBKqqpUtWBIF22YDIhJsbEkJqFN'.
|
||||
'qLtERHs7GnUkwISEQAf0uj30bY39PzbiC6qrDu2cExJ69Nhhhz'.
|
||||
'59UlIUipCQOnVi4sjG7ubJBy6um0C+he/0iDHQKIQERYyKFLqr'.
|
||||
'SI/W6kJCnvOcrWSLSquC1/Jw9Ks3R0FQKHr0uMc9bnCDGjX69A'.
|
||||
'H0XlcJkibN5jOe/alCZStHbjJL9lSMLkXExvCXRiDV6GZEeGeX'.
|
||||
'3TvvBVQoEjfBL/v0rT75Th7VU5C8gktI6NLlMY+5yU3WWGODDf'.
|
||||
'r098tHpNFNH7/2lKdXXdz7efLzVaqJIBOCmK8AJUlI6g0aV+9y'.
|
||||
'9+p7AR3bMQpTBWPy7yeN6fy0jNwewfpvC9Xe+3kFoUuXe9zj5n'.
|
||||
'BusEGHjh6GIAGawC2FWuvSvbbF1maFylZAsC1ISZADBiVNSJrP'.
|
||||
'eX73MY//skHP85z5+fnSxQsXj//4n39cmnPn7LbZlsajBmEnBL'.
|
||||
'1nuEGDG9x4aa5Ldz+h0RCuBqwBv1Wo+7vs9r7n++0MmYeAM+zB'.
|
||||
'+61EK1QUEnbbtN+9Bh3Hsebn54u//PdfLq9eWl2ZnZ1dSnaSwu'.
|
||||
'Pin40b9g3doKE0WoNIl65xj3v75njd3BBubQi6ExKmDWkMRKSl'.
|
||||
'tSbVKQcMao1Go5Ugb0+x53nOyZMnSysrKydXLq1cWlxa/McgCB'.
|
||||
'Yev3hU+GPrD3I5/q94k3pXYQY58q6B5Bs0HB//neaGx00gyWaz'.
|
||||
'VCoV7bquCoKAnZ0dfN/f03egLGj0m3XQNE1jdnY2/+WXXy6trq'.
|
||||
'6uzP3oR5eCIFi4detW5feXL1vr679Let37zVB3/mQytjXJwmSB'.
|
||||
'wikHp9ShY0RESqObwPrr5oBERKhUKly4cIFqtUq9XufmzZtsbW'.
|
||||
'2hXvuDwTTNtxZq8TyvsLy8vLS4uLgahOHphw8elL69fNlc++qr'.
|
||||
'uFOrNXPddm1cczVL5f5P+Lv5MuOJgTGxwYbZpZsCdeAq8M1Bcw'.
|
||||
'CGYeC6LtVqlRMnTjAyMkKn0yGXyx0N0LZt03Ec1zCMSrfXO37v'.
|
||||
'zp3S769csb+/ciXt1mrNdHf3ltZ6Lca8ZpJsduhtCdb2gEFJoQ'.
|
||||
'xADYHuHDS3f32lFEEQUK/XGRkZoVAocP78eZaXl9FaI/Jq25Uk'.
|
||||
'yWHAYrHozM/PlxYWFibTND32sFbLXrtyxVz76qukXas1M61WTW'.
|
||||
'm99gx+20TdN9jqtfjP7QzOwwYNp037Zd0DukDnIByA1pqdnR2+'.
|
||||
'++472u02Z8+eZWJiAsMwDsEBRNGBzYJpmsaJEyfyX3zxxdLS0t'.
|
||||
'KlVqu1dP3q1cLta9ekU6u1dat1J9b6Sk9kraV1rYXegW7apDYw'.
|
||||
'kFY6fPc4MNTw88bwfZ/NzU2UUnieRxAEiAiGcXiXfcigiIjruo'.
|
||||
'VyubxkWdbK7fX1xWvffFMInjzBM82uMT5+p++6V1UUrSe7u03t'.
|
||||
'+8lezlKt3gHyl0aSJDQaDa5fv876+vo+w6FzDq1BpZRsb2/bly'.
|
||||
'9f9vL5/Njdu3fzG0+eMJHNxsfn532vXN5NPG/7abPZal6/Hvfe'.
|
||||
'kroPHfsm98f7AHW9Xo+//vrrlmVZm71+37QNw3JnZ9PK4uJGpV'.
|
||||
'pt4Dh+vLGhsrmcfv1iHzu01m89HjIdCon2fb8TBMHtvYeRUn50'.
|
||||
'1Oj4vqp3Ok1f5LYSadfr9dQfDN642P/XeF2DA+SBAuA4jkOhUK'.
|
||||
'BQKESO43S11p3BYBDt7u4y+CtB/i/q7jp1GMiw2AAAAABJRU5E'.
|
||||
'rkJggg==' ;
|
||||
//==========================================================
|
||||
// File: ppl_pink.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[2][0]= 2779 ;
|
||||
$this->imgdata_large[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFQolY9lkpgAACmhJREFUeJy9mOtzFNl5h5+3b9'.
|
||||
'Mz0kzPBWmEVtIiWYhIiC0HCDhB8lb8ISk7nzdZ5+/zJ/8BTmpT'.
|
||||
'660CZLwG1pVFgBkgGIHECEaa+/T9nHzQCCQuRpCNz6mp6g893U'.
|
||||
'8/c37ve3qEjxiC4OA4n/Lp/EUu/tsMM/+aEWduVBx7WhdkShcY'.
|
||||
'xUH2zo0Dwod/5N6vf8V//PoGdx8M8EOFPtK9jI8BdHCcMuVSmf'.
|
||||
'LxHLmSZdm2U8xIbmKETDGDZZnIy4dBbCynyGhphurEDBOlHFnn'.
|
||||
'qPcyPxTOwDCOccw7w5nlBRZWylI+ny/mZ6rL1dzUZ5/IWGZU3D'.
|
||||
'ZIOMQDDaJcHDVGWUbJBi9odVr0QoVSPzigIEaZ8vgSS/8wZU3/'.
|
||||
'k1fylipz5dLM2WlrZqHKaGCKbEbontq3KAKWQyZfZKTgYqc9Bp'.
|
||||
'2I2PcJ4ogk/UEBQcwipbFZmT13vDBx8fhnE1Ofnp9yJopFyT3X'.
|
||||
'yANfks0QHSQMDaL37pOxMLIu2UyVkjVKLjyKSeuD8dAYCFkso1'.
|
||||
'gYMaeWJ40T56cl8yAi/O4FSa2P6kYczIDsgVpAqcDImZPMuAB1'.
|
||||
'dkLQtcc8a/bwox8IUHAxZVxGZMouSLVYwKuMkD5IxN+JSdsRJB'.
|
||||
'pexuTVgYYM6EoGmxkmg3/hEhNUMr/hd7dqbOzExMn/GRDAxWZc'.
|
||||
'j3I8HiXfMjF2FQowKw7pjoN6E/Llw/GBJj8qxVOMlX4ipxc/lY'.
|
||||
'kl2zBLkmrTcEzMkoNoRLVidLi/9g+Z3I+1xRHX5EcAihxnbPRv'.
|
||||
'OTU9kZSmpKPy9FTGrLimPZ1H+UiyGaF67w6n7E1DwMngFDxGvc'.
|
||||
'w70v0xZUby5IxjlIyMssUJrJwVWkXBdbXvSvwEibcSdKCAFI16'.
|
||||
'4/sc0SRo9cGAGq1DwvQFzV6DVuBiV4zYnlEts6A2TSPcSiXoxo'.
|
||||
'QqJCEEFMbQ2b69o5qMiOOPqIMQkagu/aSL7waE8101WFShLjk9'.
|
||||
'yxgEvjRUiyYd+gwAjY2J9VpXfZ/JEXLhDp3OR6U4T97+hEnPwx'.
|
||||
'tv4HsRjy2tTQSFzQgDUnwSLBQRI+x1ZgcH87Vcv4SF19Kt0ezS'.
|
||||
'1h9s0Ma25pgr/YJfnLnEysok0+ezjM6EBLldGqKIJYuDRhOQEJ'.
|
||||
'Oih8X9Q0xmcXNjlCofBJgn78wxVz7L2YWf8tPPz1hnfjbjzfxN'.
|
||||
'qVwutq2etZXUQSXikcXGIgUiUkJSDIQMJgYGJsaB3c7b1qQ4GZ'.
|
||||
'xSkdGZIwMeNLfK6uezMnvJK3pLxeVixfvMsyVjSNSO6IV9adPG'.
|
||||
'AArkEEz8oUkFmBjYGO80qfd6pCWIayD59wIKcsjcKqufn7JO/S'.
|
||||
'xfyi+5c24pey5rZ09mJRNkiDdT/tzbkBr3SYkpMYpgEaIJSYhI'.
|
||||
'kSOY1GhilAQk5ntDIojxCZ/kf87Pl85xbuWEnLiUy+cW3NNuJX'.
|
||||
'MmY5meKf6mT7wZS+THdOjxlG06tIlIOMZxchSxcFFEGAwAGGME'.
|
||||
'jwyZYSnWL3cXWiIUbUI6hO/vxXuFOV84ycmlBWthNeflTjuzTi'.
|
||||
'lzJmM5s46Ej0J63/ZoPmoy6PYxtYVNhmfs0mbAND1mmKVMBY1L'.
|
||||
'mxA1LN7WgXQbCApNhKJHRIM+DQbv7yQGhjnJ5NgFuXBuxpu5mD'.
|
||||
'udm3LPuY7pmZLUE6L1SIJaIPFuDAqyw9lnwDYv6NFHkWJh4ZDB'.
|
||||
'wCBFD3uMxsTAwcBAiElpE/KcPg36dIiOvpsRxDCyhmlP2YY9ZU'.
|
||||
'v8NMb/1id+FGO0DTztkSXLOONUqeITsMkW2zwnJEIDFhYGx+A1'.
|
||||
'kwK4mASkvKDPc3p0iYhRRwYUhZLUTyV6Eu0t4s1Y4kcx6W6KaM'.
|
||||
'EZThcXH59RRhGEgIAddnBwNEBKqqpUtWBIF22YDIhJsbEkJqFN'.
|
||||
'qLtERHs7GnUkwISEQAf0uj30bY39PzbiC6qrDu2cExJ69Nhhhz'.
|
||||
'59UlIUipCQOnVi4sjG7ubJBy6um0C+he/0iDHQKIQERYyKFLqr'.
|
||||
'SI/W6kJCnvOcrWSLSquC1/Jw9Ks3R0FQKHr0uMc9bnCDGjX69A'.
|
||||
'H0XlcJkibN5jOe/alCZStHbjJL9lSMLkXExvCXRiDV6GZEeGeX'.
|
||||
'3TvvBVQoEjfBL/v0rT75Th7VU5C8gktI6NLlMY+5yU3WWGODDf'.
|
||||
'r098tHpNFNH7/2lKdXXdz7efLzVaqJIBOCmK8AJUlI6g0aV+9y'.
|
||||
'9+p7AR3bMQpTBWPy7yeN6fy0jNwewfpvC9Xe+3kFoUuXe9zj5n'.
|
||||
'BusEGHjh6GIAGawC2FWuvSvbbF1maFylZAsC1ISZADBiVNSJrP'.
|
||||
'eX73MY//skHP85z5+fnSxQsXj//4n39cmnPn7LbZlsajBmEnBL'.
|
||||
'1nuEGDG9x4aa5Ldz+h0RCuBqwBv1Wo+7vs9r7n++0MmYeAM+zB'.
|
||||
'+61EK1QUEnbbtN+9Bh3Hsebn54u//PdfLq9eWl2ZnZ1dSnaSwu'.
|
||||
'Pin40b9g3doKE0WoNIl65xj3v75njd3BBubQi6ExKmDWkMRKSl'.
|
||||
'tSbVKQcMao1Go5Ugb0+x53nOyZMnSysrKydXLq1cWlxa/McgCB'.
|
||||
'Yev3hU+GPrD3I5/q94k3pXYQY58q6B5Bs0HB//neaGx00gyWaz'.
|
||||
'VCoV7bquCoKAnZ0dfN/f03egLGj0m3XQNE1jdnY2/+WXXy6trq'.
|
||||
'6uzP3oR5eCIFi4detW5feXL1vr679Let37zVB3/mQytjXJwmSB'.
|
||||
'wikHp9ShY0RESqObwPrr5oBERKhUKly4cIFqtUq9XufmzZtsbW'.
|
||||
'2hXvuDwTTNtxZq8TyvsLy8vLS4uLgahOHphw8elL69fNlc++qr'.
|
||||
'uFOrNXPddm1cczVL5f5P+Lv5MuOJgTGxwYbZpZsCdeAq8M1Bcw'.
|
||||
'CGYeC6LtVqlRMnTjAyMkKn0yGXyx0N0LZt03Ec1zCMSrfXO37v'.
|
||||
'zp3S769csb+/ciXt1mrNdHf3ltZ6Lca8ZpJsduhtCdb2gEFJoQ'.
|
||||
'xADYHuHDS3f32lFEEQUK/XGRkZoVAocP78eZaXl9FaI/Jq25Uk'.
|
||||
'yWHAYrHozM/PlxYWFibTND32sFbLXrtyxVz76qukXas1M61WTW'.
|
||||
'm99gx+20TdN9jqtfjP7QzOwwYNp037Zd0DukDnIByA1pqdnR2+'.
|
||||
'++472u02Z8+eZWJiAsMwDsEBRNGBzYJpmsaJEyfyX3zxxdLS0t'.
|
||||
'KlVqu1dP3q1cLta9ekU6u1dat1J9b6Sk9kraV1rYXegW7apDYw'.
|
||||
'kFY6fPc4MNTw88bwfZ/NzU2UUnieRxAEiAiGcXiXfcigiIjruo'.
|
||||
'VyubxkWdbK7fX1xWvffFMInjzBM82uMT5+p++6V1UUrSe7u03t'.
|
||||
'+8lezlKt3gHyl0aSJDQaDa5fv876+vo+w6FzDq1BpZRsb2/bly'.
|
||||
'9f9vL5/Njdu3fzG0+eMJHNxsfn532vXN5NPG/7abPZal6/Hvfe'.
|
||||
'kroPHfsm98f7AHW9Xo+//vrrlmVZm71+37QNw3JnZ9PK4uJGpV'.
|
||||
'pt4Dh+vLGhsrmcfv1iHzu01m89HjIdCon2fb8TBMHtvYeRUn50'.
|
||||
'1Oj4vqp3Ok1f5LYSadfr9dQfDN642P/XeF2DA+SBAuA4jkOhUK'.
|
||||
'BQKESO43S11p3BYBDt7u4y+CtB/i/q7jp1GMiw2AAAAABJRU5E'.
|
||||
'rkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: ppl_blue.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[3][0]= 2284 ;
|
||||
$this->imgdata_large[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFRAiTZAL3gAACHlJREFUeJy9mGtv29YZgJ9zKF'.
|
||||
'F3y/Q9jh05tuQkarKgbYasde0UBdZgwNou/Vqga/sD9mP2B4a1'.
|
||||
'BbZ9atFPxb5sqOtmXbI19bqsluPYiR3HN90vFEWRZx/IJI5zqa'.
|
||||
'x0OwBBSgR5Hj7v+55zSEFXTUgIJyA9C6/9RsjMjAyFIxxJCDc7'.
|
||||
'iBqKgyZACGg3G2x9+xXf/fG33P3mC9qNKsp1O+1JdkEnQTdgIO'.
|
||||
'ttCSMUi8gj072MnugllAyB9G8rBGi6RsToJTF6iuRoFi1kHKZf'.
|
||||
'7fB8Iggj0/Dy23D2dakNTR3JDsXPvzstxmZGRMER1EwHhQAEgE'.
|
||||
'CLhIkPD6InY9S3djGLJVBtQP1Qb4HDAyoJYQOOZkPx49nhTH9i'.
|
||||
'7MUBGT7egxkJgd70wZS/CUkoZtA/fRoE1DZ2ACiv52ibReCp4e'.
|
||||
'7CIEHomxDiuVdGTqUnf/ZeOjR8fpiVXZul5ZrY3bWwbdcLr/dA'.
|
||||
'AAIpAwQjUWIjQ+g9HZvswiCgBVF9/SI6OSLGzo0i+oLi6+Utbq'.
|
||||
'+bKEftgwOE/0Ohocf66M+cBjo22U2RQLIHMhmYnvaOpR9S8bSU'.
|
||||
'UqCURGpRkuMZMm9cIvPGJZLj0yBjT2LprkiSkykx9cuXIhOnUs'.
|
||||
'm+QNC2XdG02ggBTcvFabsPWwTPpBAChSCgh4kYBpoeplWp47Qs'.
|
||||
'7EYDt21xINzd5GCAxLExRl89Z+nHjpbKMmjbmkgfDzI0JEW53K'.
|
||||
'Jaa6NcAOEX8v52uJzsBlAS6u0hcnTIccPRqhWPCUcLD+s1EaUp'.
|
||||
'HCEhEMCyHNpt9SjgIU12A6iw6xb123vYhaaKjB9tlgMD5X+uBp'.
|
||||
'zdkpg6azA8EaNQtKlVba+Xez4eCntnJrsDdFsW5nYFpxlFN846'.
|
||||
'DXe8utkM4mhi+EgQmjYbS2WqexZKk6BpjwJ2YlK5VjeA3pNDiH'.
|
||||
'YjRWPzPE7tmBo8EWwGhkXx+z3uXL7D3rU97LIF8RBEAl6lK/Uo'.
|
||||
'6JNM1rZ2aTcr3eUgIQOGTgbdwXMGyRejenLYTvQGbAdRuetSud'.
|
||||
'OivVuFZgtCEgICghICnZoMhmlVTPR49LCAEkQUhk/B7KXe0MWf'.
|
||||
'nxj8xVR/cDheK14WZmtVMJSBnlGoN6FmQq0FLfdwJgORKPHRo/'.
|
||||
'Snzx4G0F/FjJ4KiOdmjPCrrx8bffnMybMv9MQGNG3rzlVqtR1B'.
|
||||
'sh/CYXCD4Aag1oCW7ZnUOjSp6WFi/QNEB8Y7BfTNjZyCmUvJ0I'.
|
||||
'XXT47MTp98Ybon9VZCk8cVazfqlNargsY34G7ByAlIjkHd9CCr'.
|
||||
'LbBdiHViUgiECuDKYCdz8b2cywREdiYZOj8zNnLuzOTzx6ODp+'.
|
||||
'OaGaqwVzBFqz0Idhz2loE7YEwBLaAJLQcKbW8qjAcBF5Jh0AMP'.
|
||||
'IOHe6kxgtb3UMO2OxkF//ffK28nQqxfvm3szrtnDVa799Qb/+v'.
|
||||
'NtsbNSpm3tAv8B+w7Ub0FhAyoBcMPec9oK6raXk48ziQBXQcmC'.
|
||||
'pT3YqHa0mpEBkTR6wz/Jjo2cy04+fzwxdDquNfQKO7sFUbpu0c'.
|
||||
'wp3JoAYsA42Bbkl4GCryUNDEM7Avm6Z/CgSYBWG8pNuFuDu1Wo'.
|
||||
'tjoxKIJGeHIiM/jmK9NnX5ycuJQMtUcqXPvLDTa+qIie4hAJ1U'.
|
||||
'vdrmO2HaDfB931twJgAn1A4lGT96obPHPLBbhVgUoTHHWo9aAA'.
|
||||
'JVAKpyKEmQNzWRENAsL18ycKjAFN/9gCNvzLB/390MMmE7pnDi'.
|
||||
'Bvwt0K5Jv3O+0oB22nJ1Vvjb/UMhOpcKknqN1OiMB2DNHU2G5s'.
|
||||
'sVndpGJVcZXjX1IAlvw9PmhRQcOFPhsSDkiBrQR1G7brgs0a7D'.
|
||||
'ag3FK4rguqBXarI4Nt1SJv5gls7TEWtJDRBO2GwnIs8maevFnA'.
|
||||
'Gx6awLZvzeTBu4kFbLigijC47pscpx0xyDfkvtUEnlarCDtrUC'.
|
||||
't2HGIhvPHVdVwqjTIrxRU2a5uUrYoP0QZ2gMvACl7+3V/LuKDq'.
|
||||
'sJuDy597516+CEezIHXv7vcgXQu2l+Bvn8He9Y4AE4kgk5P9DE'.
|
||||
'R6aFdq5Et5Nit3yTf3m9sBcsAN3+D98c0Fit5JawE25r1zg1Fo'.
|
||||
'5B8GFD7g+nVYnu8EUEop9XTa0N/9dUbqcphP/rDJzbUClVbpgR'.
|
||||
'y2fXM3fND95qj75J8AC6BWPINfVSBieK+x+6cS5UCzCLu3oFV9'.
|
||||
'GqCMx2NGOp2Znpv7aXZudsool3T5J/179sxVlHJ4kGPrP2COBX'.
|
||||
'/7DmiApWCjxIMXpYNznYuXM+6TAKWUMppOZzLvv//ery5cuDCT'.
|
||||
'SqVS336bCwr1JfAPB9r+2KAFwJS+OcETzZHz/7v3etl6ipz77X'.
|
||||
'GAMh6PG+l0OjM3NzczOzs3k0pNnFlbW43+e/GKtMqrblSsF03V'.
|
||||
'WHcJA0PjIAzvg9JTze2H67g9DjAwOTmZ+uCDD96anZ2dnZiYmF'.
|
||||
'5dW41++Lvfa1fnr7qllVK9103mXNTnJgPA+YugsvB3HTaEl+Qs'.
|
||||
'AZ/yeHPPDCiTyaRx5syZbGoilV1dW00szC9oV+avusuLy0Xd0X'.
|
||||
'MgFkDM+zkYBZEHV8f7wwKu84zmngQoNU0LaZoWUa4K31y5qX/8'.
|
||||
'4cfyyvwVN5/L10NOKNeg8UmDxoKF5Vfj1xXAgD0JrgAcvBDfel'.
|
||||
'a4g4AykUgY6XR6emJiIru2ttZXq9S0K19eUcuLy8WQE8o5OAsN'.
|
||||
'Ggsmpl+NpoL1g9X4UBU+C9xDgEKIwNTUVOqdd955M9mbnJ3/cj'.
|
||||
'6Vu5aTheXCQXNdVeMzAwJSCGEA2XKpnF1cXIzlFnOVhJPIKdR+'.
|
||||
'c88ctq4AlVKsrKzw0UcfKcC5uXqzXnNqSzb2pwLxOHP/l7Z/BN'.
|
||||
'eB01LKt4HTrusKvGr8jB+hGn8MQAkYQMrfw4Nq/MFPtf+rdvDb'.
|
||||
'k8QL+/5Z4Uepxm7bfwHuTAVUWpWaqAAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: ppl_blue.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[3][0]= 2284 ;
|
||||
$this->imgdata_large[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFRAiTZAL3gAACHlJREFUeJy9mGtv29YZgJ9zKF'.
|
||||
'F3y/Q9jh05tuQkarKgbYasde0UBdZgwNou/Vqga/sD9mP2B4a1'.
|
||||
'BbZ9atFPxb5sqOtmXbI19bqsluPYiR3HN90vFEWRZx/IJI5zqa'.
|
||||
'x0OwBBSgR5Hj7v+55zSEFXTUgIJyA9C6/9RsjMjAyFIxxJCDc7'.
|
||||
'iBqKgyZACGg3G2x9+xXf/fG33P3mC9qNKsp1O+1JdkEnQTdgIO'.
|
||||
'ttCSMUi8gj072MnugllAyB9G8rBGi6RsToJTF6iuRoFi1kHKZf'.
|
||||
'7fB8Iggj0/Dy23D2dakNTR3JDsXPvzstxmZGRMER1EwHhQAEgE'.
|
||||
'CLhIkPD6InY9S3djGLJVBtQP1Qb4HDAyoJYQOOZkPx49nhTH9i'.
|
||||
'7MUBGT7egxkJgd70wZS/CUkoZtA/fRoE1DZ2ACiv52ibReCp4e'.
|
||||
'7CIEHomxDiuVdGTqUnf/ZeOjR8fpiVXZul5ZrY3bWwbdcLr/dA'.
|
||||
'AAIpAwQjUWIjQ+g9HZvswiCgBVF9/SI6OSLGzo0i+oLi6+Utbq'.
|
||||
'+bKEftgwOE/0Ohocf66M+cBjo22U2RQLIHMhmYnvaOpR9S8bSU'.
|
||||
'UqCURGpRkuMZMm9cIvPGJZLj0yBjT2LprkiSkykx9cuXIhOnUs'.
|
||||
'm+QNC2XdG02ggBTcvFabsPWwTPpBAChSCgh4kYBpoeplWp47Qs'.
|
||||
'7EYDt21xINzd5GCAxLExRl89Z+nHjpbKMmjbmkgfDzI0JEW53K'.
|
||||
'Jaa6NcAOEX8v52uJzsBlAS6u0hcnTIccPRqhWPCUcLD+s1EaUp'.
|
||||
'HCEhEMCyHNpt9SjgIU12A6iw6xb123vYhaaKjB9tlgMD5X+uBp'.
|
||||
'zdkpg6azA8EaNQtKlVba+Xez4eCntnJrsDdFsW5nYFpxlFN846'.
|
||||
'DXe8utkM4mhi+EgQmjYbS2WqexZKk6BpjwJ2YlK5VjeA3pNDiH'.
|
||||
'YjRWPzPE7tmBo8EWwGhkXx+z3uXL7D3rU97LIF8RBEAl6lK/Uo'.
|
||||
'6JNM1rZ2aTcr3eUgIQOGTgbdwXMGyRejenLYTvQGbAdRuetSud'.
|
||||
'OivVuFZgtCEgICghICnZoMhmlVTPR49LCAEkQUhk/B7KXe0MWf'.
|
||||
'nxj8xVR/cDheK14WZmtVMJSBnlGoN6FmQq0FLfdwJgORKPHRo/'.
|
||||
'Snzx4G0F/FjJ4KiOdmjPCrrx8bffnMybMv9MQGNG3rzlVqtR1B'.
|
||||
'sh/CYXCD4Aag1oCW7ZnUOjSp6WFi/QNEB8Y7BfTNjZyCmUvJ0I'.
|
||||
'XXT47MTp98Ybon9VZCk8cVazfqlNargsY34G7ByAlIjkHd9CCr'.
|
||||
'LbBdiHViUgiECuDKYCdz8b2cywREdiYZOj8zNnLuzOTzx6ODp+'.
|
||||
'OaGaqwVzBFqz0Idhz2loE7YEwBLaAJLQcKbW8qjAcBF5Jh0AMP'.
|
||||
'IOHe6kxgtb3UMO2OxkF//ffK28nQqxfvm3szrtnDVa799Qb/+v'.
|
||||
'NtsbNSpm3tAv8B+w7Ub0FhAyoBcMPec9oK6raXk48ziQBXQcmC'.
|
||||
'pT3YqHa0mpEBkTR6wz/Jjo2cy04+fzwxdDquNfQKO7sFUbpu0c'.
|
||||
'wp3JoAYsA42Bbkl4GCryUNDEM7Avm6Z/CgSYBWG8pNuFuDu1Wo'.
|
||||
'tjoxKIJGeHIiM/jmK9NnX5ycuJQMtUcqXPvLDTa+qIie4hAJ1U'.
|
||||
'vdrmO2HaDfB931twJgAn1A4lGT96obPHPLBbhVgUoTHHWo9aAA'.
|
||||
'JVAKpyKEmQNzWRENAsL18ycKjAFN/9gCNvzLB/390MMmE7pnDi'.
|
||||
'Bvwt0K5Jv3O+0oB22nJ1Vvjb/UMhOpcKknqN1OiMB2DNHU2G5s'.
|
||||
'sVndpGJVcZXjX1IAlvw9PmhRQcOFPhsSDkiBrQR1G7brgs0a7D'.
|
||||
'ag3FK4rguqBXarI4Nt1SJv5gls7TEWtJDRBO2GwnIs8maevFnA'.
|
||||
'Gx6awLZvzeTBu4kFbLigijC47pscpx0xyDfkvtUEnlarCDtrUC'.
|
||||
't2HGIhvPHVdVwqjTIrxRU2a5uUrYoP0QZ2gMvACl7+3V/LuKDq'.
|
||||
'sJuDy597516+CEezIHXv7vcgXQu2l+Bvn8He9Y4AE4kgk5P9DE'.
|
||||
'R6aFdq5Et5Nit3yTf3m9sBcsAN3+D98c0Fit5JawE25r1zg1Fo'.
|
||||
'5B8GFD7g+nVYnu8EUEop9XTa0N/9dUbqcphP/rDJzbUClVbpgR'.
|
||||
'y2fXM3fND95qj75J8AC6BWPINfVSBieK+x+6cS5UCzCLu3oFV9'.
|
||||
'GqCMx2NGOp2Znpv7aXZudsool3T5J/179sxVlHJ4kGPrP2COBX'.
|
||||
'/7DmiApWCjxIMXpYNznYuXM+6TAKWUMppOZzLvv//ery5cuDCT'.
|
||||
'SqVS336bCwr1JfAPB9r+2KAFwJS+OcETzZHz/7v3etl6ipz77X'.
|
||||
'GAMh6PG+l0OjM3NzczOzs3k0pNnFlbW43+e/GKtMqrblSsF03V'.
|
||||
'WHcJA0PjIAzvg9JTze2H67g9DjAwOTmZ+uCDD96anZ2dnZiYmF'.
|
||||
'5dW41++Lvfa1fnr7qllVK9103mXNTnJgPA+YugsvB3HTaEl+Qs'.
|
||||
'AZ/yeHPPDCiTyaRx5syZbGoilV1dW00szC9oV+avusuLy0Xd0X'.
|
||||
'MgFkDM+zkYBZEHV8f7wwKu84zmngQoNU0LaZoWUa4K31y5qX/8'.
|
||||
'4cfyyvwVN5/L10NOKNeg8UmDxoKF5Vfj1xXAgD0JrgAcvBDfel'.
|
||||
'a4g4AykUgY6XR6emJiIru2ttZXq9S0K19eUcuLy8WQE8o5OAsN'.
|
||||
'Ggsmpl+NpoL1g9X4UBU+C9xDgEKIwNTUVOqdd955M9mbnJ3/cj'.
|
||||
'6Vu5aTheXCQXNdVeMzAwJSCGEA2XKpnF1cXIzlFnOVhJPIKdR+'.
|
||||
'c88ctq4AlVKsrKzw0UcfKcC5uXqzXnNqSzb2pwLxOHP/l7Z/BN'.
|
||||
'eB01LKt4HTrusKvGr8jB+hGn8MQAkYQMrfw4Nq/MFPtf+rdvDb'.
|
||||
'k8QL+/5Z4Uepxm7bfwHuTAVUWpWaqAAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: ppl_green.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[4][0]= 2854 ;
|
||||
$this->imgdata_large[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFQ4hANhluwAACrNJREFUeJytmF1zE1eagJ+3u9'.
|
||||
'XdkvUty2AbmLEtEzDBgZ0UpDBOalNTUzU3czl7tct/2n+wt3M/'.
|
||||
'NVM12SSTQQSyW2TA+QAJQogtYYFtyfrqL3WfvWj5g8AEjzfvhS'.
|
||||
'SXjk8//Zz3Pf3qCMcJAWxMKlT4kH+jwu/FknnJSUItKFHzCrKA'.
|
||||
'BggBQx5ziz/wn/yBz3hED4/oaJfSjgVoYjJJgTLTZCjohp7IGT'.
|
||||
'k5aZ4kb+bRTR30Q7djj8f/kpPMUSCFedRL6W8e8qMQNE6S4xpv'.
|
||||
'c5HrTPFubiJ3ZnlyOXV59rJYU5Z00h1c3d0brxAiUkScRijisk'.
|
||||
'6XLTyiN3s8HuAJpniXa/q8/pt8Or+0kF8oXJm5YiydWcIpOrJu'.
|
||||
'rjOQwd54AQwsMpTJYhPSoYuLQ58An/DnBQSdImXO8avsTPbqpc'.
|
||||
'lLp67OXDVzMznZLGxSs2qyIRu4at8gKHQEC50kE1icxqCAdxST'.
|
||||
'xjEA44tqaJlERl8uLWvvnX5PHuQfcCdxh5qq0aX76vj4WgWyXO'.
|
||||
'QiNgBP8IAaddr08X8+wHFmJSQhBbPAZGoSZSt5wQs6qoNC7UEd'.
|
||||
'4AEoLIQSCaCCy78Dv8Tiv1hjjW1CRj8XIAgEKqDtt9keboMJZa'.
|
||||
'vMjuzQVd3Xr9prTJo+GF/jKZea95R25Lxs8jg5qFGiwDnOS0mW'.
|
||||
'NE0rjNRIt3WbklUCA9mV3Zdz8OBT/JfCQLB0SKYVVjGFYSfx/E'.
|
||||
'26ow4e6uDujlPFQpE0FU6P8qNTHdXJdEdda0qf0itWBVM3pa/3'.
|
||||
'ccUlIECJet0cAJoeYk5EZCeS5IwEoerSxccJBwRqFFf38QCTaO'.
|
||||
'TRVFKJm3NTbtLNSyh2IkhIXsvLCesEGNCWdmwyruSD/z9kUlRc'.
|
||||
'3bqNlSxhJNJ43p5JITrOEis8Qtr0cXEpU/JT/pmO18n2vb42pU'.
|
||||
'3JnDnHMBqyPlpnoAaxhr2llv1ZUBqEGlqYwDQMsskMOcMgVL3Y'.
|
||||
'ZOQTHAcQQiIGjHCwCaiovjrv4hbcpKuJJjIcDHm685RGr4GLCx'.
|
||||
'YHkAcrLoAoDSLBiAQrMkjqybHJCbxgh+7xAC1MpsgzwRwD3qHL'.
|
||||
'WyTIBdlAa6u2rHfXaew06PV78ZZjAwleNnkolECoH5i090wOcY'.
|
||||
'+TgwYzFHiPi1zkOkXexeAMASnVU+LiyiA1wFUuaqggACLizeWw'.
|
||||
'ycMzyssmVYKkbpGyC5T+OUALk2mKLHKWf+ED/az+YW42d66YL+'.
|
||||
'aNrmEEzQCFEnKw368EgEvcN1m80eTIQIt0TFOjMJHkzNEBBYPp'.
|
||||
'sblf8QHzrORO5JaWZ5ZLl6cuJyyxpNPv4PZdoT+GyIxBfI5uUg'.
|
||||
'eJMCwP2/bIHO1JEudcgUUWOceKNq99mCvnzs5PzRcuTV4y5mRO'.
|
||||
'SMIjo47z5S7a94oQCNKgJsZwO7D/IDNg3/LLhRNXt4JohBb4aG'.
|
||||
'82GLdXcf93mQ+Y43r2RHZp+cRy6cqJK4l8MS+tdItaqiYtc0Mm'.
|
||||
'QpfJARh98HYh9IiXVcaAo58wGb+LBAjbSPgCOcoSa0wzxXtc08'.
|
||||
'/pv8mfyL+9MLVQvDJ1JVHJV6SZbFI1qtTsB+KlehRtRTGE8Afo'.
|
||||
'P4DRcAxiEudhAHjjzz+ubgX4oHowakHQOlqzICQwyVPITGVOXi'.
|
||||
'xfLF6aumzmczl5lHzMff2+fCdPaGttEkXoLQAO9B7C6EugPYby'.
|
||||
'gVPjGXc5eIbNAJPjGwiAbaAJUQv8wVG7GROkJFpyOqn/ovgLba'.
|
||||
'44L0+sDaraXb6jzq7aBQWjBOyUoHcaopOgmaA3IRyNDZnA1HjO'.
|
||||
'HSBkr7eEFDAEngHrQCf+/s2A8cSiSkqcKUeeTjwFy2Jd78t3+L'.
|
||||
'TR4itIiBLwLQhzkJyB5Cx4HXDaENVQCBAQcRqFIHTRaBIvuYXg'.
|
||||
'AdsouuNxEL0ZUBHnSQp66R73zYfUtQ6OytKT8RckQAJQoLtgO5'.
|
||||
'BJgj0D/WfgdyHaAHx8THoUcbGx8ciwhUl3bDEiToURPooeI7pH'.
|
||||
'MziK9Yd9nU5a6GgKjOH41vsgI4hAcyC5AZkapF+AoYNrjjsuhx'.
|
||||
'FbtPmeB5ykyQQzTPAWAQWC8S9oAI0QRRuPb9jkmyMZNAOTklvC'.
|
||||
'GGYZaFkGmkVAh8h4DtKFMIBunG+pB5B5AIkGBDsQ+qBiL20caj'.
|
||||
'zhJknq5KlgMkLjJHJos4kYEbFJi5vc5eYbATVN02bNWe19+32t'.
|
||||
'aJWlFm3wbf8Rz5NbDFJdlOFBF/g7cBf0JkrbBb+F6j1DOduEkU'.
|
||||
'8bWCOiSofPWadBnSZDWmgUkEMGhZCINut8S/0NBtPptFlZrBSu'.
|
||||
'vnt1+ndnflfIp9OJ/279Ubbbd+lP7KBKPoEBsgnqLph/BRzwdS'.
|
||||
'LnBUFvHcfdpRsGPAGqwMco6jynz+e0SPKYCHMfLX5VKHwcenR+'.
|
||||
'Igd1XTcqlUr+xn/cePv91fevzy8sLO2OtrOpWkqL7gXKSAVRdh'.
|
||||
'ZFEmEXoYkwBNqovoc/3GHH3aUR+jwC1oD/AWrANi4hGwyBzqEG'.
|
||||
'Vvb77Dgi0eT1VZzJZMxKpVJYXV1dXF1dXVm6sPSvruue3Xzcyj'.
|
||||
'6/syvDzwj0lNazK6Fj5LFCRZouZpBABj6jXouu3+Np6HNvDHaf'.
|
||||
'g91t74msbMuOJicnSSaTKKUQEUQEpRSO69But1/dB0VEm5uby9'.
|
||||
'y4cWNpdXX1+sLCworrume//PuXpeqnVeOban0U1PW2kcx+O9L7'.
|
||||
'Te9sUB4lWFR9SqNtNGcHx+/RDD2+Am4D94CnQA8OjjlEhMnyJC'.
|
||||
'srK8zOzu7BiYioMAzZ2Njg9u3brwIqpSSXy2WXl5eXLly4sOo4'.
|
||||
'zoV6vV6oflrVP/7Tx8Hmw1Zb6ydqmpWp7ha8h4O3gjOhzVANmF'.
|
||||
'XPMNQWvdDnCXCXuHR+APqH4fbCtm2mp6eZn59H13WJuYXRaKSU'.
|
||||
'UiSTyVcBdV3XDcOwRaTU7/en19bWCn/79G+JL/76RbhZ22y7u+'.
|
||||
'6ahl71nPDz/nO17m7wAxlabFOihy4+DvAcqAMbPzZ3OFzX5dmz'.
|
||||
'Z2iahoiosUUVhiGNRgPHcV4GzGQy5uLiYuH8+fMzo9FoslarJW'.
|
||||
'9+elP75E+fBJu1zY7qqpqBUW3T/niohnVvy+1zm5aVtp+WE2XT'.
|
||||
'nrHFzbjh1tYLz3XdPjD4R3BKKba2tqhWq4dzUO3noBPn4H5PKy'.
|
||||
'LaO++8U7hx48byhQsXVne7u6tf3/v64t3P7mbq9+odt+OuaWi3'.
|
||||
'PLxbW2ytubjbQCgiMnt6VlaurWgz0zM0m02q1WrUaDSUUuqI56'.
|
||||
'ivDxE5MCgiYllWtlwuL5mmufLV/a/O/uXPf9Ff1F+80Lv6Yx29'.
|
||||
'2qHzyZBh3cdvc7gaTZuZkzPh/Py8ACqVSv1/uPZDKXUAGEWRtF'.
|
||||
'qtxEcffZTL5XLF+2v39fqjeivshA/TpP83JLwzYFBzcA4370Cc'.
|
||||
'S81nTRBUs9lkOByi1GuOPI4Rh3+26JZlnSkWi781DOPXvV4v3+'.
|
||||
'/2G0R8kSBxB/jew+tERK+c49m2TblcxrZtXNfl+fPneJ6HZVmU'.
|
||||
'y2VJJpNyaJ9TSinlOA5bW1u4rntkQA0oAG8D54gb9W3ianxM3A'.
|
||||
'e/cn73U3Hq1Cm5du2aPjs7a+ztcSIShmE4ajQa6tatWzQajZ+0'.
|
||||
'fbiKI+It4SvijVUj7kL2qvGfgkskEqTTaZmcnDROnTplJhIJTU'.
|
||||
'QiwPd9P/Q8T6XTaQzDIAiCfzjP/wFVfszuFqdHXgAAAABJRU5E'.
|
||||
'rkJggg==' ;
|
||||
//==========================================================
|
||||
// File: ppl_green.png
|
||||
//==========================================================
|
||||
$this->imgdata_large[4][0]= 2854 ;
|
||||
$this->imgdata_large[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFQ4hANhluwAACrNJREFUeJytmF1zE1eagJ+3u9'.
|
||||
'XdkvUty2AbmLEtEzDBgZ0UpDBOalNTUzU3czl7tct/2n+wt3M/'.
|
||||
'NVM12SSTQQSyW2TA+QAJQogtYYFtyfrqL3WfvWj5g8AEjzfvhS'.
|
||||
'SXjk8//Zz3Pf3qCMcJAWxMKlT4kH+jwu/FknnJSUItKFHzCrKA'.
|
||||
'BggBQx5ziz/wn/yBz3hED4/oaJfSjgVoYjJJgTLTZCjohp7IGT'.
|
||||
'k5aZ4kb+bRTR30Q7djj8f/kpPMUSCFedRL6W8e8qMQNE6S4xpv'.
|
||||
'c5HrTPFubiJ3ZnlyOXV59rJYU5Z00h1c3d0brxAiUkScRijisk'.
|
||||
'6XLTyiN3s8HuAJpniXa/q8/pt8Or+0kF8oXJm5YiydWcIpOrJu'.
|
||||
'rjOQwd54AQwsMpTJYhPSoYuLQ58An/DnBQSdImXO8avsTPbqpc'.
|
||||
'lLp67OXDVzMznZLGxSs2qyIRu4at8gKHQEC50kE1icxqCAdxST'.
|
||||
'xjEA44tqaJlERl8uLWvvnX5PHuQfcCdxh5qq0aX76vj4WgWyXO'.
|
||||
'QiNgBP8IAaddr08X8+wHFmJSQhBbPAZGoSZSt5wQs6qoNC7UEd'.
|
||||
'4AEoLIQSCaCCy78Dv8Tiv1hjjW1CRj8XIAgEKqDtt9keboMJZa'.
|
||||
'vMjuzQVd3Xr9prTJo+GF/jKZea95R25Lxs8jg5qFGiwDnOS0mW'.
|
||||
'NE0rjNRIt3WbklUCA9mV3Zdz8OBT/JfCQLB0SKYVVjGFYSfx/E'.
|
||||
'26ow4e6uDujlPFQpE0FU6P8qNTHdXJdEdda0qf0itWBVM3pa/3'.
|
||||
'ccUlIECJet0cAJoeYk5EZCeS5IwEoerSxccJBwRqFFf38QCTaO'.
|
||||
'TRVFKJm3NTbtLNSyh2IkhIXsvLCesEGNCWdmwyruSD/z9kUlRc'.
|
||||
'3bqNlSxhJNJ43p5JITrOEis8Qtr0cXEpU/JT/pmO18n2vb42pU'.
|
||||
'3JnDnHMBqyPlpnoAaxhr2llv1ZUBqEGlqYwDQMsskMOcMgVL3Y'.
|
||||
'ZOQTHAcQQiIGjHCwCaiovjrv4hbcpKuJJjIcDHm685RGr4GLCx'.
|
||||
'YHkAcrLoAoDSLBiAQrMkjqybHJCbxgh+7xAC1MpsgzwRwD3qHL'.
|
||||
'WyTIBdlAa6u2rHfXaew06PV78ZZjAwleNnkolECoH5i090wOcY'.
|
||||
'+TgwYzFHiPi1zkOkXexeAMASnVU+LiyiA1wFUuaqggACLizeWw'.
|
||||
'ycMzyssmVYKkbpGyC5T+OUALk2mKLHKWf+ED/az+YW42d66YL+'.
|
||||
'aNrmEEzQCFEnKw368EgEvcN1m80eTIQIt0TFOjMJHkzNEBBYPp'.
|
||||
'sblf8QHzrORO5JaWZ5ZLl6cuJyyxpNPv4PZdoT+GyIxBfI5uUg'.
|
||||
'eJMCwP2/bIHO1JEudcgUUWOceKNq99mCvnzs5PzRcuTV4y5mRO'.
|
||||
'SMIjo47z5S7a94oQCNKgJsZwO7D/IDNg3/LLhRNXt4JohBb4aG'.
|
||||
'82GLdXcf93mQ+Y43r2RHZp+cRy6cqJK4l8MS+tdItaqiYtc0Mm'.
|
||||
'QpfJARh98HYh9IiXVcaAo58wGb+LBAjbSPgCOcoSa0wzxXtc08'.
|
||||
'/pv8mfyL+9MLVQvDJ1JVHJV6SZbFI1qtTsB+KlehRtRTGE8Afo'.
|
||||
'P4DRcAxiEudhAHjjzz+ubgX4oHowakHQOlqzICQwyVPITGVOXi'.
|
||||
'xfLF6aumzmczl5lHzMff2+fCdPaGttEkXoLQAO9B7C6EugPYby'.
|
||||
'gVPjGXc5eIbNAJPjGwiAbaAJUQv8wVG7GROkJFpyOqn/ovgLba'.
|
||||
'44L0+sDaraXb6jzq7aBQWjBOyUoHcaopOgmaA3IRyNDZnA1HjO'.
|
||||
'HSBkr7eEFDAEngHrQCf+/s2A8cSiSkqcKUeeTjwFy2Jd78t3+L'.
|
||||
'TR4itIiBLwLQhzkJyB5Cx4HXDaENVQCBAQcRqFIHTRaBIvuYXg'.
|
||||
'AdsouuNxEL0ZUBHnSQp66R73zYfUtQ6OytKT8RckQAJQoLtgO5'.
|
||||
'BJgj0D/WfgdyHaAHx8THoUcbGx8ciwhUl3bDEiToURPooeI7pH'.
|
||||
'MziK9Yd9nU5a6GgKjOH41vsgI4hAcyC5AZkapF+AoYNrjjsuhx'.
|
||||
'FbtPmeB5ykyQQzTPAWAQWC8S9oAI0QRRuPb9jkmyMZNAOTklvC'.
|
||||
'GGYZaFkGmkVAh8h4DtKFMIBunG+pB5B5AIkGBDsQ+qBiL20caj'.
|
||||
'zhJknq5KlgMkLjJHJos4kYEbFJi5vc5eYbATVN02bNWe19+32t'.
|
||||
'aJWlFm3wbf8Rz5NbDFJdlOFBF/g7cBf0JkrbBb+F6j1DOduEkU'.
|
||||
'8bWCOiSofPWadBnSZDWmgUkEMGhZCINut8S/0NBtPptFlZrBSu'.
|
||||
'vnt1+ndnflfIp9OJ/279Ubbbd+lP7KBKPoEBsgnqLph/BRzwdS'.
|
||||
'LnBUFvHcfdpRsGPAGqwMco6jynz+e0SPKYCHMfLX5VKHwcenR+'.
|
||||
'Igd1XTcqlUr+xn/cePv91fevzy8sLO2OtrOpWkqL7gXKSAVRdh'.
|
||||
'ZFEmEXoYkwBNqovoc/3GHH3aUR+jwC1oD/AWrANi4hGwyBzqEG'.
|
||||
'Vvb77Dgi0eT1VZzJZMxKpVJYXV1dXF1dXVm6sPSvruue3Xzcyj'.
|
||||
'6/syvDzwj0lNazK6Fj5LFCRZouZpBABj6jXouu3+Np6HNvDHaf'.
|
||||
'g91t74msbMuOJicnSSaTKKUQEUQEpRSO69But1/dB0VEm5uby9'.
|
||||
'y4cWNpdXX1+sLCworrume//PuXpeqnVeOban0U1PW2kcx+O9L7'.
|
||||
'Te9sUB4lWFR9SqNtNGcHx+/RDD2+Am4D94CnQA8OjjlEhMnyJC'.
|
||||
'srK8zOzu7BiYioMAzZ2Njg9u3brwIqpSSXy2WXl5eXLly4sOo4'.
|
||||
'zoV6vV6oflrVP/7Tx8Hmw1Zb6ydqmpWp7ha8h4O3gjOhzVANmF'.
|
||||
'XPMNQWvdDnCXCXuHR+APqH4fbCtm2mp6eZn59H13WJuYXRaKSU'.
|
||||
'UiSTyVcBdV3XDcOwRaTU7/en19bWCn/79G+JL/76RbhZ22y7u+'.
|
||||
'6ahl71nPDz/nO17m7wAxlabFOihy4+DvAcqAMbPzZ3OFzX5dmz'.
|
||||
'Z2iahoiosUUVhiGNRgPHcV4GzGQy5uLiYuH8+fMzo9FoslarJW'.
|
||||
'9+elP75E+fBJu1zY7qqpqBUW3T/niohnVvy+1zm5aVtp+WE2XT'.
|
||||
'nrHFzbjh1tYLz3XdPjD4R3BKKba2tqhWq4dzUO3noBPn4H5PKy'.
|
||||
'LaO++8U7hx48byhQsXVne7u6tf3/v64t3P7mbq9+odt+OuaWi3'.
|
||||
'PLxbW2ytubjbQCgiMnt6VlaurWgz0zM0m02q1WrUaDSUUuqI56'.
|
||||
'ivDxE5MCgiYllWtlwuL5mmufLV/a/O/uXPf9Ff1F+80Lv6Yx29'.
|
||||
'2qHzyZBh3cdvc7gaTZuZkzPh/Py8ACqVSv1/uPZDKXUAGEWRtF'.
|
||||
'qtxEcffZTL5XLF+2v39fqjeivshA/TpP83JLwzYFBzcA4370Cc'.
|
||||
'S81nTRBUs9lkOByi1GuOPI4Rh3+26JZlnSkWi781DOPXvV4v3+'.
|
||||
'/2G0R8kSBxB/jew+tERK+c49m2TblcxrZtXNfl+fPneJ6HZVmU'.
|
||||
'y2VJJpNyaJ9TSinlOA5bW1u4rntkQA0oAG8D54gb9W3ianxM3A'.
|
||||
'e/cn73U3Hq1Cm5du2aPjs7a+ztcSIShmE4ajQa6tatWzQajZ+0'.
|
||||
'fbiKI+It4SvijVUj7kL2qvGfgkskEqTTaZmcnDROnTplJhIJTU'.
|
||||
'QiwPd9P/Q8T6XTaQzDIAiCfzjP/wFVfszuFqdHXgAAAABJRU5E'.
|
||||
'rkJggg==' ;
|
||||
|
||||
|
||||
//==========================================================
|
||||
// File: pp_red.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[0][0]= 384 ;
|
||||
$this->imgdata_small[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'.
|
||||
'B3RJTUUH0wMJFhouFobZrQAAAQ1JREFUeJyV1dFtwyAQBuD/og'.
|
||||
'xQdYxa8gRY6hJ0jK6QdohMkTEuE5wUj5ERen05IoLvID7Jkn2G'.
|
||||
'j8MgTMyMXqRlUQBYq9ydmaL2h1cwqD7l30t+L1iwlbYFRegY7I'.
|
||||
'SHjkEifGg4ww3aBa/l4+9AhxWWr/dLhEunXUGHq6yGniw3QkOw'.
|
||||
'3jJ7UBd82n/VVAlAtvsfp98lAj2sAJOhU4AeQ7DC1ubVBODWDJ'.
|
||||
'TtCsEWa6u5M1NeFs1NzgdtuhHGtj+9Q2IDppQUAL6Cyrlz0gDN'.
|
||||
'ohSMiJCt861672EiAhEhESG3woJ9V9OKTkwRKbdqz4cHmFLSFg'.
|
||||
's69+LvAZKdeZ/n89uLnd2g0S+gjd5g8zzjH5Y/eLLi+NPEAAAA'.
|
||||
'AElFTkSuQmCC' ;
|
||||
//==========================================================
|
||||
// File: pp_red.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[0][0]= 384 ;
|
||||
$this->imgdata_small[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'.
|
||||
'B3RJTUUH0wMJFhouFobZrQAAAQ1JREFUeJyV1dFtwyAQBuD/og'.
|
||||
'xQdYxa8gRY6hJ0jK6QdohMkTEuE5wUj5ERen05IoLvID7Jkn2G'.
|
||||
'j8MgTMyMXqRlUQBYq9ydmaL2h1cwqD7l30t+L1iwlbYFRegY7I'.
|
||||
'SHjkEifGg4ww3aBa/l4+9AhxWWr/dLhEunXUGHq6yGniw3QkOw'.
|
||||
'3jJ7UBd82n/VVAlAtvsfp98lAj2sAJOhU4AeQ7DC1ubVBODWDJ'.
|
||||
'TtCsEWa6u5M1NeFs1NzgdtuhHGtj+9Q2IDppQUAL6Cyrlz0gDN'.
|
||||
'ohSMiJCt861672EiAhEhESG3woJ9V9OKTkwRKbdqz4cHmFLSFg'.
|
||||
's69+LvAZKdeZ/n89uLnd2g0S+gjd5g8zzjH5Y/eLLi+NPEAAAA'.
|
||||
'AElFTkSuQmCC' ;
|
||||
|
||||
//==========================================================
|
||||
// File: pp_orange.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[1][0]= 403 ;
|
||||
$this->imgdata_small[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'.
|
||||
'B3RJTUUH0wMJFhwAnApz5AAAASBJREFUeJyN1dFthDAMBuDf7S'.
|
||||
'3BCm2VCRKpS4QxbhikW6IewzcBqm6Fm6JyH7iEEByCn5AJH38g'.
|
||||
'BBIRHNUzBAWAGNfe/SrUGv92CtNt309BrfFdMGPjvt9CD8Fyml'.
|
||||
'ZZaDchRgA/59FDMD18pvNoNyHxMnUmgLmPHoJ+CqqfMaNAH22C'.
|
||||
'fgqKRwR+GRpxGjXBEiuXDBWQhTK3plxijyWWvtKVS5KNG1xM8I'.
|
||||
'OBr7geV1WupDqpmTAPKjCqLhxk/z0PImQmjKrAuI6vMXlhFroD'.
|
||||
'vfdqITXWqg2YMSJEAFcReoag6UXU2DzPG8w5t09YYsAyLWvHrL'.
|
||||
'HUy6D3XmvMAAhAay8kAJpBosX4vt0G4+4Jam6s6Rz1fgFG0ncA'.
|
||||
'f3XfOQcA+Acv5IUSdQw9hgAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: pp_orange.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[1][0]= 403 ;
|
||||
$this->imgdata_small[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'.
|
||||
'B3RJTUUH0wMJFhwAnApz5AAAASBJREFUeJyN1dFthDAMBuDf7S'.
|
||||
'3BCm2VCRKpS4QxbhikW6IewzcBqm6Fm6JyH7iEEByCn5AJH38g'.
|
||||
'BBIRHNUzBAWAGNfe/SrUGv92CtNt309BrfFdMGPjvt9CD8Fyml'.
|
||||
'ZZaDchRgA/59FDMD18pvNoNyHxMnUmgLmPHoJ+CqqfMaNAH22C'.
|
||||
'fgqKRwR+GRpxGjXBEiuXDBWQhTK3plxijyWWvtKVS5KNG1xM8I'.
|
||||
'OBr7geV1WupDqpmTAPKjCqLhxk/z0PImQmjKrAuI6vMXlhFroD'.
|
||||
'vfdqITXWqg2YMSJEAFcReoag6UXU2DzPG8w5t09YYsAyLWvHrL'.
|
||||
'HUy6D3XmvMAAhAay8kAJpBosX4vt0G4+4Jam6s6Rz1fgFG0ncA'.
|
||||
'f3XfOQcA+Acv5IUSdQw9hgAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: pp_pink.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[2][0]= 419 ;
|
||||
$this->imgdata_small[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'.
|
||||
'B3RJTUUH0wMJFhsQzvz1RwAAATBJREFUeJyd1MFthDAQheF/oi'.
|
||||
'gF+JYWQKICkCJRA1vGtrDbxFbhGvY0HVjCLeS2BeTiHFgTB2wg'.
|
||||
'eRISstCnmcG2qCpbuXf3ADBQzWsPfZfS9y9HsEu4/Fo33Wf4Fx'.
|
||||
'gxL3a1XkI3wbTNXHLoboVeLFUYDqObYBy+Fw/Uh9DdCmtOwIjF'.
|
||||
'YvG76CZoOhNGRmpO8zz30CJoOhMAqlDxFzQLppgXj2XaNlP7FF'.
|
||||
'GLL7ccMYCBgZERgCvXLBrfi2DEclmiKZwFY4tp6sW26bVfnede'.
|
||||
'e5Hc5dC2bUgrXGKqWrwcXnNYDjmCrcCIiQgDcFYV05kQ8SXmnB'.
|
||||
'NgPiVN06wrTDGAhz5EWY/FOccTk+cTnHM/YNu2YYllgFxCWuUM'.
|
||||
'ikzGx+2Gc+4N+CoJW8n+5a2UKm2aBoBvGA6L7wfl8aoAAAAASU'.
|
||||
'VORK5CYII=' ;
|
||||
//==========================================================
|
||||
// File: pp_pink.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[2][0]= 419 ;
|
||||
$this->imgdata_small[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'.
|
||||
'B3RJTUUH0wMJFhsQzvz1RwAAATBJREFUeJyd1MFthDAQheF/oi'.
|
||||
'gF+JYWQKICkCJRA1vGtrDbxFbhGvY0HVjCLeS2BeTiHFgTB2wg'.
|
||||
'eRISstCnmcG2qCpbuXf3ADBQzWsPfZfS9y9HsEu4/Fo33Wf4Fx'.
|
||||
'gxL3a1XkI3wbTNXHLoboVeLFUYDqObYBy+Fw/Uh9DdCmtOwIjF'.
|
||||
'YvG76CZoOhNGRmpO8zz30CJoOhMAqlDxFzQLppgXj2XaNlP7FF'.
|
||||
'GLL7ccMYCBgZERgCvXLBrfi2DEclmiKZwFY4tp6sW26bVfnede'.
|
||||
'e5Hc5dC2bUgrXGKqWrwcXnNYDjmCrcCIiQgDcFYV05kQ8SXmnB'.
|
||||
'NgPiVN06wrTDGAhz5EWY/FOccTk+cTnHM/YNu2YYllgFxCWuUM'.
|
||||
'ikzGx+2Gc+4N+CoJW8n+5a2UKm2aBoBvGA6L7wfl8aoAAAAASU'.
|
||||
'VORK5CYII=' ;
|
||||
|
||||
|
||||
//==========================================================
|
||||
// File: pp_blue.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[3][0]= 883 ;
|
||||
$this->imgdata_small[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAACi1'.
|
||||
'BMVEX///8AAAAAADMAAGYAAJkAAMwAAP8zAAAzADMzAGYzAJkz'.
|
||||
'AMwzAP9mAABmADNmAGZmAJlmAMxmAP+ZAACZADOZAGaZAJmZAM'.
|
||||
'yZAP/MAADMADPMAGbMAJnMAMzMAP//AAD/ADP/AGb/AJn/AMz/'.
|
||||
'AP8AMwAAMzMAM2YAM5kAM8wAM/8zMwAzMzMzM2YzM5kzM8wzM/'.
|
||||
'9mMwBmMzNmM2ZmM5lmM8xmM/+ZMwCZMzOZM2aZM5mZM8yZM//M'.
|
||||
'MwDMMzPMM2bMM5nMM8zMM///MwD/MzP/M2b/M5n/M8z/M/8AZg'.
|
||||
'AAZjMAZmYAZpkAZswAZv8zZgAzZjMzZmYzZpkzZswzZv9mZgBm'.
|
||||
'ZjNmZmZmZplmZsxmZv+ZZgCZZjOZZmaZZpmZZsyZZv/MZgDMZj'.
|
||||
'PMZmbMZpnMZszMZv//ZgD/ZjP/Zmb/Zpn/Zsz/Zv8AmQAAmTMA'.
|
||||
'mWYAmZkAmcwAmf8zmQAzmTMzmWYzmZkzmcwzmf9mmQBmmTNmmW'.
|
||||
'ZmmZlmmcxmmf+ZmQCZmTOZmWaZmZmZmcyZmf/MmQDMmTPMmWbM'.
|
||||
'mZnMmczMmf//mQD/mTP/mWb/mZn/mcz/mf8AzAAAzDMAzGYAzJ'.
|
||||
'kAzMwAzP8zzAAzzDMzzGYzzJkzzMwzzP9mzABmzDNmzGZmzJlm'.
|
||||
'zMxmzP+ZzACZzDOZzGaZzJmZzMyZzP/MzADMzDPMzGbMzJnMzM'.
|
||||
'zMzP//zAD/zDP/zGb/zJn/zMz/zP8A/wAA/zMA/2YA/5kA/8wA'.
|
||||
'//8z/wAz/zMz/2Yz/5kz/8wz//9m/wBm/zNm/2Zm/5lm/8xm//'.
|
||||
'+Z/wCZ/zOZ/2aZ/5mZ/8yZ///M/wDM/zPM/2bM/5nM/8zM////'.
|
||||
'/wD//zP//2b//5n//8z///9jJVUgAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAwkWGTNerea3AAAAYUlEQVR4nHXNwQ3AIAxDUUfyoROxRZ'.
|
||||
'icARin0EBTIP3Hp1gBRqSqYo0seqjZpnngojlWBir5+b8o06lM'.
|
||||
'ha5uFKEpDZulV8l52axhVzqaCdxQp32qVSSwC1wN3fYiw7b76w'.
|
||||
'bN4SMue4/KbwAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: pp_blue.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[3][0]= 883 ;
|
||||
$this->imgdata_small[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAACi1'.
|
||||
'BMVEX///8AAAAAADMAAGYAAJkAAMwAAP8zAAAzADMzAGYzAJkz'.
|
||||
'AMwzAP9mAABmADNmAGZmAJlmAMxmAP+ZAACZADOZAGaZAJmZAM'.
|
||||
'yZAP/MAADMADPMAGbMAJnMAMzMAP//AAD/ADP/AGb/AJn/AMz/'.
|
||||
'AP8AMwAAMzMAM2YAM5kAM8wAM/8zMwAzMzMzM2YzM5kzM8wzM/'.
|
||||
'9mMwBmMzNmM2ZmM5lmM8xmM/+ZMwCZMzOZM2aZM5mZM8yZM//M'.
|
||||
'MwDMMzPMM2bMM5nMM8zMM///MwD/MzP/M2b/M5n/M8z/M/8AZg'.
|
||||
'AAZjMAZmYAZpkAZswAZv8zZgAzZjMzZmYzZpkzZswzZv9mZgBm'.
|
||||
'ZjNmZmZmZplmZsxmZv+ZZgCZZjOZZmaZZpmZZsyZZv/MZgDMZj'.
|
||||
'PMZmbMZpnMZszMZv//ZgD/ZjP/Zmb/Zpn/Zsz/Zv8AmQAAmTMA'.
|
||||
'mWYAmZkAmcwAmf8zmQAzmTMzmWYzmZkzmcwzmf9mmQBmmTNmmW'.
|
||||
'ZmmZlmmcxmmf+ZmQCZmTOZmWaZmZmZmcyZmf/MmQDMmTPMmWbM'.
|
||||
'mZnMmczMmf//mQD/mTP/mWb/mZn/mcz/mf8AzAAAzDMAzGYAzJ'.
|
||||
'kAzMwAzP8zzAAzzDMzzGYzzJkzzMwzzP9mzABmzDNmzGZmzJlm'.
|
||||
'zMxmzP+ZzACZzDOZzGaZzJmZzMyZzP/MzADMzDPMzGbMzJnMzM'.
|
||||
'zMzP//zAD/zDP/zGb/zJn/zMz/zP8A/wAA/zMA/2YA/5kA/8wA'.
|
||||
'//8z/wAz/zMz/2Yz/5kz/8wz//9m/wBm/zNm/2Zm/5lm/8xm//'.
|
||||
'+Z/wCZ/zOZ/2aZ/5mZ/8yZ///M/wDM/zPM/2bM/5nM/8zM////'.
|
||||
'/wD//zP//2b//5n//8z///9jJVUgAAAAAXRSTlMAQObYZgAAAA'.
|
||||
'FiS0dEAIgFHUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElN'.
|
||||
'RQfTAwkWGTNerea3AAAAYUlEQVR4nHXNwQ3AIAxDUUfyoROxRZ'.
|
||||
'icARin0EBTIP3Hp1gBRqSqYo0seqjZpnngojlWBir5+b8o06lM'.
|
||||
'ha5uFKEpDZulV8l52axhVzqaCdxQp32qVSSwC1wN3fYiw7b76w'.
|
||||
'bN4SMue4/KbwAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: pp_green.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[4][0]= 447 ;
|
||||
$this->imgdata_small[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'.
|
||||
'B3RJTUUH0wMJFhkLdq9eKQAAAUxJREFUeJyN1LFVwzAQxvH/8f'.
|
||||
'IeDS0FLKABlN6eIwPYAzCHB0gWYI2jj+i1ABUTQN4TRSQ7iiWZ'.
|
||||
'qxLn9Mt9ydmiqrSq930AYFiu6YdKrf/hP1gYQn6960PxwBaYMG'.
|
||||
'E9UA3dBFtVQjdBOQmBakLennK0CapRwbZRZ3N0O/IeEsqp3HKL'.
|
||||
'Smtt5pUZgTPg4gdDud+6xoS97wM2rsxxmRSoTgoVcMZsXJkBho'.
|
||||
'SmKqCuOuEtls6nmGMFPTUmxBKx/MeyNfQGLoOOiC2ddsxb1Kzv'.
|
||||
'ZzUqu5IXbGDvBJf+hDisi77qFSuhq7Xpuu66TyJLRGbsXVUPxV'.
|
||||
'SxsgkzDMt0mKT3/RcjL8C5hHnvJToXY0xYRZ4xnVKsV/S+a8YA'.
|
||||
'AvCb3s9g13UhYj+TTo93B3fApRV1FVlEAD6H42DjN9/WvzDYuJ'.
|
||||
'dL5b1/ji+/IX8EGWP4AwRii8PdFHTqAAAAAElFTkSuQmCC' ;
|
||||
//==========================================================
|
||||
// File: pp_green.png
|
||||
//==========================================================
|
||||
$this->imgdata_small[4][0]= 447 ;
|
||||
$this->imgdata_small[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsSAAALEgHS3X78AAAA'.
|
||||
'B3RJTUUH0wMJFhkLdq9eKQAAAUxJREFUeJyN1LFVwzAQxvH/8f'.
|
||||
'IeDS0FLKABlN6eIwPYAzCHB0gWYI2jj+i1ABUTQN4TRSQ7iiWZ'.
|
||||
'qxLn9Mt9ydmiqrSq930AYFiu6YdKrf/hP1gYQn6960PxwBaYMG'.
|
||||
'E9UA3dBFtVQjdBOQmBakLennK0CapRwbZRZ3N0O/IeEsqp3HKL'.
|
||||
'Smtt5pUZgTPg4gdDud+6xoS97wM2rsxxmRSoTgoVcMZsXJkBho'.
|
||||
'SmKqCuOuEtls6nmGMFPTUmxBKx/MeyNfQGLoOOiC2ddsxb1Kzv'.
|
||||
'ZzUqu5IXbGDvBJf+hDisi77qFSuhq7Xpuu66TyJLRGbsXVUPxV'.
|
||||
'SxsgkzDMt0mKT3/RcjL8C5hHnvJToXY0xYRZ4xnVKsV/S+a8YA'.
|
||||
'AvCb3s9g13UhYj+TTo93B3fApRV1FVlEAD6H42DjN9/WvzDYuJ'.
|
||||
'dL5b1/ji+/IX8EGWP4AwRii8PdFHTqAAAAAElFTkSuQmCC' ;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -8,143 +8,143 @@
|
|||
// Copyright (c) Aditus Consulting. All rights reserved.
|
||||
//========================================================================
|
||||
|
||||
class ImgData_Squares extends ImgData {
|
||||
class ImgData_Squares extends ImgData
|
||||
{
|
||||
protected $name = 'Squares';
|
||||
protected $an = array(MARK_IMG_SQUARE =>'imgdata');
|
||||
|
||||
protected $colors = array('bluegreen','blue','green',
|
||||
'lightblue','orange','purple','red','yellow');
|
||||
protected $index = array('bluegreen' =>2,'blue'=>5,'green'=>6,
|
||||
'lightblue'=>0,'orange'=>7,'purple'=>4,'red'=>3,'yellow'=>1);
|
||||
protected $colors = array('bluegreen','blue','green',
|
||||
'lightblue','orange','purple','red','yellow');
|
||||
protected $index = array('bluegreen' =>2,'blue'=>5,'green'=>6,
|
||||
'lightblue'=>0,'orange'=>7,'purple'=>4,'red'=>3,'yellow'=>1);
|
||||
protected $maxidx = 7 ;
|
||||
protected $imgdata ;
|
||||
|
||||
function ImgData_Squares () {
|
||||
//==========================================================
|
||||
//sq_lblue.png
|
||||
//==========================================================
|
||||
$this->imgdata[0][0]= 362 ;
|
||||
$this->imgdata[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFgojiPx/ygAAAPdJREFUeNpj/P377+kzHx89/c'.
|
||||
'VAHNBQ5VBX52HavPWWjg6nnDQbkXoUFTnnL7zD9PPXrz17HxCj'.
|
||||
'E6Jn6fL7H7/+ZWJgYCBGJ7IeBgYGJogofp1oehDa8OjE1IOiDa'.
|
||||
'tOrHoYGBhY0NwD0enirMDAwMDFxYRVD7ptyDrNTAU0NXix6sGu'.
|
||||
'jYGBgZOT9e/f/0xMjFyczFgVsGAKCfBza2kKzpl3hIuT1c9Xb/'.
|
||||
'PW58/foKchJqx6tmy98vbjj8cvPm/afMnXW1JShA2fNmQ9EBFc'.
|
||||
'Opnw6MGjkwm/Hlw6mQjqwaqTiRg9mDoZv//4M2/+UYJ64EBWgj'.
|
||||
'cm2hwA8l24oNDl+DMAAAAASUVORK5CYII=' ;
|
||||
public function ImgData_Squares()
|
||||
{
|
||||
//==========================================================
|
||||
//sq_lblue.png
|
||||
//==========================================================
|
||||
$this->imgdata[0][0]= 362 ;
|
||||
$this->imgdata[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAIAAADZrBkAAAAABm'.
|
||||
'JLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsRAAALEQF/ZF+RAAAA'.
|
||||
'B3RJTUUH0wMLFgojiPx/ygAAAPdJREFUeNpj/P377+kzHx89/c'.
|
||||
'VAHNBQ5VBX52HavPWWjg6nnDQbkXoUFTnnL7zD9PPXrz17HxCj'.
|
||||
'E6Jn6fL7H7/+ZWJgYCBGJ7IeBgYGJogofp1oehDa8OjE1IOiDa'.
|
||||
'tOrHoYGBhY0NwD0enirMDAwMDFxYRVD7ptyDrNTAU0NXix6sGu'.
|
||||
'jYGBgZOT9e/f/0xMjFyczFgVsGAKCfBza2kKzpl3hIuT1c9Xb/'.
|
||||
'PW58/foKchJqx6tmy98vbjj8cvPm/afMnXW1JShA2fNmQ9EBFc'.
|
||||
'Opnw6MGjkwm/Hlw6mQjqwaqTiRg9mDoZv//4M2/+UYJ64EBWgj'.
|
||||
'cm2hwA8l24oNDl+DMAAAAASUVORK5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
//sq_yellow.png
|
||||
//==========================================================
|
||||
$this->imgdata[1][0]= 338 ;
|
||||
$this->imgdata[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAWl'.
|
||||
'BMVEX////+/+H+/9/9/9v8/8P8/8H8/7v8/7n6/4P5/335/3n5'.
|
||||
'/3X4/1f4/1P3/031/w30/wn0/wPt+ADp9ADm8ADk7gDc5gDa5A'.
|
||||
'DL1ADFzgCwuACqsgClrABzeAC9M0MzAAAAAWJLR0QAiAUdSAAA'.
|
||||
'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEDlOgDj'.
|
||||
'EAAAB+SURBVHjaVcpbCsQgDEDRGERGKopjDa2a/W9zfLWj9/Nw'.
|
||||
'Ac21ZRBOtZlRN9ApzSYFaDUj79KIorRDbJNO9bN/GUSh2ZRJFJ'.
|
||||
'S18iorURBiyksO8buT0zkfYaUqzI91ckfhWhoGXTLzsDjI68Sz'.
|
||||
'pGMjrzPzauA/iXk1AtykmvgBC8UcWUdc9HkAAAAASUVORK5CYI'.
|
||||
'I=' ;
|
||||
//==========================================================
|
||||
//sq_yellow.png
|
||||
//==========================================================
|
||||
$this->imgdata[1][0]= 338 ;
|
||||
$this->imgdata[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAWl'.
|
||||
'BMVEX////+/+H+/9/9/9v8/8P8/8H8/7v8/7n6/4P5/335/3n5'.
|
||||
'/3X4/1f4/1P3/031/w30/wn0/wPt+ADp9ADm8ADk7gDc5gDa5A'.
|
||||
'DL1ADFzgCwuACqsgClrABzeAC9M0MzAAAAAWJLR0QAiAUdSAAA'.
|
||||
'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEDlOgDj'.
|
||||
'EAAAB+SURBVHjaVcpbCsQgDEDRGERGKopjDa2a/W9zfLWj9/Nw'.
|
||||
'Ac21ZRBOtZlRN9ApzSYFaDUj79KIorRDbJNO9bN/GUSh2ZRJFJ'.
|
||||
'S18iorURBiyksO8buT0zkfYaUqzI91ckfhWhoGXTLzsDjI68Sz'.
|
||||
'pGMjrzPzauA/iXk1AtykmvgBC8UcWUdc9HkAAAAASUVORK5CYI'.
|
||||
'I=' ;
|
||||
|
||||
//==========================================================
|
||||
//sq_blgr.png
|
||||
//==========================================================
|
||||
$this->imgdata[2][0]= 347 ;
|
||||
$this->imgdata[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAZl'.
|
||||
'BMVEX////0+vv0+vrz+fry+frv+Png7e/d7e/a6+zY6+250tSz'.
|
||||
'0tSyztCtztGM0NWIz9SDzdNfsLVcrrRZrbJOp61MpqtIr7dHn6'.
|
||||
'RErrZArLQ6q7M2g4kygYcsp68npa4ctr8QZ20JnqepKsl4AAAA'.
|
||||
'AWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU'.
|
||||
'1FB9MDCxYEByp8tpUAAAB7SURBVHjaVcjRFoIgDADQWZpWJpjY'.
|
||||
'MsnG//9kzIFn3McLzfArDA3MndFjrhvgfDHFBEB9pt0CVzwrY3'.
|
||||
'n2yicjhY4vTSp0nbXtN+hCV53SHDWe61dZY+/9463r2XuifHAM'.
|
||||
'0SoH+6xEcovUlCfefeFSIwfTTQ3fB+pi4lV/bTIgvmaA7a0AAA'.
|
||||
'AASUVORK5CYII=' ;
|
||||
//==========================================================
|
||||
//sq_blgr.png
|
||||
//==========================================================
|
||||
$this->imgdata[2][0]= 347 ;
|
||||
$this->imgdata[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAZl'.
|
||||
'BMVEX////0+vv0+vrz+fry+frv+Png7e/d7e/a6+zY6+250tSz'.
|
||||
'0tSyztCtztGM0NWIz9SDzdNfsLVcrrRZrbJOp61MpqtIr7dHn6'.
|
||||
'RErrZArLQ6q7M2g4kygYcsp68npa4ctr8QZ20JnqepKsl4AAAA'.
|
||||
'AWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU'.
|
||||
'1FB9MDCxYEByp8tpUAAAB7SURBVHjaVcjRFoIgDADQWZpWJpjY'.
|
||||
'MsnG//9kzIFn3McLzfArDA3MndFjrhvgfDHFBEB9pt0CVzwrY3'.
|
||||
'n2yicjhY4vTSp0nbXtN+hCV53SHDWe61dZY+/9463r2XuifHAM'.
|
||||
'0SoH+6xEcovUlCfefeFSIwfTTQ3fB+pi4lV/bTIgvmaA7a0AAA'.
|
||||
'AASUVORK5CYII=' ;
|
||||
|
||||
//==========================================================
|
||||
//sq_red.png
|
||||
//==========================================================
|
||||
$this->imgdata[3][0]= 324 ;
|
||||
$this->imgdata[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'.
|
||||
'BMVEX////++Pn99/j99ff99fb98/X98/T98PL55uj43+P24+bw'.
|
||||
'kKPvjaHviJ3teJHpxMnoL2Pjs73WW3rWNljVWXnUVnbUK1DTJk'.
|
||||
'3SUHPOBz/KQmmxPVmuOFasNFOeIkWVka/fAAAAAWJLR0QAiAUd'.
|
||||
'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEHd'.
|
||||
'ceT+8AAABtSURBVHjaVchbAkMwEAXQq6i3VrQiQfa/zDYTw8z5'.
|
||||
'PCjGt9JVWFt1XWPh1fWNdfDy+tq6WPfRUPENNKnSnXNWPB4uv2'.
|
||||
'b54nSZ8jHrMtOxvWZZZtpD4KP6xLkO9/AhzhaCOMhJh68cOjzV'.
|
||||
'/K/4Ac2cG+nBcaRuAAAAAElFTkSuQmCC' ;
|
||||
//==========================================================
|
||||
//sq_red.png
|
||||
//==========================================================
|
||||
$this->imgdata[3][0]= 324 ;
|
||||
$this->imgdata[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'.
|
||||
'BMVEX////++Pn99/j99ff99fb98/X98/T98PL55uj43+P24+bw'.
|
||||
'kKPvjaHviJ3teJHpxMnoL2Pjs73WW3rWNljVWXnUVnbUK1DTJk'.
|
||||
'3SUHPOBz/KQmmxPVmuOFasNFOeIkWVka/fAAAAAWJLR0QAiAUd'.
|
||||
'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEHd'.
|
||||
'ceT+8AAABtSURBVHjaVchbAkMwEAXQq6i3VrQiQfa/zDYTw8z5'.
|
||||
'PCjGt9JVWFt1XWPh1fWNdfDy+tq6WPfRUPENNKnSnXNWPB4uv2'.
|
||||
'b54nSZ8jHrMtOxvWZZZtpD4KP6xLkO9/AhzhaCOMhJh68cOjzV'.
|
||||
'/K/4Ac2cG+nBcaRuAAAAAElFTkSuQmCC' ;
|
||||
|
||||
//==========================================================
|
||||
//sq_pink.png
|
||||
//==========================================================
|
||||
$this->imgdata[4][0]= 445 ;
|
||||
$this->imgdata[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAApV'.
|
||||
'BMVEX////6+Pz69/v49Pr38/r17/jr4+/l3Onj2efh1ua/L+i+'.
|
||||
'q8m+Lue9Lua8qsS8LuW8LeS7pca5LOG4LN+2Y9O2YNW1ZdO1Kt'.
|
||||
'y0atC0aNGzb82zbc6zKtuzKdqycsuwa8qtJtOISZ2GRpuFN6GE'.
|
||||
'NqCDQpmCMZ+BPpd/LJ1/K519S5B9Jpx9Jpt9JZt6RY11BJZ1BJ'.
|
||||
'V0BJV0BJRzBJNvNoRtIoJUEmdZ/XbrAAAAAWJLR0QAiAUdSAAA'.
|
||||
'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYDF3iKMD'.
|
||||
'YAAACeSURBVHjaVczbEoIgGARgCiMtrexoWpaa2FHUgvd/tH4Y'.
|
||||
'BnEvv9ldhNPradPnnGBUTtPDzMRPSIF46SaBoR25dYjz3I20Lb'.
|
||||
'ek6BgQz73Il7KKpSgCO0pTHU0886J1sCe0ZYbALjGhjFnEM2es'.
|
||||
'VhZVI4d+B1QtfnV47ywCEaKeP/p7JdLejSYt0j6NIiOq1wJZIs'.
|
||||
'QTDA0ELHwhPBCwyR/Cni9cOmzJtwAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
//sq_pink.png
|
||||
//==========================================================
|
||||
$this->imgdata[4][0]= 445 ;
|
||||
$this->imgdata[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAApV'.
|
||||
'BMVEX////6+Pz69/v49Pr38/r17/jr4+/l3Onj2efh1ua/L+i+'.
|
||||
'q8m+Lue9Lua8qsS8LuW8LeS7pca5LOG4LN+2Y9O2YNW1ZdO1Kt'.
|
||||
'y0atC0aNGzb82zbc6zKtuzKdqycsuwa8qtJtOISZ2GRpuFN6GE'.
|
||||
'NqCDQpmCMZ+BPpd/LJ1/K519S5B9Jpx9Jpt9JZt6RY11BJZ1BJ'.
|
||||
'V0BJV0BJRzBJNvNoRtIoJUEmdZ/XbrAAAAAWJLR0QAiAUdSAAA'.
|
||||
'AAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYDF3iKMD'.
|
||||
'YAAACeSURBVHjaVczbEoIgGARgCiMtrexoWpaa2FHUgvd/tH4Y'.
|
||||
'BnEvv9ldhNPradPnnGBUTtPDzMRPSIF46SaBoR25dYjz3I20Lb'.
|
||||
'ek6BgQz73Il7KKpSgCO0pTHU0886J1sCe0ZYbALjGhjFnEM2es'.
|
||||
'VhZVI4d+B1QtfnV47ywCEaKeP/p7JdLejSYt0j6NIiOq1wJZIs'.
|
||||
'QTDA0ELHwhPBCwyR/Cni9cOmzJtwAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
//sq_blue.png
|
||||
//==========================================================
|
||||
$this->imgdata[5][0]= 283 ;
|
||||
$this->imgdata[5][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAQl'.
|
||||
'BMVEX////4+fz39/z19vvy8vru7/ni4+7g4fHW1ue8vteXmt6B'.
|
||||
'hdhiZ7FQVaZETcxCSJo1Oq4zNoMjKakhJHcKFaMEC2jRVYdWAA'.
|
||||
'AAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0'.
|
||||
'SU1FB9MDCxYDN0PkEP4AAABfSURBVHjaVchHAoAgDATAVcCCIF'.
|
||||
'j4/1elJEjmOFDHKVgDv4iz640gLs+LMF6ZUv/VqcXXplU7Gqpy'.
|
||||
'PFzBT5qml9NzlOX259riWHlS4kOffviHD8PQYZx2EFMPRkw+9Q'.
|
||||
'FSnRPeWEDzKAAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
//sq_blue.png
|
||||
//==========================================================
|
||||
$this->imgdata[5][0]= 283 ;
|
||||
$this->imgdata[5][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAQl'.
|
||||
'BMVEX////4+fz39/z19vvy8vru7/ni4+7g4fHW1ue8vteXmt6B'.
|
||||
'hdhiZ7FQVaZETcxCSJo1Oq4zNoMjKakhJHcKFaMEC2jRVYdWAA'.
|
||||
'AAAWJLR0QAiAUdSAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0'.
|
||||
'SU1FB9MDCxYDN0PkEP4AAABfSURBVHjaVchHAoAgDATAVcCCIF'.
|
||||
'j4/1elJEjmOFDHKVgDv4iz640gLs+LMF6ZUv/VqcXXplU7Gqpy'.
|
||||
'PFzBT5qml9NzlOX259riWHlS4kOffviHD8PQYZx2EFMPRkw+9Q'.
|
||||
'FSnRPeWEDzKAAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
//sq_green.png
|
||||
//==========================================================
|
||||
$this->imgdata[6][0]= 325 ;
|
||||
$this->imgdata[6][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'.
|
||||
'BMVEX////2+vX1+vX1+fT0+fPz+PPx9/Dv9u7u9e3h7uHe697a'.
|
||||
'6dnO2s3I1sa10LOvza2ay5aEwYBWlE9TqE5Tkk1RkEpMrUJMg0'.
|
||||
'hKiUNGpEFBojw8oTcsbScaYBMWlwmMT0NtAAAAAWJLR0QAiAUd'.
|
||||
'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEFd'.
|
||||
'nFx90AAABuSURBVHjaVc9HAoAgDADB2HuJWLDx/2cKBITscW4L'.
|
||||
'5byzMIWtZobNDZIZtrcCGZsRQ8GwvRSRNxIiMuysODKG3alikl'.
|
||||
'ueOPlpKTLBaRmOZxQxaXlfb5ZWI9om4WntrXiDSJzp7SBkwMQa'.
|
||||
'FEy0VR/NAB2kNuj7rgAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
//sq_green.png
|
||||
//==========================================================
|
||||
$this->imgdata[6][0]= 325 ;
|
||||
$this->imgdata[6][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAXV'.
|
||||
'BMVEX////2+vX1+vX1+fT0+fPz+PPx9/Dv9u7u9e3h7uHe697a'.
|
||||
'6dnO2s3I1sa10LOvza2ay5aEwYBWlE9TqE5Tkk1RkEpMrUJMg0'.
|
||||
'hKiUNGpEFBojw8oTcsbScaYBMWlwmMT0NtAAAAAWJLR0QAiAUd'.
|
||||
'SAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEFd'.
|
||||
'nFx90AAABuSURBVHjaVc9HAoAgDADB2HuJWLDx/2cKBITscW4L'.
|
||||
'5byzMIWtZobNDZIZtrcCGZsRQ8GwvRSRNxIiMuysODKG3alikl'.
|
||||
'ueOPlpKTLBaRmOZxQxaXlfb5ZWI9om4WntrXiDSJzp7SBkwMQa'.
|
||||
'FEy0VR/NAB2kNuj7rgAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
//sq_orange.png
|
||||
//==========================================================
|
||||
$this->imgdata[7][0]= 321 ;
|
||||
$this->imgdata[7][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAUV'.
|
||||
'BMVEX/////8+n/8uf/8OP/59H/5Mv/zqH/zJ3/ypv/yJf/vYH/'.
|
||||
'u33/uXn/n0n/nUX/m0H/lzn/ljf/lDP/kS3/kCv/iR//hxv/fg'.
|
||||
'n/fAX/eQDYZgDW6ia5AAAAAWJLR0QAiAUdSAAAAAlwSFlzAAAL'.
|
||||
'EgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEJIgbx+cAAAB2SURBVH'.
|
||||
'jaVczRCoQwDETRbLAWLZSGUA35/w/dVI0283i4DODew3YESmWW'.
|
||||
'kg5gWkoQAe6TleUQI/66Sy7i56+kLk7cht2N0+hcnJgQu0SqiC'.
|
||||
'1SzSIbzWSi6gavqJ63wSduRi2f+kwyD5rEukwCdZ1kGAMGMfv9'.
|
||||
'AbWuGMOr5COSAAAAAElFTkSuQmCC' ;
|
||||
//==========================================================
|
||||
//sq_orange.png
|
||||
//==========================================================
|
||||
$this->imgdata[7][0]= 321 ;
|
||||
$this->imgdata[7][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAMAAABhEH5lAAAAUV'.
|
||||
'BMVEX/////8+n/8uf/8OP/59H/5Mv/zqH/zJ3/ypv/yJf/vYH/'.
|
||||
'u33/uXn/n0n/nUX/m0H/lzn/ljf/lDP/kS3/kCv/iR//hxv/fg'.
|
||||
'n/fAX/eQDYZgDW6ia5AAAAAWJLR0QAiAUdSAAAAAlwSFlzAAAL'.
|
||||
'EgAACxIB0t1+/AAAAAd0SU1FB9MDCxYEJIgbx+cAAAB2SURBVH'.
|
||||
'jaVczRCoQwDETRbLAWLZSGUA35/w/dVI0283i4DODew3YESmWW'.
|
||||
'kg5gWkoQAe6TleUQI/66Sy7i56+kLk7cht2N0+hcnJgQu0SqiC'.
|
||||
'1SzSIbzWSi6gavqJ63wSduRi2f+kwyD5rEukwCdZ1kGAMGMfv9'.
|
||||
'AbWuGMOr5COSAAAAAElFTkSuQmCC' ;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -9,136 +9,136 @@
|
|||
//========================================================================
|
||||
|
||||
|
||||
class ImgData_Stars extends ImgData {
|
||||
class ImgData_Stars extends ImgData
|
||||
{
|
||||
protected $name = 'Stars';
|
||||
protected $an = array(MARK_IMG_STAR => 'imgdata');
|
||||
|
||||
protected $colors = array('bluegreen','lightblue','purple','blue','green','pink','red','yellow');
|
||||
protected $index = array('bluegreen'=>3,'lightblue'=>4,'purple'=>1,
|
||||
'blue'=>5,'green'=>0,'pink'=>7,'red'=>2,'yellow'=>6);
|
||||
protected $index = array('bluegreen'=>3,'lightblue'=>4,'purple'=>1,
|
||||
'blue'=>5,'green'=>0,'pink'=>7,'red'=>2,'yellow'=>6);
|
||||
protected $maxidx = 7 ;
|
||||
protected $imgdata ;
|
||||
|
||||
function ImgData_Stars() {
|
||||
//==========================================================
|
||||
// File: bstar_green_001.png
|
||||
//==========================================================
|
||||
$this->imgdata[0][0]= 329 ;
|
||||
$this->imgdata[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAAUV'.
|
||||
'BMVEX///////+/v7+83rqcyY2Q/4R7/15y/1tp/05p/0lg/zdX'.
|
||||
'/zdX/zVV/zdO/zFJ9TFJvDFD4yg+8Bw+3iU68hwurhYotxYosx'.
|
||||
'YokBoTfwANgQFUp7DWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'.
|
||||
'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJj'.
|
||||
'CRyxgTAAAAcUlEQVR4nH3MSw6AIAwEUBL/IKBWwXL/g0pLojUS'.
|
||||
'ZzGLl8ko9Zumhr5iy66/GH0dp49llNPB5sTotDY5PVuLG6tnM9'.
|
||||
'CVKSIe1joSgPsAKSuANNaENFQvTAGzmheSkUpMBWeJZwqBT8wo'.
|
||||
'hmysD4bnnPsC/x8ItUdGPfAAAAAASUVORK5CYII=' ;
|
||||
//==========================================================
|
||||
// File: bstar_blred.png
|
||||
//==========================================================
|
||||
$this->imgdata[1][0]= 325 ;
|
||||
$this->imgdata[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v79uRJ6jWPOSUtKrb+ejWO+gWPaGTruJTr6rZvF2'.
|
||||
'RqC2ocqdVuCeV+egV/GsnLuIXL66rMSpcOyATbipY/OdWOp+VK'.
|
||||
'aTU9WhV+yJKBoLAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJwynv1'.
|
||||
'XVAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
public function ImgData_Stars()
|
||||
{
|
||||
//==========================================================
|
||||
// File: bstar_green_001.png
|
||||
//==========================================================
|
||||
$this->imgdata[0][0]= 329 ;
|
||||
$this->imgdata[0][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAAUV'.
|
||||
'BMVEX///////+/v7+83rqcyY2Q/4R7/15y/1tp/05p/0lg/zdX'.
|
||||
'/zdX/zVV/zdO/zFJ9TFJvDFD4yg+8Bw+3iU68hwurhYotxYosx'.
|
||||
'YokBoTfwANgQFUp7DWAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgF'.
|
||||
'HUgAAAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJj'.
|
||||
'CRyxgTAAAAcUlEQVR4nH3MSw6AIAwEUBL/IKBWwXL/g0pLojUS'.
|
||||
'ZzGLl8ko9Zumhr5iy66/GH0dp49llNPB5sTotDY5PVuLG6tnM9'.
|
||||
'CVKSIe1joSgPsAKSuANNaENFQvTAGzmheSkUpMBWeJZwqBT8wo'.
|
||||
'hmysD4bnnPsC/x8ItUdGPfAAAAAASUVORK5CYII=' ;
|
||||
//==========================================================
|
||||
// File: bstar_blred.png
|
||||
//==========================================================
|
||||
$this->imgdata[1][0]= 325 ;
|
||||
$this->imgdata[1][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v79uRJ6jWPOSUtKrb+ejWO+gWPaGTruJTr6rZvF2'.
|
||||
'RqC2ocqdVuCeV+egV/GsnLuIXL66rMSpcOyATbipY/OdWOp+VK'.
|
||||
'aTU9WhV+yJKBoLAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJwynv1'.
|
||||
'XVAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bstar_red_001.png
|
||||
//==========================================================
|
||||
$this->imgdata[2][0]= 325 ;
|
||||
$this->imgdata[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v7+eRFHzWG3SUmHnb37vWGr2WHG7Tlm+TljxZneg'.
|
||||
'Rk3KoaXgVmXnV2nxV227nJ++XGzErK3scIS4TVzzY3fqWG2mVF'.
|
||||
'zVU2PsV2rJFw9VAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJzCI0C'.
|
||||
'lSAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: bstar_red_001.png
|
||||
//==========================================================
|
||||
$this->imgdata[2][0]= 325 ;
|
||||
$this->imgdata[2][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v7+eRFHzWG3SUmHnb37vWGr2WHG7Tlm+TljxZneg'.
|
||||
'Rk3KoaXgVmXnV2nxV227nJ++XGzErK3scIS4TVzzY3fqWG2mVF'.
|
||||
'zVU2PsV2rJFw9VAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJzCI0C'.
|
||||
'lSAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bstar_blgr_001.png
|
||||
//==========================================================
|
||||
$this->imgdata[3][0]= 325 ;
|
||||
$this->imgdata[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v79Ehp5Yx/NSq9Jvw+dYwu9YzfZOmbtOmb5myPFG'.
|
||||
'gqChvcpWteBXvedXxvGcsbtcpb6su8RwzOxNmrhjyvNYwupUjK'.
|
||||
'ZTr9VXwOyJhmWNAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJTC65k'.
|
||||
'vQAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: bstar_blgr_001.png
|
||||
//==========================================================
|
||||
$this->imgdata[3][0]= 325 ;
|
||||
$this->imgdata[3][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v79Ehp5Yx/NSq9Jvw+dYwu9YzfZOmbtOmb5myPFG'.
|
||||
'gqChvcpWteBXvedXxvGcsbtcpb6su8RwzOxNmrhjyvNYwupUjK'.
|
||||
'ZTr9VXwOyJhmWNAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJTC65k'.
|
||||
'vQAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bstar_blgr_002.png
|
||||
//==========================================================
|
||||
$this->imgdata[4][0]= 325 ;
|
||||
$this->imgdata[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v79EnpxY8/FS0dJv5+dY7+9Y9vBOubtOur5m8fFG'.
|
||||
'nKChycpW3uBX5+ZX8e2curtcvrqswsRw7OdNuLZj8/BY6udUpK'.
|
||||
'ZT1dRX7OtNkrW5AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJgXHeN'.
|
||||
'wwAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: bstar_blgr_002.png
|
||||
//==========================================================
|
||||
$this->imgdata[4][0]= 325 ;
|
||||
$this->imgdata[4][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v79EnpxY8/FS0dJv5+dY7+9Y9vBOubtOur5m8fFG'.
|
||||
'nKChycpW3uBX5+ZX8e2curtcvrqswsRw7OdNuLZj8/BY6udUpK'.
|
||||
'ZT1dRX7OtNkrW5AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJgXHeN'.
|
||||
'wwAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bstar_blue_001.png
|
||||
//==========================================================
|
||||
$this->imgdata[5][0]= 325 ;
|
||||
$this->imgdata[5][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v79EY55Yi/NSetJvledYiO9YkPZOb7tObr5mkvFG'.
|
||||
'X6ChrcpWgOBXhedXi/Gcpbtcf76sssRwnOxNcbhjk/NYiepUbK'.
|
||||
'ZTfdVXh+ynNEzzAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJhStyP'.
|
||||
'zCAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: bstar_blue_001.png
|
||||
//==========================================================
|
||||
$this->imgdata[5][0]= 325 ;
|
||||
$this->imgdata[5][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v79EY55Yi/NSetJvledYiO9YkPZOb7tObr5mkvFG'.
|
||||
'X6ChrcpWgOBXhedXi/Gcpbtcf76sssRwnOxNcbhjk/NYiepUbK'.
|
||||
'ZTfdVXh+ynNEzzAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJhStyP'.
|
||||
'zCAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bstar_oy_007.png
|
||||
//==========================================================
|
||||
$this->imgdata[6][0]= 325 ;
|
||||
$this->imgdata[6][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v7+ejUTz11jSvVLn02/v1lj21li7q06+r07x2mag'.
|
||||
'lUbKxKHgy1bnz1fx1Ve7t5y+qlzEwqzs03C4pE3z2WPqz1imml'.
|
||||
'TVv1Ps01dGRjeyAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJjsGGc'.
|
||||
'GbAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: bstar_oy_007.png
|
||||
//==========================================================
|
||||
$this->imgdata[6][0]= 325 ;
|
||||
$this->imgdata[6][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v7+ejUTz11jSvVLn02/v1lj21li7q06+r07x2mag'.
|
||||
'lUbKxKHgy1bnz1fx1Ve7t5y+qlzEwqzs03C4pE3z2WPqz1imml'.
|
||||
'TVv1Ps01dGRjeyAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJjsGGc'.
|
||||
'GbAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
|
||||
//==========================================================
|
||||
// File: bstar_lred.png
|
||||
//==========================================================
|
||||
$this->imgdata[7][0]= 325 ;
|
||||
$this->imgdata[7][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v7+eRJPzWN3SUr7nb9TvWNj2WOS7Tqi+TqnxZtyg'.
|
||||
'Ro/KocPgVsjnV9LxV927nLa+XLTErL7scN24TarzY9/qWNemVJ'.
|
||||
'jVU8LsV9VCwcc9AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJxi9ZY'.
|
||||
'GoAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
//==========================================================
|
||||
// File: bstar_lred.png
|
||||
//==========================================================
|
||||
$this->imgdata[7][0]= 325 ;
|
||||
$this->imgdata[7][1]=
|
||||
'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAMAAABsDg4iAAAATl'.
|
||||
'BMVEX///+/v7+eRJPzWN3SUr7nb9TvWNj2WOS7Tqi+TqnxZtyg'.
|
||||
'Ro/KocPgVsjnV9LxV927nLa+XLTErL7scN24TarzY9/qWNemVJ'.
|
||||
'jVU8LsV9VCwcc9AAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgA'.
|
||||
'AAAJcEhZcwAACxIAAAsSAdLdfvwAAAAHdElNRQfTAxYTJxi9ZY'.
|
||||
'GoAAAAcElEQVR4nH3MyQ6AIAwEUFIqiwju2///qLQmWiJxDnN4'.
|
||||
'mYxSv5lqGCs2nvaLLtZx/VhGOW1MjnPJWp0zsw2wsUY2jd09BY'.
|
||||
'DFmESC+BwA5UCUxhqAhqrA4CGrLpCMVGK4sZe4B+/5RLdiyMb6'.
|
||||
'on/PuS9CdQNC7yBXEQAAAABJRU5ErkJggg==' ;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Directories for cache and font directory.
|
||||
// Directories for cache and font directory.
|
||||
//
|
||||
// CACHE_DIR:
|
||||
// The full absolute name of the directory to be used to store the
|
||||
|
|
@ -44,15 +44,15 @@
|
|||
// Cache directory specification for use with CSIM graphs that are
|
||||
// using the cache.
|
||||
// The directory must be the filesysystem name as seen by PHP
|
||||
// and the 'http' version must be the same directory but as
|
||||
// seen by the HTTP server relative to the 'htdocs' ddirectory.
|
||||
// and the 'http' version must be the same directory but as
|
||||
// seen by the HTTP server relative to the 'htdocs' ddirectory.
|
||||
// If a relative path is specified it is taken to be relative from where
|
||||
// the image script is executed.
|
||||
// Note: The default setting is to create a subdirectory in the
|
||||
// Note: The default setting is to create a subdirectory in the
|
||||
// directory from where the image script is executed and store all files
|
||||
// there. As ususal this directory must be writeable by the PHP process.
|
||||
DEFINE("CSIMCACHE_DIR","csimcache/");
|
||||
DEFINE("CSIMCACHE_HTTP_DIR","csimcache/");
|
||||
DEFINE("CSIMCACHE_DIR", "csimcache/");
|
||||
DEFINE("CSIMCACHE_HTTP_DIR", "csimcache/");
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Defines for font setup
|
||||
|
|
@ -61,22 +61,22 @@ DEFINE("CSIMCACHE_HTTP_DIR","csimcache/");
|
|||
// Actual name of the TTF file used together with FF_CHINESE aka FF_BIG5
|
||||
// This is the TTF file being used when the font family is specified as
|
||||
// either FF_CHINESE or FF_BIG5
|
||||
DEFINE('CHINESE_TTF_FONT','bkai00mp.ttf');
|
||||
DEFINE('CHINESE_TTF_FONT', 'bkai00mp.ttf');
|
||||
|
||||
// Special unicode greek language support
|
||||
DEFINE("LANGUAGE_GREEK",false);
|
||||
DEFINE("LANGUAGE_GREEK", false);
|
||||
|
||||
// If you are setting this config to true the conversion of greek characters
|
||||
// will assume that the input text is windows 1251
|
||||
DEFINE("GREEK_FROM_WINDOWS",false);
|
||||
// will assume that the input text is windows 1251
|
||||
DEFINE("GREEK_FROM_WINDOWS", false);
|
||||
|
||||
// Special unicode cyrillic language support
|
||||
DEFINE("LANGUAGE_CYRILLIC",false);
|
||||
DEFINE("LANGUAGE_CYRILLIC", false);
|
||||
|
||||
// If you are setting this config to true the conversion
|
||||
// will assume that the input text is windows 1251, if
|
||||
// false it will assume koi8-r
|
||||
DEFINE("CYRILLIC_FROM_WINDOWS",false);
|
||||
DEFINE("CYRILLIC_FROM_WINDOWS", false);
|
||||
|
||||
// The following constant is used to auto-detect
|
||||
// whether cyrillic conversion is really necessary
|
||||
|
|
@ -102,19 +102,19 @@ DEFINE("CYRILLIC_FROM_WINDOWS",false);
|
|||
//
|
||||
// where $locale_char_set is a GLOBAL (string) variable
|
||||
// from the application including JpGraph.
|
||||
//
|
||||
//
|
||||
DEFINE('LANGUAGE_CHARSET', null);
|
||||
|
||||
// Japanese TrueType font used with FF_MINCHO, FF_PMINCHO, FF_GOTHIC, FF_PGOTHIC
|
||||
DEFINE('MINCHO_TTF_FONT','ipam.ttf');
|
||||
DEFINE('PMINCHO_TTF_FONT','ipamp.ttf');
|
||||
DEFINE('GOTHIC_TTF_FONT','ipag.ttf');
|
||||
DEFINE('PGOTHIC_TTF_FONT','ipagp.ttf');
|
||||
DEFINE('MINCHO_TTF_FONT', 'ipam.ttf');
|
||||
DEFINE('PMINCHO_TTF_FONT', 'ipamp.ttf');
|
||||
DEFINE('GOTHIC_TTF_FONT', 'ipag.ttf');
|
||||
DEFINE('PGOTHIC_TTF_FONT', 'ipagp.ttf');
|
||||
|
||||
// Assume that Japanese text have been entered in EUC-JP encoding.
|
||||
// If this define is true then conversion from EUC-JP to UTF8 is done
|
||||
// If this define is true then conversion from EUC-JP to UTF8 is done
|
||||
// automatically in the library using the mbstring module in PHP.
|
||||
DEFINE('ASSUME_EUCJP_ENCODING',false);
|
||||
DEFINE('ASSUME_EUCJP_ENCODING', false);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// Various JpGraph Settings. Adjust accordingly to your
|
||||
|
|
@ -124,68 +124,68 @@ DEFINE('ASSUME_EUCJP_ENCODING',false);
|
|||
|
||||
// Deafult locale for error messages.
|
||||
// This defaults to English = 'en'
|
||||
DEFINE('DEFAULT_ERR_LOCALE','en');
|
||||
DEFINE('DEFAULT_ERR_LOCALE', 'en');
|
||||
|
||||
// Deafult graphic format set to "auto" which will automatically
|
||||
// choose the best available format in the order png,gif,jpeg
|
||||
// (The supported format depends on what your PHP installation supports)
|
||||
DEFINE("DEFAULT_GFORMAT","auto");
|
||||
DEFINE("DEFAULT_GFORMAT", "auto");
|
||||
|
||||
// Should the cache be used at all? By setting this to false no
|
||||
// files will be generated in the cache directory.
|
||||
// files will be generated in the cache directory.
|
||||
// The difference from READ_CACHE being that setting READ_CACHE to
|
||||
// false will still create the image in the cache directory
|
||||
// just not use it. By setting USE_CACHE=false no files will even
|
||||
// be generated in the cache directory.
|
||||
DEFINE("USE_CACHE",false);
|
||||
DEFINE("USE_CACHE", false);
|
||||
|
||||
// Should we try to find an image in the cache before generating it?
|
||||
// Should we try to find an image in the cache before generating it?
|
||||
// Set this define to false to bypass the reading of the cache and always
|
||||
// regenerate the image. Note that even if reading the cache is
|
||||
// regenerate the image. Note that even if reading the cache is
|
||||
// disabled the cached will still be updated with the newly generated
|
||||
// image. Set also "USE_CACHE" below.
|
||||
DEFINE("READ_CACHE",true);
|
||||
DEFINE("READ_CACHE", true);
|
||||
|
||||
// Determine if the error handler should be image based or purely
|
||||
// text based. Image based makes it easier since the script will
|
||||
// always return an image even in case of errors.
|
||||
DEFINE("USE_IMAGE_ERROR_HANDLER",true);
|
||||
DEFINE("USE_IMAGE_ERROR_HANDLER", true);
|
||||
|
||||
// Should the library examin the global php_errmsg string and convert
|
||||
// any error in it to a graphical representation. This is handy for the
|
||||
// occasions when, for example, header files cannot be found and this results
|
||||
// in the graph not being created and just a "red-cross" image would be seen.
|
||||
// This should be turned off for a production site.
|
||||
DEFINE("CATCH_PHPERRMSG",true);
|
||||
DEFINE("CATCH_PHPERRMSG", true);
|
||||
|
||||
// Determine if the library should also setup the default PHP
|
||||
// error handler to generate a graphic error mesage. This is useful
|
||||
// during development to be able to see the error message as an image
|
||||
// instead as a "red-cross" in a page where an image is expected.
|
||||
DEFINE("INSTALL_PHP_ERR_HANDLER",false);
|
||||
DEFINE("INSTALL_PHP_ERR_HANDLER", false);
|
||||
|
||||
// If the color palette is full should JpGraph try to allocate
|
||||
// the closest match? If you plan on using background images or
|
||||
// gradient fills it might be a good idea to enable this.
|
||||
// If not you will otherwise get an error saying that the color palette is
|
||||
// exhausted. The drawback of using approximations is that the colors
|
||||
// might not be exactly what you specified.
|
||||
// Note1: This does only apply to paletted images, not truecolor
|
||||
// If not you will otherwise get an error saying that the color palette is
|
||||
// exhausted. The drawback of using approximations is that the colors
|
||||
// might not be exactly what you specified.
|
||||
// Note1: This does only apply to paletted images, not truecolor
|
||||
// images since they don't have the limitations of maximum number
|
||||
// of colors.
|
||||
DEFINE("USE_APPROX_COLORS",true);
|
||||
DEFINE("USE_APPROX_COLORS", true);
|
||||
|
||||
// Should usage of deprecated functions and parameters give a fatal error?
|
||||
// (Useful to check if code is future proof.)
|
||||
DEFINE("ERR_DEPRECATED",true);
|
||||
DEFINE("ERR_DEPRECATED", true);
|
||||
|
||||
// Should the time taken to generate each picture be branded to the lower
|
||||
// left in corner in each generated image? Useful for performace measurements
|
||||
// generating graphs
|
||||
DEFINE("BRAND_TIMING",false);
|
||||
DEFINE("BRAND_TIMING", false);
|
||||
|
||||
// What format should be used for the timing string?
|
||||
DEFINE("BRAND_TIME_FORMAT","(%01.3fs)");
|
||||
DEFINE("BRAND_TIME_FORMAT", "(%01.3fs)");
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// The following constants should rarely have to be changed !
|
||||
|
|
@ -196,32 +196,29 @@ DEFINE("BRAND_TIME_FORMAT","(%01.3fs)");
|
|||
// Please note that the Apache user must be a member of the
|
||||
// specified group since otherwise it is impossible for Apache
|
||||
// to set the specified group.
|
||||
DEFINE("CACHE_FILE_GROUP","wwwadmin");
|
||||
DEFINE("CACHE_FILE_GROUP", "wwwadmin");
|
||||
|
||||
// What permissions should the cached file have
|
||||
// (Set to "" will give the default persmissions for the "PHP-user")
|
||||
DEFINE("CACHE_FILE_MOD",0664);
|
||||
DEFINE("CACHE_FILE_MOD", 0664);
|
||||
|
||||
// Decide if we should use the bresenham circle algorithm or the
|
||||
// built in Arc(). Bresenham gives better visual apperance of circles
|
||||
// built in Arc(). Bresenham gives better visual apperance of circles
|
||||
// but is more CPU intensive and slower then the built in Arc() function
|
||||
// in GD. Turned off by default for speed
|
||||
DEFINE("USE_BRESENHAM",false);
|
||||
DEFINE("USE_BRESENHAM", false);
|
||||
|
||||
// Special file name to indicate that we only want to calc
|
||||
// the image map in the call to Graph::Stroke() used
|
||||
// internally from the GetHTMLCSIM() method.
|
||||
DEFINE("_CSIM_SPECIALFILE","_csim_special_");
|
||||
DEFINE("_CSIM_SPECIALFILE", "_csim_special_");
|
||||
|
||||
// HTTP GET argument that is used with image map
|
||||
// to indicate to the script to just generate the image
|
||||
// and not the full CSIM HTML page.
|
||||
DEFINE("_CSIM_DISPLAY","_jpg_csimd");
|
||||
DEFINE("_CSIM_DISPLAY", "_jpg_csimd");
|
||||
|
||||
// Special filename for Graph::Stroke(). If this filename is given
|
||||
// then the image will NOT be streamed to browser of file. Instead the
|
||||
// Stroke call will return the handler for the created GD image.
|
||||
DEFINE("_IMG_HANDLER","__handle");
|
||||
|
||||
|
||||
?>
|
||||
DEFINE("_IMG_HANDLER", "__handle");
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -8,198 +8,201 @@
|
|||
// Copyright (c) Aditus Consulting. All rights reserved.
|
||||
//========================================================================
|
||||
|
||||
class HandDigits {
|
||||
class HandDigits
|
||||
{
|
||||
public $digits = array();
|
||||
public $iHeight=30, $iWidth=30;
|
||||
public $iHeight=30;
|
||||
public $iWidth=30;
|
||||
|
||||
function HandDigits() {
|
||||
//==========================================================
|
||||
// d6-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['6'][0]= 645 ;
|
||||
$this->digits['6'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAEBAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwMC'.
|
||||
'BAQEBwAAAAAAAAABAgMEAAURBiESIjFRBxMUQRUWMmFTYnGRkrHC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFhEBAQEAAAAA'.
|
||||
'AAAAAAAAAAAAAAER/9oADAMBAAIRAxEAPwDslwiR3oDku8ONttsAvDiVyMcO/ET7ke5/aoOz6k1Vr5htNjW7a7M1yO3NTQU9JUDu'.
|
||||
'GgrlSn8xyf6p4gXaHJvNps9/mKZtSkGdMjRwpfqAFBLLACRlZUrJONsI2717No1lbZ10kx7XGnRpKWQ/6GVGMfzEJ5VFIVtsOH6e'.
|
||||
'wyKVhYsia0y22pLThSkJK1uniVgdThOM0ol+StIUhpopIyCFq3H8aUVCwnG3PGe4Rp6fLXJtMdyM0ojcIWvIz3HFnAPfrWTXb6GN'.
|
||||
'WaLXDwZjVz8pKEfhuIUFg/bAz9sVJ61nt61mxJFslLtq7e5yPqiBT4UDklKw4MDpt+u+9bFiu9riXNu83R+fcr6tohuQ5HQhmK37'.
|
||||
'paaC8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+e7Qerl5z74DY/1SomP//Z' ;
|
||||
public function HandDigits()
|
||||
{
|
||||
//==========================================================
|
||||
// d6-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['6'][0]= 645 ;
|
||||
$this->digits['6'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAEBAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwMC'.
|
||||
'BAQEBwAAAAAAAAABAgMEAAURBiESIjFRBxMUQRUWMmFTYnGRkrHC/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFhEBAQEAAAAA'.
|
||||
'AAAAAAAAAAAAAAER/9oADAMBAAIRAxEAPwDslwiR3oDku8ONttsAvDiVyMcO/ET7ke5/aoOz6k1Vr5htNjW7a7M1yO3NTQU9JUDu'.
|
||||
'GgrlSn8xyf6p4gXaHJvNps9/mKZtSkGdMjRwpfqAFBLLACRlZUrJONsI2717No1lbZ10kx7XGnRpKWQ/6GVGMfzEJ5VFIVtsOH6e'.
|
||||
'wyKVhYsia0y22pLThSkJK1uniVgdThOM0ol+StIUhpopIyCFq3H8aUVCwnG3PGe4Rp6fLXJtMdyM0ojcIWvIz3HFnAPfrWTXb6GN'.
|
||||
'WaLXDwZjVz8pKEfhuIUFg/bAz9sVJ61nt61mxJFslLtq7e5yPqiBT4UDklKw4MDpt+u+9bFiu9riXNu83R+fcr6tohuQ5HQhmK37'.
|
||||
'paaC8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+e7Qerl5z74DY/1SomP//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// d2-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['2'][0]= 606 ;
|
||||
$this->digits['2'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEQMBIgACEQEDEQH/xAAYAAEBAQEBAAAAAAAAAAAAAAAFAAQHAv/EACsQAAEDBAEC'.
|
||||
'BAYDAAAAAAAAAAIBAwQABQYRIRIxQVFhcQcTFSJSU5GU0f/EABcBAAMBAAAAAAAAAAAAAAAAAAECAwT/xAAZEQACAwEAAAAAAAAA'.
|
||||
'AAAAAAAAARESUUH/2gAMAwEAAhEDEQA/AOqXm/Q8dxmOL4PPSnCSNFixx6nXnkXgRT3Te17JWbGsveueSyLZdbPItNxOKLzTLjou'.
|
||||
'gYCSoSoY8ISKSbFeUrzkdlnTL1YshskiErkQnFEZaF8kkdBBVdjyi6RNL5+9F486eS/ECVkcBtDt1vZcho5viS8ZCp9C9tAIAm/F'.
|
||||
'VoPRU+HRtJ5JVRP1kP0PfwP+1VKrHBMliXG4Nw8VgE4xGkuqk2S1wTUNEVdIvgpL9iL6KtNxY7WOwo9tt0RCitj0sR2uCbFPPzH1'.
|
||||
'7+6rRuSRcljMBMsUy2tky045KOawZk5xtEFBJEROO3hx61kh2rPCIX3MhsyC4QmfTbC6lH8dq5212qwkiG5H6Y/9R2qm+ofxqqsL'.
|
||||
'DLZ6f//Z' ;
|
||||
//==========================================================
|
||||
// d2-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['2'][0]= 606 ;
|
||||
$this->digits['2'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEQMBIgACEQEDEQH/xAAYAAEBAQEBAAAAAAAAAAAAAAAFAAQHAv/EACsQAAEDBAEC'.
|
||||
'BAYDAAAAAAAAAAIBAwQABQYRIRIxQVFhcQcTFSJSU5GU0f/EABcBAAMBAAAAAAAAAAAAAAAAAAECAwT/xAAZEQACAwEAAAAAAAAA'.
|
||||
'AAAAAAAAARESUUH/2gAMAwEAAhEDEQA/AOqXm/Q8dxmOL4PPSnCSNFixx6nXnkXgRT3Te17JWbGsveueSyLZdbPItNxOKLzTLjou'.
|
||||
'gYCSoSoY8ISKSbFeUrzkdlnTL1YshskiErkQnFEZaF8kkdBBVdjyi6RNL5+9F486eS/ECVkcBtDt1vZcho5viS8ZCp9C9tAIAm/F'.
|
||||
'VoPRU+HRtJ5JVRP1kP0PfwP+1VKrHBMliXG4Nw8VgE4xGkuqk2S1wTUNEVdIvgpL9iL6KtNxY7WOwo9tt0RCitj0sR2uCbFPPzH1'.
|
||||
'7+6rRuSRcljMBMsUy2tky045KOawZk5xtEFBJEROO3hx61kh2rPCIX3MhsyC4QmfTbC6lH8dq5212qwkiG5H6Y/9R2qm+ofxqqsL'.
|
||||
'DLZ6f//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// d9-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['9'][0]= 680 ;
|
||||
$this->digits['9'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwP/xAArEAABAwMD'.
|
||||
'AgYBBQAAAAAAAAABAgMEBQYRABIhE1EUIjEzQUIHMlJhcdH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAQD/xAAYEQEAAwEAAAAAAAAA'.
|
||||
'AAAAAAAAAREhQf/aAAwDAQACEQMRAD8AkK7brF6X7XpMeGoKhFMLEeT4ZUheEhanF4OcZ2pTgDykk92bZpdCsi7aezLjxkIPUZiV'.
|
||||
'RSCy8hah7EkZ27yM7V+iscal5bE22Lon1qNDmSKROd8Sl+Ix1lMOlIS4HGgQpbStoUCnlJz8HmsXtW3Lst2rmBAelLMRRekOwnYz'.
|
||||
'Edls9QKKnOVLyk7UgcbzzrdBthqEJJwZbAI4x1U/7o1TaFa9lG36aXaZTy54VrcXUgrzsGdx+T30aNydweqVw1GS87T6Lb86Q4ha'.
|
||||
'my/IAYjZBx+snKk99oOQMf1AViE65SY348hzFy6hPKnqtKz7DC1lbqyPrvJKUJ7H+M6Wrt3InP7o1brFNp4bCDGhxGAsqz69VSiQ'.
|
||||
'ORwBxrrQ7itm1ac7Hp0WoGTIc3PSn0pccdcP2WorycfA1RaRHjxosZqOyhtDTSAhCf2gDAGjVHTd9sKSCumynFEZK1tIJUe58/ro'.
|
||||
'1V1//9k=' ;
|
||||
//==========================================================
|
||||
// d9-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['9'][0]= 680 ;
|
||||
$this->digits['9'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwP/xAArEAABAwMD'.
|
||||
'AgYBBQAAAAAAAAABAgMEBQYRABIhE1EUIjEzQUIHMlJhcdH/xAAWAQEBAQAAAAAAAAAAAAAAAAACAQD/xAAYEQEAAwEAAAAAAAAA'.
|
||||
'AAAAAAAAAREhQf/aAAwDAQACEQMRAD8AkK7brF6X7XpMeGoKhFMLEeT4ZUheEhanF4OcZ2pTgDykk92bZpdCsi7aezLjxkIPUZiV'.
|
||||
'RSCy8hah7EkZ27yM7V+iscal5bE22Lon1qNDmSKROd8Sl+Ix1lMOlIS4HGgQpbStoUCnlJz8HmsXtW3Lst2rmBAelLMRRekOwnYz'.
|
||||
'Edls9QKKnOVLyk7UgcbzzrdBthqEJJwZbAI4x1U/7o1TaFa9lG36aXaZTy54VrcXUgrzsGdx+T30aNydweqVw1GS87T6Lb86Q4ha'.
|
||||
'my/IAYjZBx+snKk99oOQMf1AViE65SY348hzFy6hPKnqtKz7DC1lbqyPrvJKUJ7H+M6Wrt3InP7o1brFNp4bCDGhxGAsqz69VSiQ'.
|
||||
'ORwBxrrQ7itm1ac7Hp0WoGTIc3PSn0pccdcP2WorycfA1RaRHjxosZqOyhtDTSAhCf2gDAGjVHTd9sKSCumynFEZK1tIJUe58/ro'.
|
||||
'1V1//9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// d5-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['5'][0]= 632 ;
|
||||
$this->digits['5'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgIFBwT/xAAoEAABAwME'.
|
||||
'AQQCAwAAAAAAAAABAgMEBQYRABIhIkEUMVFhBxNCgaH/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAv/EABcRAQEBAQAAAAAAAAAAAAAA'.
|
||||
'AAABEUH/2gAMAwEAAhEDEQA/ANGvW4YVOeiRX5b4mv5Sin05IdlupPKdo/j2SO3+6TbPNQvOsTVz33KRT4csR3YUF7Dsh5OSFvug'.
|
||||
'kqG4FPBxnjxpvvi4KZb1pTpU+QwxUi2Y7ZIAefUk5ATxnB9/gbtL/wCH1UpuhPUlZlMVaQ0mS8zJjqZOPfc2TwpIUonI9tw40R1r'.
|
||||
'WNGq/wBdJR1XT3lqHBUnGCfkfWjRWs1ve249erQqQYjOtN1FqPUpCXQ4WIzQSsJwT0UpRwQPG0nzqyuNHobjsl9kBuWqoOoXtT1/'.
|
||||
'WppZcA8lKRj64HxqU+3KpAr6plElRVKef3S4E0K9O8pLXVzKcqSsJAB9wSAca6bSoNXeuA1+5pEV+SGFNU1iKVFqI0Vdx2AJUeoz'.
|
||||
'8DGlTDwG3CAf3q/pI0ah6MDhLz6U+EpXwPoaNMU//9k=' ;
|
||||
//==========================================================
|
||||
// d5-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['5'][0]= 632 ;
|
||||
$this->digits['5'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgIFBwT/xAAoEAABAwME'.
|
||||
'AQQCAwAAAAAAAAABAgMEBQYRABIhIkEUMVFhBxNCgaH/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAv/EABcRAQEBAQAAAAAAAAAAAAAA'.
|
||||
'AAABEUH/2gAMAwEAAhEDEQA/ANGvW4YVOeiRX5b4mv5Sin05IdlupPKdo/j2SO3+6TbPNQvOsTVz33KRT4csR3YUF7Dsh5OSFvug'.
|
||||
'kqG4FPBxnjxpvvi4KZb1pTpU+QwxUi2Y7ZIAefUk5ATxnB9/gbtL/wCH1UpuhPUlZlMVaQ0mS8zJjqZOPfc2TwpIUonI9tw40R1r'.
|
||||
'WNGq/wBdJR1XT3lqHBUnGCfkfWjRWs1ve249erQqQYjOtN1FqPUpCXQ4WIzQSsJwT0UpRwQPG0nzqyuNHobjsl9kBuWqoOoXtT1/'.
|
||||
'WppZcA8lKRj64HxqU+3KpAr6plElRVKef3S4E0K9O8pLXVzKcqSsJAB9wSAca6bSoNXeuA1+5pEV+SGFNU1iKVFqI0Vdx2AJUeoz'.
|
||||
'8DGlTDwG3CAf3q/pI0ah6MDhLz6U+EpXwPoaNMU//9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// d1-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['1'][0]= 646 ;
|
||||
$this->digits['1'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEwMBIgACEQEDEQH/xAAZAAADAAMAAAAAAAAAAAAAAAAABQYCBAf/xAApEAACAQMD'.
|
||||
'AwQBBQAAAAAAAAABAgMEBREABiESMUEHEyJRkSNCYXGB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAA'.
|
||||
'AAAAAAEREv/aAAwDAQACEQMRAD8A6jdd4WLbstILnc4Uq0VoWpkJknb6IjXLHJUePOlez923fcW4r1SxWlqC2UbdKirQif3Xw3yA'.
|
||||
'OFAGT09/kO3OmV3a20MFRf6lIYPcpy7yRRAzgxjIy2M8YwcdiBzpX6d22VNvUlTXsFkuwkrKqNSfnK7F8OTzwrAY+l5zoxKskudN'.
|
||||
'EgQPUT9PBkWF3DH+1GPxo1mLnRoAqF2VRgGOFmX/AAgY/GjRUP6hVMFv2FuFqUvUGrpDFJMBnpdyF5bsAQew7Hxzp6LZNT0yQ1DI'.
|
||||
'wp0QCFBhD0jCsfLZHxbx5xxpTuvb1+v9PV7Ztk9roLPLCjmSSN3mX5ZwqjCgZX7PfWxDQb2in96pv9qq46aTE0bW4x9ceAWAYPwS'.
|
||||
'PsYzoixgmheBGjIVcYCnjp/jHjHbRpe1JLn9OnopE/a0ykvjwDx47aNMXqP/2Q==' ;
|
||||
//==========================================================
|
||||
// d1-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['1'][0]= 646 ;
|
||||
$this->digits['1'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEwMBIgACEQEDEQH/xAAZAAADAAMAAAAAAAAAAAAAAAAABQYCBAf/xAApEAACAQMD'.
|
||||
'AwQBBQAAAAAAAAABAgMEBREABiESMUEHEyJRkSNCYXGB/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAEC/8QAFxEBAQEBAAAAAAAAAAAA'.
|
||||
'AAAAAAEREv/aAAwDAQACEQMRAD8A6jdd4WLbstILnc4Uq0VoWpkJknb6IjXLHJUePOlez923fcW4r1SxWlqC2UbdKirQif3Xw3yA'.
|
||||
'OFAGT09/kO3OmV3a20MFRf6lIYPcpy7yRRAzgxjIy2M8YwcdiBzpX6d22VNvUlTXsFkuwkrKqNSfnK7F8OTzwrAY+l5zoxKskudN'.
|
||||
'EgQPUT9PBkWF3DH+1GPxo1mLnRoAqF2VRgGOFmX/AAgY/GjRUP6hVMFv2FuFqUvUGrpDFJMBnpdyF5bsAQew7Hxzp6LZNT0yQ1DI'.
|
||||
'wp0QCFBhD0jCsfLZHxbx5xxpTuvb1+v9PV7Ztk9roLPLCjmSSN3mX5ZwqjCgZX7PfWxDQb2in96pv9qq46aTE0bW4x9ceAWAYPwS'.
|
||||
'PsYzoixgmheBGjIVcYCnjp/jHjHbRpe1JLn9OnopE/a0ykvjwDx47aNMXqP/2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// d8-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['8'][0]= 694 ;
|
||||
$this->digits['8'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AFQMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABgcEBf/EACsQAAEDAwMD'.
|
||||
'AwMFAAAAAAAAAAECAwQFBhEAEiEUMVEHE0EVYYEiIzJCsf/EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/EABcRAQEBAQAAAAAAAAAA'.
|
||||
'AAAAAAABERL/2gAMAwEAAhEDEQA/AKL6gVVUa0i1T5QjvTprUJMlxW4R9zgQXe/AH+kaWrntqlWjaq7gpcmotXAw82ht9yY4tch8'.
|
||||
'uAFC0k7VBXPGMY51ruiaue+bThIj+7NbWqS+7HDxajFf6AlB/k44o8ZOABk4xkL0X0tZiojKrlRuGRJjugqldSlKGf6t7BuUQe3J'.
|
||||
'44xxxrA1a4KVJipLidri8uLHgqOcfjOPxo0o2hdDvS1CmV2Yl6fS5ioipIQR1CAlKkLKR2UUqAI8g6NRSwuuyHab6s1ufLI/Zai7'.
|
||||
'UBJOxhTS0+6B32pWSFH4CidOdWU0ukLiN1BLr0zG5Sdm3GRvcPhIT858DvjXNrVsSLnm/VIdTXS6tTnFsxZTSN3jchaTwps+O/z9'.
|
||||
'tcBVq3hIX0tYqlIiQHdy5CqRHKHXEjAOMgBKjnvyRk4xrQa7OiGt1K5biYZL8SoVEpjOqkFsONtJCNwASeCQrn7aNUKnQYtLp7EC'.
|
||||
'EylmLHQltptPZKQOBo1FzH//2Q==' ;
|
||||
//==========================================================
|
||||
// d8-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['8'][0]= 694 ;
|
||||
$this->digits['8'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AFQMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABgcEBf/EACsQAAEDAwMD'.
|
||||
'AwMFAAAAAAAAAAECAwQFBhEAEiEUMVEHE0EVYYEiIzJCsf/EABYBAQEBAAAAAAAAAAAAAAAAAAIAAf/EABcRAQEBAQAAAAAAAAAA'.
|
||||
'AAAAAAABERL/2gAMAwEAAhEDEQA/AKL6gVVUa0i1T5QjvTprUJMlxW4R9zgQXe/AH+kaWrntqlWjaq7gpcmotXAw82ht9yY4tch8'.
|
||||
'uAFC0k7VBXPGMY51ruiaue+bThIj+7NbWqS+7HDxajFf6AlB/k44o8ZOABk4xkL0X0tZiojKrlRuGRJjugqldSlKGf6t7BuUQe3J'.
|
||||
'44xxxrA1a4KVJipLidri8uLHgqOcfjOPxo0o2hdDvS1CmV2Yl6fS5ioipIQR1CAlKkLKR2UUqAI8g6NRSwuuyHab6s1ufLI/Zai7'.
|
||||
'UBJOxhTS0+6B32pWSFH4CidOdWU0ukLiN1BLr0zG5Sdm3GRvcPhIT858DvjXNrVsSLnm/VIdTXS6tTnFsxZTSN3jchaTwps+O/z9'.
|
||||
'tcBVq3hIX0tYqlIiQHdy5CqRHKHXEjAOMgBKjnvyRk4xrQa7OiGt1K5biYZL8SoVEpjOqkFsONtJCNwASeCQrn7aNUKnQYtLp7EC'.
|
||||
'EylmLHQltptPZKQOBo1FzH//2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// d4-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['4'][0]= 643 ;
|
||||
$this->digits['4'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABAYHAv/EAC0QAAIBAwQA'.
|
||||
'BAMJAAAAAAAAAAECAwQFEQAGEiETFDFBUmGBByIjUVNxobHR/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAIB/8QAGBEBAAMBAAAAAAAA'.
|
||||
'AAAAAAAAAAERIVH/2gAMAwEAAhEDEQA/ANjM00Nxmt1xiWW31CZp5uJwoAAaOQ/n7qfcZHqO5my3q5XX7R6ijiqnNut9u4NyJ4yv'.
|
||||
'JJyjYr8Xhrn5g599J7x3ulBNU7Zo7dXXXcLQ8kURYi4epYtkALjOePv1nUvbLvV7P3BZm3DR3eh88Kp7pVzBZI6iUhGWRRGWwE44'.
|
||||
'HX3V+uiL1uHgt+vL/H+aNJQ3CSeCOaFqSaJ1DJKs/TqRkMOvQjvRorHE4pRDLNWLGlRHGUeYIORXs9e5B7OP31E0fmdyb/t0DJ4Q'.
|
||||
'27bfx3YZzPUIoAAz7IpOD6cuxq0uNumqLfVNDOqXBoZEjnZcqhIPXH4c46+WkdoWOltu3IDDLLLVVR83UVcuPEmmcZZ2/rHoAANG'.
|
||||
'GI7KIY1ijoLeEQBVCwIoAHpgY6Hy0aZe7mJ2jeHLKcEhusj6aNKgzr//2Q==' ;
|
||||
//==========================================================
|
||||
// d4-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['4'][0]= 643 ;
|
||||
$this->digits['4'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABAYHAv/EAC0QAAIBAwQA'.
|
||||
'BAMJAAAAAAAAAAECAwQFEQAGEiETFDFBUmGBByIjUVNxobHR/8QAFgEBAQEAAAAAAAAAAAAAAAAAAAIB/8QAGBEBAAMBAAAAAAAA'.
|
||||
'AAAAAAAAAAERIVH/2gAMAwEAAhEDEQA/ANjM00Nxmt1xiWW31CZp5uJwoAAaOQ/n7qfcZHqO5my3q5XX7R6ijiqnNut9u4NyJ4yv'.
|
||||
'JJyjYr8Xhrn5g599J7x3ulBNU7Zo7dXXXcLQ8kURYi4epYtkALjOePv1nUvbLvV7P3BZm3DR3eh88Kp7pVzBZI6iUhGWRRGWwE44'.
|
||||
'HX3V+uiL1uHgt+vL/H+aNJQ3CSeCOaFqSaJ1DJKs/TqRkMOvQjvRorHE4pRDLNWLGlRHGUeYIORXs9e5B7OP31E0fmdyb/t0DJ4Q'.
|
||||
'27bfx3YZzPUIoAAz7IpOD6cuxq0uNumqLfVNDOqXBoZEjnZcqhIPXH4c46+WkdoWOltu3IDDLLLVVR83UVcuPEmmcZZ2/rHoAANG'.
|
||||
'GI7KIY1ijoLeEQBVCwIoAHpgY6Hy0aZe7mJ2jeHLKcEhusj6aNKgzr//2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// d7-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['7'][0]= 658 ;
|
||||
$this->digits['7'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgEFBwT/xAAuEAABAwIE'.
|
||||
'BAQGAwAAAAAAAAABAgMEBREABiExEhMiQSMyUXEHFBclVJFhk9L/xAAXAQADAQAAAAAAAAAAAAAAAAAAAQID/8QAGREBAQEAAwAA'.
|
||||
'AAAAAAAAAAAAAAEREiFR/9oADAMBAAIRAxEAPwDXq9mCjZeQ05VZ5ZST4bfEpa3VdglCbqUe+g9MZ5Uq7V8415WXoMSdQ6etgSps'.
|
||||
'19wpkCMDZKUpv0FZvbi1NzpYasMDLDUbMVXrtQdbeeU23xLWkj5RlLYK0J7anW9gbAjCzkOtsVSUJUdtc6dVZK51UeaFm4LKbhpC'.
|
||||
'l7EhIFkDW974GbRI2XorUVls1OTdKAOqUpR0Hc3198GITQ6k+hLwrEpoODiDenRfW23bBicg78JXxPpD0mgVOW5PAivNNpahsPW5'.
|
||||
'8xxQaSVkboQnhsnYm5OHqDGp1IpsalMKjMsMIC3+XZKbJFth62/QOEfMOZqZXp9JcKZTcGmTky3meSi7xQklI81vMR+sXIz/AEgp'.
|
||||
'Q0qPNu6ea8Q2jqtbp8+2w9h/OKORc/cpHjt1dDSHOtLZ4ekHW23bBjj+o9H/AB539aP94MG0+L//2Q==' ;
|
||||
//==========================================================
|
||||
// d7-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['7'][0]= 658 ;
|
||||
$this->digits['7'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgEFBwT/xAAuEAABAwIE'.
|
||||
'BAQGAwAAAAAAAAABAgMEBREABiExEhMiQSMyUXEHFBclVJFhk9L/xAAXAQADAQAAAAAAAAAAAAAAAAAAAQID/8QAGREBAQEAAwAA'.
|
||||
'AAAAAAAAAAAAAAEREiFR/9oADAMBAAIRAxEAPwDXq9mCjZeQ05VZ5ZST4bfEpa3VdglCbqUe+g9MZ5Uq7V8415WXoMSdQ6etgSps'.
|
||||
'19wpkCMDZKUpv0FZvbi1NzpYasMDLDUbMVXrtQdbeeU23xLWkj5RlLYK0J7anW9gbAjCzkOtsVSUJUdtc6dVZK51UeaFm4LKbhpC'.
|
||||
'l7EhIFkDW974GbRI2XorUVls1OTdKAOqUpR0Hc3198GITQ6k+hLwrEpoODiDenRfW23bBicg78JXxPpD0mgVOW5PAivNNpahsPW5'.
|
||||
'8xxQaSVkboQnhsnYm5OHqDGp1IpsalMKjMsMIC3+XZKbJFth62/QOEfMOZqZXp9JcKZTcGmTky3meSi7xQklI81vMR+sXIz/AEgp'.
|
||||
'Q0qPNu6ea8Q2jqtbp8+2w9h/OKORc/cpHjt1dDSHOtLZ4ekHW23bBjj+o9H/AB539aP94MG0+L//2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// d3-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['3'][0]= 662 ;
|
||||
$this->digits['3'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwL/xAArEAABBAED'.
|
||||
'AwMDBQEAAAAAAAABAgMEBREABhIhMUEiMmETFZEHFkJDUdH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAL/xAAYEQEBAQEBAAAAAAAA'.
|
||||
'AAAAAAAAEQExQf/aAAwDAQACEQMRAD8A0vclruBdk3VVLLUNssGRJsZSCtqOjlgJAHvcOD6c4HnOdIbcttw1W5P29cFEhuawqTXS'.
|
||||
'VsJjnCMBxKkJJx7goAde+ceJfdNxU0UNlyymyXHi6kxWUNl1S3EnkAEIHX2nv86qtTuZr9Q9+1VhRsOoYpYcgSVyAE/TdewkJxnK'.
|
||||
'sBCjkdPGpnOtFMd3PqsXgfOAgD8Y0aX+11H9rDDjn8lr9yj5J+dGqsqxaw6Cc9cQZU4Sp7zTJsIrKlcUEKwhSin1JABI45GUjqOu'.
|
||||
'lbOvjbc3Ts9ynjGCy445UuFLYRzbWgrT6fhSCQSMDke+pew2zYVly/d7YchNqkMJZnQpgV9J8IzwWFJyUrAJHYgjvpLbu37G5nR7'.
|
||||
'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ;
|
||||
}
|
||||
}
|
||||
|
||||
class AntiSpam {
|
||||
|
||||
var $iNumber='';
|
||||
|
||||
function AntiSpam($aNumber='') {
|
||||
$this->iNumber = $aNumber;
|
||||
}
|
||||
|
||||
function Rand($aLen) {
|
||||
$d='';
|
||||
for($i=0; $i < $aLen; ++$i) {
|
||||
$d .= rand(1,9);
|
||||
}
|
||||
$this->iNumber = $d;
|
||||
return $d;
|
||||
}
|
||||
|
||||
function Stroke() {
|
||||
|
||||
$n=strlen($this->iNumber);
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
if( !is_numeric($this->iNumber[$i]) || $this->iNumber[$i]==0 ) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$dd = new HandDigits();
|
||||
$n = strlen($this->iNumber);
|
||||
$img = @imagecreatetruecolor($n*$dd->iWidth, $dd->iHeight);
|
||||
if( $img < 1 ) {
|
||||
return false;
|
||||
}
|
||||
$start=0;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$size = $dd->digits[$this->iNumber[$i]][0];
|
||||
$dimg = imagecreatefromstring(base64_decode($dd->digits[$this->iNumber[$i]][1]));
|
||||
imagecopy($img,$dimg,$start,0,0,0,imagesx($dimg), $dd->iHeight);
|
||||
$start += imagesx($dimg);
|
||||
}
|
||||
$resimg = @imagecreatetruecolor($start+4, $dd->iHeight+4);
|
||||
if( $resimg < 1 ) {
|
||||
return false;
|
||||
}
|
||||
imagecopy($resimg,$img,2,2,0,0,$start, $dd->iHeight);
|
||||
header("Content-type: image/jpeg");
|
||||
imagejpeg($resimg);
|
||||
return true;
|
||||
//==========================================================
|
||||
// d3-small.jpg
|
||||
//==========================================================
|
||||
$this->digits['3'][0]= 662 ;
|
||||
$this->digits['3'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwL/xAArEAABBAED'.
|
||||
'AwMDBQEAAAAAAAABAgMEBREABhIhMUEiMmETFZEHFkJDUdH/xAAWAQEBAQAAAAAAAAAAAAAAAAABAAL/xAAYEQEBAQEBAAAAAAAA'.
|
||||
'AAAAAAAAEQExQf/aAAwDAQACEQMRAD8A0vclruBdk3VVLLUNssGRJsZSCtqOjlgJAHvcOD6c4HnOdIbcttw1W5P29cFEhuawqTXS'.
|
||||
'VsJjnCMBxKkJJx7goAde+ceJfdNxU0UNlyymyXHi6kxWUNl1S3EnkAEIHX2nv86qtTuZr9Q9+1VhRsOoYpYcgSVyAE/TdewkJxnK'.
|
||||
'sBCjkdPGpnOtFMd3PqsXgfOAgD8Y0aX+11H9rDDjn8lr9yj5J+dGqsqxaw6Cc9cQZU4Sp7zTJsIrKlcUEKwhSin1JABI45GUjqOu'.
|
||||
'lbOvjbc3Ts9ynjGCy445UuFLYRzbWgrT6fhSCQSMDke+pew2zYVly/d7YchNqkMJZnQpgV9J8IzwWFJyUrAJHYgjvpLbu37G5nR7'.
|
||||
'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
class AntiSpam
|
||||
{
|
||||
public $iNumber='';
|
||||
|
||||
public function AntiSpam($aNumber='')
|
||||
{
|
||||
$this->iNumber = $aNumber;
|
||||
}
|
||||
|
||||
public function Rand($aLen)
|
||||
{
|
||||
$d='';
|
||||
for ($i=0; $i < $aLen; ++$i) {
|
||||
$d .= rand(1, 9);
|
||||
}
|
||||
$this->iNumber = $d;
|
||||
return $d;
|
||||
}
|
||||
|
||||
public function Stroke()
|
||||
{
|
||||
$n=strlen($this->iNumber);
|
||||
for ($i=0; $i < $n; ++$i) {
|
||||
if (!is_numeric($this->iNumber[$i]) || $this->iNumber[$i]==0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$dd = new HandDigits();
|
||||
$n = strlen($this->iNumber);
|
||||
$img = @imagecreatetruecolor($n*$dd->iWidth, $dd->iHeight);
|
||||
if ($img < 1) {
|
||||
return false;
|
||||
}
|
||||
$start=0;
|
||||
for ($i=0; $i < $n; ++$i) {
|
||||
$size = $dd->digits[$this->iNumber[$i]][0];
|
||||
$dimg = imagecreatefromstring(base64_decode($dd->digits[$this->iNumber[$i]][1]));
|
||||
imagecopy($img, $dimg, $start, 0, 0, 0, imagesx($dimg), $dd->iHeight);
|
||||
$start += imagesx($dimg);
|
||||
}
|
||||
$resimg = @imagecreatetruecolor($start+4, $dd->iHeight+4);
|
||||
if ($resimg < 1) {
|
||||
return false;
|
||||
}
|
||||
imagecopy($resimg, $img, 2, 2, 0, 0, $start, $dd->iHeight);
|
||||
header("Content-type: image/jpeg");
|
||||
imagejpeg($resimg);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,17 +8,20 @@
|
|||
// Copyright (c) Aditus Consulting. All rights reserved.
|
||||
//========================================================================
|
||||
|
||||
class HandDigits {
|
||||
class HandDigits
|
||||
{
|
||||
public $chars = array();
|
||||
public $iHeight=30, $iWidth=30;
|
||||
public $iHeight=30;
|
||||
public $iWidth=30;
|
||||
|
||||
function HandDigits() {
|
||||
public function HandDigits()
|
||||
{
|
||||
|
||||
//==========================================================
|
||||
// lj-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['j'][0]= 658 ;
|
||||
$this->chars['j'][1]=
|
||||
// lj-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['j'][0]= 658 ;
|
||||
$this->chars['j'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAUGBAf/xAAsEAACAQMDAwMBCQAAAAAAAAAB'.
|
||||
|
|
@ -27,13 +30,13 @@ $this->chars['j'][1]=
|
|||
'SOeD441TKRTyingUBG4/ah8j684+dSFzh/BvtaslejMUu9DPQTDnLx4lQ/ONw1TGBm0jdRWqguEMghEisWilgDmNs4Ze+MEEEH40'.
|
||||
'aUVFTa7JeLjRXu4GjhmnNbSfqFQVlA3rkckOjH/Q99Glmkl0C/Q06pvsvT9vttXHDF6T1KrWbs5gRgQJM+FDlQxPhjpF1XcVq+qe'.
|
||||
'jEoKiOecXBqh2TDDYIXLKuP6549xk8auI6aJqV45oknWdNswkAIkGMYIxjGO2NR1F0LZY5qkWqkS1xrM0M8lMSJpY+TGrnJiQ577'.
|
||||
'cEgeNHhi7D3qC3UN69M8tIakRhgrh9o748+eNGtcCiKjjpkQKlMTEg3ZwoxtHHtgfTRpYXArvp//2Q==' ;
|
||||
'cEgeNHhi7D3qC3UN69M8tIakRhgrh9o748+eNGtcCiKjjpkQKlMTEg3ZwoxtHHtgfTRpYXArvp//2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// lf-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['f'][0]= 633 ;
|
||||
$this->chars['f'][1]=
|
||||
//==========================================================
|
||||
// lf-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['f'][0]= 633 ;
|
||||
$this->chars['f'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQFBgcC/8QAKxAAAgEDAwMCBQUAAAAAAAAA'.
|
||||
|
|
@ -42,13 +45,13 @@ $this->chars['f'][1]=
|
|||
'akUuz8x5DwdN5peS1jV1dSipSiVUigIcdQjQ26lIB/c6r3F86SZpE/zCFJaqsihQNhRgdj3Jyfxo0jDSbXHt9Oph9RAoV3qJGltY'.
|
||||
'HDOxyb/nRpV0D3RXle21m48XraOk3IUSemUaV4g4Zc9ShcDtgff+tQfwvjq34Dtku7buamFqeJKemCCMxKFsEJU+/FrX8d76sEHG'.
|
||||
'aNItzr4usVNdG3S0rmRYAVwEUmyjyQLZ11x7aF4zs9DQOyzml29I2cLa/pixIHi99DFCtU9dFuLIaijo9qiYPmR2mZmB9thgAHOD'.
|
||||
'4+mjUrURyrUNMZFEkkIOFuFAbsP9d/OjVIQ6Vh4tP//Z' ;
|
||||
'4+mjUrURyrUNMZFEkkIOFuFAbsP9d/OjVIQ6Vh4tP//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// lb-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['b'][0]= 645 ;
|
||||
$this->chars['b'][1]=
|
||||
//==========================================================
|
||||
// lb-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['b'][0]= 645 ;
|
||||
$this->chars['b'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYCAwUH/8QAKxAAAQMDAwMDAwUAAAAAAAAA'.
|
||||
|
|
@ -57,13 +60,13 @@ $this->chars['b'][1]=
|
|||
'Q1CvMNQWTjCt+HFD+PB/Y1fI1PL1HFFt0zaGblFdJQ9cJjpZiqPJUlBAKnPcEpGB5NNRKdrOl1NlgiQol4R2w4Sc5VtGf7opZteo'.
|
||||
'LhdorjUSM5FnQnlR50NeHQysYxtVxlJHIPgjtRRD3xkaghs6juumdHz4+Y7RVPnt59K2mk7W+fcKWsZ7djTXMkW+xMP3GRJjwIEN'.
|
||||
'HTG/CWx5wPY8AADx2NYk3SL9wukvUjGobnBkORksIbjdMANozgEqSo8qJPGO/wAVO36IsjUmBIfZfuM7epZk3F9UhSSk5O0K9Kcq'.
|
||||
'8AcU3UzFuhUSBFud6nRXoz96mqmJZWg7m2dqUNhWBwdqQSP1UU5c/FFCn//Z' ;
|
||||
'8AcU3UzFuhUSBFud6nRXoz96mqmJZWg7m2dqUNhWBwdqQSP1UU5c/FFCn//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// d6-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['6'][0]= 645 ;
|
||||
$this->chars['6'][1]=
|
||||
//==========================================================
|
||||
// d6-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['6'][0]= 645 ;
|
||||
$this->chars['6'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAEBAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwMC'.
|
||||
|
|
@ -72,13 +75,13 @@ $this->chars['6'][1]=
|
|||
'GgrlSn8xyf6p4gXaHJvNps9/mKZtSkGdMjRwpfqAFBLLACRlZUrJONsI2717No1lbZ10kx7XGnRpKWQ/6GVGMfzEJ5VFIVtsOH6e'.
|
||||
'wyKVhYsia0y22pLThSkJK1uniVgdThOM0ol+StIUhpopIyCFq3H8aUVCwnG3PGe4Rp6fLXJtMdyM0ojcIWvIz3HFnAPfrWTXb6GN'.
|
||||
'WaLXDwZjVz8pKEfhuIUFg/bAz9sVJ61nt61mxJFslLtq7e5yPqiBT4UDklKw4MDpt+u+9bFiu9riXNu83R+fcr6tohuQ5HQhmK37'.
|
||||
'paaC8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+e7Qerl5z74DY/1SomP//Z' ;
|
||||
'paaC8DruScmg6X8KkjZEhbaB9KEyFYSOw26Uqd+e7Qerl5z74DY/1SomP//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// lx-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['x'][0]= 650 ;
|
||||
$this->chars['x'][1]=
|
||||
//==========================================================
|
||||
// lx-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['x'][0]= 650 ;
|
||||
$this->chars['x'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABMDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAUHBgj/xAApEAABAwMDAwQCAwAAAAAAAAAB'.
|
||||
|
|
@ -87,13 +90,13 @@ $this->chars['x'][1]=
|
|||
'p9I0lSX2kgqCSklK+5PKCMAng6zV2XRO6u3lSIURtbDRShltlZHa0tW7q/0MeTwnjxq1Jiw2xc9xTLbhSVU5iaXUFfqFFILgJOCd'.
|
||||
'9Gt3SXabR6REpkL8yo0RpLCFNx1qBCRjOQMHxo0pEr6o3um2LVYpMEpTVqg25lHn08dfcB9kEgfZ1LIFDuawqZRb7aQlLTzqglsg'.
|
||||
'9wQdveOEqBIB425xqhQuk8qo9UKlPrlRblw2ZBeCSVKW6CcoSrI2AGOT41SKzT4dYtmdS5bIXDZhNoWgbZJ94x8AYT/GkM03oNUc'.
|
||||
'uKgwqtTZDTMOU0FttqRkoHggnPkEEHRrkJ6t1SlSHYUOc6zHaWrsbQrATk5/vRqK/9k=' ;
|
||||
'uKgwqtTZDTMOU0FttqRkoHggnPkEEHRrkJ6t1SlSHYUOc6zHaWrsbQrATk5/vRqK/9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// d2-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['2'][0]= 606 ;
|
||||
$this->chars['2'][1]=
|
||||
//==========================================================
|
||||
// d2-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['2'][0]= 606 ;
|
||||
$this->chars['2'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEQMBIgACEQEDEQH/xAAYAAEBAQEBAAAAAAAAAAAAAAAFAAQHAv/EACsQAAEDBAEC'.
|
||||
|
|
@ -102,13 +105,13 @@ $this->chars['2'][1]=
|
|||
'gYCSoSoY8ISKSbFeUrzkdlnTL1YshskiErkQnFEZaF8kkdBBVdjyi6RNL5+9F486eS/ECVkcBtDt1vZcho5viS8ZCp9C9tAIAm/F'.
|
||||
'VoPRU+HRtJ5JVRP1kP0PfwP+1VKrHBMliXG4Nw8VgE4xGkuqk2S1wTUNEVdIvgpL9iL6KtNxY7WOwo9tt0RCitj0sR2uCbFPPzH1'.
|
||||
'7+6rRuSRcljMBMsUy2tky045KOawZk5xtEFBJEROO3hx61kh2rPCIX3MhsyC4QmfTbC6lH8dq5212qwkiG5H6Y/9R2qm+ofxqqsL'.
|
||||
'DLZ6f//Z' ;
|
||||
'DLZ6f//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// lm-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['m'][0]= 649 ;
|
||||
$this->chars['m'][1]=
|
||||
//==========================================================
|
||||
// lm-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['m'][0]= 649 ;
|
||||
$this->chars['m'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAcDBAUCBv/EAC0QAAICAQMCBAMJAAAAAAAA'.
|
||||
|
|
@ -117,13 +120,13 @@ $this->chars['m'][1]=
|
|||
'iywyBhjDKTkeXfSr+GRfYtq2KAO32b1BGxAZu0dyJ2DKPTxY1wPddVszycUq2Golq8jRWbcnJWwCVGMjz+VQP50atxMtm2ZUOY4l'.
|
||||
'4qfUnBP0x/Z0amy4jJm10Tt2yddWasFmfaRfdrlG3UcgArnxKzJ+Fu4DqCMkcgNem2DoWav8PLfTm+FPEkuSNTnqueS5bnHIv6CG'.
|
||||
'LNjJwM99bm67NB1Ht89KSxNXnr2hNDbiUc47K4KyD2GQMfmMjUnS+7vuIktTqPCaaWCqAMMojPFyw8hyYMQBnAwNJHYGXPTsW9VN'.
|
||||
'jg2zf50W9zk524GAEihuz+xbIOD82jW5TkjtRPZkTkJ+4VgDhQfuj/f3OjUxl1f/2Q==' ;
|
||||
'jg2zf50W9zk524GAEihuz+xbIOD82jW5TkjtRPZkTkJ+4VgDhQfuj/f3OjUxl1f/2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// lt-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['t'][0]= 648 ;
|
||||
$this->chars['t'][1]=
|
||||
//==========================================================
|
||||
// lt-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['t'][0]= 648 ;
|
||||
$this->chars['t'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQDBQYH/8QAJxAAAQMDAgYDAQEAAAAAAAAA'.
|
||||
|
|
@ -132,13 +135,13 @@ $this->chars['t'][1]=
|
|||
'Hk7AHVkbkLI+RQc7uRxgkfr1tx2rGu6VbToLVKkhU+kbugGf9WfaknCk5ycaX0zmaa+3JkqvW/CmzojsB9xoF6OoFK0r6HOcEDI0'.
|
||||
'aefTuKX5ScMdC14HYq8n12zo1DEUcKTGg1Z+hyBwoPBVIiA/VQyOIgedhUCB4WMfXSV3UufVLcTUIqVf26K6mXDbPVRRzKT54iMg'.
|
||||
'+zjtq6mtsyJjclxpKlUhSXEbkgkqWnBx4+J5e/zU0pZemPvJJQzEPDfQOrwwFY9AZ5eeYPLV6FwhoFYZuigxpkJeIjqAeIoAk9wA'.
|
||||
'D46EnuD+6Nc1smDNrTlRkxqtMo1vzKhIdYgU9YDqVpISrLhHxSSd21I0aYyqP//Z' ;
|
||||
'D46EnuD+6Nc1smDNrTlRkxqtMo1vzKhIdYgU9YDqVpISrLhHxSSd21I0aYyqP//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// li-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['i'][0]= 639 ;
|
||||
$this->chars['i'][1]=
|
||||
//==========================================================
|
||||
// li-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['i'][0]= 639 ;
|
||||
$this->chars['i'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABwAGBP/EACcQAAEEAQMEAgIDAAAAAAAAAAEC'.
|
||||
|
|
@ -150,11 +153,11 @@ $this->chars['i'][1]=
|
|||
'KND+h47km1bZwsvCbYYjycxIyK1qDv2yEi0hQviK8atKDcy9j//Z' ;
|
||||
|
||||
|
||||
//==========================================================
|
||||
// lp-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['p'][0]= 700 ;
|
||||
$this->chars['p'][1]=
|
||||
//==========================================================
|
||||
// lp-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['p'][0]= 700 ;
|
||||
$this->chars['p'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGgAAAQUBAAAAAAAAAAAAAAAAAAECBAUGB//EAC8QAAEDAwMCBAMJAAAAAAAA'.
|
||||
|
|
@ -164,13 +167,13 @@ $this->chars['p'][1]=
|
|||
'Y0qmLZSrwJJcQoOJ5XKlJFu4HbJOjVbt+V5nu7eopNRivqcdhK+bFnWwA1Y2AOcgjvj9dGlxy0g5y0xd+hNXoG24C4obizq3HZUh'.
|
||||
'YHqtRHD06bG/8a0MbbG1mqekxaBSGmgkrcdcitlLfrckZIz7DUatbeFak0tyRLUwzT5vmiGm0cufEkFBJItfkD+59tKmiO12atFa'.
|
||||
'eQukO3ejUxgENqTcfnE5WbkHiOnJ76N2IqI1DibabptS+zkZhtp90F2Y0S026EkAFK/qL46cXv65NVZDfxHmVCK4DE2/RX/lRFbA'.
|
||||
'C5LwAyq2EtpHZI7mxPYDRqoctdESimz/2Q==' ;
|
||||
'C5LwAyq2EtpHZI7mxPYDRqoctdESimz/2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// le-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['e'][0]= 700 ;
|
||||
$this->chars['e'][1]=
|
||||
//==========================================================
|
||||
// le-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['e'][0]= 700 ;
|
||||
$this->chars['e'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABgDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYEBQcB/8QAKhAAAQMCBAUEAwEAAAAAAAAA'.
|
||||
|
|
@ -180,13 +183,13 @@ $this->chars['e'][1]=
|
|||
'UiqjkynzAVtwV23Ud+X4Ibpa2DCPkjhfUaRO/p8yzpb+YHhUmhbev6ZEll1lvqK3jt2XrbBgp6HVwsK3THpfEubGSoOUyFMpbJmL'.
|
||||
'Deh6SgOGKti57EuY6l62JMWdJy7k3hg1LkOozEbVm7suQSkTiKtkEfP1pH664Za/QItccgI4bseTHdNxiXHLQ8yVl7V32XyioqL5'.
|
||||
'TGc1ng6eYs0idczXUZscBBABWgEhEtfKNuUezwPnBhEuj8X2M21z9BR6NUX211Kk/UKKAjuhkPhL7XVf8vtgw7UPJlEyrDWFSYLb'.
|
||||
'LBNF6qrzG6t0spEu6+fpL7YMXhUndp//2Q==' ;
|
||||
'LBNF6qrzG6t0spEu6+fpL7YMXhUndp//2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// la-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['a'][0]= 730 ;
|
||||
$this->chars['a'][1]=
|
||||
//==========================================================
|
||||
// la-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['a'][0]= 730 ;
|
||||
$this->chars['a'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABoDASIAAhEBAxEB/8QAGAABAAMBAAAAAAAAAAAAAAAABgMEBwX/xAAvEAABAwIFAQcCBwAAAAAAAAAB'.
|
||||
|
|
@ -198,11 +201,11 @@ $this->chars['a'][1]=
|
|||
'UGaD1c9HSR1HFUh9tJU45EBcAtcC9+P9wqbg8IAto9o81yputrVGpiUkgHKkqUTZI32+cKm1z1tIUgPBBAKQ4UBQH3uL3xmXSXep'.
|
||||
'HVDtXStE5K5jlPU7PF3Q41+okJFkjgC+3OuNSYiSzHaLtRcW4UDMpLYSCbakDW3thhum5p//2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// d9-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['9'][0]= 680 ;
|
||||
$this->chars['9'][1]=
|
||||
//==========================================================
|
||||
// d9-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['9'][0]= 680 ;
|
||||
$this->chars['9'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwP/xAArEAABAwMD'.
|
||||
|
|
@ -212,13 +215,13 @@ $this->chars['9'][1]=
|
|||
'Edls9QKKnOVLyk7UgcbzzrdBthqEJJwZbAI4x1U/7o1TaFa9lG36aXaZTy54VrcXUgrzsGdx+T30aNydweqVw1GS87T6Lb86Q4ha'.
|
||||
'my/IAYjZBx+snKk99oOQMf1AViE65SY348hzFy6hPKnqtKz7DC1lbqyPrvJKUJ7H+M6Wrt3InP7o1brFNp4bCDGhxGAsqz69VSiQ'.
|
||||
'ORwBxrrQ7itm1ac7Hp0WoGTIc3PSn0pccdcP2WorycfA1RaRHjxosZqOyhtDTSAhCf2gDAGjVHTd9sKSCumynFEZK1tIJUe58/ro'.
|
||||
'1V1//9k=' ;
|
||||
'1V1//9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// d5-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['5'][0]= 632 ;
|
||||
$this->chars['5'][1]=
|
||||
//==========================================================
|
||||
// d5-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['5'][0]= 632 ;
|
||||
$this->chars['5'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgIFBwT/xAAoEAABAwME'.
|
||||
|
|
@ -227,13 +230,13 @@ $this->chars['5'][1]=
|
|||
'kqG4FPBxnjxpvvi4KZb1pTpU+QwxUi2Y7ZIAefUk5ATxnB9/gbtL/wCH1UpuhPUlZlMVaQ0mS8zJjqZOPfc2TwpIUonI9tw40R1r'.
|
||||
'WNGq/wBdJR1XT3lqHBUnGCfkfWjRWs1ve249erQqQYjOtN1FqPUpCXQ4WIzQSsJwT0UpRwQPG0nzqyuNHobjsl9kBuWqoOoXtT1/'.
|
||||
'WppZcA8lKRj64HxqU+3KpAr6plElRVKef3S4E0K9O8pLXVzKcqSsJAB9wSAca6bSoNXeuA1+5pEV+SGFNU1iKVFqI0Vdx2AJUeoz'.
|
||||
'8DGlTDwG3CAf3q/pI0ah6MDhLz6U+EpXwPoaNMU//9k=' ;
|
||||
'8DGlTDwG3CAf3q/pI0ah6MDhLz6U+EpXwPoaNMU//9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// d1-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['1'][0]= 646 ;
|
||||
$this->chars['1'][1]=
|
||||
//==========================================================
|
||||
// d1-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['1'][0]= 646 ;
|
||||
$this->chars['1'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEwMBIgACEQEDEQH/xAAZAAADAAMAAAAAAAAAAAAAAAAABQYCBAf/xAApEAACAQMD'.
|
||||
|
|
@ -242,13 +245,13 @@ $this->chars['1'][1]=
|
|||
'OFAGT09/kO3OmV3a20MFRf6lIYPcpy7yRRAzgxjIy2M8YwcdiBzpX6d22VNvUlTXsFkuwkrKqNSfnK7F8OTzwrAY+l5zoxKskudN'.
|
||||
'EgQPUT9PBkWF3DH+1GPxo1mLnRoAqF2VRgGOFmX/AAgY/GjRUP6hVMFv2FuFqUvUGrpDFJMBnpdyF5bsAQew7Hxzp6LZNT0yQ1DI'.
|
||||
'wp0QCFBhD0jCsfLZHxbx5xxpTuvb1+v9PV7Ztk9roLPLCjmSSN3mX5ZwqjCgZX7PfWxDQb2in96pv9qq46aTE0bW4x9ceAWAYPwS'.
|
||||
'PsYzoixgmheBGjIVcYCnjp/jHjHbRpe1JLn9OnopE/a0ykvjwDx47aNMXqP/2Q==' ;
|
||||
'PsYzoixgmheBGjIVcYCnjp/jHjHbRpe1JLn9OnopE/a0ykvjwDx47aNMXqP/2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// ll-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['l'][0]= 626 ;
|
||||
$this->chars['l'][1]=
|
||||
//==========================================================
|
||||
// ll-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['l'][0]= 626 ;
|
||||
$this->chars['l'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYEBQf/xAArEAACAQIFAwIGAwAAAAAAAAAB'.
|
||||
|
|
@ -260,11 +263,11 @@ $this->chars['l'][1]=
|
|||
'Ivgw+T0yRRyyxIqNfkLcA8jt7YMKcBWn/9k=' ;
|
||||
|
||||
|
||||
//==========================================================
|
||||
// ls-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['s'][0]= 701 ;
|
||||
$this->chars['s'][1]=
|
||||
//==========================================================
|
||||
// ls-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['s'][0]= 701 ;
|
||||
$this->chars['s'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGgAAAgMBAQAAAAAAAAAAAAAAAAMCBAUGB//EACwQAAEEAQIFAgUFAAAAAAAA'.
|
||||
|
|
@ -274,13 +277,13 @@ $this->chars['s'][1]=
|
|||
'LGU+whZZK+Rw+oYJAyj3GjS4dZFpZVkqPLktdfMXNcaU2kBC1BIITkdx6c599GlnvPAa3TL2vNvU76n0063acr3YSLCEjpUpUQtW'.
|
||||
'Dhf14SMEnOc57aZ8Tegm7dbrEQGZt1PeTDgc1PEW3FeXAvyAkZVkeMDOm2G3f3O7Cl/qEuqkQg4lp6CRxraWfUlRUD24kZA741Ko'.
|
||||
'2k1HvlT3ri2sLOCgtsyJz6XEtBwZPAgJAGQMHUNPWKqWItsqh0UCFVyLeKhyLHQ2TMdHNVj+RKlAnJyfto1FW2ahgjrq6LYTFjjf'.
|
||||
'lymUOLdWfJyoHA+gA7AAAaNPE3ysJdLT/9k=' ;
|
||||
'lymUOLdWfJyoHA+gA7AAAaNPE3ysJdLT/9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// lh-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['h'][0]= 677 ;
|
||||
$this->chars['h'][1]=
|
||||
//==========================================================
|
||||
// lh-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['h'][0]= 677 ;
|
||||
$this->chars['h'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGgAAAQUBAAAAAAAAAAAAAAAAAAIDBAUGB//EACwQAAIBAwMCBQIHAAAAAAAA'.
|
||||
|
|
@ -290,14 +293,14 @@ $this->chars['h'][1]=
|
|||
'tTwwJ9WjhILDrTKnIdMEDl2+P80aVdJZb1QW+vgqENLPH4sBCDLIwUgnOf4GjVvDnLgUk79T81voqjb8NnuUx8pVRCiEaYUSuynl'.
|
||||
'jHU9mOfnOoOx6hqz8PrbNdfEkMUXg1LSM3rKOUywJ7YAJ1ZTWmSpvdvlaVTDSUzJAhH5ZJBgv0x2RSAPlz21WXqoet3ba9nuW8n4'.
|
||||
'Jr6qTPqnUNxSM/f6mPvxA9zqJnExTbR+h0nkhVu1uE8j0UBRQ9PGxBKFjnkAScdsDp10a0lc7z0tI7Y5YYN+5GAf7GjVXF4Icj3f'.
|
||||
'/9k=' ;
|
||||
'/9k=' ;
|
||||
|
||||
|
||||
//==========================================================
|
||||
// ld-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['d'][0]= 681 ;
|
||||
$this->chars['d'][1]=
|
||||
//==========================================================
|
||||
// ld-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['d'][0]= 681 ;
|
||||
$this->chars['d'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQFBgH/xAAsEAABAwMEAAQFBQAAAAAAAAAB'.
|
||||
|
|
@ -309,11 +312,11 @@ $this->chars['d'][1]=
|
|||
'slsRKo0HwlODkBRzxj2AGoXTtpzIdQ8MbffUChz4NCPRaClAo9Mn6c7T3o13wytmo0K05VIqkiPJbizFiMWs4CTgnIIHOST796NL'.
|
||||
'Ia1JX//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// d8-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['8'][0]= 694 ;
|
||||
$this->chars['8'][1]=
|
||||
//==========================================================
|
||||
// d8-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['8'][0]= 694 ;
|
||||
$this->chars['8'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AFQMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABgcEBf/EACsQAAEDAwMD'.
|
||||
|
|
@ -323,13 +326,13 @@ $this->chars['8'][1]=
|
|||
'44xxxrA1a4KVJipLidri8uLHgqOcfjOPxo0o2hdDvS1CmV2Yl6fS5ioipIQR1CAlKkLKR2UUqAI8g6NRSwuuyHab6s1ufLI/Zai7'.
|
||||
'UBJOxhTS0+6B32pWSFH4CidOdWU0ukLiN1BLr0zG5Sdm3GRvcPhIT858DvjXNrVsSLnm/VIdTXS6tTnFsxZTSN3jchaTwps+O/z9'.
|
||||
'tcBVq3hIX0tYqlIiQHdy5CqRHKHXEjAOMgBKjnvyRk4xrQa7OiGt1K5biYZL8SoVEpjOqkFsONtJCNwASeCQrn7aNUKnQYtLp7EC'.
|
||||
'EylmLHQltptPZKQOBo1FzH//2Q==' ;
|
||||
'EylmLHQltptPZKQOBo1FzH//2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// lz-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['z'][0]= 690 ;
|
||||
$this->chars['z'][1]=
|
||||
//==========================================================
|
||||
// lz-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['z'][0]= 690 ;
|
||||
$this->chars['z'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAFwABAQEBAAAAAAAAAAAAAAAABgAHA//EACsQAAEDAwQBAwIHAAAAAAAAAAEC'.
|
||||
|
|
@ -341,11 +344,11 @@ $this->chars['z'][1]=
|
|||
'4lLlyJk2cEqW+6V+m0AE9ISLnsj5+O9UhsFK92bZZqb9SRu9p2c4A0OCEqDbYAJSlJwAVZv3fBvbFrg/462btlhuS1RG5nL8pYkq'.
|
||||
'KrnsKH06I/rVrQKkf//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// d4-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['4'][0]= 643 ;
|
||||
$this->chars['4'][1]=
|
||||
//==========================================================
|
||||
// d4-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['4'][0]= 643 ;
|
||||
$this->chars['4'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAYAAADAQEAAAAAAAAAAAAAAAAABAYHAv/EAC0QAAIBAwQA'.
|
||||
|
|
@ -354,13 +357,13 @@ $this->chars['4'][1]=
|
|||
'JJyjYr8Xhrn5g599J7x3ulBNU7Zo7dXXXcLQ8kURYi4epYtkALjOePv1nUvbLvV7P3BZm3DR3eh88Kp7pVzBZI6iUhGWRRGWwE44'.
|
||||
'HX3V+uiL1uHgt+vL/H+aNJQ3CSeCOaFqSaJ1DJKs/TqRkMOvQjvRorHE4pRDLNWLGlRHGUeYIORXs9e5B7OP31E0fmdyb/t0DJ4Q'.
|
||||
'27bfx3YZzPUIoAAz7IpOD6cuxq0uNumqLfVNDOqXBoZEjnZcqhIPXH4c46+WkdoWOltu3IDDLLLVVR83UVcuPEmmcZZ2/rHoAANG'.
|
||||
'GI7KIY1ijoLeEQBVCwIoAHpgY6Hy0aZe7mJ2jeHLKcEhusj6aNKgzr//2Q==' ;
|
||||
'GI7KIY1ijoLeEQBVCwIoAHpgY6Hy0aZe7mJ2jeHLKcEhusj6aNKgzr//2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// lv-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['v'][0]= 648 ;
|
||||
$this->chars['v'][1]=
|
||||
//==========================================================
|
||||
// lv-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['v'][0]= 648 ;
|
||||
$this->chars['v'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQDBQYH/8QAKBAAAQQBAwMEAgMAAAAAAAAA'.
|
||||
|
|
@ -371,11 +374,11 @@ $this->chars['v'][1]=
|
|||
'shyW6AocpHNIrv8AvWzk9BUSdPdYS4BcRlomkhIV6KP0VE39V+tU2wdlRMHtZUB8NuTQ+51X27+Kr46ZPIAFV540D8zeLsJ5LMHa'.
|
||||
'ubmMBCVJdjx0pRyLoWR4I8aNIQ8BvZMNtMTeUcsptKfc4tC1gAkCyFC+K0aJtf/Z' ;
|
||||
|
||||
//==========================================================
|
||||
// lk-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['k'][0]= 680 ;
|
||||
$this->chars['k'][1]=
|
||||
//==========================================================
|
||||
// lk-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['k'][0]= 680 ;
|
||||
$this->chars['k'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABUDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAUGBAMH/8QALhAAAQMDAwIEBAcAAAAAAAAA'.
|
||||
|
|
@ -385,13 +388,13 @@ $this->chars['k'][1]=
|
|||
'PEp18JTIfeW3kq3ly4H26aNZqvTWZsjFcZTsVtSg0G8Rio+vr2vb7g6NLPRnuXy8F+8kl+obUh4KXJdqSJJQnohlkZqJPYBXh3P+'.
|
||||
'a4b5Hyp6k1bO7sOotPyXkj9NlwFl0ewstJA9ifrqkVSmET4csoS7UTHXFQ+6SQlskKUMb/tH9ddLVUmS7DqdBqD7U6OsqfS46jzl'.
|
||||
'hQ5bXb1K9Scuybdxo2OTu92dwSZkWn0Sb8viQWyn8Qq5D6ifSLd0BIv7q0arTBRSKPToMZbi2GWylsvLK148Wue/XRrRjxOpT2R2'.
|
||||
'k9aP/9k=' ;
|
||||
'k9aP/9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// lr-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['r'][0]= 681 ;
|
||||
$this->chars['r'][1]=
|
||||
//==========================================================
|
||||
// lr-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['r'][0]= 681 ;
|
||||
$this->chars['r'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABYDASIAAhEBAxEB/8QAGgAAAgIDAAAAAAAAAAAAAAAAAAYCBQMEB//EAC4QAAICAQIFAgMJAQAAAAAA'.
|
||||
|
|
@ -401,13 +404,13 @@ $this->chars['r'][1]=
|
|||
'r3IBAth5OYxozKsgc8y4GTgnJB9uncdTi6tXq2140rRVM13JMEMAVAg7sMdBjJB/18uDgRO9R2Oo6FX2vShkFzURFUq1whIj+8DI'.
|
||||
'7EdAFjXv7MeNb0kuStsFEmIaajZaos2fy2Q4VGH7SGxn+Rzw9yMLOm/FzRhZazmOTkP4grYyD3B8j2PTyeFfZ+z7G3BeSS8lmprl'.
|
||||
'2K2qcnK0Z5S8gPjrgAY8cNEWmq7u23pEos6/Zji+Kd0rLLGWwseA3joeZj/w4OET1g0vlmrWV+ydFnkUxSgsvM4V+YYIwfHz6cHB'.
|
||||
'ZeKZ1//Z' ;
|
||||
'ZeKZ1//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// lg-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['g'][0]= 655 ;
|
||||
$this->chars['g'][1]=
|
||||
//==========================================================
|
||||
// lg-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['g'][0]= 655 ;
|
||||
$this->chars['g'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAQCBQYH/8QAJxAAAQQBAwQCAgMAAAAAAAAA'.
|
||||
|
|
@ -418,11 +421,11 @@ $this->chars['g'][1]=
|
|||
'KvtaSkW4tYNVSqKiTwB+fw5n9sY/cuOXCzDDcluyW3Ckd7V+0n0eNZTH9DdouFalHIOJBUhtDki0pNV3UALo81ehG6IdKjPZ6d47'.
|
||||
'4ywltanVJvuJI+RQs/sHRqy2r003JhsImEc/CUyhxRZBjKV2oJ8eRXNmufPnRo1WIz3DdNn/2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// lc-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['c'][0]= 629 ;
|
||||
$this->chars['c'][1]=
|
||||
//==========================================================
|
||||
// lc-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['c'][0]= 629 ;
|
||||
$this->chars['c'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAAUGBwID/8QALRAAAgICAQIEBAYDAAAAAAAA'.
|
||||
|
|
@ -431,13 +434,13 @@ $this->chars['c'][1]=
|
|||
'IB1IVQT5frrv24twPgunk6a288crbklUSJNNdnSTZ2STHHqOP/Eb17njdZtAoqwEvrEiGVyG117/AG6HhyV8H1sljMldoxXTksGC'.
|
||||
'zV7M0oaWGQOVeGQ92I6EMR22D11w4LmEPjaOL51iL8ssc9Z69zHtZkYCGGeQK0ez2UEoU39wCeX1S/LLiEt+mPSbMLxsGVv2kEjR'.
|
||||
'305xkaEV/GTULMUT1LD/AAGh8gIZS2jv+vpybb8NMIb0dVLWYWgiiU0vmMphOj6V0TvQI3rfsON1E6dYjGtisa0F1mAWR2NhG0WZ'.
|
||||
'3Ls3TqNs5Hc9h23w49NWL9K+Q/VD5T/zhwPH/9k=' ;
|
||||
'3Ls3TqNs5Hc9h23w49NWL9K+Q/VD5T/zhwPH/9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// d7-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['7'][0]= 658 ;
|
||||
$this->chars['7'][1]=
|
||||
//==========================================================
|
||||
// d7-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['7'][0]= 658 ;
|
||||
$this->chars['7'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABgEFBwT/xAAuEAABAwIE'.
|
||||
|
|
@ -446,13 +449,13 @@ $this->chars['7'][1]=
|
|||
'19wpkCMDZKUpv0FZvbi1NzpYasMDLDUbMVXrtQdbeeU23xLWkj5RlLYK0J7anW9gbAjCzkOtsVSUJUdtc6dVZK51UeaFm4LKbhpC'.
|
||||
'l7EhIFkDW974GbRI2XorUVls1OTdKAOqUpR0Hc3198GITQ6k+hLwrEpoODiDenRfW23bBicg78JXxPpD0mgVOW5PAivNNpahsPW5'.
|
||||
'8xxQaSVkboQnhsnYm5OHqDGp1IpsalMKjMsMIC3+XZKbJFth62/QOEfMOZqZXp9JcKZTcGmTky3meSi7xQklI81vMR+sXIz/AEgp'.
|
||||
'Q0qPNu6ea8Q2jqtbp8+2w9h/OKORc/cpHjt1dDSHOtLZ4ekHW23bBjj+o9H/AB539aP94MG0+L//2Q==' ;
|
||||
'Q0qPNu6ea8Q2jqtbp8+2w9h/OKORc/cpHjt1dDSHOtLZ4ekHW23bBjj+o9H/AB539aP94MG0+L//2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// ly-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['y'][0]= 672 ;
|
||||
$this->chars['y'][1]=
|
||||
//==========================================================
|
||||
// ly-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['y'][0]= 672 ;
|
||||
$this->chars['y'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGAAAAwEBAAAAAAAAAAAAAAAAAAQGBQf/xAArEAABAwMEAQIFBQAAAAAAAAAB'.
|
||||
|
|
@ -461,13 +464,13 @@ $this->chars['y'][1]=
|
|||
'76xtz0ioVvbcJ6msx2JtOfZmw1PKI5LQcJNh7UqBKcn6+NRfqPu6s1fYc6GxSJsRfWDUVSGA22ygEckJWSexRNgOP0udXzDKOJ0I'.
|
||||
'yo62mHm25Sy80l1Z4lSgpQvZRGLgWwPGjTjbchyLH+Ejx22EtJSgO8kki3kADA/nOjWjGzv73CyQZjUWNVp7bNSrj7qJDqflqUlQ'.
|
||||
'DMds24l3HvcNr3Pi9gME6T9WWVsemdYWswwC2lPta4m5WMA3OdUExCmozUJD6g84ntMjrHIFBTdQz5yLDx/WDNytpwW6nAkViqVe'.
|
||||
'uvmXdlme6n4dCwlRBKEgA2tj99QG7Ilncp5QqpU31PMsJ6x7A32f6SPxo0hPVCD45oVyKf0MtgeT97/nRrO7UOCFla3tn//Z' ;
|
||||
'uvmXdlme6n4dCwlRBKEgA2tj99QG7Ilncp5QqpU31PMsJ6x7A32f6SPxo0hPVCD45oVyKf0MtgeT97/nRrO7UOCFla3tn//Z' ;
|
||||
|
||||
//==========================================================
|
||||
// d3-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['3'][0]= 662 ;
|
||||
$this->chars['3'][1]=
|
||||
//==========================================================
|
||||
// d3-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['3'][0]= 662 ;
|
||||
$this->chars['3'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD//gAJSnBHcmFwaP/bAEMACAYGBwYFCAcHBwkJCAoMFA0MCwsMGRITDxQdGh8eHRocHCAkLicg'.
|
||||
'IiwjHBwoNyksMDE0NDQfJzk9ODI8LjM0Mv/bAEMBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAB4AEgMBIgACEQEDEQH/xAAZAAACAwEAAAAAAAAAAAAAAAAABAUGBwL/xAArEAABBAED'.
|
||||
|
|
@ -476,13 +479,13 @@ $this->chars['3'][1]=
|
|||
'VsJjnCMBxKkJJx7goAde+ceJfdNxU0UNlyymyXHi6kxWUNl1S3EnkAEIHX2nv86qtTuZr9Q9+1VhRsOoYpYcgSVyAE/TdewkJxnK'.
|
||||
'sBCjkdPGpnOtFMd3PqsXgfOAgD8Y0aX+11H9rDDjn8lr9yj5J+dGqsqxaw6Cc9cQZU4Sp7zTJsIrKlcUEKwhSin1JABI45GUjqOu'.
|
||||
'lbOvjbc3Ts9ynjGCy445UuFLYRzbWgrT6fhSCQSMDke+pew2zYVly/d7YchNqkMJZnQpgV9J8IzwWFJyUrAJHYgjvpLbu37G5nR7'.
|
||||
'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ;
|
||||
'vck5C3YRKYEOEVJZj8kjKypXqWvirjk9h+dB9i4faa89TDZUfKlIyT8k+To10a6KTkpcJ/0vL/7o0TS//9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// ln-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['n'][0]= 643 ;
|
||||
$this->chars['n'][1]=
|
||||
//==========================================================
|
||||
// ln-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['n'][0]= 643 ;
|
||||
$this->chars['n'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGwAAAgEFAAAAAAAAAAAAAAAAAAYCAQMEBQf/xAAtEAACAQMCBAUCBwAAAAAA'.
|
||||
|
|
@ -491,13 +494,13 @@ $this->chars['n'][1]=
|
|||
'LVGS1+K16vCzfiR3GmoqqXGyxz06hWPsFlVMfOmq1iNvE69KjBYo3oJMZ3GKeYYPxg/fW+xzZX1FLQyxwSTcpWNceu4G3+aNSmpY'.
|
||||
'qmQzzwh2k8yhv2r2H23/AJ0aoy+EWh7I1ntacR3PxDtEzhjWy0wkkIwYmanU5GO6sNh7rrU8AVdTceNbhDXxNHUQvS0tZ3DzwxVA'.
|
||||
'fB7hj59/XJ08cPWaKj4gvlwSQiG7dCboqvLy9NOmQT9SM7ayJrBa6K5V91hjlWorp4JGUOAglRSiMMDb82/vgaBGTpVvtNUVtyJg'.
|
||||
'5+WNAh5ZCu/r2+dGrgq0pi0DhmlRsSSAfqMd+b6ZyNu3po1Rk1yNBe3/2Q==' ;
|
||||
'5+WNAh5ZCu/r2+dGrgq0pi0DhmlRsSSAfqMd+b6ZyNu3po1Rk1yNBe3/2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// lu-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['u'][0]= 671 ;
|
||||
$this->chars['u'][1]=
|
||||
//==========================================================
|
||||
// lu-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['u'][0]= 671 ;
|
||||
$this->chars['u'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAYDBAUH/8QAJRAAAQQBAwQDAQEAAAAAAAAA'.
|
||||
|
|
@ -506,13 +509,13 @@ $this->chars['u'][1]=
|
|||
'wTiW0ukkrS28nn5fV2SPPFfurHUKQhzYG7pLYKEfyBhaSOS7dG/YCki/uvWn3LPDOJrwa4kyEzOYeakqkpC3Hk0bNePQHgDRpchY'.
|
||||
'leIZwzUWauKtuPctTSUlCAUmrBHIKuAPV/ujQsmHdm7hya43UbbD3ZVElOQJsdTS6IQaQUqBHCk8E2Pocgam6oYwObHy0Zm0oi45'.
|
||||
'T1KBPdpV2f0pom/1Ws7cmPazu98Ltvcq3VzRHfehz8a4pirFEKRZo8eQT+eCdWYfS/b+WYnxpbuVcDRMdHcyTqg2fiAfiLoi+Rf+'.
|
||||
'jT7Xc74HtOYnHyUOh8yWUvKeHhy0CiPVUAPoDRrm+OeznTva6lzsyMjCYbbaiNJjJSWElagD5tRpNUSALFeNGoOCH7Bv/9k=' ;
|
||||
'jT7Xc74HtOYnHyUOh8yWUvKeHhy0CiPVUAPoDRrm+OeznTva6lzsyMjCYbbaiNJjJSWElagD5tRpNUSALFeNGoOCH7Bv/9k=' ;
|
||||
|
||||
//==========================================================
|
||||
// lw-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['w'][0]= 673 ;
|
||||
$this->chars['w'][1]=
|
||||
//==========================================================
|
||||
// lw-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['w'][0]= 673 ;
|
||||
$this->chars['w'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABcDASIAAhEBAxEB/8QAGAAAAgMAAAAAAAAAAAAAAAAAAAYDBAX/xAAtEAACAQMDAgMHBQAAAAAAAAAB'.
|
||||
|
|
@ -523,11 +526,11 @@ $this->chars['w'][1]=
|
|||
'7oz/ALqitJulYJKuqvFsppHALLFb3cp9FBaXr+O51bq0q6i38KK5PDVAAxSzU6SIpz3Kjjn8jUFoS7uFmut1gq17xLFQ+DxOccj8'.
|
||||
'Rsn+tVpiyJnqv09YfOXu5AycgZZQEhBZjgDBOOgwO/po0sttWHdNzqLruioa4UwmdaC3kYp4IwSvJlBHKQ4OSe3po0qxM6P/2Q==' ;
|
||||
|
||||
//==========================================================
|
||||
// lq-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['q'][0]= 671 ;
|
||||
$this->chars['q'][1]=
|
||||
//==========================================================
|
||||
// lq-small.jpg
|
||||
//==========================================================
|
||||
$this->chars['q'][0]= 671 ;
|
||||
$this->chars['q'][1]=
|
||||
'/9j/4AAQSkZJRgABAQEASgBKAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx'.
|
||||
'NDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy'.
|
||||
'MjIyMjIyMjL/wAARCAAeABQDASIAAhEBAxEB/8QAGQAAAgMBAAAAAAAAAAAAAAAAAAcDBAUG/8QAKRAAAQQBBAICAQQDAAAAAAAA'.
|
||||
|
|
@ -537,79 +540,76 @@ $this->chars['q'][1]=
|
|||
'aiA0lQUopBJBI/7X9aNT7amRo228e3a31iO3yUzCcdSPiKAIFdCho0TIswZ7GQlO/hlRxBooih1YXzAoKUkX0LPEBX110dJ7zbuv'.
|
||||
'AORpO04cIpmxH23FSEIRwKuNnsdk0o31702XhFMKbuRUZJWP8LTQ6HBCuIB+iVWSR2BXuqK93/hDlvGzEphmG3Ml5JpDi1I7TzNA'.
|
||||
'BYFlPafY+/7LBiv1CYDH4iFDOGySlMR22lFP4wCUpANfL11o1r4bxXlWMNEaE/bqlIbCFl/ANPK5Do/M0VDr2Rf3o0TX/9k=' ;
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class AntiSpam {
|
||||
|
||||
class AntiSpam
|
||||
{
|
||||
private $iData='';
|
||||
private $iDD=null;
|
||||
|
||||
function AntiSpam($aData='') {
|
||||
$this->iData = $aData;
|
||||
$this->iDD = new HandDigits();
|
||||
public function AntiSpam($aData='')
|
||||
{
|
||||
$this->iData = $aData;
|
||||
$this->iDD = new HandDigits();
|
||||
}
|
||||
|
||||
function Set($aData) {
|
||||
$this->iData = $aData;
|
||||
public function Set($aData)
|
||||
{
|
||||
$this->iData = $aData;
|
||||
}
|
||||
|
||||
function Rand($aLen) {
|
||||
$d='';
|
||||
for($i=0; $i < $aLen; ++$i) {
|
||||
if( rand(0,9) < 6 ) {
|
||||
// Digits
|
||||
$d .= chr( ord('1') + rand(0,8) );
|
||||
}
|
||||
else {
|
||||
// Letters
|
||||
do {
|
||||
$offset = rand(0,25);
|
||||
} while ( $offset==14 );
|
||||
$d .= chr( ord('a') + $offset );
|
||||
}
|
||||
}
|
||||
$this->iData = $d;
|
||||
return $d;
|
||||
public function Rand($aLen)
|
||||
{
|
||||
$d='';
|
||||
for ($i=0; $i < $aLen; ++$i) {
|
||||
if (rand(0, 9) < 6) {
|
||||
// Digits
|
||||
$d .= chr(ord('1') + rand(0, 8));
|
||||
} else {
|
||||
// Letters
|
||||
do {
|
||||
$offset = rand(0, 25);
|
||||
} while ($offset==14);
|
||||
$d .= chr(ord('a') + $offset);
|
||||
}
|
||||
}
|
||||
$this->iData = $d;
|
||||
return $d;
|
||||
}
|
||||
|
||||
function Stroke() {
|
||||
public function Stroke()
|
||||
{
|
||||
$n=strlen($this->iData);
|
||||
if ($n==0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$n=strlen($this->iData);
|
||||
if( $n==0 ) {
|
||||
return false;
|
||||
}
|
||||
for ($i=0; $i < $n; ++$i) {
|
||||
if ($this->iData[$i]==='0' || strtolower($this->iData[$i])==='o') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
if( $this->iData[$i]==='0' || strtolower($this->iData[$i])==='o') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$img = @imagecreatetruecolor($n*$this->iDD->iWidth, $this->iDD->iHeight);
|
||||
if ($img < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$img = @imagecreatetruecolor($n*$this->iDD->iWidth, $this->iDD->iHeight);
|
||||
if( $img < 1 ) {
|
||||
return false;
|
||||
}
|
||||
$start=0;
|
||||
for ($i=0; $i < $n; ++$i) {
|
||||
$dimg = imagecreatefromstring(base64_decode($this->iDD->chars[strtolower($this->iData[$i])][1]));
|
||||
imagecopy($img, $dimg, $start, 0, 0, 0, imagesx($dimg), $this->iDD->iHeight);
|
||||
$start += imagesx($dimg);
|
||||
}
|
||||
$resimg = @imagecreatetruecolor($start+4, $this->iDD->iHeight+4);
|
||||
if ($resimg < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$start=0;
|
||||
for($i=0; $i < $n; ++$i ) {
|
||||
$dimg = imagecreatefromstring(base64_decode($this->iDD->chars[strtolower($this->iData[$i])][1]));
|
||||
imagecopy($img,$dimg,$start,0,0,0,imagesx($dimg), $this->iDD->iHeight);
|
||||
$start += imagesx($dimg);
|
||||
}
|
||||
$resimg = @imagecreatetruecolor($start+4, $this->iDD->iHeight+4);
|
||||
if( $resimg < 1 ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
imagecopy($resimg,$img,2,2,0,0,$start, $this->iDD->iHeight);
|
||||
header("Content-type: image/jpeg");
|
||||
imagejpeg($resimg);
|
||||
return true;
|
||||
imagecopy($resimg, $img, 2, 2, 0, 0, $start, $this->iDD->iHeight);
|
||||
header("Content-type: image/jpeg");
|
||||
imagejpeg($resimg);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -15,81 +15,88 @@
|
|||
// might be used together with the basic Image drawing
|
||||
// primitives. Useful to auickoly produce some arbitrary
|
||||
// graphic which benefits from all the functionality in the
|
||||
// graph liek caching for example.
|
||||
// graph liek caching for example.
|
||||
//===================================================
|
||||
class CanvasGraph extends Graph {
|
||||
//---------------
|
||||
// CONSTRUCTOR
|
||||
function CanvasGraph($aWidth=300,$aHeight=200,$aCachedName="",$timeout=0,$inline=1) {
|
||||
$this->Graph($aWidth,$aHeight,$aCachedName,$timeout,$inline);
|
||||
class CanvasGraph extends Graph
|
||||
{
|
||||
//---------------
|
||||
// CONSTRUCTOR
|
||||
public function CanvasGraph($aWidth=300, $aHeight=200, $aCachedName="", $timeout=0, $inline=1)
|
||||
{
|
||||
$this->Graph($aWidth, $aHeight, $aCachedName, $timeout, $inline);
|
||||
}
|
||||
|
||||
//---------------
|
||||
// PUBLIC METHODS
|
||||
//---------------
|
||||
// PUBLIC METHODS
|
||||
|
||||
function InitFrame() {
|
||||
$this->StrokePlotArea();
|
||||
public function InitFrame()
|
||||
{
|
||||
$this->StrokePlotArea();
|
||||
}
|
||||
|
||||
// Method description
|
||||
function Stroke($aStrokeFileName="") {
|
||||
if( $this->texts != null ) {
|
||||
for($i=0; $i < count($this->texts); ++$i) {
|
||||
$this->texts[$i]->Stroke($this->img);
|
||||
}
|
||||
}
|
||||
if( $this->iTables !== null ) {
|
||||
for($i=0; $i < count($this->iTables); ++$i) {
|
||||
$this->iTables[$i]->Stroke($this->img);
|
||||
}
|
||||
}
|
||||
$this->StrokeTitles();
|
||||
public function Stroke($aStrokeFileName="")
|
||||
{
|
||||
if ($this->texts != null) {
|
||||
for ($i=0; $i < count($this->texts); ++$i) {
|
||||
$this->texts[$i]->Stroke($this->img);
|
||||
}
|
||||
}
|
||||
if ($this->iTables !== null) {
|
||||
for ($i=0; $i < count($this->iTables); ++$i) {
|
||||
$this->iTables[$i]->Stroke($this->img);
|
||||
}
|
||||
}
|
||||
$this->StrokeTitles();
|
||||
|
||||
// If the filename is the predefined value = '_csim_special_'
|
||||
// we assume that the call to stroke only needs to do enough
|
||||
// to correctly generate the CSIM maps.
|
||||
// We use this variable to skip things we don't strictly need
|
||||
// to do to generate the image map to improve performance
|
||||
// a best we can. Therefor you will see a lot of tests !$_csim in the
|
||||
// code below.
|
||||
$_csim = ($aStrokeFileName===_CSIM_SPECIALFILE);
|
||||
// If the filename is the predefined value = '_csim_special_'
|
||||
// we assume that the call to stroke only needs to do enough
|
||||
// to correctly generate the CSIM maps.
|
||||
// We use this variable to skip things we don't strictly need
|
||||
// to do to generate the image map to improve performance
|
||||
// a best we can. Therefor you will see a lot of tests !$_csim in the
|
||||
// code below.
|
||||
$_csim = ($aStrokeFileName===_CSIM_SPECIALFILE);
|
||||
|
||||
// We need to know if we have stroked the plot in the
|
||||
// GetCSIMareas. Otherwise the CSIM hasn't been generated
|
||||
// and in the case of GetCSIM called before stroke to generate
|
||||
// CSIM without storing an image to disk GetCSIM must call Stroke.
|
||||
$this->iHasStroked = true;
|
||||
// We need to know if we have stroked the plot in the
|
||||
// GetCSIMareas. Otherwise the CSIM hasn't been generated
|
||||
// and in the case of GetCSIM called before stroke to generate
|
||||
// CSIM without storing an image to disk GetCSIM must call Stroke.
|
||||
$this->iHasStroked = true;
|
||||
|
||||
if( !$_csim ) {
|
||||
if (!$_csim) {
|
||||
|
||||
// Should we do any final image transformation
|
||||
if( $this->iImgTrans ) {
|
||||
if( !class_exists('ImgTrans') ) {
|
||||
require_once('jpgraph_imgtrans.php');
|
||||
}
|
||||
|
||||
$tform = new ImgTrans($this->img->img);
|
||||
$this->img->img = $tform->Skew3D($this->iImgTransHorizon,$this->iImgTransSkewDist,
|
||||
$this->iImgTransDirection,$this->iImgTransHighQ,
|
||||
$this->iImgTransMinSize,$this->iImgTransFillColor,
|
||||
$this->iImgTransBorder);
|
||||
}
|
||||
|
||||
// Should we do any final image transformation
|
||||
if ($this->iImgTrans) {
|
||||
if (!class_exists('ImgTrans')) {
|
||||
require_once('jpgraph_imgtrans.php');
|
||||
}
|
||||
|
||||
$tform = new ImgTrans($this->img->img);
|
||||
$this->img->img = $tform->Skew3D(
|
||||
$this->iImgTransHorizon,
|
||||
$this->iImgTransSkewDist,
|
||||
$this->iImgTransDirection,
|
||||
$this->iImgTransHighQ,
|
||||
$this->iImgTransMinSize,
|
||||
$this->iImgTransFillColor,
|
||||
$this->iImgTransBorder
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// If the filename is given as the special _IMG_HANDLER
|
||||
// then the image handler is returned and the image is NOT
|
||||
// streamed back
|
||||
if( $aStrokeFileName == _IMG_HANDLER ) {
|
||||
return $this->img->img;
|
||||
}
|
||||
else {
|
||||
// Finally stream the generated picture
|
||||
$this->cache->PutAndStream($this->img,$this->cache_name,$this->inline,$aStrokeFileName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
// If the filename is given as the special _IMG_HANDLER
|
||||
// then the image handler is returned and the image is NOT
|
||||
// streamed back
|
||||
if ($aStrokeFileName == _IMG_HANDLER) {
|
||||
return $this->img->img;
|
||||
} else {
|
||||
// Finally stream the generated picture
|
||||
$this->cache->PutAndStream($this->img, $this->cache_name, $this->inline, $aStrokeFileName);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Class
|
||||
|
||||
/* EOF */
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue