echo '<div align="center"> ' . $render . ' </div>'; } elseif ($_GET["action"] == "Mistakes") { $intPropID = $_GET["propID"]; $sql = "SELECT * FROM property, area, state_of_trade, proptype, branch WHERE property.prop_ID = " . $intPropID . " AND "; $sql .= " property.area_id = area.area_ID AND property.state_of_trade_id = state_of_trade.state_ID "; $sql .= " AND property.type_id = proptype.type_ID "; $sql .= " AND property.Branch = branch.Branch_ID"; if (DB::isError($res = $con->query($sql))) { die(DB::errorMessage($res)); } $from = isset($_GET['from']) ? (int) $_GET['from'] : 0; $limit = 1; $pager = new DB_Pager($res, $from, $limit); $data = $pager->build(); if (DB::isError($data)) { die(DB::errorMessage($data)); } while ($row = $pager->fetchRow(DB_FETCHMODE_ASSOC)) { $pc = explode(" ", $row['Postcode']); $intOSX = $row["osx"]; $intOSY = $row["osy"]; $SQLTrans = "SELECT places.place_ID, places.place_type, places.place_title, places.place_desc, places.place_osx, places.place_osy, pl_type.pl_type_id, pl_type_title FROM places, pl_type WHERE (places.place_type = 1 OR places.place_type = 2) AND places.place_type = pl_type.pl_type_id ORDER BY sqrt((abs(places.place_osx-" . $intOSX . ")*abs(places.place_osx-" . $intOSX . "))+(abs(places.place_osy-" . $intOSY . ")*abs(places.place_osy-" . $intOSY . "))) LIMIT 1"; $rowTrans = $con->getRow($SQLTrans, DB_FETCHMODE_ASSOC); if (DB::isError($resTrans = $con->query($SQLTrans))) { die(DB::errorMessage($resTrans)); } $intTransType = $rowTrans['place_type']; $strTransType = $rowTrans['pl_type_title']; $strTransTitle = $rowTrans['place_title'];
function get($query, $from = 0, $class = "") { $res = $this->db->query($query); $pager = new DB_Pager($res, $from, $this->limit); $data = $pager->build(); if (DB::isError($data)) { return $this->raiseError(DB::errorMessage($data)); } if (!$data) { //return $this->raiseError("There were no results"); return $this->str_emptyresult; } if ($this->heading) { $this->table_Header($class); } $this->table_Body($pager, $from, $class); $this->table_Footer($class); if ($class) { $row1Style = array("class" => $class); if ($this->alternate_background) { $row2Style = array("class" => $class . $this->alternate_background_style); $this->table->altRowAttributes(1, $row1Style, $row2Style); } } return $this->meta_head($data) . "<br>" . $this->get_nav($data) . $this->table->toHTML() . $this->get_nav($data); }