Esempio n. 1
0
 /**
  * Gets a pilots details.
  *
  * @param int $id
  *
  * @return array
  */
 public static function getPilotDetails($id, $parameters = array())
 {
     global $mdb;
     $data = $mdb->findDoc('information', ['cacheTime' => 1500, 'type' => 'characterID', 'id' => (int) $id]);
     if ($data != null) {
         $data['characterID'] = (int) $id;
     }
     if ($data != null) {
         $data['characteName'] = $data['name'];
     }
     if ($data == null) {
         $data = [];
     }
     self::addInfo($data);
     $data['isCEO'] = $mdb->exists('information', ['type' => 'corporationID', 'id' => (int) @$data['corporationID'], 'ceoID' => (int) $id]);
     $data['isExecutorCEO'] = $mdb->exists('information', ['type' => 'allianceID', 'id' => (int) @$data['allianceID'], 'executorCorpID' => (int) (int) @$data['corporationID']]);
     $retValue = $parameters == null ? $data : Summary::getPilotSummary($data, $id, $parameters);
     return $retValue;
 }
Esempio n. 2
0
 /**
  * Gets a pilots details
  * @param  int $id
  * @return array
  */
 public static function getPilotDetails($id, $parameters = array())
 {
     $data = Db::queryRow("select characterID, corporationID, allianceID, factionID from zz_participants where characterID = :id and dttm >= date_sub(now(), interval 7 day) order by killID desc limit 1", array(":id" => $id), 3600);
     if (sizeof($data) == 0) {
         $data = Db::queryRow("select characterID, corporationID, allianceID, 0 factionID from zz_characters where characterID = :id", array(":id" => $id));
     }
     if (sizeof($data) == 0) {
         $data["characterID"] = $id;
     }
     self::addInfo($data);
     return Summary::getPilotSummary($data, $id, $parameters);
 }