* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ use EDTB\Bookmarks\PoiBm; if (isset($_GET["do"])) { /** @require functions */ require_once $_SERVER["DOCUMENT_ROOT"] . "/source/functions.php"; /** @require PoiBm class */ require_once "PoiBm.php"; $data = json_decode($_REQUEST["input"]); $AddBm = new PoiBm(); $AddBm->add_bm($data); exit; } ?> <div class="input" id="addBm"> <form method="post" id="bm_form" action="/"> <div class="input-inner"> <div class="suggestions" id="suggestions_3" style="margin-top:79px;margin-left:14px"></div> <table> <tr> <td class="heading" colspan="2">Add/edit bookmark <span class="right"> <a href="javascript:void(0)" onclick="tofront('addBm')" title="Close form"> <img src="/style/img/close.png" class="icon" alt="X" /> </a>
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ use EDTB\Bookmarks\PoiBm; if (isset($_GET["do"])) { /** @require config */ require_once $_SERVER["DOCUMENT_ROOT"] . "/source/config.inc.php"; /** @require functions */ require_once $_SERVER["DOCUMENT_ROOT"] . "/source/functions.php"; /** @require PoiBm class */ require_once "PoiBm.php"; $data = json_decode($_REQUEST["input"]); $AddPoi = new PoiBm(); $AddPoi->add_poi($data); exit; } ?> <div class="input" id="addPoi" style="text-align:center"> <form method="post" id="poi_form" action="/Bookmarks"> <div class="input-inner"> <div class="suggestions" id="suggestions_33" style="margin-top:79px;margin-left:12px"></div> <table> <tr> <td class="heading" colspan="2">Add/edit Point of Interest <span class="right"> <a href="javascript:void(0)" onclick="tofront('addPoi')" title="Close form"> <img class="icon" src="/style/img/close.png" alt="X" /> </a>
$query = " SELECT SQL_CACHE user_poi.id, user_poi.poi_name AS item_name,\n user_poi.system_name, user_poi.text, user_poi.added_on,\n IFNULL(user_poi.x, user_systems_own.x) AS item_coordx,\n IFNULL(user_poi.y, user_systems_own.y) AS item_coordy,\n IFNULL(user_poi.z, user_systems_own.z) AS item_coordz,\n edtb_systems.id AS system_id,\n user_poi_categories.name AS catname\n FROM user_poi\n LEFT JOIN edtb_systems ON user_poi.system_name = edtb_systems.name\n LEFT JOIN user_poi_categories ON user_poi_categories.id = user_poi.category_id\n LEFT JOIN user_systems_own ON user_poi.system_name = user_systems_own.name\n ORDER BY -(sqrt(pow((item_coordx-({$usex})), 2)+pow((item_coordy-({$usey})), 2)+pow((item_coordz-({$usez})), 2))) DESC,\n poi_name,\n system_name"; $result = $mysqli->query($query) or write_log($mysqli->error, __FILE__, __LINE__); $poi = new PoiBm(); $poi->usex = $usex; $poi->usey = $usey; $poi->usez = $usez; $poi->time_difference = $system_time; echo $poi->make_table($result, "Poi"); $result->close(); ?> </td> <td class="poi_minmax" style="vertical-align:top;padding:0"> <?php /** * fetch bookmarks */ $query = " SELECT SQL_CACHE user_bookmarks.id, user_bookmarks.system_id, user_bookmarks.system_name,\n user_bookmarks.comment as text, user_bookmarks.added_on,\n IFNULL(edtb_systems.x, user_systems_own.x) AS item_coordx,\n IFNULL(edtb_systems.y, user_systems_own.y) AS item_coordy,\n IFNULL(edtb_systems.z, user_systems_own.z) AS item_coordz,\n user_bm_categories.name AS catname\n FROM user_bookmarks\n LEFT JOIN edtb_systems ON user_bookmarks.system_name = edtb_systems.name\n LEFT JOIN user_bm_categories ON user_bookmarks.category_id = user_bm_categories.id\n LEFT JOIN user_systems_own ON user_bookmarks.system_name = user_systems_own.name\n ORDER BY -(sqrt(pow((item_coordx-({$usex})), 2)+pow((item_coordy-({$usey})), 2)+pow((item_coordz-({$usez})), 2))) DESC,\n system_name,\n user_bookmarks.added_on DESC"; $result = $mysqli->query($query) or write_log($mysqli->error, __FILE__, __LINE__); $i = 0; $bm = new PoiBm(); $bm->usex = $usex; $bm->usey = $usey; $bm->usez = $usez; $bm->time_difference = $system_time; echo $bm->make_table($result, "Bm"); $result->close(); ?> </td> </tr> </table>