<?php
/*
	Copyright(c) 2010 Shift Tech Inc. All Rights Reserved.
 	http://www.shift-tech.jp/

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    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, see <http://www.gnu.org/licenses/>.
 */

require_once("../../../app_path.php");
require_once(APP_PATH.'/PcController.php');
require_once 'bMap.php';
$bMap = new bMap();

$bMap->_pageu_code =  $_REQUEST["code"];
$bMap->_prev = $_REQUEST["prev"];
$data = $bMap->getDetail();
if($data!=null) {
	if($data['bmap_img']!=null) {
		$data['path'] = "<img src=\"../../../".UNITS_IMG_PATH.$data['bmap_img']."\" width=\"120\" />";
	}
}
?>
<html>
<head>
<script type="text/javascript" src="http://map.yahooapis.jp/MapsService/js/V1/?appid=<?php echo $data["bmap_apikey"]; ?>">
</script>
<script type="text/javascript">
   window.onload=function(){
   var dlat = <?php echo $data["bmap_lat"]; ?>;
   var dlng = <?php echo $data["bmap_lng"]; ?>;
   var _map = '';
   _map = new YahooMapsCtrl("map", dlat+","+dlng, 4, YMapMode.MAP);
   var popup='';
   var title = '<?php echo ereg_replace(";|:", "", addslashes($data["bmap_title"])); ?>';
   var addr ='<?php echo ereg_replace(";|\r|\n",'',addslashes($data["bmap_addr"])); ?>';
   var body =  '<?php echo ereg_replace(";|:", "", addslashes($data["bmap_body"])); ?>';
   var html = '<table><tr><td width="200"><b>'+title+'</b><p style="font-size:10px;">[住所]<br />'+addr+'<br /><br />'+body+'</p></td><td><div style="text-align:center;"><?php echo $data["path"]; ?></div></td></tr></table>';
   _map.addIcon("info", 
    			_map.getCenter(), 
    			html, 
    			"L1",
    			title
    			);
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style></head>
<body>
<div id="map" style="height: 100%; width: 100%">&nbsp;</div>
</body>
</html>