예제 #1
0
    $staticType = strtoupper(trim(mysql_real_escape_string($_REQUEST["s"])));
    $staticInfoSQL = sprintf("SELECT it.typeName, COALESCE(whClass.valueFloat,whClass.valueInt) AS wormholeType, COALESCE(whStableTime.valueFloat,whStableTime.valueInt) AS maxStableTime, COALESCE(whStableMass.valueFloat,whStableMass.valueInt) AS maxStableMass, COALESCE(whMassRegen.valueFloat,whMassRegen.valueInt) AS massRegeneration, COALESCE(whJumpMass.valueFloat,whJumpMass.valueInt) AS maxJumpMass, sm.sigSize AS signatureSize " . "FROM " . EVEDB_NAME . ".invTypes it " . "LEFT JOIN " . EVEDB_NAME . ".dgmTypeAttributes whClass USING(typeID) " . "LEFT JOIN " . EVEDB_NAME . ".dgmTypeAttributes whStableTime USING(typeID) " . "LEFT JOIN " . EVEDB_NAME . ".dgmTypeAttributes whStableMass USING(typeID) " . "LEFT JOIN " . EVEDB_NAME . ".dgmTypeAttributes whMassRegen USING(typeID) " . "LEFT JOIN " . EVEDB_NAME . ".dgmTypeAttributes whJumpMass USING(typeID) " . "LEFT JOIN " . WHDB_NAME . ".sigDataMap sm USING(typeID) " . "WHERE UPPER(it.typeName) LIKE '%%%s' " . "AND whClass.attributeID = 1381 " . "AND whStableTime.attributeID = 1382 " . "AND whStableMass.attributeID = 1383 " . "AND whMassRegen.attributeID = 1384 " . "AND whJumpMass.attributeID = 1385 " . "ORDER BY FIND_IN_SET(wormholeType,'7,8,9,1,2,3,4,5,6')", $staticType);
    //printf("<p>%s</p>", $staticInfoSQL);
    $rsStaticInfo = mysql_query_cache($staticInfoSQL, $whConn);
    if (!empty($rsStaticInfo)) {
        printf('<table class="iTbl">' . '<tr><td class="hdr">Lifetime:</td><td class="data">%s hours</td></tr>' . '<tr><td class="hdr">Max. stable mass:</td><td class="data">%s kg (%s b)</td></tr>' . '<tr><td class="hdr">Mass variance (&plusmn;10%%):</td><td class="data">%s kg</td></tr>' . '<tr><td class="hdr">Max. jump mass:</td><td class="data">%s kg</td></tr>' . '<tr><td class="hdr">Signature size:</td><td class="data">%s</td></tr>' . '</table>', number_format($rsStaticInfo[0]["maxStableTime"] / 60, 0), number_format($rsStaticInfo[0]["maxStableMass"], 0, '.', ','), number_format($rsStaticInfo[0]["maxStableMass"] / 1000 / 1000 / 1000, 1, '.', ','), number_format($rsStaticInfo[0]["maxStableMass"] * 0.1, 0, '.', ','), number_format($rsStaticInfo[0]["maxJumpMass"], 0, '.', ','), is_null($rsStaticInfo[0]["signatureSize"]) ? "?" : $rsStaticInfo[0]["signatureSize"]);
    } else {
        printf("Could not find information for wormhole type <strong>%s</strong>", $staticType);
    }
    // ========================================================================
} elseif ($action == "intel_whinfo") {
    // ========================================================================
    $n_LocusID = str_replace("_", " ", strtoupper(trim(mysql_real_escape_string($_REQUEST["lid"]))));
    $aTempWH = new Wormhole($n_LocusID);
    if ($aTempWH->isValidLocus()) {
        printf('<table class="iTbl">' . '<tr><td class="hdr">Region:</td><td class="data">%s</td></tr>' . '<tr><td class="hdr">Constellation:</td><td class="data">%s</td></tr>' . '</table>', $aTempWH->getRegion(), $aTempWH->getConstellation());
        printf('<table class="sTbl" style="margin-top: 10px;">');
        printf('<tr class="hdr"><td>Planet</td><td>Type</td><td>Moons</td></tr>');
        foreach ($aTempWH->cCelestial as $aCelestial) {
            if ($aCelestial->isPlanet()) {
                printf('<tr><td class="hdr">%s</td><td class="data pt_%d">%s</td>', $aCelestial->Name(), $aCelestial->typeID(), $aCelestial->planetType(), $aCelestial->typeID());
                $aMoons = $aTempWH->getCelestialChildren($aCelestial->itemID());
                $moonCount = 0;
                foreach ($aMoons as $cCelestial) {
                    $moonCount += $cCelestial->isMoon() ? 1 : 0;
                }
                printf('<td class="data_r">%d</td>', $moonCount);
                printf('</tr>');
            }
        }
        printf('<tr class="ftr"><td class="data_r">%d</td><td></td><td class="data_r">%d</td></tr>', $aTempWH->getPlanetCount(), $aTempWH->getMoonCount());