/** * * @return tpl_upgrade */ public static function getinstance() { if (!DataEngine::_tpl_defined(get_class())) { DataEngine::_set_tpl(get_class(), new self()); } return DataEngine::tpl(get_class()); }
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... }
/** * * @return string html header */ public static function Get_Header() { $obj = DataEngine::tpl(''); if ($obj->page_title == "") { $title = "EU2: Data Engine v{$obj->version}"; } else { $title = $obj->page_title; } if ($obj->css_file != '') { $nocache = filemtime(ROOT_PATH . $obj->css_file); $css = <<<EOF \t\t<link rel="stylesheet" type="text/css" href="%ROOT_URL%{$obj->css_file}?{$nocache}" media="screen" /> EOF; } else { $css = ''; } if (DE_DEMO) { $stats = addons::getinstance()->Get_Addons('demo')->lng('stats'); } $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'; $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; $doctype = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'; $doctype = '<html xmlns="http://www.w3.org/1999/html" lang="' . LNG_CODE . '" xml:lang="' . LNG_CODE . '">'; return <<<EOF {$doctype} <head> <title>{$title}</title> {$css} \t<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> \t<link rel="shortcut icon" href="%BTN_URL%eude.png"> </head> <body> {$stats} <script type="text/javascript" src="%INCLUDE_URL%prototype.js?1.6.1"></script> <script type="text/javascript" src="%LNG_URL%eude.local.js?{$obj->version}"></script> <script type="text/javascript" src="%INCLUDE_URL%Script.js?{$obj->version}"></script> <img src="%ROOT_URL%cron.php" /> <div id="curseur" class="infobulle"></div> <!--<div id="debug" style="z-index:8; position:fixed; visibility:visible; background-color: #C0C0C0;white-space:nowrap; top:50px; left:5px"></div>--> %NEW_MESSAGE_ENTRY% EOF; }
function initimg($Nbx, $Nby, $taillex, $tailley) { global $colormap, $image, $debug_cl; $map = map::getinstance(); $image = imagecreate($Nbx * $taillex, $Nby * $tailley); $background_color = imagecolorallocate($image, 0, 0, 0); $blanc = imagecolorallocate($image, 254, 254, 254); $rouge = imagecolorallocate($image, 85, 0, 64); imagefilledrectangle($image, 0, 0, $Nbx * $taillex, $Nby * $tailley, $background_color); // Tableau des couleurs... $colormap = DataEngine::config('MapColors'); $colormap = $colormap[$map->itineraire ? 0 : $map->sc + 1]; if ($map->itineraire) { $map->load_prefs('1;0;0;0;' . $map->sc . ';' . $map->taille . ';0;0;0'); } foreach ($colormap as $k => $c) { $R = hexdec(p_substr($c, 1, 2)); $V = hexdec(p_substr($c, 3, 2)); $B = hexdec(p_substr($c, 5, 2)); $colormap[$k] = imagecolorallocate($image, $R, $V, $B); } $colormap[-1] = $debug_cl = $blanc; $colormap[-2] = $rouge; // Centre de communication... $comlevel = ownuniverse::getinstance()->get_comlevel(); if (is_array($comlevel)) { foreach ($comlevel as $k => $planet) { list($CoordsY, $CoordsX) = map::ss2xy($planet['ss']); $level = $planet['level']; if ($level > 0) { ImageFilledEllipse($image, 1 + ($CoordsY - 1) * $taillex + round($taillex / 2) + 1, 1 + ($CoordsX - 1) * $tailley + round($tailley / 2) + 1, $level * 20 * $taillex, $level * 20 * $tailley, $colormap["0"]); } } } return $image; }
<?php //The included Includes/DataEngine.php contains //functions to help easily embed the charts and connect to a database. include "Includes/DataEngine.php"; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text-html; charset=utf-8"/> <script type="text/javascript" src="../../JSC/jquery-latest.min.js"></script> <script type="text/javascript" src="../../JSC/JSCharting.js"></script> <?php $de = new DataEngine(); $de->addParameter(new DateTime('2013-03-01')); $de->addParameter(new DateTime('2013-05-01')); $de->sqlStatement = 'SELECT TransDate, HighPrice AS MSFT FROM MSFT WHERE TransDate >= ? AND TransDate <= ? ORDER BY TransDate'; $series = $de->getSeries(); ?> <title>JSCharting Navigator Axis Markers DB Chart</title> <style type="text/css">/*CSS*/</style> </head> <body> <div id="cc" style="width: 840px; height: 400px;"></div> <script type="text/javascript"> /* Query a Database using PHP to get a single series using date ranges. Learn how to:
$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();
echo $datas['Paiement'] & UP_CHOIX ? 'checked ' : ''; ?> /></td><td>Vous acceptez un paiement dans une sélection de ressources ci-dessous: <?php for ($i = 0; $i < sizeof($cnhMineraisName); $i++) { echo '<br /><input class="color_row0" type="checkbox" name="Paiement_' . ($i + 3) . '" ' . ($datas['Paiement'] & pow(2, $i + 3) ? 'checked ' : '') . '/> <img src=' . IMAGES_URL . $cnhMineraisName[$i] . '.png /> ' . $cnhMineraisName[$i]; } ?> </td></tr> </table></td> </tr> <tr class="color_row0"> <td>Sur quelle(s) planète(s) vous appartenant<br /> acceptez-vous les paiements en ressources?</td> <td> <?php $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()); $i = 0; if ($ownplanetes = mysql_fetch_array($mysql_result)) { for ($i = 0; $ownplanetes['planet' . $i] != '' && $i < 5; $i++) { if ($i > 0) { echo '<br />'; } echo '<input class="color_row0" type="checkbox" name="Planete_' . $i . '" ' . ($datas['Planetes'] & pow(2, $i) ? 'checked ' : '') . '/> ' . $ownplanetes['planet' . $i] . ' aux coordonnées ' . $ownplanetes['coord' . $i]; } } if ($i == 0) { echo "<font color=red><b>Vous n'avez pas saisi vos informations dans la partie Ma fiche => Production, veuillez le faire à la page <a href=\"" . ROOT_URL . "ownuniverse.php\" target=\"_blank\">Production</a>.</b></font>"; } ?> </td> </tr>
} 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); }
require_once './fonction.php'; // les cinq planètes $Planete1 = 1; $Planete2 = 2; $Planete3 = 3; $Planete4 = 4; $Planete5 = 5; $Pla1 = false; $Pla2 = false; $Pla3 = false; $Pla4 = false; $Pla5 = false; //Check si activé $coordvalid = false; if (!addons::getinstance()->Get_Addons('triangulation')->CheckPerms()) { DataEngine::NoPermsAndDie(); } // Si les coordonnées de deux centre de communications avec deux mesure de distance correspondante sont rentrée dans le tableau alors $coordvalid = true; if (isset($_POST['sys1']) && isset($_POST['sys2']) && isset($_POST['dist11']) && isset($_POST['dist21']) || isset($_POST['sys1']) && isset($_POST['sys3']) && isset($_POST['dist11']) && isset($_POST['dist31']) || isset($_POST['sys3']) && isset($_POST['sys2']) && isset($_POST['dist31']) && isset($_POST['dist21'])) { $_SESSION['coord_syst1'] = gpc_esc($_POST['sys1']); $_SESSION['coord_syst2'] = gpc_esc($_POST['sys2']); $_SESSION['coord_syst3'] = gpc_esc($_POST['sys3']); $_SESSION['ccdistance11'] = gpc_esc($_POST['dist11']); $_SESSION['ccdistance21'] = gpc_esc($_POST['dist21']); $_SESSION['ccdistance31'] = gpc_esc($_POST['dist31']); $coordvalid = true; // Faire des calculs que s'il y a une entrée $Pla1 = $_SESSION['coord_syst1'] != "" && $_SESSION['coord_syst2'] != "" && $_SESSION['ccdistance11'] != "" && $_SESSION['ccdistance21'] != "" || $_SESSION['coord_syst1'] != "" && $_SESSION['coord_syst3'] != "" && $_SESSION['ccdistance11'] != "" && $_SESSION['ccdistance31'] != "" || $_SESSION['coord_syst3'] != "" && $_SESSION['coord_syst2'] != "" && $_SESSION['ccdistance31'] != "" && $_SESSION['ccdistance21'] != ""; $dist11 = $_SESSION['ccdistance11']; $dist21 = $_SESSION['ccdistance21']; $dist31 = $_SESSION['ccdistance31'];
</table> </td> </tr> </table> <p align="center"> <?php if ($datas_id > 0) { ?> <input class="color_row0" type="submit" name="submit" id="submit" value="Sauver"> <input class="color_row0" type="submit" name="submit" id="submit" value="Sauver et retour"> <?php } ?> <input class="color_row0" type="submit" name="submit" id="submit" value="Sauver sous nouveau"> <?php if (DataEngine::CheckPerms('ZZZ_COMMERCE_TPL_DELETE')) { ?> <input class="color_row0" type="submit" name="submit" id="submit" value="SUPPRIMER"> <?php } ?> <input class="color_row0" type="reset" name="Reset" id="Reset" value="Réinitialiser"> </p> </form> <br /> <center><a href='template_list.php'>Retourner à la liste des templates de module...</a></center> <!-- FIN CODE LIBRE --> </BODY></HTML>
<?php //The included Includes/DataEngine.php contains //functions to help easily embed the charts and connect to a database. include "Includes/DataEngine.php"; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text-html; charset=utf-8"/> <script type="text/javascript" src="../../JSC/jquery-latest.min.js"></script> <script type="text/javascript" src="../../JSC/JSCharting.js"></script> <?php $de = new DataEngine(); $de->sqlStatement = 'SELECT Code,Sales FROM Locations'; $arrayData = $de->getArrayData(); ?> <title>JSCharting Map Thematic Sales DB Chart</title> <style type="text/css">/*CSS*/</style> </head> <body> <div id="cc" style="width: 740px; height: 480px"> </div> <script type="text/javascript"> /* Query a MySQL Database using PHP to get thematic map data. Learn how to:
function formatarr(&$value, $key) { global $lng; $value = sprintf($lng['listing_playerrow'], $key, DataEngine::format_number($value, true)); return true; }
for ($i = 0; $i < $nb_planet; $i++) { $tpl->Planet_Header($cleandata[$i]); if (isset($cleandata[$i]['percent_' . $keys[0]])) { $tpl->Add_PercentRow($cleandata[$i], $lng['row_concentration'], 'percent_', 'row0'); } $tpl->Add_RessRow($cleandata[$i], $lng['row_prod/h'], '', 'row1'); $tpl->Add_Current_Ress($cleandata[$i]); } $tpl->RowHeader(); $tpl->Add_RessRow($total_all, $lng['row_Total'], '', 'row0'); if ($ownuniverse->get_race() != '') { $tpl->Add_PercentRow(DataEngine::a_race_ressources($ownuniverse->get_race()), $lng['row_race_needed'], '', 'row1'); } //------------------------------------------------------------------------------ $BatimentsName = DataEngine::a_batiments(); $tpl->SetheaderBatiments(); foreach ($BatimentsName as $k => $name) { $tpl->AddToRow($name, $k); } $tpl->PushRow(); foreach ($cleandata as $k => $planet) { $id = $k % 2; $tpl->AddToRow($id, 'class'); $tpl->AddToRow($planet['Name'], 'Name'); foreach ($BatimentsName as $k => $name) { $tpl->AddToRow(DataEngine::format_number($planet[$k]), $k); } $tpl->PushRow(); } } $tpl->DoOutput();
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']); $tpl->add_row($lng['Construction'], 'Construction', $ligne['Construction']); $tpl->add_row($lng['Economie'], 'Economie', $ligne['Economie']); $tpl->add_row($lng['Navigation'], 'Navigation', $ligne['Navigation']); $tpl->add_row($lng['Race'], '', $ligne['Race']); //$tpl->add_row_select($lng['Race'], '', $tabrace, $ligne['Race']); $tpl->add_row_select($lng['lastship'], 'ship', DataEngine::a_shiplist(), $ligne['ship']); $tpl->add_row($lng['Titre'], '', $ligne['Titre']); $tpl->add_row($lng['grade_ingame'], '', $ligne['GameGrade']); $tpl->add_row($lng['grade_eude'], '', $ligne['Grade']); $tpl->footer(); $tpl->doOutput();
$modifier = ' (<font color="' . ($basket->vendors[$modid][$j]['Modifier'] > 0 ? "#ff0000" : "#00ff00") . '">' . $basket->vendors[$modid][$j]['Modifier'] . '%</font>)'; } else { $modifier = ''; } // 'modvendor_'.$modid.'_'.$j echo $basket->vendors[$modid][$j]['Login'] . $modifier . '</td><td valign=middle>' . $basket->StringPaiements($basket->vendors[$modid][$j]['Paiement'], '', '<br>') . '</td></tr>'; } echo "\n"; } echo '<tr class="text_center color_row0" valign=top><td>TOTAL</td><td align=center>' . $basket->total . ' article' . ($basket->total > 1 ? 's' : '') . '<br>' . $basket->nbtotal . ' module' . ($basket->nbtotal > 1 ? 's' : '') . '</td><td><table border=0 width=100% cellpadding=0 cellspacing=0>'; foreach ($cnhMineraisName as $value) { if ($basket->totalitems[$value] > 0) { echo '<tr class="text_center color_row0"><td><img src=' . IMAGES_URL . $value . '.png > ' . $value . '</td><td> </td><td align=right>' . DataEngine::format_number($basket->totalitems[$value]) . '</td><td colspan=2> </td></tr>'; } } echo '<tr class="text_center color_row0"><td colspan=3><hr size=1></td></tr><tr class="text_center color_row0" STYLE="font-weight:bold;"><td><img src="images/ressources.png" /> TOTAL</td><td> </td><td align=right>' . DataEngine::format_number($basket->totalress) . "</td></tr>"; echo "</table></td><td colspan=2> </td></tr>\n"; ?> <tr class="text_center color_row0"><td colspan=5 align=right><?php echo $defaultbutton; ?> </td></tr> </table></form> <!-- FIN CODE LIBRE --> </BODY></HTML> <?php require_once TEMPLATE_PATH . 'sample.tpl.php'; $tpl = tpl_sample::getinstance();
$iv = $message->{'iv'}; $decrypted = trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_128, substr(sha1($user_row['cb_key']), 0, 32), base64_decode($encrypted), MCRYPT_MODE_CBC, base64_decode($iv)), ".."); $order = json_decode($decrypted, true); if ($order['transactionType'] == 'TEST') { $user_sql = "UPDATE 202_users_pref\n SET cb_verified=1\n WHERE user_id='" . $mysql['user_id'] . "'"; $user_results = $db->query($user_sql); } else { if ($order['transactionType'] == 'SALE') { $mysql['click_id'] = $db->real_escape_string($order['trackingCodes'][0]); $mysql['click_payout'] = $db->real_escape_string($order['totalAccountAmount']); $cpa_sql = "SELECT 202_cpa_trackers.tracker_id_public, 202_trackers.click_cpa FROM 202_cpa_trackers LEFT JOIN 202_trackers USING (tracker_id_public) WHERE click_id = '" . $mysql['click_id'] . "'"; $cpa_result = $db->query($cpa_sql); $cpa_row = $cpa_result->fetch_assoc(); $mysql['click_cpa'] = $db->real_escape_string($cpa_row['click_cpa']); if ($mysql['click_cpa']) { $sql_set = "click_cpc='" . $mysql['click_cpa'] . "', click_lead='1', click_filtered='0', click_payout='" . $mysql['click_payout'] . "'"; } else { $sql_set = "click_lead='1', click_filtered='0', click_payout='" . $mysql['click_payout'] . "'"; } $click_sql = "\n UPDATE\n 202_clicks \n SET\n " . $sql_set . "\n WHERE\n click_id='" . $mysql['click_id'] . "' \n "; $db->query($click_sql); $click_sql = "\n UPDATE\n 202_clicks_spy \n SET\n " . $sql_set . "\n WHERE\n click_id='" . $mysql['click_id'] . "' \n "; $db->query($click_sql); //set dirty hour $de = new DataEngine(); $data = $de->setDirtyHour($mysql['click_id']); } } } else { die("Missing Mcrypt!"); }
echo '<tr class="color_row0"><td><img src=' . IMAGES_URL . $value . '.png> ' . $value . '</td><td> </td><td align=right>' . DataEngine::format_number($vlist[$oldi]['Ress'][$value]) . '</td></tr>'; } } echo '<tr class="color_row0"><td colspan=3><hr size=1></td></tr><tr class="color_row0" STYLE="font-weight:bold;"><td><img src="images/ressources.png" /> TOTAL</td><td> </td><td align=right>' . DataEngine::format_number($vlist[$oldi]['RessTotal']) . '</td></tr>'; echo "</table></td>"; } echo "</tr>\n"; } // Total général echo '<tr class="text_center color_row0" valign=top><td>TOTAL GENERAL</td><td align=center>' . $nvendor . ' vendeur' . ($nvendor > 1 ? 's' : '') . '<br>' . $basket->total . ' article' . ($basket->total > 1 ? 's' : '') . '<br>' . $basket->nbtotal . ' module' . ($basket->nbtotal > 1 ? 's' : '') . '</td><td><table border=0 width=100% cellpadding=0 cellspacing=0>'; foreach ($cnhMineraisName as $value) { if ($vlist['RessourcesNB'][$value] > 0) { echo '<tr class="color_row0"><td><img src=' . IMAGES_URL . $value . '.png> ' . $value . '</td><td> </td><td align=right>' . DataEngine::format_number($vlist['RessourcesNB'][$value]) . '</td><td colspan=2> </td></tr>'; } } echo '<tr><td colspan=3><hr size=1></td></tr><tr class="color_row0" STYLE="font-weight:bold;"><td><img src="images/ressources.png" /> TOTAL</td><td> </td><td align=right>' . DataEngine::format_number($vlist['RessourcesNBTotal']) . '</td></tr>'; echo "</table></td></tr>\n"; ?> <tr class="text_center color_row0"><td colspan=3 align=right><?php echo $defaultbutton; ?> </td></tr> </table></form> <?php } ?> <!-- FIN CODE LIBRE --> </BODY></HTML> <?php
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; } }
/** * 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); }
<?php //The included Includes/DataEngine.php contains //functions to help easily embed the charts and connect to a database. include "Includes/DataEngine.php"; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text-html; charset=utf-8"/> <script type="text/javascript" src="../../JSC/jquery-latest.min.js"></script> <script type="text/javascript" src="../../JSC/JSCharting.js"></script> <?php $de = new DataEngine(); $de->sqlStatement = 'SELECT * FROM Employees'; $de->dataFields = 'name=name,yAxis=salary'; $series = $de->getSeries(); ?> <title>JSCharting Step Line DB Chart</title> <style type="text/css">/*CSS*/</style> </head> <body> <div id="cc" style="width: 640px; height: 400px"> </div> <script type="text/javascript"> /* Query a MySQL Database using PHP to get a data series. Learn how to:
<?php // Partie standard d'EU2de require_once '../../init.php'; require_once INCLUDE_PATH . 'Script.php'; require_once TEMPLATE_PATH . 'sample.tpl.php'; $tpl = tpl_sample::getinstance(); // Déclaration variables $Joueur = $_SESSION['_login']; require_once 'cnh_fonctions.php'; Init_Addon(); if (!DataEngine::CheckPerms('ZZZ_COMMERCE_INDEX')) { output::Boink(ROOT_URL . 'index.php'); } // DEBUT CODE LIBRE // FIN CODE LIBRE ?> <HTML> <HEAD> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </HEAD> <BODY> <!-- DEBUT CODE LIBRE --> <?php if (isset($_GET['sousmenu'])) { // cnhToolbar(3, "menu_", 128, $_GET['sousmenu']); cnhTB(1, "menu_", 128, $_GET['sousmenu']); } elseif (empty($Joueur)) {
$tpl->AddToRow($stype[$ligne['TYPE']], 'type'); $tpl->AddToRow($coords, 'coords'); if ($ligne['EMPIRE']) { $shw_emp = wordwrap($ligne['EMPIRE'], 20, '<br/>', true); $tpl->AddToRow($ligne['USER'] ? $ligne['USER'] . '<br/>' . $shw_emp : $shw_emp, 'player'); } else { $tpl->AddToRow($ligne['USER'] ? $ligne['USER'] : '******', 'player'); } $tpl->AddToRow($ligne['INFOS'] ? $ligne['INFOS'] : '-', 'infos'); $tpl->AddToRow($ligne['NOTE'], 'notes'); $tpl->AddToRow($ligne['water'], 'water'); $tpl->AddToRow($ligne['batiments'], 'batiments'); if (!isset($ligne['troop'])) { $ligne['troop'] = -1; } $tpl->AddToRow(DataEngine::format_number($ligne['troop'], true), 'troop'); if (isset($ligne['troop_date'])) { $tpl->AddToRow(bulle(sprintf($lng['search_troopdate'], date($lng['search_date_long_format']), $ligne['troop_date'])), 'troop_date'); } else { $tpl->AddToRow('', 'troop_date'); } $tmp = sprintf($lng['search_userdate'], $ligne['UTILISATEUR'], date($lng['search_date_long_format'], $ligne['udate'])); $tpl->AddToRow(bulle($tmp), 'userdate'); $tpl->AddToRow(date($lng['search_date_short_format'], $ligne['udate']), 'udate'); if (Members::CheckPerms('CARTOGRAPHIE_DELETE')) { $tpl->AddToRow($cmdinput, 'cmd_delete'); $tpl->AddToRow('delete', 'cmd'); $tpl->AddToRow(bulle($lng['search_bulle_cmd_delete']), 'bulle'); } else { $tpl->AddToRow('', 'cmd_delete'); }
if ($cur >= count($sqls)) { error('Incorrect $cur'); } sql($sqls[$cur]); if (file_put_contents($lockfile, $cur + 1) === false) { error('I/O Error .lock ' . $cur); } $xml = str_replace('%msg%', 'Installation de la base de donnée en cours', $xml); $xml = str_replace('%haserror%', '0', $xml); if ($cur + 1 >= count($sqls)) { $xml = str_replace('%done%', '1', $xml); } else { $xml = str_replace('%done%', '0', $xml); } if (INSTALLED) { DataEngine::sql_log(); } die($xml); function sql($sql) { $sql = str_replace('%%username%%', mysql_real_escape_string(gpc_esc($_POST['username'])), $sql); $sql = str_replace('%%password%%', mysql_real_escape_string(gpc_esc($_POST['password'])), $sql); $empire = gpc_esc($_POST['empire']); $sql = str_replace('%%empirename%%', mysql_real_escape_string($empire), $sql); $sql = str_replace('%%empirenamelen%%', p_strlen($empire), $sql); $board = gpc_esc($_POST['board']); $sql = str_replace('%%boardname%%', mysql_real_escape_string($board), $sql); $sql = str_replace('%%boardnamelen%%', p_strlen($board), $sql); $sql = str_replace('SQL_PREFIX_', SQL_PREFIX_, $sql); FB::log($sql); if (!DEBUG_PLAIN) {
//The included Includes/DataEngine.php contains //functions to help easily embed the charts and connect to a database. include "Includes/DataEngine.php"; ?> <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text-html; charset=utf-8"/> <script type="text/javascript" src="../../JSC/jquery-latest.min.js"></script> <script type="text/javascript" src="../../JSC/JSCharting.js"></script> <?php $startDate = new DateTime('2014-10-1'); $endDate = new DateTime('2014-10-31 23:59:59'); $title = 'Sales From ' . date_format($startDate, 'm/d/Y') . ' to ' . date_format($endDate, 'm/d/Y') . ', Total : %sum'; $de = new DataEngine(); $de->addParameter($startDate); $de->addParameter($endDate); $de->sqlStatement = 'SELECT OrderDate AS Month, SUM(Total) AS Sales FROM Orders WHERE OrderDate >=? And OrderDate <=? GROUP BY DAY(OrderDate) ORDER BY DAY(OrderDate);'; $de->dataFields = 'xAxis=Month,yAxis=Sales'; //default setting $de->dateGrouping = "Month"; $series = $de->getSeries(); ?> <title>JSCharting Month DB Chart</title> <style type="text/css">/*CSS*/</style>
public function CheckPerms() { return DataEngine::CheckPerms('STATS_COMBAT'); }
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; }
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 /> Vous pouvez importer: <ul> <li><b>Liste des modules</b> que vous pouvez fabriquer (<i>Bâtiment -> Chantier Naval -> Modules</i>).</li> <?php if (DataEngine::CheckPerms('ZZZ_COMMERCE_TPL_INSERT')) { ?> <li><b>Template de module</b> (<i>Bâtiment -> Chantier Naval -> Modules -> Click sur Module concerné</i>).</li> <?php } ?> </ul></td> <td> Données à interpréter: <textarea class="color_row0" name="RawData" cols="45" rows="5" wrap="virtual" id="RawData"></textarea><br /> <input class="color_row0" type="checkbox" name="ReplaceAll" id="ReplaceAll" /> Avant cette importation, remise à zéro de la liste des modules que vous pouvez fabriquer. </td> </tr> </table> <br /> <center><input class="color_row0" type="submit" name="submit" id="submit" value="Interpréter"></center> </form>
public function __construct() { $this->reset(); $this->lng = language::getinstance()->GetLngBlock('cartographie'); $this->lngmain = language::getinstance()->GetLngBlock('dataengine'); $this->allys = DataEngine::config('EmpireAllys'); $this->wars = DataEngine::config('EmpireEnnemy'); if (!is_array($this->allys) && $this->allys != '') { $this->allys = array($this->allys); } if (!is_array($this->wars) && $this->wars != '') { $this->wars = array($this->wars); } if (!is_array($this->allys) && $this->allys == '') { $this->allys = array(); } if (!is_array($this->wars) && $this->wars == '') { $this->wars = array(); } if (is_array($this->allys)) { $this->allys = parser::getinstance()->cleaning_array($this->allys); } if (is_array($this->wars)) { $this->wars = parser::getinstance()->cleaning_array($this->wars); } $this->detelespooler = array(); }
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; }