function sql($query) { if (DEBUG_PLAIN) { return FB::log($query); } if (SCRIPT_IN) { return DataEngine::sql($query); } $sql = str_replace('SQL_PREFIX_', SQL_PREFIX_, $query); $result = mysql_query($sql) or sqlerror($query); }
public function Get_Menu() { $root_url = ROOT_URL; $Joueur = $_SESSION['_login']; $sqlreq = 'SELECT `ID` FROM `SQL_PREFIX_modules_commandes` WHERE (`DateLivraison` IS NULL) AND `LoginV` = \'' . $Joueur . '\''; $mysql_result = DataEngine::sql($sqlreq); if (mysql_num_rows($mysql_result) > 0) { $bouton = '%BTN_URL%modules_red.png'; $menu = array('%ADDONS_URL%commerce/commandes_list.php', $bouton, 155, 'DataEngine::CheckPerms("ZZZ_COMMERCE_INDEX")'); $submenu = array(array('%ADDONS_URL%commerce/commandes_list.php', $bouton, 155, 'DataEngine::CheckPerms("ZZZ_COMMERCE_INDEX")')); } else { $bouton = '%BTN_URL%modules.png'; $menu = array('%ADDONS_URL%commerce/index.php', $bouton, 155, 'DataEngine::CheckPerms("ZZZ_COMMERCE_INDEX")'); $submenu = array(array('%ADDONS_URL%commerce/index.php', $bouton, 155, 'DataEngine::CheckPerms("ZZZ_COMMERCE_INDEX")')); } return array('insertafter' => 'addon', 'id' => 'commerce', 'onlysub' => true, 'menu' => $submenu); // "onlysub" => "key", // hmm... }
if ($Grade['Rattachement'] == 0) { $levels[0][$id] = $Grade['GradeId']; } } $lid = 0; do { $level = $levels[$lid]; foreach ($Grades as $id => $Grade) { if (array_search($Grade['Rattachement'], $level) !== false) { $levels[$lid + 1][$id] = $Grade['GradeId']; } } $lid++; } while ($lid < count($levels)); $players = array(); $mysql_result = DataEngine::sql('SELECT `Joueur`, `Grade`, `Points`, `Economie`, `Commerce`, `Recherche`, `Combat`, `Construction`, `Navigation` from `SQL_PREFIX_Membres` ORDER BY `Grade`, `Joueur` ASC'); while ($ligne = mysql_fetch_assoc($mysql_result)) { $players[$ligne['Grade']][] = $ligne; } $tpl->header(); foreach ($levels as $levelkey => $level) { $tpl->level_header(); foreach ($level as $GradeKey => $GradeId) { $tpl->level_grade($Grades[$GradeKey]['Grade']); } $tpl->level_grade_sep(); foreach ($level as $GradeKey => $GradeId) { if (!isset($players[$GradeId])) { $tpl->level_players_empty(); continue; }
/** * Ajout d'un joueur * @param string $user Nom du joueur * @param md5 $pass pass en md5 * @param integer $axx niveau d'accès souhaité * @param integer $points nombre de points * @param integer $grade id du grade dans l'empire */ public static function NewUser($user, $md5pass, $axx = AXX_VALIDATING, $points = 0, $grade = 3) { DataEngine::sql('INSERT INTO `SQL_PREFIX_Users` VALUES(\'' . $user . '\',\'' . $md5pass . '\',' . $axx . ')'); DataEngine::sql('INSERT INTO `SQL_PREFIX_Membres` (`Joueur`,`Points`,`Date`,`Grade`) ' . 'VALUES(\'' . sqlesc($user) . '\',\'' . $points . '\',now(),' . $grade . ')'); addons::getinstance()->NewUser($user); }
} $query = <<<q UPDATE `SQL_PREFIX_Membres` SET `POINTS`=%d, `ship`='%s', `Economie`=%d, `Commerce`=%d, `Recherche`=%d, `Combat`=%d, `Construction`='%s', `Navigation`=%d, `pts_architecte`=%d, `pts_mineur`=%d, `pts_science`=%d, `pts_commercant`=%d, `pts_amiral`=%d, `pts_guerrier`=%d WHERE `Joueur`='%s' q; DataEngine::sql(sprintf($query, $_POST['Points'], $_POST['ship'], $_POST['Economie'], $_POST['Commerce'], $_POST['Recherche'], $_POST['Combat'], $_POST['Construction'], $_POST['Navigation'], $_POST['pts_architecte'], $_POST['pts_mineur'], $_POST['pts_science'], $_POST['pts_commercant'], $_POST['pts_amiral'], $_POST['pts_guerrier'], $_SESSION['_login'])); } if (isset($_POST['pwd']) && !($_SESSION['_login'] == 'test' && DE_DEMO)) { $query = 'UPDATE `SQL_PREFIX_Users` SET `Password`=md5(\'' . sqlesc($_POST['pwd'], false) . '\') WHERE `Login`=\'' . $_SESSION['_login'] . '\''; DataEngine::sql($query); } $mysql_result = DataEngine::sql('Select m.`Joueur`, m.`Points`, m.`Economie`, m.`Commerce`, m.`Recherche`, m.`Combat`, m.`Construction`, m.`Navigation`, m.`Race`, m.`ship`, m.`Titre`, m.`GameGrade`, m.`pts_architecte`, m.`pts_mineur`, m.`pts_science`, m.`pts_commercant`, m.`pts_amiral`, m.`pts_guerrier`, g.`Grade` from `SQL_PREFIX_Membres` m, `SQL_PREFIX_Grade` g WHERE m.`Joueur`=\'' . $_SESSION['_login'] . '\' AND (m.`Grade`=g.`GradeId`)'); $ligne = mysql_fetch_assoc($mysql_result); require_once TEMPLATE_PATH . 'mafiche.tpl.php'; $tpl = tpl_mafiche::getinstance(); $tpl->page_title = $lng['page_title']; $tpl->header($ligne); $tpl->add_row($lng['POINTS'], 'Points', $ligne['Points']); $tpl->add_row($lng['pts_architecte'], 'pts_architecte', $ligne['pts_architecte']); $tpl->add_row($lng['pts_mineur'], 'pts_mineur', $ligne['pts_mineur']); $tpl->add_row($lng['pts_science'], 'pts_science', $ligne['pts_science']); $tpl->add_row($lng['pts_commercant'], 'pts_commercant', $ligne['pts_commercant']); $tpl->add_row($lng['pts_amiral'], 'pts_amiral', $ligne['pts_amiral']); $tpl->add_row($lng['pts_guerrier'], 'pts_guerrier', $ligne['pts_guerrier']); $tpl->add_row($lng['Commerce'], 'Commerce', $ligne['Commerce']); $tpl->add_row($lng['Recherche'], 'Recherche', $ligne['Recherche']); $tpl->add_row($lng['Combat'], 'Combat', $ligne['Combat']);
$datas['ProtType'] = 0; $datas['ProtChasseur'] = 0; $datas['ProtGVG'] = 0; $datas['EquipType'] = 0; $datas['EquipNiv'] = 0; } if (isset($_POST['submit'])) { if (($_POST['submit'] == 'Sauver' || $_POST['submit'] == 'Sauver et retour') && $datas_id > 0) { mysql_update_array('SQL_PREFIX_Modules_Template', '`ID`=' . $datas_id, $datas); if ($_POST['submit'] == 'Sauver et retour') { header('Location: template_list.php#ID' . $datas_id); exit; } } elseif ($_POST['submit'] == 'SUPPRIMER' && $datas_id > 0) { $mysql_result = DataEngine::sql('DELETE FROM `SQL_PREFIX_Modules_Template` WHERE `ID`=' . $datas_id) or die(mysql_error()); $mysql_result = DataEngine::sql('DELETE FROM `SQL_PREFIX_Modules_Users` WHERE `Module_ID`=' . $datas_id) or die(mysql_error()); header('Location: template_list.php'); exit; } elseif ($_POST['submit'] == 'Sauver sous nouveau') { $datas_id = mysql_insert_array('SQL_PREFIX_Modules_Template', $datas); } } // FIN CODE LIBRE ?> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </HEAD> <BODY>
$lng = language::getinstance()->GetLngBlock('pillage'); $_GET['player'] = str_replace('%', '', $_GET['player']); if ($_GET['player'] != '') { $player = gpc_esc($_GET['player']); } else { $player = $_SESSION['_login']; } $sql = sqlesc($player); $sql = <<<sql SELECT ta.`ID`, ta.`type`, ta.`players_attack`, ta.`players_defender`, ta.`players_pertes`, ta.`when`, ta.`coords_ss`, ta.`coords_3p`, tp.`mid`, tp.`Player`, tp.`ress0`, tp.`ress1`, tp.`ress2`, tp.`ress3`, tp.`ress4`, tp.`ress5`, tp.`ress6`, tp.`ress7`, tp.`ress8`, tp.`ress9`, tp.`date` FROM `SQL_PREFIX_troops_attack` ta LEFT JOIN `SQL_PREFIX_troops_pillage` tp on (tp.`mid`=ta.`id`) WHERE `players_attack` LIKE '%"{$sql}"%' OR `players_defender` LIKE '%"{$sql}"%' ORDER BY `when` DESC LIMIT 0,30 sql; $result = DataEngine::sql($sql); $tpl->Setheader(); $tpl->AddToRow($player, 'player'); $tpl->PushRow(); $i = 1; $id = -1; $closepillagelog = false; while ($row = mysql_fetch_assoc($result)) { if ($id != $row['ID']) { if ($closepillagelog) { $tpl->SetlogRow_footer(); $closepillagelog = false; } $row['players_attack'] = unserialize($row['players_attack']); $row['players_defender'] = unserialize($row['players_defender']); $row['players_pertes'] = unserialize($row['players_pertes']);
$Order = ' ORDER BY `Date` DESC'; } } else { $TriModif = '0'; } $where = ''; if ($_GET['Joueur'] != '') { $where = ' AND m.`Joueur`=\'' . sqlesc($_GET['Joueur']) . '\''; } $axx = array(); foreach (Members::s_perms() as $k => $v) { if ($k == AXX_DISABLED) { continue; } if (Members::CurrentPerms() > $k || Members::CurrentPerms() == AXX_ROOTADMIN) { $axx[$k] = $v; } } require_once TEMPLATE_PATH . 'editmembres.tpl.php'; $tpl = tpl_editmembres::getinstance(); $mysql_result = DataEngine::sql('SELECT m.`Joueur`, m.`Points`, m.`Date`, m.`Economie`, m.`Commerce`, m.`Recherche`, m.`Combat`, m.`Construction`, m.`Navigation`, m.`Grade`, m.`Race`, m.`ship`, u.`Permission` from `SQL_PREFIX_Membres` m, `SQL_PREFIX_Users` u WHERE (m.`Joueur`=u.`Login`)' . $where . $Order); if (mysql_num_rows($mysql_result) == 0) { output::Boink('Membres.php'); } $tpl->header(Get_string(), $TriMembre, $triPermission, $TriPoints, $TriRace, $TriShip, $TriModif); $i = 0; while ($ligne = mysql_fetch_assoc($mysql_result)) { $tpl->row($i++, $ligne, $Grades, $tabrace, $axx); } $tpl->footer(); $tpl->DoOutput();
function AddPillage_log($mode, $idate, $msg) { // check si existant $sql = sprintf('SELECT `pid` FROM SQL_PREFIX_troops_pillage WHERE Player=\'%s\' AND date=%d', sqlesc($_SESSION['_login']), $idate); $result = DataEngine::sql($sql); if (mysql_numrows($result) > 0) { return $this->lng['log_allreadyexists']; } // Type du log/bataille // Puis recherche de la bataille (coords+participation) if ($mode == 'defender') { preg_match($this->lng['defender_regex'], $msg, $info); $ident = $this->lng['defender_ident']; if (!($planets = ownuniverse::getinstance()->get_coordswithname())) { return $this->lng['battle_error_ownuniverse']; } foreach ($planets as $v) { if ($v['Name'] == $info[$this->lng[$mode . '_regex_planetid']]) { cartographie::getinstance()->FormatId($v['Coord'], $idsys, $iddet, 'troops::AddPillage_log(def,1)'); break; } } $sql = sprintf('SELECT `ID` FROM `SQL_PREFIX_troops_attack` WHERE `type`=\'%s\' AND ' . '`coords_ss`=\'%s\' AND `coords_3p`=\'%s\' AND `when`<=%d AND `when`>=%d' . ' AND `players_defender` LIKE \'%%"%s"%%\' AND `players_attack` LIKE \'%%"%s"%%\'' . 'ORDER BY `when` DESC LIMIT 1', sqlesc($mode), $idsys, $iddet, $idate, $idate - 604800, sqlesc($_SESSION['_login']), sqlesc($info[$this->lng[$mode . '_regex_userid']])); $result = DataEngine::sql($sql); if (mysql_numrows($result) < 1) { return $this->lng['log_battlenofound']; } $line = mysql_fetch_assoc($result); $mid = $line['ID']; } else { preg_match($this->lng['attacker_regex'], $msg, $info); $ident = $this->lng['attacker_ident']; $sql = <<<sql SELECT `POSIN`, `COORDET` FROM `SQL_PREFIX_Coordonnee` LEFT JOIN `SQL_PREFIX_Coordonnee_Joueurs` on `ID`=`jID` WHERE `TYPE` in (0,3,5) AND `USER`='%s' AND `INFOS`='%s' sql; $sql = sprintf($sql, $info[$this->lng[$mode . '_regex_userid']], $info[$this->lng[$mode . '_regex_planetid']]); $result = DataEngine::sql($sql); if (mysql_numrows($result) < 1) { return $this->lng['log_coordsnotfound']; } if (mysql_numrows($result) > 1) { return $this->lng['log_multiplecoords']; } $line = mysql_fetch_assoc($result); $idsys = $line['POSIN']; $iddet = $line['COORDET']; $sql = sprintf('SELECT `ID` FROM `SQL_PREFIX_troops_attack` WHERE `type`=\'%s\' AND ' . '`coords_ss`=\'%s\' AND `coords_3p`=\'%s\' AND `when`<%d AND `when`>%d AND ' . '`players_attack` LIKE \'%%"%s"%%\' AND `players_defender` LIKE \'%%"%s"%%\'', sqlesc($mode), $idsys, $iddet, $idate, $idate - 604800, sqlesc($_SESSION['_login']), sqlesc($info[$this->lng[$mode . '_regex_userid']])); $result = DataEngine::sql($sql); if (mysql_numrows($result) < 1) { return $this->lng['log_battlenofound']; } if (mysql_numrows($result) > 1) { return 'Error battle result > 1 (omfg)'; } $line = mysql_fetch_assoc($result); $mid = $line['ID']; } // Info à ajouter $amsg = explode("\n", trim(p_substr($msg, p_stripos($msg, $ident, 0) + p_strlen($ident), -1))); $ares = DataEngine::a_ressources(); $fields = array(); $sets = array(); $fields[] = 'date'; $sets[] = $idate; $fields[] = 'mid'; $sets[] = $mid; $fields[] = 'Player'; $sets[] = '\'' . sqlesc($_SESSION['_login']) . '\''; foreach ($ares as $k => $v) { foreach ($amsg as $line) { list($key, $value) = explode(':', $line); if ($v['Nom'] == trim($key)) { $fields[] = 'ress' . $k; $sets[] = DataEngine::strip_number($value); break; } } } $fields = implode(',', $fields); $sets = implode(',', $sets); $sql = 'INSERT INTO `SQL_PREFIX_troops_pillage` (' . $fields . ') VALUES (' . $sets . ')'; $result = DataEngine::sql($sql); return $this->lng['log_added']; }
public function __wakeup() { $this->filename = CACHE_PATH . 'map.' . md5($_SESSION['_login'] . $_SESSION['_pass']) . '.js'; if (file_exists($this->filename)) { $this->lastrun = filemtime($this->filename); $sqlr = DataEngine::sql('SELECT udate FROM SQL_PREFIX_Coordonnee ORDER BY udate DESC LIMIT 1'); $sqla = mysql_fetch_array($sqlr); if ($this->lastrun > $sqla['udate']) { $this->CronPattern = strftime("%M %H %d %m 0", time() + 3600); } else { $this->CronPattern = strftime("%M %H %d %m %w", time()); } } else { $this->lastrun = 0; $this->CronPattern = '* * * * *'; } }
$tpl->perms_header(); $i = 0; // Loop par CXX foreach ($cxx_name as $cxx_k => $cxx_v) { $class = 'color_row' . $i % 2; if (is_numeric($cxx_k)) { $tpl->perms_category($cxx_v); continue; } else { $tpl->perms_row($cxx_k, $cxx_v, $axx_name, $cxx_conf); } $tpl->PushOutput('</tr>'); if (is_numeric($cxx_k)) { $i = 1; } $i++; } $tpl->perms_footer(); } ///--- if ($_REQUEST['act'] == 'config' && Members::CheckPerms(AXX_ROOTADMIN)) { $mysql_result = DataEngine::sql('SELECT * from `SQL_PREFIX_Grade` ORDER BY `Rattachement`, `Niveau`'); while ($ligne = mysql_fetch_assoc($mysql_result)) { $Grades[] = $ligne; } $tpl->page_title = $lng['config_title']; $tpl->config_header(); $tpl->config_xxx($Grades); $tpl->config_footer(); } $tpl->DoOutput();
$tritable = 'Categorie, CatType, NivTech'; } $titlecat = 2; break; } $sqlreq = ' SELECT ID, URLIcone, Categorie, Nom, Abreviation, SQL_PREFIX_Modules_Own.Modifier, (SELECT COUNT(SQL_PREFIX_Modules_Users.Login) FROM SQL_PREFIX_Modules_Users LEFT JOIN SQL_PREFIX_Modules_Users_Config ON SQL_PREFIX_Modules_Users.Login = SQL_PREFIX_Modules_Users_Config.Login WHERE Module_ID = ID AND IF(Categorie=4, ChassisSecret, CommerceType)<=1) AS TotalFab, (IF(Categorie = 0, IF(PropWarp >= 1, 1, 0), IF(Categorie = 1, ArmType, IF(Categorie = 2, ProtType, IF(Categorie = 3, EquipType, ChassType))))) AS CatType, (IF(Categorie = 0, IF(PropWarp > 0, PropWarp, PropImpulsion), IF(Categorie = 1, ArmDegat, IF(Categorie = 2, ProtChasseur, IF(Categorie = 3, EquipNiv, ChassPA))))) AS NivTech, (IF(Categorie = 0, IF(PropWarp > 0, CONCAT(FORMAT(PropWarp, 0)," (",FORMAT(PropImpulsion, 0),")"), FORMAT(PropImpulsion, 0)), IF(Categorie = 1, CONCAT(FORMAT(ArmDegat, 0)," (",FORMAT(ArmManiabilite, 0),")"), IF(Categorie = 2, CONCAT(FORMAT(ProtChasseur, 0),", ",FORMAT(ProtGVG, 0)), IF(Categorie = 3, FORMAT(EquipNiv, 0), FORMAT(ChassPA,0)))))) AS NivDef FROM SQL_PREFIX_Modules_Template LEFT JOIN (SELECT * FROM SQL_PREFIX_Modules_Users WHERE Login = "******") AS SQL_PREFIX_Modules_Own ON SQL_PREFIX_Modules_Template.ID = SQL_PREFIX_Modules_Own.Module_ID ORDER BY ' . $tritable; // pDebug($sqlreq); $mysql_result = DataEngine::sql($sqlreq) or die(mysql_error()); $i = 0; $oldtitle = ''; $nowtitle = ''; $titremod = false; while ($ligne = mysql_fetch_array($mysql_result)) { $subcatname = $cnhNames[$ligne['Categorie']][$ligne['CatType']]; $catname = $cnhCategorieName[$ligne['Categorie']]; if ($titlecat == 1) { $nowtitle = $catname; } elseif ($titlecat == 2) { $nowtitle = $subcatname . ' (' . $catname . ')'; } // En cas de mode commande if ($modecommande) { if ($i == 0 && !$titremod) {
public function get_race() { if ($this->race != '') { return $this->race; } $result = DataEngine::sql('SELECT `Race` FROM `SQL_PREFIX_Membres` WHERE `Joueur`=\'' . $_SESSION['_login'] . '\''); $line = mysql_fetch_assoc($result); $this->race = $line['Race']; return $this->race; }
<td><?php echo $datas['EquipNiv']; ?> </td> </tr> </table> </td> </tr> <?php } ?> <tr class="color_row0"> <td>Fourniture</td> <td> <?php $mysql_fab = DataEngine::sql('SELECT u.`Login`, u.`Module_ID`, u.`Modifier` FROM `SQL_PREFIX_Modules_Users` u LEFT JOIN `SQL_PREFIX_Modules_Users_Config` c ON u.`Login`=c.`Login` WHERE `Module_ID`=' . $_GET['viewid'] . ' AND ' . ($datas['Categorie'] == 4 ? 'ChassisSecret' : 'CommerceType') . '<=1 ORDER BY u.`Login`') or die(mysql_error()); $i = 0; $minmod = 0; $maxmod = 0; while ($ligne = mysql_fetch_array($mysql_fab)) { if ($ligne['Modifier'] < $minmod) { $minmod = $ligne['Modifier']; } if ($ligne['Modifier'] > $maxmod) { $maxmod = $ligne['Modifier']; } echo '<b>' . $ligne['Login'] . '</b> (' . $ligne['Modifier'] . '%)<br>'; $i++; } echo '<hr>'; echo $i . ' fabricant' . ($i > 1 ? 's' : '') . ' fourni' . ($i > 1 ? 'ssent' : 't') . ' ce module.<br>';
function mysql_update_array($my_table, $my_where, $my_array) { foreach ($my_array as $field => $value) { if (is_numeric($value)) { $fields[] = sprintf("`%s` = %s", $field, $value); } else { $fields[] = sprintf("`%s` = '%s'", $field, mysql_real_escape_string($value)); } // $fields[] = sprintf("`%s` = '%s'", $field, str_replace("'", "\'", $value)); // $fields[] = sprintf("`%s` = '%s'", $field, $value); } $field_list = join(',', $fields); $query = sprintf("UPDATE `%s` SET %s WHERE %s", $my_table, $field_list, $my_where); return DataEngine::sql($query); }
public function init_map($custom = '') { // init ici global $vortex_a, $CurrSS, $CurrSS_a; $this->Parcours(); // variables $vortex_a = array(); $CurrSS = 0; $CurrSS_a = array(); /// RÉCUPÉRATION DES VORTEX (POSOUT) /// if ($this->vortex) { $sql = 'SELECT `ID`, `POSIN`, `POSOUT` from `SQL_PREFIX_Coordonnee` where `Type`=1'; $mysql_result = DataEngine::sql($sql); while ($line = mysql_fetch_assoc($mysql_result)) { $vortex_a[$line['POSOUT']][$line['ID']]['POSIN'] = $line['POSOUT']; $vortex_a[$line['POSOUT']][$line['ID']]['POSOUT'] = $line['POSIN']; $vortex_a[$line['POSOUT']][$line['ID']]['TYPE'] = 1; } mysql_free_result($mysql_result); } /// TRAITEMENT DES CORPS CÉLESTES /// /// filtre spécial... $if = array(); if (!$this->ennemis && !$this->allys && $this->joueur) { $if[] = 'IF(c.`TYPE` in (3,5), 0, c.`TYPE`) as TYPE'; } if (!$this->ennemis && $this->allys) { $if[] = 'IF(c.`TYPE`=5, 0, c.`TYPE`) as TYPE'; } if ($this->ennemis && !$this->allys) { $if[] = 'IF(c.`TYPE`=3, 0, c.`TYPE`) as TYPE'; } /// filtre in type: $in = array(); if ($this->joueur) { $in[] = 0; } if ($this->vortex) { $in[] = 1; } if ($this->planete) { $in[] = 2; } if ($this->allys || $this->joueur) { $in[] = 3; } if ($this->asteroide) { $in[] = 4; } if ($this->pnj) { $in[] = 6; } if ($this->ennemis || $this->joueur) { $in[] = 5; } if (count($in) > 0 && count($in) < 7) { $in = 'AND ( `TYPE` IN (' . implode(',', $in) . ')'; } else { $in = ''; } /// filtre au cas par cas: $cas = array(); if (!$this->joueur) { $cas[] = '(`Type`=0 AND m.`Joueur`=\'' . $_SESSION['_login'] . '\')'; } if ($this->joueur) { $if[] = 'IFNULL(g.`Grade`,\'\') as Grade'; $if[] = 'IFNULL(m.`Joueur`,\'\') as Joueur'; } // compilation des filtres if (count($if) > 0) { $if = ', ' . trim(implode(', ', $if)); } else { $if = ''; } if (count($cas) > 0) { if ($in != '') { $where = $in . ' OR ' . implode(' OR ', $cas) . ' ) '; } else { $where = ' AND ' . implode(' OR ', $cas) . ' '; } } else { if ($in != '') { $where = $in . ' ) '; } } if ($custom == '') { $custom = '1 '; } $where = 'WHERE ' . $custom . $where; $where = $where . ' ORDER BY `POSIN` ASC'; $sql = <<<sql SELECT c.`ID`, c.`TYPE`, c.`POSIN`, c.`POSOUT`, j.`USER`, j.`INFOS`, j.`EMPIRE` {$if} FROM `SQL_PREFIX_Coordonnee` c left outer join `SQL_PREFIX_Coordonnee_Joueurs` j on (c.id=j.jid) left outer join `SQL_PREFIX_Membres` m on (j.`USER`=m.`Joueur`) left outer join `SQL_PREFIX_Grade` g on (m.`Grade`=g.`GradeId`) {$where} sql; $mysql_result = DataEngine::sql($sql); return $mysql_result; }
} if ($validsession !== true && IS_IMG) { header("Content-Type: image/png"); header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Mon, 16 Jul 2008 04:21:44 GMT"); // HTTP/1.0 Date dans le passé require_once CLASS_PATH . 'map.class.php'; $Taille = 180; $image = imagecreate($Taille, 20); $background_color = imagecolorallocate($image, 0, 0, 0); imagefilledrectangle($image, 0, 0, $Taille, $Taille, $background_color); $debug_cl = imagecolorallocate($image, 254, 254, 254); map::map_debug($lng['session_lost']); imagepng($image); imagedestroy($image); exit; } // $validsession if ($validsession === true && $_SESSION['_Perm'] < AXX_VALIDATING) { $query = 'INSERT INTO `SQL_PREFIX_Log` (`DATE`,`log`,`IP`) VALUES(NOW(),"login,needvalidation:' . $_SESSION['_login'] . '",\'' . $_SESSION['_IP'] . '\')'; $_SESSION['_login'] = ''; DataEngine::sql($query); output::_DoOutput('<a href="' . DataEngine::config_key('config', 'ForumLink') . '"><p style="color:red">' . $lng['no_axx'] . '</p></a>'); } if ($validsession !== true) { require_once TEMPLATE_PATH . 'login.tpl.php'; $tpl = tpl_login::getinstance(); $tpl->page_title = $lng['login_page_title']; $tpl->DoOutput($login_msg); }
public function FillVendors() { for ($i = 0; $i < sizeof($this->items); $i++) { $modid = $this->items[$i]['ID']; $mysql_result = DataEngine::sql(' SELECT u.`Login`, c.`Paiement`, u.`Modifier` FROM `SQL_PREFIX_Modules_Users_Config` c LEFT JOIN `SQL_PREFIX_Modules_Users` u ON c.`Login` = u.`Login` WHERE `CommerceType` <= 1 AND `Module_ID` = \'' . $modid . '\' ORDER BY u.`Login`; ') or die(mysql_error()); $this->vendors[$modid][0]['Paiement'] = 0; $j = 1; while ($ligne = mysql_fetch_array($mysql_result)) { $this->vendors[$modid][$j]['Login'] = $ligne['Login']; $this->vendors[$modid][$j]['Paiement'] = $ligne['Paiement']; $this->vendors[$modid][$j]['Modifier'] = $ligne['Modifier']; $j++; } $this->vendors[$modid][0]['Total'] = $j - 1; } }
$datas['Description'] = addslashes(trim($t)); // Divers $datas['Taille'] = $datas['PAGVG'] * 1000; $query = 'SELECT ID FROM SQL_PREFIX_Modules_Template WHERE Nom LIKE \'' . $datas['Nom'] . '\''; $mysql_result = DataEngine::sql($query); if (mysql_num_rows($mysql_result) > 0) { $ligne = mysql_fetch_assoc($mysql_result); if ($ligne['ID'] > 0) { DataEngine::sql('UPDATE SQL_PREFIX_Modules_Template SET Nom=\'' . $datas['Nom'] . '\', Description=\'' . $datas['Description'] . '\', Categorie=\'' . $datas['Categorie'] . '\', Taille=\'' . $datas['Taille'] . '\', PAChasseur=\'' . $datas['PAChasseur'] . '\', PAGVG=\'' . $datas['PAGVG'] . '\', Temps=\'' . $datas['Temps'] . '\', Titane=\'' . $datas['Titane'] . '\', Cuivre=\'' . $datas['Cuivre'] . '\', Fer=\'' . $datas['Fer'] . '\', Aluminium=\'' . $datas['Aluminium'] . '\', Mercure=\'' . $datas['Mercure'] . '\', Silicium=\'' . $datas['Silicium'] . '\', Uranium=\'' . $datas['Uranium'] . '\', Krypton=\'' . $datas['Krypton'] . '\', Azote=\'' . $datas['Azote'] . '\', Hydrogene=\'' . $datas['Hydrogene'] . '\', PropImpulsion=\'' . $datas['PropImpulsion'] . '\', PropWarp=\'' . $datas['PropWarp'] . '\', PropConsommation=\'' . $datas['PropConsommation'] . '\', ArmType=\'' . $datas['ArmType'] . '\', ArmDegat=\'' . $datas['ArmDegat'] . '\', ProtType=\'' . $datas['ProtType'] . '\', ProtChasseur=\'' . $datas['ProtChasseur'] . '\', ProtGVG=\'' . $datas['ProtGVG'] . '\', EquipType=\'' . $datas['EquipType'] . '\', EquipNiv=\'' . $datas['EquipNiv'] . '\' WHERE ID=\'' . $ligne['ID'] . '\''); echo "<br /><center><b>Templates de module mis à jour.</b></center><br /><br />"; echo "<br /><br /><hr width='50%' /><p align=center> <a href='user_importmod.php'>Autre importation...</a> </p>"; } } else { $query = 'INSERT INTO SQL_PREFIX_Modules_Template (`Nom`, `Description`, `Categorie`, `Taille`, `PAChasseur`, `PAGVG`, `Temps`, `Titane`, `Cuivre`, `Fer`, `Aluminium`, `Mercure`, `Silicium`, `Uranium`, `Krypton`, `Azote`, `Hydrogene`, `PropImpulsion`, `PropWarp`, `PropConsommation`, `ArmType`, `ArmDegat`, `ArmManiabilite`, `ProtType`, `ProtChasseur`, `ProtGVG`, `EquipType`, `EquipNiv`) '; $query .= 'VALUES (\'' . $datas['Nom'] . '\', \'' . $datas['Description'] . '\', \'' . $datas['Categorie'] . '\', \'' . $datas['Taille'] . '\', \'' . $datas['PAChasseur'] . '\', \'' . $datas['PAGVG'] . '\', \'' . $datas['Temps'] . '\', \'' . $datas['Titane'] . '\', \'' . $datas['Cuivre'] . '\', \'' . $datas['Fer'] . '\', \'' . $datas['Aluminium'] . '\', \'' . $datas['Mercure'] . '\', \'' . $datas['Silicium'] . '\', \'' . $datas['Uranium'] . '\', \'' . $datas['Krypton'] . '\', \'' . $datas['Azote'] . '\', \'' . $datas['Hydrogene'] . '\', \'' . $datas['PropImpulsion'] . '\', \'' . $datas['PropWarp'] . '\', \'' . $datas['PropConsommation'] . '\', \'' . $datas['ArmType'] . '\', \'' . $datas['ArmDegat'] . '\', \'' . $datas['ArmManiabilite'] . '\', \'' . $datas['ProtType'] . '\', \'' . $datas['ProtChasseur'] . '\', \'' . $datas['ProtGVG'] . '\', \'' . $datas['EquipType'] . '\', \'' . $datas['EquipNiv'] . '\')'; $datas_id = DataEngine::sql($query); echo "<br /><center><b>Templates de module ajouté.</b></center><br /><br />"; echo "<br /><br /><hr width='50%' /><p align=center> <a href='user_importmod.php'>Autre importation...</a> </p>"; } } else { echo "<br /><center><b>Données non reconnues.</b></center><br /><br />"; } } } if ($bcontinue) { ?> <form name="form1" method="post" action=""> <table border="1" align="center" cellpadding="3" cellspacing="0" width=80%> <tr class="color_row0"> <td>Pour importer des données, il vous suffit de sélectionner une page du jeu (CTRL-A), de la copier entièrement (CTRL-C) puis de la coller dans le champs à droite (CTRL-V).<br /> <br />
// echo("vendeur:".$vendeur."<BR>"); // echo("commande:".$commande."<BR>"); // echo("typepaiement:".$typepaiement."<BR>"); // echo("ressourcesitems:".$ressourcesitems."<BR>"); // echo("RessourcesNBTotal:".$RessourcesNBTotal."<BR>"); // echo ("requete sql:".$query."<br>"); // echo("</font></center><br>"); DataEngine::sql($query); } echo "<center><font color=#ff0000><h1>Commande enregistrée</h1><br>\r\n Vous pourrez la suivre dans la partie <a href='commandes_list.php'>Gestion</a></font></center>"; unset($_SESSION['checkout']); unset($_SESSION['basket']); } else { $vlist = $basket->VendorSelSort(); $activecommande = false; $mysql_result = DataEngine::sql('SELECT planet0, coord0, planet1, coord1, planet2, coord2, planet3, coord3, planet4, coord4 FROM SQL_PREFIX_ownuniverse WHERE `UTILISATEUR`=\'' . $Joueur . '\'') or die(mysql_error()); $j = 0; $valider_form_cond = ''; $radiolist = ''; if ($ownplanetes = mysql_fetch_array($mysql_result)) { for ($i = 0; $ownplanetes['planet' . $i] != '' && $i < 5; $i++) { if ($i > 0) { $radiolist .= '<br>'; $valider_form_cond .= ' && '; } $radiolist .= '<input class="color_row0" name="coordplanete" value="' . $ownplanetes['coord' . $i] . '" type="radio"> ' . $ownplanetes['planet' . $i] . ' aux coordonnées ' . $ownplanetes['coord' . $i]; $valider_form_cond .= '(document.forms["formMe"].coordplanete[' . $i . '].checked==false)'; $j++; } } // PaiementMe_
if (isset($_GET['sort'][$v])) { $_GET['sort'][$v] = ''; } } $newvalue = array('sort' => array($v => $invert_sort[$_GET['sort'][$v]])); $tpl->AddToRow(Get_string($newvalue), 'sort_' . $v); } $tpl->PushRow(); $sql = <<<sql SELECT udate, c.`ID`, c.`TYPE`, c.`POSIN`, c.`POSOUT`, c.`COORDET`, c.`COORDETOUT`, j.`USER`, j.`EMPIRE`, j.`INFOS`, c.`NOTE`, p.`water`, \tj.`batiments`, j.`troop`, j.`troop_date`, c.`UTILISATEUR`, p.`pID`, p.`Titane`, p.`Cuivre`, p.`Fer`, p.`Aluminium`, p.`Mercure`, p.`Silicium`, p.`Uranium`, p.`Krypton`, \tp.`Azote`, p.`Hydrogene` from `SQL_PREFIX_Coordonnee` c left outer join `SQL_PREFIX_Coordonnee_Joueurs` j on (c.`ID`=j.`jID`) left outer join `SQL_PREFIX_Coordonnee_Planetes` p on (c.`ID`=p.`pID`) {$where}{$sort}{$limit} sql; $mysql_result = DataEngine::sql($sql); $lngmain = language::getinstance()->GetLngBlock('dataengine'); $a_Ress = DataEngine::a_ressources(); $stype = $lngmain['types']['string']; $i = 0; $cmdinput = '<input class="color_row%%rowA%%" type="checkbox" value="1" id="item[%%id%%][%%cmd%%]" name="item[%%id%%][%%cmd%%]" %%bulle%%/>'; while ($ligne = mysql_fetch_assoc($mysql_result)) { $coords = $ligne['POSIN'] . '-' . $ligne['COORDET']; switch ($ligne['TYPE']) { case 1: $coords = $ligne['POSIN'] . '-' . $ligne['COORDET'] . '<br/>' . $ligne['POSOUT'] . '-' . $ligne['COORDETOUT']; case 6: $tpl->SetRowModelTypeC(); break; case 2: case 4:
* @license GNU Public License 3.0 ( http://www.gnu.org/licenses/gpl-3.0.txt ) * @license Creative Commons 3.0 BY-SA ( http://creativecommons.org/licenses/by-sa/3.0/deed.fr ) * **/ require_once './init.php'; require_once INCLUDE_PATH . 'Script.php'; require_once CLASS_PATH . 'ownuniverse.class.php'; require_once CLASS_PATH . 'parser.class.php'; require_once TEMPLATE_PATH . 'ownuniverse.tpl.php'; Members::CheckPermsOrDie('PERSO_OWNUNIVERSE'); $ownuniverse = ownuniverse::getinstance(); $lng = language::getinstance()->GetLngBlock('ownuniverse'); // initialisation des variables $info = $warn = ''; if (isset($_GET['reset']) && $_GET['reset'] == $_SESSION['_permkey']) { DataEngine::sql('DELETE FROM `SQL_PREFIX_ownuniverse` WHERE `UTILISATEUR` = \'' . $_SESSION['_login'] . '\' LIMIT 1'); output::Boink('%ROOT_URL%ownuniverse.php'); } if ($_GET['showuser'] != '' && Members::CheckPerms('PERSO_OWNUNIVERSE_READONLY')) { $player = gpc_esc($_GET['showuser']); $include_form = false; } else { $player = false; $include_form = true; } if (isset($_POST['importation'])) { $cleandata = $ownuniverse->get_universe(false); // initialise les infos (planet) $data = gpc_esc($_POST['importation']); // Partie centre de controle if ($data != "" and strpos($data, $lng['control_center_ident']) !== false) {
public function do_spooler() { if (count($this->detelespooler) > 0) { $in = implode(',', $this->detelespooler); $query = 'DELETE FROM `SQL_PREFIX_Coordonnee` WHERE id IN (' . $in . ')'; $sql_result = DataEngine::sql($query); if (mysql_affected_rows() == 0) { return $this->AddErreur(sprintf($this->lng['class_delete_nofound'], $ident)); } $query = 'DELETE FROM `SQL_PREFIX_Coordonnee_Joueurs` WHERE jid IN (' . $in . ')'; $sql_result = DataEngine::sql($query); $query = 'DELETE FROM `SQL_PREFIX_Coordonnee_Planetes` WHERE pid IN (' . $in . ')'; $sql_result = DataEngine::sql($query); $this->detelespooler = array(); } }
$map->parcours = $map->Parcours()->Do_Parcours($map->IN, $map->OUT); $map->load_prefs('1;0;0;0;' . $map->sc . ';' . $map->taille . ';0;0;0'); } include_once TEMPLATE_PATH . 'carte.tpl.php'; $tpl = tpl_carte::getinstance(); $tpl->page_title = $title != '' ? 'Carte: ' . $title . '' : 'EU2: Carte'; $tpl->navigation(); // menu carte $tpl->maparea(); // la carte $map->update_session(); //************ //Itinéraire //************ $tpl->itineraire_header(); $mysql_result = DataEngine::sql('SELECT `ID`,`Flotte` from `SQL_PREFIX_itineraire` where `Joueur`=\'' . $_SESSION['_login'] . '\' ORDER BY `Flotte` ASC'); while ($ligne = mysql_fetch_assoc($mysql_result)) { $array[$ligne['ID']] = $ligne['Flotte']; } if (is_array($array)) { $tpl->SelectOptions($array, $map->loadfleet); } $tpl->itineraire_form(); $javascript = ''; if ($map->itineraire) { $tpl->Parcours_Start($map->parcours[1][0]); $tmp = $map->Parcours()->get_coords_part($map->parcours[1][0]); $javascript .= 'tmp = Carte.Get_SS(' . $tmp . ');'; $javascript .= 'tmp.parcours=1;'; $javascript .= 'Carte.Get_SS(' . $tmp . ', tmp);'; $i = $dt = 0;