Fatal error: Cannot instantiate non-existent class: gim_db in /home/.mabeloven/mecharpg/mechaasylum.com/global/game/modules/country/country.php on line 23
Fatal error: Cannot instantiate non-existent class: gim_page in /home/.mabeloven/mecharpg/mechaasylum.com/global/game/prepare.php on line 50
What does this mean...
Spesificly this: Fatal error: Cannot instantiate non-existent class:
this is the coding for the first error:
Code:
class GIM_Country {
var $id = -1;
var $data = array();
var $db = NULL;
function GIM_Country() {
$this->db = new GIM_DB;
}
function link($id) {
if ($this->id == $id) return;
$this->id = $id;
}
function fill($name, $id = -1) {
if ($id == -1) $id = $this->id;
$this->db->Query("SELECT $name FROM countries WHERE id='$id'");
$this->db->Next();
$this->data[$this->id] = $this->db->getAll();
}
function set($name, $val, $met = "") {
$id = $this->id;
if ($met != "") {
$set = "$name = $name $met $val";
if ($met == "+") $this->data[$id][$name] += $val;
if ($met == "-") $this->data[$id][$name] -= $val;
} else {
$this->data[$id][$name] = $val;
$set = "$name = $val";
}
$this->db->Query("UPDATE countries SET $set WHERE id='$id'");
}
function get($name, $id = -1) {
if ($id == -1) $id = $this->id;
if ($this->data[$id][$name] == NULL) {
$this->db->Query("SELECT $name FROM countries WHERE id='$id'");
$this->db->Next();
$this->data[$id][$name] = $this->db->get($name);
}
return $this->data[$id][$name];
}
function getoil($id) {
global $cdb;
$cdb->query("SELECT oil FROM countries WHERE id='$id'");
$cdb->Next();
return $cdb->get("oil");
}
function getname($id) {
global $cdb;
$cdb->query("SELECT name FROM countries WHERE id='$id'");
$cdb->Next();
return $cdb->get("name");
}
function getlatlon($cid) {
$db = new GIM_DB;
$db->Query("SELECT * FROM countries WHERE id='$cid'");
$db->Next();
$info[0] = $db->Get("lat");
$info[1] = $db->Get("lon");
return $info;
}
function time($dist, $speed) {
return $dist / $speed * 60 * 60;
}
function distance($c1, $c2, $unit = "K") {
$l1 = $this->getlatlon($c1);
$l2 = $this->getlatlon($c2);
$lat1 = $l1[0];
$lon1 = $l1[1];
$lat2 = $l2[0];
$lon2 = $l2[1];
$theta = $lon1 - $lon2;
$dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta));
$dist = acos($dist);
$dist = rad2deg($dist);
$dist = $dist * 60 * 1.1515;
switch($unit) {
case "M":
break;
case "K":
$dist = $dist * 1.609344;
break;
case "N":
$dist = $dist * 0.8684;
break;
}
return ($dist);
}
}
|