Changeset 16
- Timestamp:
- 10/18/06 23:45:48 (16 years ago)
- Location:
- dev
- Files:
-
- 3 added
- 8 modified
Legend:
- Unmodified
- Added
- Removed
-
dev/common/admin.php
r10 r16 15 15 $config->setStyleBanner($_POST['style_banner']); 16 16 $config->setStyleName($_POST['style_name']); 17 if ($_POST['kill_points'] == "on") $killpoints = 1; 18 else $killpoints = 0; 19 if ($_POST['least_active'] == "on") $leastactive = 1; 20 else $leastactive = 0; 17 if ($_POST['kill_points'] == "on") 18 { 19 $killpoints = 1; 20 } 21 else 22 { 23 $killpoints = 0; 24 } 25 if ($_POST['least_active'] == "on") 26 { 27 $leastactive = 1; 28 } 29 else 30 { 31 $leastactive = 0; 32 } 21 33 $config->setKillPoints($killpoints); 22 34 $config->setLeastActive($leastactive); 35 if ($_POST['comments'] == "on") 36 { 37 require_once('autoupgrade.php'); 38 check_commenttable(); 39 $config->setConfig('comments', '1'); 40 } 41 else 42 { 43 $config->setConfig('comments', '0'); 44 } 45 if ($_POST['comments_pw'] == "on") 46 { 47 $config->setConfig('comments_pw', '1'); 48 } 49 else 50 { 51 $config->setConfig('comments_pw', '0'); 52 } 23 53 $config->setPostPassword($_POST['post_password']); 24 54 $config->setPostMailto($_POST['post_mailto']); … … 64 94 if (is_dir($dir . $file)) 65 95 { 66 if ($file == "." || $file == ".." )96 if ($file == "." || $file == ".." || $file == ".svn") 67 97 continue; 68 98 $html .= "<option value=\"" . $file . "\""; … … 81 111 $html .= "<table class=kb-subtable>"; 82 112 $html .= "<tr><td width=120><b>Display killpoints:</b></td><td><input type=checkbox name=kill_points id=kill_points"; 83 if ($config->getKillPoints()) 113 if ($config->getConfig('kill_points')) 114 $html .= " checked=\"checked\""; 115 $html .= "></td></tr>"; 116 $html .= "<tr><td width=120><b>Enable Comments:</b></td><td><input type=checkbox name=comments id=comments"; 117 if ($config->getConfig('comments')) 118 $html .= " checked=\"checked\""; 119 $html .= "></td></tr>"; 120 $html .= "<tr><td width=120><b>Require password for Comments:</b></td><td><input type=checkbox name=comments_pw id=comments_pw"; 121 if ($config->getConfig('comments_pw')) 84 122 $html .= " checked=\"checked\""; 85 123 $html .= "></td></tr>"; -
dev/common/class.kill.php
r2 r16 1 <? 2 require_once( "db.php");3 require_once( "class.item.php");4 require_once( "class.corp.php");5 require_once( "class.alliance.php");6 require_once( "class.ship.php");7 require_once( "class.system.php");8 require_once( "class.pilot.php");9 require_once( "class.killlist.php" ); 10 11 class Kill { 12 13 function Kill( $id = 0)14 { 15 $this->id_ = $id;16 $this->involvedparties_ = array();17 $this->destroyeditems_ = array();1 <?php 2 require_once("db.php"); 3 require_once("class.item.php"); 4 require_once("class.corp.php"); 5 require_once("class.alliance.php"); 6 require_once("class.ship.php"); 7 require_once("class.system.php"); 8 require_once("class.pilot.php"); 9 require_once("class.killlist.php"); 10 11 class Kill 12 { 13 function Kill($id = 0) 14 { 15 $this->id_ = $id; 16 $this->involvedparties_ = array(); 17 $this->destroyeditems_ = array(); 18 18 } 19 19 20 20 function getID() 21 21 { 22 return $this->id_;22 return $this->id_; 23 23 } 24 24 25 25 function getTimeStamp() 26 26 { 27 $this->execQuery();28 return $this->timestamp_;27 $this->execQuery(); 28 return $this->timestamp_; 29 29 } 30 30 31 31 function getVictimName() 32 32 { 33 $this->execQuery();34 return $this->victimname_;33 $this->execQuery(); 34 return $this->victimname_; 35 35 } 36 36 37 37 function getVictimID() 38 38 { 39 $this->execQuery();40 return $this->victimid_;41 } 42 43 function getVictimPortrait( $size = 32)44 { 45 $this->execQuery();46 $plt = new Pilot( $this->victimid_);47 return $plt->getPortraitURL( $size);39 $this->execQuery(); 40 return $this->victimid_; 41 } 42 43 function getVictimPortrait($size = 32) 44 { 45 $this->execQuery(); 46 $plt = new Pilot($this->victimid_); 47 return $plt->getPortraitURL($size); 48 48 } 49 49 50 50 function getVictimCorpID() 51 51 { 52 $this->execQuery();53 return $this->victimcorpid_;52 $this->execQuery(); 53 return $this->victimcorpid_; 54 54 } 55 55 56 56 function getVictimCorpName() 57 57 { 58 $this->execQuery();59 return $this->victimcorpname_;58 $this->execQuery(); 59 return $this->victimcorpname_; 60 60 } 61 61 62 62 function getVictimAllianceName() 63 63 { 64 $this->execQuery();65 return $this->victimalliancename_;64 $this->execQuery(); 65 return $this->victimalliancename_; 66 66 } 67 67 68 68 function getVictimShip() 69 69 { 70 $this->execQuery();71 return $this->victimship_;70 $this->execQuery(); 71 return $this->victimship_; 72 72 } 73 73 74 74 function getSystem() 75 75 { 76 $this->execQuery();77 return $this->solarsystem_;76 $this->execQuery(); 77 return $this->solarsystem_; 78 78 } 79 79 80 80 function getFBPilotID() 81 81 { 82 $this->execQuery();83 if ( !$this->fbpilotid_) return "null";84 else return $this->fbpilotid_;85 } 86 82 $this->execQuery(); 83 if (!$this->fbpilotid_) return "null"; 84 else return $this->fbpilotid_; 85 } 86 87 87 function getFBPilotName() 88 88 { 89 $this->execQuery();90 return $this->fbpilotname_;89 $this->execQuery(); 90 return $this->fbpilotname_; 91 91 } 92 92 93 93 function getFBCorpID() 94 94 { 95 $this->execQuery();96 if ( !$this->fbcorpid_) return "null";97 else return $this->fbcorpid_;95 $this->execQuery(); 96 if (!$this->fbcorpid_) return "null"; 97 else return $this->fbcorpid_; 98 98 } 99 99 100 100 function getFBCorpName() 101 101 { 102 $this->execQuery();103 return $this->fbcorpname_;102 $this->execQuery(); 103 return $this->fbcorpname_; 104 104 } 105 105 106 106 function getFBAllianceID() 107 107 { 108 $this->execQuery();109 if ( !$this->fballianceid_) return "null";110 else return $this->fballianceid_;108 $this->execQuery(); 109 if (!$this->fballianceid_) return "null"; 110 else return $this->fballianceid_; 111 111 } 112 112 113 113 function getFBAllianceName() 114 114 { 115 $this->execQuery();116 return $this->fballiancename_;117 } 118 115 $this->execQuery(); 116 return $this->fballiancename_; 117 } 118 119 119 function getKillPoints() 120 120 { 121 $this->execQuery();122 return $this->killpoints_;121 $this->execQuery(); 122 return $this->killpoints_; 123 123 } 124 124 125 125 function getSolarSystemName() 126 126 { 127 return $this->solarsystemname_;127 return $this->solarsystemname_; 128 128 } 129 129 130 130 function getSolarSystemSecurity() 131 131 { 132 return $this->solarsystemsecurity_;132 return $this->solarsystemsecurity_; 133 133 } 134 134 135 135 function getVictimShipName() 136 136 { 137 return $this->victimshipname_;137 return $this->victimshipname_; 138 138 } 139 139 140 140 function getVictimShipExternalID() 141 141 { 142 return $this->victimshipexternalid_;142 return $this->victimshipexternalid_; 143 143 } 144 144 145 145 function getVictimShipClassName() 146 146 { 147 return $this->victimshipclassname_;147 return $this->victimshipclassname_; 148 148 } 149 149 150 150 function getVictimShipValue() 151 151 { 152 return $this->victimshipvalue_;153 } 154 155 function getVictimShipImage( $size)156 { 157 return IMG_URL."/ships/".$size."_".$size."/"158 .$this->victimshipexternalid_.".png";152 return $this->victimshipvalue_; 153 } 154 155 function getVictimShipImage($size) 156 { 157 return IMG_URL . "/ships/" . $size . "_" . $size . "/" 158 . $this->victimshipexternalid_ . ".png"; 159 159 } 160 160 161 161 function getVictimShipValueIndicator() 162 162 { 163 $value = $this->getVictimShipValue();164 165 if ( $value >= 0 && $value <= 1)166 $color = "gray";167 elseif ( $value > 1 && $value <= 15)168 $color = "blue";169 elseif ( $value > 15 && $value <= 25)170 $color = "green";171 elseif ( $value > 25 && $value <= 40)172 $color = "yellow";173 elseif ( $value > 40 && $value <= 80)174 $color = "red";175 elseif ( $value > 80 && $value <= 250)176 $color = "orange";177 elseif ( $value > 250 && $value <= 5000)178 $color = "purple";179 180 return IMG_URL."/ships/ship-".$color.".gif";163 $value = $this->getVictimShipValue(); 164 165 if ($value >= 0 && $value <= 1) 166 $color = "gray"; 167 elseif ($value > 1 && $value <= 15) 168 $color = "blue"; 169 elseif ($value > 15 && $value <= 25) 170 $color = "green"; 171 elseif ($value > 25 && $value <= 40) 172 $color = "yellow"; 173 elseif ($value > 40 && $value <= 80) 174 $color = "red"; 175 elseif ($value > 80 && $value <= 250) 176 $color = "orange"; 177 elseif ($value > 250 && $value <= 5000) 178 $color = "purple"; 179 180 return IMG_URL . "/ships/ship-" . $color . ".gif"; 181 181 } 182 182 183 183 function getRawMail() 184 184 { 185 $this->execQuery(); 186 187 $mail .= substr( str_replace( '-', '.' , $this->getTimeStamp() ), 0, 16 )."\r\n\r\n"; 188 $mail .= "Victim: ".$this->getVictimName()."\r\n"; 189 $mail .= "Alliance: ".$this->getVictimAllianceName()."\r\n"; 190 $mail .= "Corp: ".$this->getVictimCorpName()."\r\n"; 191 $ship = $this->getVictimShip(); 192 $mail .= "Destroyed: ".$ship->getName()."\r\n"; 193 $system = $this->getSystem(); 194 $mail .= "System: ".$system->getName()."\r\n"; 195 $mail .= "Security: ".$system->getSecurity( true )."\r\n\r\n"; 196 $mail .= "Involved parties:\r\n\r\n"; 197 198 foreach ( $this->involvedparties_ as $inv ) { 199 $pilot = new Pilot( $inv->getPilotID() ); 200 $corp = new Corporation( $inv->getCorpID() ); 201 $alliance = new Alliance( $inv->getAllianceID() ); 202 203 $weapon = $inv->getWeapon(); 204 $ship = $inv->getShip(); 205 if ( $pilot->getName() == $weapon->getName() ) 206 $name = $pilot->getName()." / ".$corp->getName(); 207 else 208 $name = $pilot->getName(); 209 210 $mail .= "Name: ".$name; 211 if ( $pilot->getID() == $this->getFBPilotID() ) 212 $mail .= " (laid the final blow)"; 213 $mail .= "\r\n"; 214 215 if ( $pilot->getName() != $weapon->getName() ) { 216 $mail .= "Security: ".$inv->getSecStatus()."\r\n"; 217 $mail .= "Alliance: ".$alliance->getName()."\r\n"; 218 $mail .= "Corp: ".$corp->getName()."\r\n"; 219 $mail .= "Ship: ".$ship->getName()."\r\n"; 220 $mail .= "Weapon: ".$weapon->getName()."\r\n"; 221 } 222 $mail .= "\r\n"; 223 } 224 225 if ( count( $this->destroyeditems_ ) > 0 ) { 226 $mail .= "\r\nDestroyed items:\r\n\r\n"; 227 228 foreach( $this->destroyeditems_ as $destroyed ) { 229 $item = $destroyed->getItem(); 230 $mail .= $item->getName(); 231 if ( $destroyed->getQuantity() > 1 ) 232 $mail .= ", Qty: ".$destroyed->getQuantity(); 233 if ( $destroyed->getLocationID() == 4 ) // cargo 234 $mail .= " (Cargo)"; 235 if ( $destroyed->getLocationID() == 6 ) // drone 236 $mail .= " (Drone Bay)"; 237 $mail .= "\r\n"; 185 $this->execQuery(); 186 187 $mail .= substr(str_replace('-', '.' , $this->getTimeStamp()), 0, 16) . "\r\n\r\n"; 188 $mail .= "Victim: " . $this->getVictimName() . "\r\n"; 189 $mail .= "Alliance: " . $this->getVictimAllianceName() . "\r\n"; 190 $mail .= "Corp: " . $this->getVictimCorpName() . "\r\n"; 191 $ship = $this->getVictimShip(); 192 $mail .= "Destroyed: " . $ship->getName() . "\r\n"; 193 $system = $this->getSystem(); 194 $mail .= "System: " . $system->getName() . "\r\n"; 195 $mail .= "Security: " . $system->getSecurity(true) . "\r\n\r\n"; 196 $mail .= "Involved parties:\r\n\r\n"; 197 198 foreach ($this->involvedparties_ as $inv) 199 { 200 $pilot = new Pilot($inv->getPilotID()); 201 $corp = new Corporation($inv->getCorpID()); 202 $alliance = new Alliance($inv->getAllianceID()); 203 204 $weapon = $inv->getWeapon(); 205 $ship = $inv->getShip(); 206 if ($pilot->getName() == $weapon->getName()) 207 $name = $pilot->getName() . " / " . $corp->getName(); 208 else 209 $name = $pilot->getName(); 210 211 $mail .= "Name: " . $name; 212 if ($pilot->getID() == $this->getFBPilotID()) 213 $mail .= " (laid the final blow)"; 214 $mail .= "\r\n"; 215 216 if ($pilot->getName() != $weapon->getName()) 217 { 218 $mail .= "Security: " . $inv->getSecStatus() . "\r\n"; 219 $mail .= "Alliance: " . $alliance->getName() . "\r\n"; 220 $mail .= "Corp: " . $corp->getName() . "\r\n"; 221 $mail .= "Ship: " . $ship->getName() . "\r\n"; 222 $mail .= "Weapon: " . $weapon->getName() . "\r\n"; 223 } 224 $mail .= "\r\n"; 238 225 } 239 } 240 241 return $mail; 226 227 if (count($this->destroyeditems_) > 0) 228 { 229 $mail .= "\r\nDestroyed items:\r\n\r\n"; 230 231 foreach($this->destroyeditems_ as $destroyed) 232 { 233 $item = $destroyed->getItem(); 234 $mail .= $item->getName(); 235 if ($destroyed->getQuantity() > 1) 236 $mail .= ", Qty: " . $destroyed->getQuantity(); 237 if ($destroyed->getLocationID() == 4) // cargo 238 $mail .= " (Cargo)"; 239 if ($destroyed->getLocationID() == 6) // drone 240 $mail .= " (Drone Bay)"; 241 $mail .= "\r\n"; 242 } 243 } 244 245 return $mail; 242 246 } 243 247 244 248 function getDupe() 245 249 { 246 $this->execQuery();247 $dupe = 0;248 $qry = new DBQuery();249 if ( !$this->getFBPilotID() || !$this->victimid_)250 return 0;251 $qry->execute("select kll_id250 $this->execQuery(); 251 $dupe = 0; 252 $qry = new DBQuery(); 253 if (!$this->getFBPilotID() || !$this->victimid_) 254 return 0; 255 $qry->execute("select kll_id 252 256 from kb3_kills 253 where kll_timestamp <= 254 date_add( '" .$this->timestamp_."', INTERVAL '15:0' MINUTE_SECOND )255 and kll_timestamp >= 256 date_sub( '" .$this->timestamp_."', INTERVAL '15:0' MINUTE_SECOND )257 and kll_victim_id = " .$this->victimid_."258 and kll_ship_id = " .$this->victimship_->getID()."259 and kll_system_id = " .$this->solarsystem_->getID()."260 and kll_fb_plt_id = " .$this->getFBPilotID()."261 and kll_id != " .$this->id_);262 263 $row = $qry->getRow();264 if ( $row)265 return $row['kll_id'];266 else267 return 0;257 where kll_timestamp <= 258 date_add( '" . $this->timestamp_ . "', INTERVAL '15:0' MINUTE_SECOND ) 259 and kll_timestamp >= 260 date_sub( '" . $this->timestamp_ . "', INTERVAL '15:0' MINUTE_SECOND ) 261 and kll_victim_id = " . $this->victimid_ . " 262 and kll_ship_id = " . $this->victimship_->getID() . " 263 and kll_system_id = " . $this->solarsystem_->getID() . " 264 and kll_fb_plt_id = " . $this->getFBPilotID() . " 265 and kll_id != " . $this->id_); 266 267 $row = $qry->getRow(); 268 if ($row) 269 return $row['kll_id']; 270 else 271 return 0; 268 272 } 269 273 270 274 function execQuery() 271 275 { 272 if ( !$this->timestamp_ ) { 273 $qry = new DBQuery(); 274 275 $this->qry_ = new DBQuery(); 276 $this->sql_ = "select kll.kll_id, kll.kll_timestamp, plt.plt_name, 276 if (!$this->timestamp_) 277 { 278 $qry = new DBQuery(); 279 280 $this->qry_ = new DBQuery(); 281 $this->sql_ = "select kll.kll_id, kll.kll_timestamp, plt.plt_name, 277 282 crp.crp_name, ali.all_name, kll.kll_ship_id, 278 283 kll.kll_system_id, kll.kll_ship_id, … … 288 293 kb3_alliances ali, kb3_alliances fbali, kb3_corps fbcrp, 289 294 kb3_pilots fbplt 290 where kll.kll_id = " .$this->id_."295 where kll.kll_id = " . $this->id_ . " 291 296 and plt.plt_id = kll.kll_victim_id 292 297 and crp.crp_id = kll.kll_crp_id … … 295 300 and fbcrp.crp_id = kll.kll_fb_crp_id 296 301 and fbplt.plt_id = kll.kll_fb_plt_id"; 297 298 299 $this->qry_->execute( $this->sql_ ); 300 $row = $this->qry_->getRow(); 301 $this->setTimeStamp( $row['kll_timestamp'] ); 302 $this->setSolarSystem( new SolarSystem( $row['kll_system_id'] ) ); 303 $this->setVictimID( $row['kll_victim_id'] ); 304 $this->setVictimName( $row['plt_name'] ); 305 $this->setVictimCorpID( $row['kll_crp_id'] ); 306 $this->setVictimCorpName( $row['crp_name'] ); 307 $this->setVictimAllianceName( $row['all_name'] ); 308 $this->setVictimShip( new Ship( $row['kll_ship_id'] ) ); 309 $this->setFBPilotID( $row['fbplt_id'] ); 310 $this->setFBPilotName( $row['fbplt_name'] ); 311 $this->setFBCorpID( $row['fbcrp_id'] ); 312 $this->setFBCorpName( $row['fbcrp_name'] ); 313 $this->setFBAllianceID( $row['fbali_id'] ); 314 $this->setFBAllianceName( $row['fbali_name'] ); 315 $this->setKillPoints( $row['kll_points'] ); 316 317 if ( !$row ) 318 $this->valid_ = false; 319 else 320 $this->valid_ = true; 321 322 // involved 323 $sql = "select ind_plt_id, ind_crp_id, ind_all_id, ind_sec_status, 302 303 $this->qry_->execute($this->sql_); 304 $row = $this->qry_->getRow(); 305 $this->setTimeStamp($row['kll_timestamp']); 306 $this->setSolarSystem(new SolarSystem($row['kll_system_id'])); 307 $this->setVictimID($row['kll_victim_id']); 308 $this->setVictimName($row['plt_name']); 309 $this->setVictimCorpID($row['kll_crp_id']); 310 $this->setVictimCorpName($row['crp_name']); 311 $this->setVictimAllianceName($row['all_name']); 312 $this->setVictimShip(new Ship($row['kll_ship_id'])); 313 $this->setFBPilotID($row['fbplt_id']); 314 $this->setFBPilotName($row['fbplt_name']); 315 $this->setFBCorpID($row['fbcrp_id']); 316 $this->setFBCorpName($row['fbcrp_name']); 317 $this->setFBAllianceID($row['fbali_id']); 318 $this->setFBAllianceName($row['fbali_name']); 319 $this->setKillPoints($row['kll_points']); 320 321 if (!$row) 322 $this->valid_ = false; 323 else 324 $this->valid_ = true; 325 // involved 326 $sql = "select ind_plt_id, ind_crp_id, ind_all_id, ind_sec_status, 324 327 ind_shp_id, ind_wep_id 325 328 from kb3_inv_detail 326 where ind_kll_id = " .$this->getID()."329 where ind_kll_id = " . $this->getID() . " 327 330 order by ind_order"; 328 329 $qry->execute( $sql ) or die( $qry->getErrorMsg());330 while ( $row = $qry->getRow() ) { 331 $involved = new InvolvedParty( $row['ind_plt_id'], 332 $row['ind_crp_id'],333 $row['ind_all_id'],334 $row['ind_sec_status'],335 new Ship( $row['ind_shp_id'] ),336 new Item( $row['ind_wep_id'] ) ); 337 array_push( $this->involvedparties_, $involved);338 } 339 340 341 331 332 $qry->execute($sql) or die($qry->getErrorMsg()); 333 while ($row = $qry->getRow()) 334 { 335 $involved = new InvolvedParty($row['ind_plt_id'], 336 $row['ind_crp_id'], 337 $row['ind_all_id'], 338 $row['ind_sec_status'], 339 new Ship($row['ind_shp_id']), 340 new Item($row['ind_wep_id'])); 341 array_push($this->involvedparties_, $involved); 342 } 343 // destroyed items 344 $sql = "select sum( itd.itd_quantity ) as itd_quantity, itd_itm_id, 342 345 itd_itl_id, itl_location 343 346 from kb3_items_destroyed itd, kb3_items itm, 344 347 kb3_item_locations itl 345 where itd.itd_kll_id = " .$this->getID()."348 where itd.itd_kll_id = " . $this->getID() . " 346 349 and itd.itd_itm_id = itm.itm_id 347 350 and ( itd.itd_itl_id = itl.itl_id or itd.itd_itl_id = 0 ) 348 351 group by itd_itm_id, itd_itl_id 349 352 order by itd.itd_itl_id, itm.itm_type"; 350 351 $qry->execute( $sql ) or die( $qry->getErrorMsg() ); 352 while ( $row = $qry->getRow() ) { 353 $destroyed = new DestroyedItem( new Item( $row['itd_itm_id'] ), 354 $row['itd_quantity'], 355 $row['itl_location'] ); 356 array_push( $this->destroyeditems_, $destroyed ); 357 } 358 } 353 354 $qry->execute($sql) or die($qry->getErrorMsg()); 355 while ($row = $qry->getRow()) 356 { 357 $destroyed = new DestroyedItem(new Item($row['itd_itm_id']), 358 $row['itd_quantity'], 359 $row['itl_location']); 360 array_push($this->destroyeditems_, $destroyed); 361 } 362 } 359 363 } 360 364 361 365 function exists() 362 366 { 363 $this->execQuery();364 return $this->valid_;367 $this->execQuery(); 368 return $this->valid_; 365 369 } 366 370 367 371 function relatedKillCount() 368 372 { 369 $kslist = new KillList();370 $kslist->setRelated( $this->id_);371 if ( CORP_ID)372 $kslist->addInvolvedCorp( new Corporation( CORP_ID ));373 if ( ALLIANCE_ID)374 $kslist->addInvolvedAlliance( new Alliance( ALLIANCE_ID ));375 376 return $kslist->getCount();377 } 378 373 $kslist = new KillList(); 374 $kslist->setRelated($this->id_); 375 if (CORP_ID) 376 $kslist->addInvolvedCorp(new Corporation(CORP_ID)); 377 if (ALLIANCE_ID) 378 $kslist->addInvolvedAlliance(new Alliance(ALLIANCE_ID)); 379 380 return $kslist->getCount(); 381 } 382 379 383 function relatedLossCount() 380 384 { 381 $lslist = new KillList();382 $lslist->setRelated( $this->id_);383 if ( CORP_ID)384 $lslist->addVictimCorp( new Corporation( CORP_ID ));385 if ( ALLIANCE_ID)386 $lslist->addVictimAlliance( new Alliance( ALLIANCE_ID ));387 388 return $lslist->getCount();389 } 390 391 function setID( $id)392 { 393 $this->id_ = $id;394 } 395 396 function setTimeStamp( $timestamp)397 { 398 $this->timestamp_ = $timestamp;399 } 400 401 function setSolarSystem( $solarsystem)402 { 403 $this->solarsystem_ = $solarsystem;404 } 405 406 function setSolarSystemName( $solarsystemname)407 { 408 $this->solarsystemname_ = $solarsystemname;409 } 410 411 function setSolarSystemSecurity( $solarsystemsecurity)412 { 413 $this->solarsystemsecurity_ = $solarsystemsecurity;414 } 415 416 function setVictim( $victim)417 { 418 $this->victim_ = $victim;419 } 420 421 function setVictimID( $victimid)422 { 423 $this->victimid_ = $victimid;424 } 425 426 function setVictimName( $victimname)427 { 428 $this->victimname_ = $victimname;429 } 430 431 function setVictimCorpID( $victimcorpid)432 { 433 $this->victimcorpid_ = $victimcorpid;434 } 435 436 function setVictimCorpName( $victimcorpname)437 { 438 $this->victimcorpname_ = $victimcorpname;439 } 440 441 function setVictimAllianceID( $victimallianceid)442 { 443 $this->victimallianceid_ = $victimallianceid;444 } 445 446 function setVictimAllianceName( $victimalliancename)447 { 448 $this->victimalliancename_ = $victimalliancename;449 } 450 451 function setVictimShip( $victimship)452 { 453 $this->victimship_ = $victimship;454 } 455 456 function setVictimShipName( $victimshipname)457 { 458 $this->victimshipname_ = $victimshipname;459 } 460 461 function setVictimShipExternalID( $victimshipexternalid)462 { 463 $this->victimshipexternalid_ = $victimshipexternalid;464 } 465 466 function setVictimShipClassName( $victimshipclassname)467 { 468 $this->victimshipclassname_ = $victimshipclassname;469 } 470 471 function setVictimShipValue( $victimshipvalue)472 { 473 $this->victimshipvalue_ = $victimshipvalue;474 } 475 476 function setFBPilotID( $fbpilotid)477 { 478 $this->fbpilotid_ = $fbpilotid;479 } 480 481 function setFBPilotName( $fbpilotname)482 { 483 $this->fbpilotname_ = $fbpilotname;484 } 485 486 function setFBCorpID( $fbcorpid)487 { 488 $this->fbcorpid_ = $fbcorpid;489 } 490 491 function setFBCorpName( $fbcorpname)492 { 493 $this->fbcorpname_ = $fbcorpname;494 } 495 496 function setFBAllianceID( $fballianceid)497 { 498 $this->fballianceid_ = $fballianceid;499 } 500 501 function setFBAllianceName( $fballiancename)502 { 503 $this->fballiancename_ = $fballiancename;504 } 505 function setKillPoints( $killpoints)506 { 507 $this->killpoints_ = $killpoints;508 } 509 385 $lslist = new KillList(); 386 $lslist->setRelated($this->id_); 387 if (CORP_ID) 388 $lslist->addVictimCorp(new Corporation(CORP_ID)); 389 if (ALLIANCE_ID) 390 $lslist->addVictimAlliance(new Alliance(ALLIANCE_ID)); 391 392 return $lslist->getCount(); 393 } 394 395 function setID($id) 396 { 397 $this->id_ = $id; 398 } 399 400 function setTimeStamp($timestamp) 401 { 402 $this->timestamp_ = $timestamp; 403 } 404 405 function setSolarSystem($solarsystem) 406 { 407 $this->solarsystem_ = $solarsystem; 408 } 409 410 function setSolarSystemName($solarsystemname) 411 { 412 $this->solarsystemname_ = $solarsystemname; 413 } 414 415 function setSolarSystemSecurity($solarsystemsecurity) 416 { 417 $this->solarsystemsecurity_ = $solarsystemsecurity; 418 } 419 420 function setVictim($victim) 421 { 422 $this->victim_ = $victim; 423 } 424 425 function setVictimID($victimid) 426 { 427 $this->victimid_ = $victimid; 428 } 429 430 function setVictimName($victimname) 431 { 432 $this->victimname_ = $victimname; 433 } 434 435 function setVictimCorpID($victimcorpid) 436 { 437 $this->victimcorpid_ = $victimcorpid; 438 } 439 440 function setVictimCorpName($victimcorpname) 441 { 442 $this->victimcorpname_ = $victimcorpname; 443 } 444 445 function setVictimAllianceID($victimallianceid) 446 { 447 $this->victimallianceid_ = $victimallianceid; 448 } 449 450 function setVictimAllianceName($victimalliancename) 451 { 452 $this->victimalliancename_ = $victimalliancename; 453 } 454 455 function setVictimShip($victimship) 456 { 457 $this->victimship_ = $victimship; 458 } 459 460 function setVictimShipName($victimshipname) 461 { 462 $this->victimshipname_ = $victimshipname; 463 } 464 465 function setVictimShipExternalID($victimshipexternalid) 466 { 467 $this->victimshipexternalid_ = $victimshipexternalid; 468 } 469 470 function setVictimShipClassName($victimshipclassname) 471 { 472 $this->victimshipclassname_ = $victimshipclassname; 473 } 474 475 function setVictimShipValue($victimshipvalue) 476 { 477 $this->victimshipvalue_ = $victimshipvalue; 478 } 479 480 function setFBPilotID($fbpilotid) 481 { 482 $this->fbpilotid_ = $fbpilotid; 483 } 484 485 function setFBPilotName($fbpilotname) 486 { 487 $this->fbpilotname_ = $fbpilotname; 488 } 489 490 function setFBCorpID($fbcorpid) 491 { 492 $this->fbcorpid_ = $fbcorpid; 493 } 494 495 function setFBCorpName($fbcorpname) 496 { 497 $this->fbcorpname_ = $fbcorpname; 498 } 499 500 function setFBAllianceID($fballianceid) 501 { 502 $this->fballianceid_ = $fballianceid; 503 } 504 505 function setFBAllianceName($fballiancename) 506 { 507 $this->fballiancename_ = $fballiancename; 508 } 509 function setKillPoints($killpoints) 510 { 511 $this->killpoints_ = $killpoints; 512 } 513 510 514 function calculateKillPoints() 511 515 { 512 $ship = $this->getVictimShip(); 513 $shipclass= $ship->getClass(); 514 $vicpoints = $shipclass->getPoints(); 515 $maxpoints = round( $vicpoints * 1.2 ); 516 foreach ( $this->involvedparties_ as $inv ) { 517 $ship = $inv->getShip(); 518 $invpoints += $shipclass->getPoints(); 519 } 520 521 $gankfactor = $vicpoints / ( $vicpoints + $invpoints ); 522 $points = ceil( $vicpoints * ( $gankfactor / 0.6 ) ); 523 524 if ( $points > $maxpoints ) $points = $maxpoints; 525 526 $points = round( $points, 0 ); 527 //echo "invpoints:".$invpoints."<br>"; 528 //echo "vicpoints:".$vicpoints."<br>"; 529 //echo "gankfactor:".$gankfactor."<br>"; 530 //echo "points:".$points; 531 //exit; 532 533 return $points; 516 $ship = $this->getVictimShip(); 517 $shipclass = $ship->getClass(); 518 $vicpoints = $shipclass->getPoints(); 519 $maxpoints = round($vicpoints * 1.2); 520 521 foreach ($this->involvedparties_ as $inv) 522 { 523 $shipinv = $inv->getShip(); 524 $shipclassinv = $shipinv->getClass(); 525 $invpoints += $shipclassinv->getPoints(); 526 } 527 528 $gankfactor = $vicpoints / ($vicpoints + $invpoints); 529 $points = ceil($vicpoints * ($gankfactor / 0.75)); 530 531 if ($points > $maxpoints) $points = $maxpoints; 532 533 $points = round($points, 0); 534 return $points; 534 535 } 535 536 536 537 function add() 537 538 { 538 //if ( $this->timestamp_ == "" || !$this->victimid_ || !$this->victimship_->getID() || !$this->solarsystem_->getID() || 539 // !$this->victimallianceid_ || !$this->victimcorpid_ || !$this->getFBAllianceID() || !$this->getFBCorpID() || 540 // !$this->getFBPilotID() ) 541 // return 0; 542 543 $qry = new DBQuery(); 544 $qry->execute( "select kll_id 539 // if ( $this->timestamp_ == "" || !$this->victimid_ || !$this->victimship_->getID() || !$this->solarsystem_->getID() || 540 // !$this->victimallianceid_ || !$this->victimcorpid_ || !$this->getFBAllianceID() || !$this->getFBCorpID() || 541 // !$this->getFBPilotID() ) 542 // return 0; 543 $qry = new DBQuery(); 544 $qry->execute("select kll_id 545 545 from kb3_kills 546 where kll_timestamp <= 547 date_add( '".$this->timestamp_."', INTERVAL '15:0' MINUTE_SECOND ) 548 and kll_timestamp >= 549 date_sub( '".$this->timestamp_."', INTERVAL '15:0' MINUTE_SECOND ) 550 and kll_victim_id = ".$this->victimid_." 551 and kll_ship_id = ".$this->victimship_->getID()." 552 and kll_system_id = ".$this->solarsystem_->getID()." 553 and kll_fb_plt_id = ".$this->getFBPilotID() ) or die( $qry->getErrorMsg() ); 554 555 if ( $qry->recordCount() == 0 ) { 556 $sql = "insert into kb3_kills 546 where kll_timestamp <= 547 date_add( '" . $this->timestamp_ . "', INTERVAL '15:0' MINUTE_SECOND ) 548 and kll_timestamp >= 549 date_sub( '" . $this->timestamp_ . "', INTERVAL '15:0' MINUTE_SECOND ) 550 and kll_victim_id = " . $this->victimid_ . " 551 and kll_ship_id = " . $this->victimship_->getID() . " 552 and kll_system_id = " . $this->solarsystem_->getID() . " 553 and kll_fb_plt_id = " . $this->getFBPilotID()) or die($qry->getErrorMsg()); 554 555 if ($qry->recordCount() == 0) 556 { 557 $sql = "insert into kb3_kills 557 558 values ( null, 558 date_format('".$this->timestamp_."', '%Y.%m.%d %H:%i:%s'), 559 ".$this->victimid_.", ".$this->victimallianceid_.", 560 ".$this->victimcorpid_.", ".$this->victimship_->getID().", 561 ".$this->solarsystem_->getID().", ".$this->getFBAllianceID().", 562 ".$this->getFBCorpID().", ".$this->getFBPilotID().", ".$this->calculateKillPoints()." )"; 563 $qry->execute( $sql ) or die( $qry->getErrorMsg() ); 564 $this->id_ = $qry->getInsertID(); 565 566 // involved 567 $order = 0; 568 $invall = array(); 569 $invcrp = array(); 570 $invplt = array(); 571 foreach ( $this->involvedparties_ as $inv ) { 572 $ship = $inv->getShip(); 573 $weapon = $inv->getWeapon(); 574 if ( !$inv->getPilotID() || $inv->getSecStatus() == "" || !$inv->getAllianceID() || !$inv->getCorpID() || 575 !$ship->getID() || !$weapon->getID() ) { 576 $this->remove(); 577 return 0; 578 } 579 580 $sql = "insert into kb3_inv_detail 581 values ( ".$this->getID().", ".$inv->getPilotID().", '".$inv->getSecStatus()."', " 582 .$inv->getAllianceID().", ".$inv->getCorpID().", ".$ship->getID().", " 583 .$weapon->getID().", ".$order++." )"; 584 $qry->execute( $sql ) or die( $qry->getErrorMsg() ); 585 586 if ( !in_array( $inv->getAllianceID(), $invall ) && $inv->getAllianceID() != 14 ) { 587 array_push( $invall, $inv->getAllianceID() ); 588 $qry->execute( "insert into kb3_inv_all values ( ".$this->getID().", ".$inv->getAllianceID()." )" ) or die( $qry->getErrorMsg() ); 589 } 590 if ( !in_array( $inv->getCorpID(), $invcrp ) ) { 591 array_push( $invcrp, $inv->getCorpID() ); 592 $qry->execute( "insert into kb3_inv_crp values ( ".$this->getID().", ".$inv->getCorpID()." )" ) or die( $qry->getErrorMsg() ); 593 } 594 if ( !in_array( $inv->getPilotID(), $invplt ) ) { 595 array_push( $invplt, $inv->getPilotID() ); 596 $qry->execute( "insert into kb3_inv_plt values ( ".$this->getID().", ".$inv->getPilotID()." )" ) or die( $qry->getErrorMsg() ); 597 } 598 } 599 600 // destroyed 601 foreach ( $this->destroyeditems_ as $dest ) { 602 $item = $dest->getItem(); 603 if ( !$item->getID() || !$dest->getQuantity() || !$dest->getLocationID() ) 604 continue; 605 606 $sql = "insert into kb3_items_destroyed 607 values ( ".$this->getID().", ".$item->getID().", ".$dest->getQuantity().", " 608 .$dest->getLocationID()." )"; 609 $qry->execute( $sql ) or die( $qry->getErrorMsg() ); 610 } 611 } 612 else { 613 $row = $qry->getRow(); 614 $this->dupeid_ = $row['kll_id']; 615 $this->id_ = -1; 616 } 617 return $this->id_; 559 date_format('" . $this->timestamp_ . "', '%Y.%m.%d %H:%i:%s'), 560 " . $this->victimid_ . ", " . $this->victimallianceid_ . ", 561 " . $this->victimcorpid_ . ", " . $this->victimship_->getID() . ", 562 " . $this->solarsystem_->getID() . ", " . $this->getFBAllianceID() . ", 563 " . $this->getFBCorpID() . ", " . $this->getFBPilotID() . ", " . $this->calculateKillPoints() . " )"; 564 $qry->execute($sql) or die($qry->getErrorMsg()); 565 $this->id_ = $qry->getInsertID(); 566 // involved 567 $order = 0; 568 $invall = array(); 569 $invcrp = array(); 570 $invplt = array(); 571 foreach ($this->involvedparties_ as $inv) 572 { 573 $ship = $inv->getShip(); 574 $weapon = $inv->getWeapon(); 575 if (!$inv->getPilotID() || $inv->getSecStatus() == "" || !$inv->getAllianceID() || !$inv->getCorpID() || !$ship->getID() || !$weapon->getID()) 576 { 577 $this->remove(); 578 return 0; 579 } 580 581 $sql = "insert into kb3_inv_detail 582 values ( " . $this->getID() . ", " . $inv->getPilotID() . ", '" . $inv->getSecStatus() . "', " 583 . $inv->getAllianceID() . ", " . $inv->getCorpID() . ", " . $ship->getID() . ", " 584 . $weapon->getID() . ", " . $order++ . " )"; 585 $qry->execute($sql) or die($qry->getErrorMsg()); 586 587 if (!in_array($inv->getAllianceID(), $invall) && $inv->getAllianceID() != 14) 588 { 589 array_push($invall, $inv->getAllianceID()); 590 $qry->execute("insert into kb3_inv_all values ( " . $this->getID() . ", " . $inv->getAllianceID() . " )") or die($qry->getErrorMsg()); 591 } 592 if (!in_array($inv->getCorpID(), $invcrp)) 593 { 594 array_push($invcrp, $inv->getCorpID()); 595 $qry->execute("insert into kb3_inv_crp values ( " . $this->getID() . ", " . $inv->getCorpID() . " )") or die($qry->getErrorMsg()); 596 } 597 if (!in_array($inv->getPilotID(), $invplt)) 598 { 599 array_push($invplt, $inv->getPilotID()); 600 $qry->execute("insert into kb3_inv_plt values ( " . $this->getID() . ", " . $inv->getPilotID() . " )") or die($qry->getErrorMsg()); 601 } 602 } 603 // destroyed 604 foreach ($this->destroyeditems_ as $dest) 605 { 606 $item = $dest->getItem(); 607 if (!$item->getID() || !$dest->getQuantity() || !$dest->getLocationID()) 608 continue; 609 610 $sql = "insert into kb3_items_destroyed 611 values ( " . $this->getID() . ", " . $item->getID() . ", " . $dest->getQuantity() . ", " 612 . $dest->getLocationID() . " )"; 613 $qry->execute($sql) or die($qry->getErrorMsg()); 614 } 615 } 616 else 617 { 618 $row = $qry->getRow(); 619 $this->dupeid_ = $row['kll_id']; 620 $this->id_ = -1; 621 } 622 return $this->id_; 618 623 } 619 624 620 625 function remove() 621 626 { 622 if ( !$this->id_)623 return;624 625 $qry = new DBQuery();626 $qry->execute("delete from kb3_kills627 where kll_id = " .$this->id_);628 $qry->execute("delete from kb3_inv_detail629 where ind_kll_id = " .$this->id_);630 $qry->execute("delete from kb3_inv_all631 where ina_kll_id = " .$this->id_);632 $qry->execute("delete from kb3_inv_crp633 where inc_kll_id = " .$this->id_);634 $qry->execute("delete from kb3_inv_plt635 where inp_kll_id = " .$this->id_);636 $qry->execute("delete from kb3_items_destroyed637 where itd_kll_id = " .$this->id_);638 } 639 640 function addInvolvedParty( $involved)641 { 642 array_push( $this->involvedparties_, $involved);643 } 644 645 function addDestroyedItem( $destroyed)646 { 647 array_push( $this->destroyeditems_, $destroyed);648 } 649 650 651 652 653 function InvolvedParty( 654 $secstatus, $ship, $weapon)655 { 656 $this->pilotid_ = $pilotid;657 $this->corpid_ = $corpid;658 $this->allianceid_ = $allianceid;659 $this->secstatus_ = $secstatus;660 $this->ship_ = $ship;661 $this->weapon_ = $weapon;627 if (!$this->id_) 628 return; 629 630 $qry = new DBQuery(); 631 $qry->execute("delete from kb3_kills 632 where kll_id = " . $this->id_); 633 $qry->execute("delete from kb3_inv_detail 634 where ind_kll_id = " . $this->id_); 635 $qry->execute("delete from kb3_inv_all 636 where ina_kll_id = " . $this->id_); 637 $qry->execute("delete from kb3_inv_crp 638 where inc_kll_id = " . $this->id_); 639 $qry->execute("delete from kb3_inv_plt 640 where inp_kll_id = " . $this->id_); 641 $qry->execute("delete from kb3_items_destroyed 642 where itd_kll_id = " . $this->id_); 643 } 644 645 function addInvolvedParty($involved) 646 { 647 array_push($this->involvedparties_, $involved); 648 } 649 650 function addDestroyedItem($destroyed) 651 { 652 array_push($this->destroyeditems_, $destroyed); 653 } 654 } 655 656 class InvolvedParty 657 { 658 function InvolvedParty($pilotid, $corpid, $allianceid, 659 $secstatus, $ship, $weapon) 660 { 661 $this->pilotid_ = $pilotid; 662 $this->corpid_ = $corpid; 663 $this->allianceid_ = $allianceid; 664 $this->secstatus_ = $secstatus; 665 $this->ship_ = $ship; 666 $this->weapon_ = $weapon; 662 667 } 663 668 664 669 function getPilotID() 665 670 { 666 return $this->pilotid_;671 return $this->pilotid_; 667 672 } 668 673 669 674 function getCorpID() 670 675 { 671 return $this->corpid_;676 return $this->corpid_; 672 677 } 673 678 674 679 function getAllianceID() 675 680 { 676 return $this->allianceid_;681 return $this->allianceid_; 677 682 } 678 683 679 684 function getSecStatus() 680 685 { 681 return $this->secstatus_;686 return $this->secstatus_; 682 687 } 683 688 684 689 function getShip() 685 690 { 686 return $this->ship_;691 return $this->ship_; 687 692 } 688 693 689 694 function getWeapon() 690 695 { 691 return $this->weapon_;692 } 693 694 695 696 697 function DestroyedItem( $item, $quantity, $location)698 { 699 $this->item_ = $item;700 $this->quantity_ = $quantity;701 $this->location_ = $location;702 } 703 696 return $this->weapon_; 697 } 698 } 699 700 class DestroyedItem 701 { 702 function DestroyedItem($item, $quantity, $location) 703 { 704 $this->item_ = $item; 705 $this->quantity_ = $quantity; 706 $this->location_ = $location; 707 } 708 704 709 function getItem() 705 710 { 706 return $this->item_;711 return $this->item_; 707 712 } 708 713 709 714 function getQuantity() 710 715 { 711 if ( $this->quantity_ == "") $this->quantity = 1;712 return $this->quantity_;716 if ($this->quantity_ == "") $this->quantity = 1; 717 return $this->quantity_; 713 718 } 714 719 715 720 function getLocationID() 716 721 { 717 $id = 0; 718 if ( strlen( $this->location_ ) < 2 ) { 719 $id = $this->item_->getSlot(); 720 } 721 else { 722 $qry = new DBQuery(); 723 $qry->execute( "select itl_id from kb3_item_locations where itl_location = '".$this->location_."'" ) or die( $qry->getErrorMsg() ); 724 $row = $qry->getRow(); 725 $id = $row['itl_id']; 726 } 727 728 return $id; 729 } 730 } 722 $id = 0; 723 if (strlen($this->location_) < 2) 724 { 725 $id = $this->item_->getSlot(); 726 } 727 else 728 { 729 $qry = new DBQuery(); 730 $qry->execute("select itl_id from kb3_item_locations where itl_location = '" . $this->location_ . "'") or die($qry->getErrorMsg()); 731 $row = $qry->getRow(); 732 $id = $row['itl_id']; 733 } 734 735 return $id; 736 } 737 } 738 731 739 ?> -
dev/common/class.killboard.php
r10 r16 102 102 { 103 103 $this->execQuery(); 104 return $this->config[$key]; 104 if (isset($this->config[$key])) 105 { 106 return $this->config[$key]; 107 } 108 return 0; 105 109 } 106 110 -
dev/common/generic.js
r2 r16 3 3 var w = screen.width; 4 4 var h = screen.height; 5 5 6 6 var x = ( w / 2 ) - ( width / 2 ); 7 7 var y = ( h / 2 ) - ( height / 2 ); 8 8 9 9 window.open( url, target, 'width=' + width + ',height=' + height + ',' + flags ); 10 10 } … … 16 16 curtab.style.display = 'block'; 17 17 } 18 19 function limitText(limitField, limitCount, limitNum) 20 { 21 if (limitField.value.length > limitNum) 22 { 23 limitField.value = limitField.value.substring(0, limitNum); 24 } 25 else 26 { 27 limitCount.value = limitNum - limitField.value.length; 28 } 29 } -
dev/common/kill_detail.php
r13 r16 85 85 } 86 86 $html .= "</table>"; 87 88 $config = $page->killboard_->getConfig(); 89 if ($config->getConfig('comments')) 90 { 91 include('comments.php'); 92 } 87 93 88 94 $html .= "</td><td width=50> </td>"; … … 187 193 $page->addContext($menubox->generate()); 188 194 189 $config = $page->killboard_->getConfig();190 195 if ($config->getKillPoints()) 191 196 { -
dev/common/search.php
r2 r16 1 <? 2 require_once( "class.page.php");3 require_once( "db.php");4 require_once( "globals.php");1 <?php 2 require_once("db.php"); 3 require_once("class.page.php"); 4 require_once("globals.php"); 5 5 6 $page = new Page( "Search");6 $page = new Page("Search"); 7 7 8 $html .= "<form id=search action=\"?a=search\" method=post>"; 9 $html .= "<table class=kb-subtable><tr>"; 10 $html .= "<td>Type:</td><td>Text: (3 letters minimum)</td>"; 11 $html .= "</tr><tr>"; 12 $html .= "<td><select id=searchtype name=searchtype><option value=pilot>Pilot</option><option value=corp>Corporation</option><option value=alliance>Alliance</option></select></td>"; 13 $html .= "<td><input id=searchphrase name=searchphrase type=text size=30/></td>"; 14 $html .= "<td><input type=submit name=submit value=Search></td>"; 15 $html .= "</tr></table>"; 16 $html .= "</form>"; 17 18 if ( $_POST['searchphrase'] != "" && strlen( $_POST['searchphrase'] ) >= 3 ) { 19 switch ( $_POST['searchtype'] ) { 20 case "pilot": 21 $sql = "select plt.plt_id, plt.plt_name, crp.crp_name 8 $html .= "<form id=search action=\"?a=search\" method=post>"; 9 $html .= "<table class=kb-subtable><tr>"; 10 $html .= "<td>Type:</td><td>Text: (3 letters minimum)</td>"; 11 $html .= "</tr><tr>"; 12 $html .= "<td><select id=searchtype name=searchtype><option value=pilot>Pilot</option><option value=corp>Corporation</option><option value=alliance>Alliance</option></select></td>"; 13 $html .= "<td><input id=searchphrase name=searchphrase type=text size=30/></td>"; 14 $html .= "<td><input type=submit name=submit value=Search></td>"; 15 $html .= "</tr></table>"; 16 $html .= "</form>"; 17 18 if ($_REQUEST['searchphrase'] != "" && strlen($_REQUEST['searchphrase']) >= 3) 19 { 20 switch ($_REQUEST['searchtype']) 21 { 22 case "pilot": 23 $sql = "select plt.plt_id, plt.plt_name, crp.crp_name 22 24 from kb3_pilots plt, kb3_corps crp 23 where lower( plt.plt_name ) like lower( '%" .slashfix( $_POST['searchphrase'] )."%' )25 where lower( plt.plt_name ) like lower( '%" . slashfix($_REQUEST['searchphrase']) . "%' ) 24 26 and plt.plt_crp_id = crp.crp_id 25 27 order by plt.plt_name"; 26 $header = "<td>Pilot</td><td>Corporation</td>";27 break;28 case "corp":29 $sql = "select crp.crp_id, crp.crp_name, ali.all_name28 $header = "<td>Pilot</td><td>Corporation</td>"; 29 break; 30 case "corp": 31 $sql = "select crp.crp_id, crp.crp_name, ali.all_name 30 32 from kb3_corps crp, kb3_alliances ali 31 where lower( crp.crp_name ) like lower( '%" .slashfix( $_POST['searchphrase'] )."%' )33 where lower( crp.crp_name ) like lower( '%" . slashfix($_REQUEST['searchphrase']) . "%' ) 32 34 and crp.crp_all_id = ali.all_id 33 35 order by crp.crp_name"; 34 $header = "<td>Corporation</td><td>Alliance</td>";35 break;36 case "alliance":37 $sql = "select ali.all_id, ali.all_name36 $header = "<td>Corporation</td><td>Alliance</td>"; 37 break; 38 case "alliance": 39 $sql = "select ali.all_id, ali.all_name 38 40 from kb3_alliances ali 39 where lower( ali.all_name ) like lower( '%" .slashfix( $_POST['searchphrase'] )."%' )41 where lower( ali.all_name ) like lower( '%" . slashfix($_REQUEST['searchphrase']) . "%' ) 40 42 order by ali.all_name"; 41 $header = "<td>Alliance</td><td></td>";42 break;43 $header = "<td>Alliance</td><td></td>"; 44 break; 43 45 } 44 46 45 47 $qry = new DBQuery(); 46 if ( !$qry->execute( $sql ) ) 47 die ( $qry->getErrorMsg() ); 48 if (!$qry->execute($sql)) 49 { 50 die ($qry->getErrorMsg()); 51 } 48 52 49 53 $html .= "<div class=block-header>Search results</div>"; 50 51 if ( $qry->recordCount() > 0 ) { 52 $html .= "<table class=kb-table width=450 cellspacing=1>"; 53 $html .= "<tr class=kb-table-header>".$header."</tr>"; 54 55 if ($qry->recordCount() > 0) 56 { 57 $html .= "<table class=kb-table width=450 cellspacing=1>"; 58 $html .= "<tr class=kb-table-header>".$header."</tr>"; 54 59 } 55 60 else 56 $html .= "No results.";57 58 while ( $row = $qry->getRow() )59 61 { 60 $html .= "<tr class=kb-table-row-even>"; 61 switch ( $_POST['searchtype'] ) { 62 case "pilot": 63 $html .= "<td><a href=\"?a=pilot_detail&plt_id=".$row['plt_id']."\">".$row['plt_name']."</a></td><td>".$row['crp_name']."</td>"; 64 break; 65 case "corp": 66 $html .= "<td><a href=\"?a=corp_detail&crp_id=".$row['crp_id']."\">".$row['crp_name']."</a></td><td>".$row['all_name']."</td>"; 67 break; 68 case "alliance": 69 $html .= "<td><a href=\"?a=alliance_detail&all_id=".$row['all_id']."\">".$row['all_name']."</a></td><td></td>"; 70 break; 71 } 72 $html .= "</tr>"; 62 $html .= "No results."; 73 63 } 74 if ( $qry->recordCount() > 0 ) 75 $html .= "</table>"; 76 } 77 78 $page->setContent( $html ); 79 $page->generate(); 64 65 while ($row = $qry->getRow()) 66 { 67 $html .= "<tr class=kb-table-row-even>"; 68 switch ($_REQUEST['searchtype']) 69 { 70 case "pilot": 71 $html .= "<td><a href=\"?a=pilot_detail&plt_id=" . $row['plt_id'] . "\">" . $row['plt_name'] . "</a></td><td>" . $row['crp_name'] . "</td>"; 72 break; 73 case "corp": 74 $html .= "<td><a href=\"?a=corp_detail&crp_id=" . $row['crp_id'] . "\">" . $row['crp_name'] . "</a></td><td>" . $row['all_name'] . "</td>"; 75 break; 76 case "alliance": 77 $html .= "<td><a href=\"?a=alliance_detail&all_id=" . $row['all_id'] . "\">" . $row['all_name'] . "</a></td><td></td>"; 78 break; 79 } 80 $html .= "</tr>"; 81 } 82 if ($qry->recordCount() > 0) 83 { 84 $html .= "</table>"; 85 } 86 } 87 88 $page->setContent($html); 89 $page->generate(); 80 90 ?> -
dev/style/blue/style.css
r12 r16 493 493 text-decoration: none; 494 494 } 495 .comment { 496 background-color: #292929; 497 border: 1px solid; 498 border-color: #292929; 499 margin-top: 5px; 500 padding-top: 8px; 501 padding-left: 8px; 502 color: #cccccc; 503 font-size: 12px; 504 font-family: Arial, Helvetica, sans-serif; 505 -moz-border-radius-topleft: 10px; 506 -moz-border-radius-topright: 10px; 507 -moz-border-radius-bottomleft: 10px; 508 -moz-border-radius-bottomright: 10px; 509 } 510 511 .comment:focus { 512 border-color: #FFFFFF; 513 } 514 .comment-button { 515 background-color: #292929; 516 border: 1px solid; 517 border-color: #292929; 518 color: #cccccc; 519 font-size: 12px; 520 margin-top: 5px; 521 padding-left: 8px; 522 font-family: Arial, Helvetica, sans-serif; 523 -moz-border-radius-topleft: 10px; 524 -moz-border-radius-topright: 10px; 525 -moz-border-radius-bottomleft: 10px; 526 -moz-border-radius-bottomright: 10px; 527 } 528 .comment-button:focus { 529 border-color: #FFFFFF; 530 } 531 #comments-wrap { 532 border-top:#333333 thin solid; 533 width:350px; 534 margin-top:15px; 535 float:left; 536 clear:left; 537 color: #cccccc; 538 font-size: 12px; 539 } 540 .comment-text { 541 padding:5px; 542 border-bottom-width:thin; 543 border-bottom-style:solid; 544 border-bottom-color: #333333; 545 overflow: hidden; 546 } 547 #countdown { 548 border:0px; 549 background-color:#000000; 550 color: #cccccc; 551 font-size: 12px; 552 font-family: Arial, Helvetica, sans-serif; 553 } -
dev/style/default/style.css
r12 r16 229 229 img.avatar 230 230 { 231 border: 1px solid #333333 #333333 #444444 #444444;231 border: 1px solid #333333; 232 232 } 233 233 … … 493 493 text-decoration: none; 494 494 } 495 .comment { 496 background-color: #292929; 497 border: 1px solid; 498 border-color: #292929; 499 margin-top: 5px; 500 padding-top: 8px; 501 padding-left: 8px; 502 color: #cccccc; 503 font-size: 12px; 504 font-family: Arial, Helvetica, sans-serif; 505 -moz-border-radius-topleft: 10px; 506 -moz-border-radius-topright: 10px; 507 -moz-border-radius-bottomleft: 10px; 508 -moz-border-radius-bottomright: 10px; 509 } 510 511 .comment:focus { 512 border-color: #FFFFFF; 513 } 514 .comment-button { 515 background-color: #292929; 516 border: 1px solid; 517 border-color: #292929; 518 color: #cccccc; 519 font-size: 12px; 520 margin-top: 5px; 521 padding-left: 8px; 522 font-family: Arial, Helvetica, sans-serif; 523 -moz-border-radius-topleft: 10px; 524 -moz-border-radius-topright: 10px; 525 -moz-border-radius-bottomleft: 10px; 526 -moz-border-radius-bottomright: 10px; 527 } 528 .comment-button:focus { 529 border-color: #FFFFFF; 530 } 531 #comments-wrap { 532 border-top:#333333 thin solid; 533 width:350px; 534 margin-top:15px; 535 float:left; 536 clear:left; 537 color: #cccccc; 538 font-size: 12px; 539 } 540 .comment-text { 541 padding:5px; 542 border-bottom-width:thin; 543 border-bottom-style:solid; 544 border-bottom-color: #333333; 545 overflow: hidden; 546 } 547 #countdown { 548 border:0px; 549 background-color:#000000; 550 color: #cccccc; 551 font-size: 12px; 552 font-family: Arial, Helvetica, sans-serif; 553 }