当前位置: 首页>>代码示例>>PHP>>正文


PHP DBQuery::getRow方法代码示例

本文整理汇总了PHP中DBQuery::getRow方法的典型用法代码示例。如果您正苦于以下问题:PHP DBQuery::getRow方法的具体用法?PHP DBQuery::getRow怎么用?PHP DBQuery::getRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBQuery的用法示例。


在下文中一共展示了DBQuery::getRow方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 function init($kll_id)
 {
     $this->killID_ = $kll_id;
     $this->raw_ = false;
     $this->scouts_ = array();
     $qry = new DBQuery(true);
     $qry->execute("SELECT * FROM kb3_scout WHERE `inp_kll_id` = '" . $kll_id . "'");
     while ($row = $qry->getRow()) {
         $this->scouts_[] = $this->getPilotData($row['inp_plt_id'], $row['scout_id']);
     }
 }
开发者ID:jjlupa,项目名称:edk-mods,代码行数:11,代码来源:class.scout.php

示例2: lower

         break;
     case 2:
         $sql = "select reg_id as id, reg_name as name\n                      from kb3_regions\n                     where lower( reg_name ) like '%" . $qry->escape(strtolower($_POST['add_name']), true) . "%'";
         break;
     case 3:
         $sql = "select sys_id as id, sys_name as name\n                      from kb3_systems\n                     where lower( sys_name ) like '%" . $qry->escape(strtolower($_POST['add_name']), true) . "%'";
         break;
 }
 $qry->execute($sql) or die($qry->getErrorMsg());
 if ($qry->recordCount()) {
     $html .= "<table class='kb-table' width='450'>";
     $html .= "<tr class='kb-table-header'><td width='340'>Name</td><td width='80' align='center'>Action</td></tr>";
 } else {
     $html .= "No matches found for '" . htmlentities($_POST['add_name']) . "'.";
 }
 while ($row = $qry->getRow()) {
     $html .= "<tr class='kb-table-row-even'>";
     $editURL = edkuri::build(array(array('ctr_id', $ctrID, false), array('op', 'edit', false), array('add_type', (int) $_POST['add_type'], false), array('add_id', $row['id'], false)));
     switch ($_POST['add_type']) {
         case 0:
             $html .= '<td><a href="' . edkURI::page('corp_detail', $row['id'], 'crp_id') . '">' . $row['name'] . "</a></td><td align='center'><button id='submit' name='submit' onclick=\"window.location.href='" . $editURL . "'\">Select</button></td>";
             break;
         case 1:
             $html .= '<td><a href="' . edkURI::page('alliance_detail', $row['id'], 'all_id') . '">' . $row['name'] . "</a></td><td align='center'><button id='submit' name='submit' onclick=\"window.location.href='" . $editURL . "'\">Select</button></td>";
             break;
         case 2:
             $html .= '<td><a href="' . edkURI::page('detail_view', $row['id'], 'region_id') . '">' . $row['name'] . "</td><td align=center><button id=submit name=submit onClick=\"window.location.href='" . $editURL . "'\">Select</button></td>";
             break;
         case 3:
             $html .= '<td><a href="' . edkURI::page('system_detail', $row['id'], 'sys_id') . '">' . $row['name'] . "</td><td align=center><button id=submit name=submit onClick=\"window.location.href='" . $editURL . "'\">Select</button></td>";
             break;
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:admin_cc.php

示例3: mkdir

}
$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);
    $html = str_replace("<br>", "\n", $html);
开发者ID:Salvoxia,项目名称:fleet_battles_mod,代码行数:31,代码来源:cron_fleet_battles_update.php

示例4: 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"];
    }
开发者ID:Salvoxia,项目名称:fleet_battles_mod,代码行数:12,代码来源:class.battles.php

示例5: 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;
 }
开发者ID:Salvoxia,项目名称:advanced_search,代码行数:101,代码来源:class.search.php

示例6: 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&region_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&region_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;
 }
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:55,代码来源:home.php

示例7: 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();
//.........这里部分代码省略.........
开发者ID:snitchashor,项目名称:ship_display_tool,代码行数:101,代码来源:fitting.class.php

示例8: 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));
//.........这里部分代码省略.........
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:101,代码来源:map.php

示例9: 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&amp;id=" . $row['xid'] . "&amp;size=32";
        $killers[$pilot]['corp'] = $row['corp'];
        $killers[$pilot]['id'] = $row['id'];
        if ($row['SClass'] == 1) {
            //battleship
            $bs++;
        }
    }
    return $bs;
}
开发者ID:Salvoxia,项目名称:fleet_battles_mod,代码行数:26,代码来源:class.killlisttable.php

示例10: 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;
 }
开发者ID:Salvoxia,项目名称:advanced_search,代码行数:16,代码来源:class.advkilllist.php

示例11: 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 = "+";
                         }
//.........这里部分代码省略.........
开发者ID:snitchashor,项目名称:ship_display_tool,代码行数:101,代码来源:init.php

示例12: count

 if ($region_set == 0) {
     $sql2 = "select reg.reg_id, count(distinct kll.kll_id) as kills \n\t\t\t\tfrom kb3_systems sys, kb3_kills kll, kb3_inv_detail inv, kb3_constellations con, kb3_regions reg\n\t\t\t\twhere kll.kll_system_id = sys.sys_id \n\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) . ")";
     $sql2 .= "    and date_format( kll.kll_timestamp, \"%m\" ) = " . $i . "\n\t\t\t\tand date_format( kll.kll_timestamp, \"%Y\" ) = " . $year . "\n\t\t\t\tand con.con_id = sys.sys_con_id\n                and reg.reg_id = con.con_reg_id\n\t\t\t\tgroup by reg.reg_id\n\t\t\t\t\n\t\t\t\torder by kills desc\n\t\t\t\tLIMIT 0,1;";
     $qry2 = new DBQuery();
     $qry2->execute($sql2) or die($qry2->getErrorMsg());
     while ($row2 = $qry2->getRow()) {
         $region = $row2['reg_id'];
     }
 } else {
     $region = $region_set;
     $region_nav = '&region_id=' . $region_set;
 }
 if ($i % 2) {
     $html .= '<tr >';
 }
 if ($region != 0) {
     $html .= ' 	<td align="center"><img src="?a=map&mode=activity&size=350&region_id=' . $region . '&month=' . $i . '&year=' . $year . '" /></td>';
 } else {
     $html .= ' 	<td align="center"><img src="?a=map&mode=na&size=250" width="350" height="350"></td>';
 }
 if ($i % 2) {
开发者ID:biow0lf,项目名称:evedev-kb,代码行数:31,代码来源:map_year.php


注:本文中的DBQuery::getRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。