本文整理汇总了PHP中DBQuery::execute方法的典型用法代码示例。如果您正苦于以下问题:PHP DBQuery::execute方法的具体用法?PHP DBQuery::execute怎么用?PHP DBQuery::execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBQuery
的用法示例。
在下文中一共展示了DBQuery::execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createTables
/**
* This creates all the tables as defined in self::$required_tables
*/
public function createTables()
{
foreach (self::$required_tables as $statement) {
$query = new DBQuery($statement);
$query->execute();
}
}
示例2: breakUpAndGetIDs
function breakUpAndGetIDs($field, $dbfieldid, $dbfieldname, $dbtable)
{
$sval = explode(",", $field);
$where = array();
foreach ($sval as $val) {
$where[] = "lower( " . $dbfieldname . " ) LIKE lower( '" . trim($val) . "' )";
}
$ssql = "SELECT " . $dbfieldid . " FROM " . $dbtable . " WHERE " . implode(" OR ", $where);
$qry = new DBQuery();
$qry->execute($ssql);
$sid = array();
while ($srow = $qry->getRow()) {
$sid[] = $srow[$dbfieldid];
}
return $sid;
}
示例3: mkdir
$stylename = 'default';
}
$smarty->template_dir = "./themes/{$themename}/templates";
if (!is_dir(KB_CACHEDIR . '/templates_c/' . $themename)) {
mkdir(KB_CACHEDIR . '/templates_c/' . $themename);
}
$smarty->compile_dir = KB_CACHEDIR . '/templates_c/' . $themename;
$smarty->cache_dir = KB_CACHEDIR . '/data';
$smarty->assign('theme_url', THEME_URL);
if ($stylename != 'default' || $themename != 'default') {
$smarty->assign('style', $stylename);
}
if (config::get('fleet_battles_mod_cache')) {
$dbq = new DBQuery();
$system_sql = "select count(*) as cnt, kll_system_id from kb3_kills\n group by kll_system_id\n having cnt > " . config::get('fleet_battles_mod_minkills') . " order by cnt";
$dbq->execute($system_sql);
while ($system = $dbq->getRow()) {
$battlelist = new BattleList((int) $system['kll_system_id']);
$battlelist->execQuery();
$table = new BattleListTable($battlelist);
$table->getTableStats();
unset($battlelist);
unset($table);
}
$html .= "Built battle cache with mod version " . config::get("fleet_battles_mod_version") . ".<br/>";
} else {
$html .= "Caching must be enabled to build the battle cache.<br/>";
}
$html .= "Time taken = " . (microtime(true) - $cronStartTime) . " seconds.";
if (php_sapi_name() == 'cli') {
$html = str_replace("</div>", "</div>\n", $html);
示例4: advSrch
//.........这里部分代码省略.........
if (strlen($_SESSION['invpilot']) > 0) {
$list->setInvPilot($_SESSION['invpilot']);
}
if (strlen($_SESSION['invcorp']) > 0) {
$list->setInvCorp($_SESSION['invcorp']);
}
if (strlen($_SESSION['invally']) > 0) {
$list->setInvAlly($_SESSION['invally']);
}
if (strlen($_SESSION['invweapon']) > 0) {
$list->setInvWeapon($_SESSION['invweapon']);
}
if (strlen($_SESSION['invcount']) > 0) {
$list->setInvCount($_SESSION['invcount']);
}
if (strlen($_SESSION['itemdropped']) > 0) {
$list->setItemDropped($_SESSION['itemdropped']);
}
if (strlen($_SESSION['itemdestroyed']) > 0) {
$list->setItemDestroyed($_SESSION['itemdestroyed']);
}
if (strlen($_SESSION['commcnt']) > 0) {
$list->setCommentCount($_SESSION['commcnt']);
}
if (strlen($_SESSION['daterange']) > 0) {
$list->setDateRange($_SESSION['daterange']);
}
}
$combined = config::get('adv_search_show_combined') or "default";
$error_handling = config::get('adv_search_error_handling') or "continue";
if ($combined == "always" or config::get('show_comb_home') and $combined == "default") {
if (ALLIANCE_ID > 0) {
$list->addCombinedAlliance(ALLIANCE_ID);
}
if (CORP_ID > 0) {
$list->addCombinedCorp(CORP_ID);
}
if (PILOT_ID > 0) {
$list->addCombinedPilot(PILOT_ID);
}
}
// add page splitter
$pagesplitter = new PageSplitter($list->getCount(), $killperpage);
$list->setPageSplitter($pagesplitter);
// prepare list table
$table = new KillListTable($list);
$table->setDayBreak(false);
if (method_exists($table, "setCombined") and ($combined == "always" or config::get('show_comb_home') and $combined == "default")) {
$table->setCombined(true);
}
$errors = $list->getErrors();
/* error handling */
if (count($errors) and $error_handling == "halt") {
// header
$html .= "<div class=\"kb-date-header\">There was one or more errors</div>\n";
// list errors
$html .= "<ul>\n";
foreach ($errors as $error) {
$html .= "<li>" . $error . ";</li>\n";
}
$html .= "</ul>\n";
} else {
if (count($errors) and $error_handling == "continue") {
// header
$html .= "<div class=\"kb-date-header\">There was one or more errors</div>\n";
// list errors
$html .= "<ul>\n";
foreach ($errors as $error) {
$html .= "<li>" . $error . ";</li>\n";
}
$html .= "</ul>\n";
}
// header
$html .= "<div class=kb-kills-header>Search results";
// share url
if ($shareUrl) {
$html .= " (<a href=\"" . $shareUrl . "\">share</a>)";
}
$html .= "</div>\n";
// generate html
$html .= $table->generate();
$html .= $pagesplitter->generate();
}
} else {
/* get ship classes */
$kbShipClasses = array();
$qry = new DBQuery();
$qry->execute("SELECT * FROM `kb3_ship_classes` WHERE `scl_class` NOT LIKE 'POS%' AND `scl_class` NOT LIKE 'Drone' ORDER BY `scl_class`");
while ($sql_row = $qry->getRow()) {
$kbShipClasses[$sql_row['scl_id']] = $sql_row['scl_class'];
}
$smarty->assignByRef('kbShipClasses', $kbShipClasses);
// generate from tpl
$html .= $smarty->fetch(getcwd() . '/mods/advanced_search/adv_search.tpl');
}
// generate page
$html .= "<hr><p class=\"kb-subtable\" align=\"right\"><i>Advanced Search by Sonya Rayner<br>" . ADV_SRCH_VERSION . "</i></p>";
/* return the generated content */
return $html;
}
示例5: DBQuery
case 222:
if ($act->isOldKey($row['key_id'], $row['key_key'])) {
$flags |= KB_APIKEY_LEGACY;
break;
}
$flags |= KB_APIKEY_EXPIRED;
break;
default:
}
} else {
// no error so user didn't have '256' access
}
}
$qry2 = new DBQuery();
$sql = "UPDATE kb3_api_keys SET key_flags = {$flags} WHERE key_name='" . $qry->escape($row['key_name']) . "' AND key_id='" . $qry->escape($row['key_id']) . "' AND key_key='" . $qry->escape($row['key_key']) . "' AND key_kbsite = '" . KB_SITE . "'";
$qry2->execute($sql);
}
if ($flags & KB_APIKEY_LEGACY) {
$html .= "<td></td><td>-</td><td>-</td>";
} else {
$html .= "<td>";
$chars = array();
if (!($flags & KB_APIKEY_BADAUTH || $flags & KB_APIKEY_EXPIRED)) {
$act = new API_Account();
$characters = $act->fetch($row['key_id'], $row['key_key']);
if (is_array($characters)) {
foreach ($act->fetch($row['key_id'], $row['key_key']) as $character) {
$chars[] = $character["characterName"] . ", " . $character["corporationName"];
}
} else {
if ($act->getError() !== null) {
示例6: getCount
function getCount()
{
if (!config::get('fleet_battles_mod_cache')) {
return 0;
}
$countSql = 'select COUNT(*) as numberOfBattles
from kb3_battles_cache';
$numberOfBattlesQuery = new DBQuery();
$numberOfBattlesQuery->execute($countSql);
$numberOfBattles = $numberOfBattlesQuery->getRow();
return $numberOfBattles["numberOfBattles"];
}
示例7: Page
* @package EDK
*/
/*
* EDK IDFeed Syndication Admin Page
*/
require_once 'common/admin/admin_menu.php';
$page = new Page("Administration - Feed Syndication " . $idfeedversion);
$page->setCachable(false);
$page->setAdmin();
$qry = new DBQuery();
// Delete any old feeds first
if ($_POST['submit']) {
if ($_POST['delete']) {
foreach ($_POST['delete'] as $id) {
$id = intval($id);
$qry->execute("DELETE FROM kb3_feeds WHERE feed_kbsite = '" . KB_SITE . "' AND feed_id = {$id}");
unset($_POST["feed"][$id]);
}
}
}
$feeds = array();
// Retrieve feeds from Database
$qry->execute("SELECT * FROM kb3_feeds WHERE feed_kbsite = '" . KB_SITE . "'");
while ($row = $qry->getRow()) {
$active = (bool) ($row["feed_flags"] & FEED_ACTIVE);
$feeds[$row["feed_id"]] = array('id' => $row["feed_id"], 'updated' => $row["feed_updated"], 'active' => $active, 'uri' => $row["feed_url"], 'lastkill' => $row["feed_lastkill"]);
}
// updating/saving urls and options
if ($_POST['submit']) {
foreach ($_POST["feed"] as $key => $val) {
if ($key == "new") {
示例8: moduleInfo
function moduleInfo($param_moduleArray)
{
$low = 0;
$mid = 0;
$hig = 0;
$rig = 0;
$slots = array(7 => "", 3 => "[empty low slot]", 2 => "[empty mid slot]", 1 => "[empty high slot]", 5 => "[empty rig slot]", 6 => "", 10 => "", 11 => "");
/*echo "<pre>";
print_r($param_moduleArray);
echo "</pre>";*/
/*
[0] => Array
(
[name] => E500 Prototype Energy Vampire
[groupID] => 68
[chargeSize] =>
[itemid] => 16501
[id] => 16501
[capacity] => 0
[mass] => 1000
[volume] => 5
[icon] => 01_03
[slot] => 1
)
*/
foreach ($slots as $j => $slot) {
$moduleArr = null;
$moduleArr = array();
if ($param_moduleArray[$j]) {
foreach ($param_moduleArray[$j] as $i => $value) {
//echo $value['itemid']." -> <br />";
$item = new Item($value[itemid]);
if (array_key_exists($value['itemid'], $moduleArr)) {
//echo $value[itemid]." -> ".$moduleArr[$value[itemid]]['name']." - > ".self::$moduleCount." -> ".$moduleArr[$value[itemid]]["ignore"]."<br />";
if ($moduleArr[$value[itemid]]["ignore"] !== true) {
self::$modSlots[$j][] = array('id' => $moduleArr[$value[itemid]]['id'], 'name' => $moduleArr[$value[itemid]]['name'], 'groupID' => $moduleArr[$value[itemid]]['groupID'], 'icon' => $moduleArr[$value[itemid]]['icon'], 'iconloc' => $moduleArr[$value[itemid]]['iconloc'], 'metaLevel' => $moduleArr[$value[itemid]]["metaLevel"], 'techLevel' => $moduleArr[$value[itemid]]["techLevel"], 'capacity' => $moduleArr[$value[itemid]]['capacity'], 'volume' => $moduleArr[$value[itemid]]['volume'], 'mass' => $moduleArr[$value[itemid]]['mass']);
$valueinput = explode(",", $moduleArr[$value[itemid]]['value']);
$attributeName = explode(",", $moduleArr[$value[itemid]]['attributeName']);
$displayName = explode(",", $moduleArr[$value[itemid]]['displayName']);
$stackable = explode(",", $moduleArr[$value[itemid]]['stackable']);
$unit = explode(",", $moduleArr[$value[itemid]]['unit']);
//echo $moduleArr[$value[itemid]]['name']." -> <br />";
for ($k = 0; $k < count($valueinput); $k++) {
if ($valueinput != "") {
if ($unit[$k] == "%") {
$type = $unit[$k];
} else {
$type = "+";
}
$neg = fittingTools::negRules($stackable[$k], $unit[$k]);
if ($j == 6) {
fittingTools::applyDroneSkills(abs($valueinput[$k]), "+", $type, $attributeName[$k], false, 1, $neg, $moduleArr[$value[itemid]]['groupID'], $moduleArr[$value[itemid]]['capacity'], $moduleArr[$value[itemid]]['name'], $moduleArr[$value[itemid]]["techLevel"], $j);
} else {
//echo $moduleArr[$value[itemid]]['name']."<br />";
fittingTools::applyShipSkills(abs($valueinput[$k]), "+", $type, $attributeName[$k], false, 1, $neg, $moduleArr[$value[itemid]]['groupID'], $moduleArr[$value[itemid]]['capacity'], $moduleArr[$value[itemid]]['name'], $moduleArr[$value[itemid]]["techLevel"], $j, $moduleArr[$value[itemid]]['mass']);
}
}
}
} else {
if (self::$droneArr[$value[itemid]]['name']) {
self::$droneArr[$value[itemid]]['count']++;
}
}
} else {
if (fittingTools::advancedModuleSettings($value['name']) == "mwd") {
//i removed icon thing here :: note
self::$shipStats->setIsMWD(true);
}
if (fittingTools::advancedModuleSettings($value['name']) == "ab") {
self::$shipStats->setIsAB(true);
}
//self::$modSlots[$j][] = array('id'=> $value['id'],'name'=> $value['name'], 'icon'=> $value['itemid'], 'metaLevel' => $value["meta"], 'techLevel' => $value["tech"], 'capacity' => $value["capacity"], 'volume' => $value["volume"], 'mass' => $value["mass"]);
if ($j == 10 || $j == 6) {
self::$modSlots[$j][] = array('id' => $value['id'], 'name' => $value['name'], 'groupID' => $value['groupID'], 'icon' => $value['icon'], 'iconloc' => $item->getIcon(32), 'metaLevel' => $value["meta"], 'techLevel' => $value["tech"], 'capacity' => $value["capacity"], 'volume' => $value["volume"], 'mass' => $value["mass"]);
} else {
self::$modSlots[$j][] = array('id' => $value['id'], 'name' => $value['name'], 'groupID' => $value['groupID'], 'icon' => $value['icon'], 'iconloc' => $item->getIcon(64, false), 'metaLevel' => $value["meta"], 'techLevel' => $value["tech"], 'capacity' => $value["capacity"], 'volume' => $value["volume"], 'mass' => $value["mass"]);
}
/*echo "<br/>-----------------------<br/>";
echo "<pre>";
print_r($value);
echo "</pre>";*/
//echo "not found -> ".$typeID['typeName']." ".$value['itemid']."<br />";
if ($j == 7) {
self::$shipStats->setMass(fittingTools::statOntoShip(self::$shipStats->getMass(), fittingTools::calculateMass($value['mass']), "+", "+", 1));
}
////////////////////////////////////////
//add in functionality here
//get module stats on the fly
//see how it displays
//limit the amount of queries here
$qry2 = new DBQuery();
$qry2->execute("select kb3_dgmtypeattributes.value, kb3_dgmattributetypes.attributeName, kb3_dgmattributetypes.displayName, kb3_dgmattributetypes.stackable, kb3_eveunits.displayName as unit\nfrom kb3_dgmtypeattributes\ninner join kb3_dgmattributetypes on kb3_dgmtypeattributes.attributeID = kb3_dgmattributetypes.attributeID\nleft join kb3_eveunits on kb3_dgmattributetypes.unitID = kb3_eveunits.unitID\nwhere typeID = " . $value['itemid']);
while ($row = $qry2->getRow()) {
//echo $row['value']." ".$row['attributeName']."<br/>";
//echo abs($row['value'])." "+" ".$row['unit']." ".$row['attributeName']." ".false." 1 ".$row['stackable']."<br />";
if ($row['unit'] == "%") {
$type = $row['unit'];
} else {
$type = "+";
}
//.........这里部分代码省略.........
示例9: getIDFeed
/**
* @param boolean $trusted Depreciated.
*/
function getIDFeed($id, $url, $trusted, $lastkill)
{
// Just in case, check for empty urls.
if (empty($url)) {
return '';
}
$qry2 = new DBQuery();
$feedfetch = new IDFeed();
$feedfetch->setID();
$feedfetch->setAllKills(1);
if (!$lastkill) {
$feedfetch->setStartDate(time() - 60 * 60 * 24 * 7);
} else {
$feedfetch->setStartKill($lastkill + 1, true);
}
if ($feedfetch->read($url) !== false) {
$posted = count($feedfetch->getPosted());
$skipped = count($feedfetch->getSkipped());
$duplicate = count($feedfetch->getDuplicate());
if (strrpos(strtolower($url), 'zkillboard')) {
$newKillID = $feedfetch->getLastReturned();
} else {
$newKillID = $feedfetch->getLastInternalReturned();
}
if ($newKillID > $lastkill) {
$qry2->execute("UPDATE kb3_feeds SET feed_lastkill=" . intval($newKillID) . ", feed_updated=NOW()\n\t\t\t\tWHERE feed_kbsite = '" . KB_SITE . "' AND feed_id = {$id}");
}
printlog($posted . " kills were posted, " . $duplicate . " duplicate kills and " . $skipped . " were skipped.");
printlog("Last kill ID returned was {$newKillID}");
if ($feedfetch->getParseMessages()) {
foreach ($feedfetch->getParseMessages() as $msg) {
printlog($msg);
}
}
} else {
if (!$val['lastkill']) {
printlog("Start time = " . date('YmdHi', time() - 60 * 60 * 24 * 7));
} else {
if ($val['apikills']) {
printlog("Start kill = " . $val['lastkill']);
}
}
printlog("Error reading feed: " . $feedfetch->errormsg());
}
printlog("Fetch url: " . $feedfetch->getFullURL());
}
示例10: showactivityoverview
function showactivityoverview()
{
$week = $this->getWeek();
$month = $this->getMonth();
$year = $this->getYear();
if (config::get('show_activity_overview')) {
if (!config::get('show_monthly')) {
$weekly = 1;
} else {
$weekly = 0;
}
$row_counter = 0;
$html .= '<table class=kb-table width="100%" border=0 cellspacing="1">';
if ($weekly == 1) {
$html .= '<tr ><td colspan="3" class=kb-table-header>Activity Map for Week ' . $week . '</td></tr>';
} else {
$html .= '<tr ><td colspan="3" class=kb-table-header>Activity Map for ' . date('F', mktime(0, 1, 0, $month, 1, $year)) . '</td></tr>';
}
$html .= '<tr>';
$sql2 = "select reg.reg_id, count(distinct kll.kll_id) as kills\n\t\t\t\t\t\tfrom kb3_systems sys, kb3_kills kll, kb3_inv_detail inv, kb3_constellations con, kb3_regions reg\n\t\t\t\t\t\twhere kll.kll_system_id = sys.sys_id\n\t\t\t\t\t\tand inv.ind_kll_id = kll.kll_id";
if (count(config::get('cfg_allianceid'))) {
$orargs[] = 'inv.ind_all_id IN (' . implode(",", config::get('cfg_allianceid')) . ") ";
}
if (count(config::get('cfg_corpid'))) {
$orargs[] = 'inv.ind_crp_id IN (' . implode(",", config::get('cfg_corpid')) . ") ";
}
if (count(config::get('cfg_pilotid'))) {
$orargs[] = 'inv.ind_plt_id IN (' . implode(",", config::get('cfg_pilotid')) . ") ";
}
$sql2 .= " AND (" . implode(" OR ", $orargs) . ")";
if ($weekly == 1) {
$sql2 .= "\t\tand date_format( kll.kll_timestamp, \"%u\" ) = " . $week . " ";
} else {
$sql2 .= "\t\tand date_format( kll.kll_timestamp, \"%m\" ) = " . $month . " ";
}
$sql2 .= "\t\tand date_format( kll.kll_timestamp, \"%Y\" ) = " . $year . "\n\t\t\t\t\t\tand con.con_id = sys.sys_con_id\n\t\t\t\t\t\tand reg.reg_id = con.con_reg_id\n\t\t\t\t\t\tgroup by reg.reg_id\n\t\t\t\t\t\torder by kills desc\n\t\t\t\t\t\tLIMIT 0,3;";
$qry2 = new DBQuery();
$qry2->execute($sql2) or die($qry2->getErrorMsg());
while ($row2 = $qry2->getRow()) {
$row_counter++;
$link = edkuri::build(array(array('a', 'detail_view', true), array('region_id', $row2['reg_id'], true)));
if ($weekly == 1) {
$html .= '<td align="center"><a href="' . $link . '"><img src="?a=map&mode=activity&size=250®ion_id=' . $row2['reg_id'] . '&week=' . $week . '&year=' . $year . '" border=0 /></a></td>';
} else {
$html .= '<td align="center"><a href="' . $link . '"><img src="?a=map&mode=activity&size=250®ion_id=' . $row2['reg_id'] . '&month=' . $month . '&year=' . kbdate("Y") . '" border=0 /></a></td>';
}
}
while ($row_counter < 3) {
$row_counter++;
$html .= '<td align="center"><img width="250" height="250" src="?a=map&mode=na&size=250"></td>';
}
$html .= '</tr></table><br />';
}
return $html;
}
示例11: generate
function generate()
{
$regioncache = KB_CACHEDIR . '/img/map/' . KB_SITE . '_' . $this->regionid_ . '_' . $this->imgwidth_ . '.png';
$is_cached = 0;
//INIT
$title_caption = $this->regname_;
if (file_exists($regioncache)) {
$cfgttl = '6';
$ttyl_sec = $cfgttl * 3600;
$ttl = filemtime($regioncache) + $ttyl_sec;
if ($ttl <= time()) {
$is_cached = 0;
unlink($regioncache);
unlink($regioncache . ".txt");
} else {
$img = imagecreatefrompng($regioncache);
$is_cached = 1;
}
}
if ($is_cached == 0) {
$sql = 'SELECT sys.sys_x, sys.sys_y, sys.sys_z, sys.sys_sec, sys.sys_id, sys.sys_name, sys.sys_id, sjp.sjp_to, con.con_id, con.con_name, reg.reg_id, reg.reg_name, reg.reg_x, reg.reg_z
FROM kb3_systems sys
LEFT JOIN kb3_system_jumps sjp ON sys.sys_id = sjp.sjp_from
JOIN kb3_constellations con ON con.con_id = sys.sys_con_id
JOIN kb3_regions reg ON reg.reg_id = con.con_reg_id';
if ($this->mode_ == "sys") {
$sql .= " and reg.reg_id = '" . $this->regionid_ . "'";
} else {
$sql .= " and reg.reg_id = " . $this->regionid2_;
}
$qry = new DBQuery();
$qry->execute($sql) or die($qry->getErrorMsg());
if (!$img) {
$img = imagecreatetruecolor($this->imgwidth_, $this->imgheight_);
}
$white = imagecolorallocate($img, 255, 255, 255);
$red = imagecolorallocate($img, 255, 0, 0);
if (config::get('map_act_cl_bg')) {
$bcolor = explode(",", config::get('map_act_cl_bg'));
mapview::setbgcolor($bcolor[0], $bcolor[1], $bcolor[2]);
}
$bgcolor = imagecolorallocate($img, $this->bgcolor_[0], $this->bgcolor_[1], $this->bgcolor_[2]);
imagefilledrectangle($img, 0, 0, $this->imgwidth_, $this->imgheight_, $bgcolor);
$color = $white;
$fov = 0;
//INIT
$i = 0;
$minx = 0;
$minz = 0;
$maxx = 0;
$maxz = 0;
$mini = 0;
$maxi = 0;
$pi = 0;
$sc = 0;
$systems = array();
while ($row = $qry->getRow()) {
$i = $row['sys_id'];
$systems[] = $i;
if ($i < $mini || $mini == 0) {
$mini = $i;
}
if ($i > $maxi || $maxi == 0) {
$maxi = $i;
}
$x = $row['sys_x'] * $this->ly_;
$z = $row['sys_z'] * $this->ly_;
if ($x < $minx || $minx == 0) {
$minx = $x;
}
if ($x > $maxx || $maxx == 0) {
$maxx = $x;
}
if ($z < $minz || $minz == 0) {
$minz = $z;
}
if ($z > $maxz || $maxz == 0) {
$maxz = $z;
}
$sys[$i][0] = $x;
$sys[$i][1] = $z;
if ($i == $pi || $pi == 0) {
$sys[$i][2][$sc] = $row['sjp_to'];
$sys[$i][3] = $sc++;
} else {
$sc = 0;
}
$sys[$i][4] = $row['sys_id'];
$sys[$i][5] = $row['sys_name'];
$sys[$i][6] = $row['sys_sec'];
$sys[$i][7] = $row['con_id'];
$sys[$i][8] = $row['con_name'];
$sys[$i][9] = $row['reg_id'];
$sys[$i][10] = $row['reg_name'];
$pi = $i;
}
$dx = abs($maxx - $minx);
$dz = abs($maxz - $minz);
$xscale = 1 / ($dx / ($this->imgwidth_ - $this->offset_ * 2));
$yscale = 1 / ($dz / ($this->imgheight_ - $this->offset_ * 2));
//.........这里部分代码省略.........
示例12: TrovaInvolvedParty
function TrovaInvolvedParty($kill, &$killers)
{
$qry = new DBQuery();
/* $qry->execute("SELECT kb3_pilots.plt_name as pilot, kb3_corps.crp_name as corp, kb3_pilots.plt_id as id, kb3_pilots.plt_externalid as xid
FROM kb3_inv_detail, kb3_pilots, kb3_corps
WHERE (kb3_inv_detail.ind_plt_id = kb3_pilots.plt_id)and (kb3_inv_detail.ind_crp_id = kb3_corps.crp_id)and(kb3_inv_detail.ind_kll_id =" . $kill->getID() .")")
or die($qry->getErrorMsg());
*/
$qry->execute("SELECT kb3_pilots.plt_name AS pilot, kb3_corps.crp_name AS corp, kb3_pilots.plt_id AS id, kb3_pilots.plt_externalid AS xid, kb3_ships.shp_class AS SClass\n FROM kb3_inv_detail, kb3_pilots, kb3_corps, kb3_ships\n WHERE (\n kb3_inv_detail.ind_plt_id = kb3_pilots.plt_id\n )\n AND (\n kb3_inv_detail.ind_crp_id = kb3_corps.crp_id\n )\n AND (\n kb3_inv_detail.ind_shp_id = kb3_ships.shp_id\n )\n AND (\n kb3_inv_detail.ind_kll_id = " . $kill->getID() . ")") or die($qry->getErrorMsg());
$bs = 0;
while ($row = $qry->getRow()) {
$pilot = TestPilotName($row['pilot']);
$killers[$pilot]['punti'] += $kill->getKillPoints();
if ($pilot == TestPilotName($kill->getFBPilotName())) {
$killers[$pilot]['punti'] += 1;
}
$killers[$pilot]['portrait'] = "?a=thumb&id=" . $row['xid'] . "&size=32";
$killers[$pilot]['corp'] = $row['corp'];
$killers[$pilot]['id'] = $row['id'];
if ($row['SClass'] == 1) {
//battleship
$bs++;
}
}
return $bs;
}
示例13: Config
require_once 'common/includes/db.php';
require_once 'common/includes/class.edkerror.php';
set_error_handler(array('EDKError', 'handler'), E_ERROR);
$config = new Config(KB_SITE);
define('KB_TITLE', config::get('cfg_kbtitle'));
if (!($dir = config::get('cache_dir'))) {
$dir = 'cache/data';
}
define('KB_CACHEDIR', $dir);
$outhead = "Running API Import on " . gmdate("M d Y H:i") . "\n\n";
$html = '';
$outtemp = '';
$myEveAPI = new API_KillLog();
$myEveAPI->iscronjob_ = true;
$qry = new DBQuery();
$qry->execute("SELECT * FROM kb3_api_keys WHERE key_kbsite = '" . KB_SITE . "' ORDER BY key_name");
while ($row = $qry->getRow()) {
if (isset($_GET['feed']) && $_GET['feed'] && $row['key_id'] != $_GET['feed']) {
continue;
}
$html .= "Importing Mails for " . $row['key_name'] . "<br />";
$html .= $myEveAPI->Import($row['key_name'], $row['key_id'], $row['key_key'], $row['key_flags']);
$apicachetime[$i] = $myEveAPI->CachedUntil_;
}
$html .= "Time taken = " . (microtime(true) - $cronStartTime) . " seconds.";
$html = $outhead . $html;
if (php_sapi_name() == 'cli') {
$html = str_replace("</div>", "</div>\n", $html);
$html = str_replace("<br>", "\n", $html);
$html = str_replace("<br />", "\n", $html);
$html = strip_tags($html);
示例14: delScout
function delScout($s_id, $pilotid)
{
$qry = new DBQuery(true);
$qry->execute("delete from kb3_scout where inp_kll_id = " . $this->killID_ . " and scout_id = " . $s_id . " limit 1");
//get pilot order to be deleted
$pqry = new DBPreparedQuery();
$pqry->prepare("select ind_order from kb3_inv_detail where ind_kll_id = ? and ind_plt_id = ?");
$pqry->bind_param('ii', $this->killID_, $pilotid);
$pqry->bind_result($scoutOrder);
if (!$pqry->execute() || !$pqry->recordCount()) {
return false;
} else {
$pqry->fetch();
}
//get highest pilot order
$pqry = new DBPreparedQuery();
$pqry->prepare("select max(ind_order) from kb3_inv_detail where ind_kll_id = ?");
$pqry->bind_param('i', $this->killID_);
$pqry->bind_result($maxScoutOrder);
if (!$pqry->execute() || !$pqry->recordCount()) {
return false;
} else {
$pqry->fetch();
}
$qry->execute("delete from kb3_inv_detail where ind_kll_id = " . $this->killID_ . " and ind_plt_id = " . $pilotid . " and ind_shp_id = '9999' limit 1");
//reorder remaining scouts
for ($i = $scoutOrder + 1; $i <= $maxScoutOrder; $i++) {
$qry->execute("update kb3_inv_detail set ind_order = '" . ($i - 1) . "' where ind_kll_id = '" . $this->killID_ . "' and ind_shp_id = '9999' and ind_order = '" . $i . "' limit 1");
}
//remove from pilot's stats
$qry->execute("SELECT 1 FROM kb3_sum_pilot WHERE psm_plt_id = '" . $pilotid . "'");
if ($qry->recordCount() > 0) {
$this->kill = new Kill($this->killID_);
$qry->execute("UPDATE kb3_sum_pilot SET psm_kill_count = psm_kill_count - 1, psm_kill_isk = psm_kill_isk - '" . $this->kill->getISKLoss() . "' WHERE psm_plt_id = '" . $pilotid . "' AND psm_shp_id = '" . $this->kill->getVictimShip()->getClass()->getID() . "'");
$qry->execute("UPDATE kb3_pilots SET plt_kpoints = plt_kpoints - '" . $this->kill->getKillPoints() . "' WHERE plt_id = '" . $pilotid . "'");
}
//make sure involved count is shown correctly (it's generated before this class is loaded)
header("Location: ?a=kill_detail&kll_id=" . $this->killID_);
exit;
}
示例15: displayFitting
function displayFitting()
{
$eftFit = "";
/*$kill = new Kill($this->kill_id);
$ship = $kill->getVictimShip();
$pilotname = $kill->getVictimName();
//$shipclass = $ship->getClass();
$shipname = $ship->getName();
//$system = $kill->getSystem();
$killtitle .= $pilotname."'s ".$shipname;*/
$fitting_array[1] = array();
// high slots
$fitting_array[2] = array();
// med slots
$fitting_array[3] = array();
// low slots
$fitting_array[5] = array();
// rig slots
$fitting_array[6] = array();
// drone bay
$fitting_array[7] = array();
// subsystems
$fitting_array[10] = array();
// ammo
$ammo_array[1] = array();
// high ammo
$ammo_array[2] = array();
// mid ammo
/*select kb3_items_destroyed.*, kb3_invtypes.typeID, kb3_invtypes.typeName, kb3_invtypes.capacity, kb3_invtypes.mass, kb3_invtypes.volume, kb3_invtypes.icon, kb3_item_types.itt_slot from (kb3_items_destroyed left join kb3_invtypes on kb3_items_destroyed.itd_itm_id = kb3_invtypes.typeID) left join kb3_item_types on itt_id = groupID where kb3_items_destroyed.itd_kll_id =*/
$qry = new DBQuery();
$qry->execute("select kb3_items_destroyed.*,\nkb3_invtypes.typeID, kb3_invtypes.groupID, kb3_invtypes.typeName, kb3_invtypes.capacity, kb3_invtypes.mass, kb3_invtypes.volume, kb3_invtypes.icon,\nkb3_item_types.itt_slot\nfrom\n(kb3_items_destroyed left join kb3_invtypes on kb3_items_destroyed.itd_itm_id = kb3_invtypes.typeID)\nleft join kb3_item_types on itt_id = groupID where kb3_items_destroyed.itd_kll_id = '" . $this->kill_id . "'\nunion all\nselect kb3_items_dropped.*,\nkb3_invtypes.typeID, kb3_invtypes.groupID, kb3_invtypes.typeName, kb3_invtypes.capacity, kb3_invtypes.mass, kb3_invtypes.volume, kb3_invtypes.icon,\nkb3_item_types.itt_slot\nfrom\n(kb3_items_dropped left join kb3_invtypes on kb3_items_dropped.itd_itm_id = kb3_invtypes.typeID)\nleft join kb3_item_types on itt_id = groupID where kb3_items_dropped.itd_kll_id = '" . $this->kill_id . "'\nORDER BY groupID");
/*
[0] => Array
(
[Name] => E500 Prototype Energy Vampire
[groupID] => 68
[chargeSize] =>
[itemid] => 16501
)
*/
/*"id" => $row['typeID'],
"capacity" => $row['capacity'],
"mass" => $row['mass'],
"volume" => $row['volume'],
"icon" => $row['icon'],
"id" => $row['itt_slot']*/
while ($row = $qry->getRow()) {
$qryA = new DBQuery();
$qryA->execute("select kb3_dgmtypeattributes.value\nfrom kb3_dgmtypeattributes\ninner join kb3_dgmattributetypes on kb3_dgmtypeattributes.attributeID = kb3_dgmattributetypes.attributeID\nwhere typeID = '" . $row['itd_itm_id'] . "' and attributeName = 'techLevel'");
$tech = $qryA->getRow();
$qryA = new DBQuery();
$qryA->execute("select kb3_dgmtypeattributes.value\nfrom kb3_dgmtypeattributes\ninner join kb3_dgmattributetypes on kb3_dgmtypeattributes.attributeID = kb3_dgmattributetypes.attributeID\nwhere typeID = '" . $row['itd_itm_id'] . "' and attributeName = 'metaLevel'");
$meta = $qryA->getRow();
if ($row['itt_slot'] == 0) {
if ($row['itd_itl_id'] == 6) {
for ($i = 0; $i < $row['itd_quantity']; $i++) {
$fitting_array[6][] = array("name" => $row['typeName'], "groupID" => $row['groupID'], "itemid" => $row['itd_itm_id'], "id" => $row['typeID'], "capacity" => $row['capacity'], "mass" => $row['mass'], "volume" => $row['volume'], "icon" => $row['icon'], "slot" => $row['itt_slot'], "meta" => $meta['value'], "tech" => $tech['value']);
}
} else {
if ($row['groupID'] == 87 || $row['groupID'] == 910 || $row['groupID'] == 909 || $row['groupID'] == 907 || $row['groupID'] == 911) {
if ($row['itd_itl_id'] == 2 || $row['itd_itl_id'] == 0) {
$qry2 = new DBQuery();
$qry2->execute("select kb3_dgmtypeattributes.value\nfrom kb3_dgmtypeattributes\ninner join kb3_dgmattributetypes on kb3_dgmtypeattributes.attributeID = kb3_dgmattributetypes.attributeID\nwhere typeID = '" . $row['itd_itm_id'] . "' and kb3_dgmattributetypes.attributeName = 'launcherGroup'");
$usedgroupID = $qry2->getRow();
$ammo_array[2][] = array("name" => $row['typeName'], "groupID" => $row['groupID'], "usedgroupID" => $usedgroupID['value'], "itemid" => $row['itd_itm_id'], "id" => $row['typeID'], "capacity" => $row['capacity'], "mass" => $row['mass'], "volume" => $row['volume'], "icon" => $row['icon'], "slot" => $row['itt_slot'], "meta" => $meta['value'], "tech" => $tech['value']);
}
} else {
if ($row['itd_itl_id'] != 4) {
$qry2 = new DBQuery();
$qry2->execute("select kb3_dgmtypeattributes.value\nfrom kb3_dgmtypeattributes\ninner join kb3_dgmattributetypes on kb3_dgmtypeattributes.attributeID = kb3_dgmattributetypes.attributeID\nwhere typeID = '" . $row['itd_itm_id'] . "' and kb3_dgmattributetypes.attributeName = 'launcherGroup'");
$usedgroupID = $qry2->getRow();
$ammo_array[1][] = array("name" => $row['typeName'], "groupID" => $row['groupID'], "usedgroupID" => $usedgroupID['value'], "itemid" => $row['itd_itm_id'], "id" => $row['typeID'], "capacity" => $row['capacity'], "mass" => $row['mass'], "volume" => $row['volume'], "icon" => $row['icon'], "slot" => $row['itt_slot'], "meta" => $meta['value'], "tech" => $tech['value']);
}
}
}
} else {
if ($row['itd_itl_id'] != 4) {
for ($i = 0; $i < $row['itd_quantity']; $i++) {
if ($row['groupID'] == 87 || $row['groupID'] == 910 || $row['groupID'] == 909 || $row['groupID'] == 907 || $row['groupID'] == 911) {
if ($row['itd_itl_id'] == 2) {
$qry2 = new DBQuery();
$qry2->execute("select kb3_dgmtypeattributes.value\nfrom kb3_dgmtypeattributes\ninner join kb3_dgmattributetypes on kb3_dgmtypeattributes.attributeID = kb3_dgmattributetypes.attributeID\nwhere typeID = '" . $row['itd_itm_id'] . "' and kb3_dgmattributetypes.attributeName = 'launcherGroup'");
$usedgroupID = $qry2->getRow();
$ammo_array[2][] = array("name" => $row['typeName'], "groupID" => $row['groupID'], "usedgroupID" => $usedgroupID['value'], "itemid" => $row['itd_itm_id'], "id" => $row['typeID'], "capacity" => $row['capacity'], "mass" => $row['mass'], "volume" => $row['volume'], "icon" => $row['icon'], "slot" => $row['itt_slot'], "meta" => $meta['value'], "tech" => $tech['value']);
}
} else {
if ($row['groupID'] == 908) {
$fitting_array[10][] = array("name" => $row['typeName'], "groupID" => $row['groupID'], "usedgroupID" => $usedgroupID['value'], "itemid" => $row['itd_itm_id'], "id" => $row['typeID'], "capacity" => $row['capacity'], "mass" => $row['mass'], "volume" => $row['volume'], "icon" => $row['icon'], "slot" => $row['itt_slot'], "meta" => $meta['value'], "tech" => $tech['value']);
} else {
$fitting_array[$row[itt_slot]][] = array("name" => $row['typeName'], "groupID" => $row['groupID'], "chargeSize" => "", "itemid" => $row['itd_itm_id'], "id" => $row['typeID'], "capacity" => $row['capacity'], "mass" => $row['mass'], "volume" => $row['volume'], "icon" => $row['icon'], "slot" => $row['itt_slot'], "meta" => $meta['value'], "tech" => $tech['value']);
}
}
}
}
}
}
$length = count($ammo_array[1]);
$temp = array();
if (is_array($fitting_array[1])) {
$hiammo = array();
//.........这里部分代码省略.........