get_exception();
}
}
/* 出力準備 */
$smarty = new SmartyEx();
$smarty->prepare();
/* マイプロフィール */
include('common/myprofile.inc');
/* Spotクラスインスタンス生成 */
if ($err_str === "") {
try {
$spot = new Spot($locomill->get_db3());
} catch (SpotError $e) {
$err_str .= $e->get_exception();
}
}
/* Couponクラスインスタンス生成 */
if ($err_str === "") {
try {
$cp = new Coupon($locomill->get_db3());
} catch (CouponError $e) {
$err_str .= $e->get_exception();
}
}
/* Request値の検証 */
if ($err_str === "") {
if (isset($_POST) === true && empty($_POST) === false) {
$rq = $_POST;
} elseif (isset($_GET) === true && empty($_GET) === false) {
$rq = $_GET;
}
$g_latitude = (isset($rq['latitude']) && preg_match("/^[0-9.]+$/", $rq['latitude']))? $rq['latitude']: '';
$g_longitude = (isset($rq['longitude']) && preg_match("/^[0-9.]+$/", $rq['longitude']))? $rq['longitude']: '';
$g_scale = (isset($rq['scale']) && preg_match("/^[0-9]+$/", $rq['scale']))? $rq['scale']: '';
}
/* スポットデータ取得 */
if ($err_str === "") {
try {
if ($spot->check_id($rq['id'])) {
$spot_id = $rq['id'];
} else {
throw new SpotError('・正しい手続きでアクセスしていません。
');
}
$spot_data = $spot->get_data($spot_id);
if ($preview != 1) {
// 表示判定
if ($spot_data['enable'] != 1 || $now <= $spot_data['start_stamp'] || (0 < $spot_data['end_stamp'] && $spot_data['end_stamp'] <= $now)) {
$the_corner_id = 6;
$adver_param = array("terminal_type" => 1, "corner_id" => $the_corner_id);
$adver_b_type = array(1);
include('common/banners.inc');
header("HTTP/1.0 404 Not Found");
$smarty->display('parts/spot/disabled.tpl');
exit;
}
if ($spot_data['is_closed'] == 1) {
// 閉店
$the_corner_id = 6;
$adver_param = array("terminal_type" => 1, "corner_id" => $the_corner_id);
$adver_b_type = array(1);
include('common/banners.inc');
header("HTTP/1.0 404 Not Found");
$smarty->display('parts/spot/closed.tpl');
exit;
}
}
$spot_data = $spot->adjust($spot_data);
$spot_sub_array = $spot->get_sub_data_array($spot_id);
} catch (SpotError $e) {
ErrorRedirect(404);
}
}
/* コンテンツメニュー */
if ($err_str === "") {
$feature_type = 'pc';
$page_type = 'map';
include('common/spotmenu.inc');
}
/* クーポンデータ取得 */
if ($err_str === "") {
try {
$temp = $cp->get_data_array(true, true, $spot_id, 0, 1);
foreach ($temp AS $k => $v) {
$v['contents_01'] = str_replace("\n", "
", htmlspecialchars_textarea($v['contents_01']));
$v['notice_01'] = str_replace("\n", "
", htmlspecialchars_textarea($v['notice_01']));
$v['image_01'] = unserialize(stripslashes($v['image_01']));
$v['limit'] = (mktime(0, 0, 0, 12, 31, 2037) <= $v['c_end'])? '': date('Y/n/j', $v['c_end']);
$coupon_array[$k] = array("ID" => $v['id'],
"NAME" => $v['contents_01'],
"NOTICE" => $v['notice_01'],
"LIMIT" => $v['limit'],
"QR" => (!empty($v['image_01']['up_name'])? $v['image_01']['up_name']: ''),
"LUNCH_FLG" => ($is_lunch? $v['lunch_flg']: 0),
"PARTY_FLG" => ($is_party? $v['party_flg']: 0)
);
}
} catch (CouponError $e) {
$err_str .= $e->get_exception();
}
}
/* 変数の準備 */
// ページタイプ
$smarty->assign("PAGE_TYPE", $page_type);
// スポットデータ
$smarty->assign("SPOT_ID", $spot_id);
$smarty->assign("SPOT_DATA", $spot_data);
$smarty->assign_ex("G_LATITUDE", $g_latitude, $spot_data['g_latitude']);
$smarty->assign_ex("G_LONGITUDE", $g_longitude, $spot_data['g_longitude']);
$smarty->assign_ex("G_SCALE", $g_scale, $spot_data['g_scale']);
$smarty->assign_ex("G_LATITUDE_ICON", $spot_data['g_latitude']);
$smarty->assign_ex("G_LONGITUDE_ICON", $spot_data['g_longitude']);
//$smarty->assign_ex( "G_MARKER_INFO_01", $spot_data['g_marker_info_01'], "" );
// クーポン情報
$smarty->assign_ex("COUPON_NUM", count($coupon_array), "");
$smarty->assign_ex("COUPON", $coupon_array, "");
/* AccessDailyクラスインスタンス生成 */
if ($err_str === "") {
try {
$access = new AccessDaily($locomill->get_db());
$params = array("corner_type" => 1,
"terminal" => 1,
"corner_id" => $spot_data['id'],
"page" => $_SERVER['PHP_SELF'],
"title" => '地図・クーポン印刷',
"refer_url" => (isset($_SERVER['HTTP_REFERER'])? $_SERVER['HTTP_REFERER']: ''),
"refer_name" => "",
"keyword" => "",
"file_name" => $_SERVER['REQUEST_URI'],
"member_data" => (isset($locomill->session->sess_data['member_data'])? $locomill->session->sess_data['member_data']: array()));
$access->do_logging($params);
} catch (AccessDailyError $e) {
$access->output_error($e->get_exception());
}
}
// エラー文字列
$smarty->assign("ERR_STR", $err_str);
if (!empty($err_str)) {
header("HTTP/1.0 404 Not Found");
}
// Smarty Cache
if ($err_str === "" && $preview != 1) {
// $smarty = getSmartyCache($smarty);
}
/* 出 力 */
$smarty->display('spot/map/index_print.tpl', getSmartyCacheId($rq, array('id', 'update_stamp', 'isSP', 'latitude', 'longitude', 'scale')));