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();
}
}
/* Request値の検証 */
if ($err_str === "") {
if (isset($_POST) === true && empty($_POST) === false) {
$rq = $_POST;
} elseif (isset($_GET) === true && empty($_GET) === false) {
$rq = $_GET;
}
}
/* スポットデータ取得 */
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);
} catch (SpotError $e) {
ErrorRedirect(404);
}
}
/* コンテンツメニュー */
if ($err_str === "") {
$feature_type = 'pc';
$page_type = 'osusume';
include('common/spotmenu.inc');
}
/* クーポンデータ取得 */
if ($err_str === "") {
try {
$coupon = new Coupon($locomill->get_db3());
if ($preview == 1) {
$coupon_array = $coupon->get_data_array_pre($spot_id, 0, 1);
} else {
$coupon_array = $coupon->get_data_array(true, true, $spot_id, 0, 1);
}
foreach ($coupon_array AS $k => $v) {
$coupon_array[$k]['contents_01'] = htmlspecialchars_textarea($v['contents_01']);
$coupon_array[$k]['notice_01'] = htmlspecialchars_textarea($v['notice_01']);
$coupon_array[$k]['limit'] = (mktime(0, 0, 0, 12, 31, 2037) <= $v['c_end'])? '': date('Y/n/j', $v['c_end']);
$coupon_array[$k]['lunch_flg'] = ($is_lunch == 1 || $preview == 1)? $v['lunch_flg']: 0;
$coupon_array[$k]['party_flg'] = ($is_party == 1 || $preview == 1)? $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("PREVIEW", $preview);
$smarty->assign("PV_MODE", $pv_mode);
$smarty->assign("PV_URL", $pv_url);
// メニューページデータ
$smarty->assign("CURRENT_PLUS_MENU_ID", 0);
// クーポン情報
$smarty->assign_ex("COUPON", $coupon_array, "");
if ($spot_data['menu_type'] == 2) {
$page_title = 'おすすめ';
} else {
$page_title = 'メニュー';
}
if (!empty($coupon_array)) {
$page_title .= '・クーポン';
}
// イマココ
$imakoko = getTopicsPath('spot');
if ($err_str === "") {
$imakoko[] = array(sprintf('/search_result/?type=spot&C1=%d', $spot_data['category_01_01_id']), $spot_data['category_01_01_name']);
$imakoko[] = array(sprintf('/search_result/?type=spot&C2=%d', $spot_data['category_01_02_id']), $spot_data['category_01_02_name']);
$imakoko[] = array(sprintf('/search_result/?type=spot&C3=%d', $spot_data['category_01_03_id']), $spot_data['category_01_03_name']);
$imakoko[] = array(sprintf('/spot/home/?id=%d', $spot_id), $spot_data['name_01']);
$imakoko[] = array(sprintf('/spot/osusume/?id=%d', $spot_id), $page_title);
}
$smarty->assign("IMAKOKO_ARRAY", $imakoko);
// 最新情報
include('common/whatsnew.inc');
/* AccessDailyクラスインスタンス生成 */
if ($err_str === "" && $preview != 1) {
try {
$access = new AccessDaily($locomill->get_db());
$params = array("corner_type" => 1,
"terminal" => 1,
"corner_id" => $spot_data['id'],
"page" => $_SERVER['PHP_SELF'],
"title" => $page_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());
}
}
/* 広告系 */
$the_corner_id = 6;
$adver_param = array("terminal_type" => 1,
"corner_id" => $the_corner_id,
"category_03_id" => $spot_data['category_01_03_id']);
$adver_b_type = ($spot_data['adver_block_flg'] == 1)? array(7): array(1, 2, 7);
include('common/banners.inc');
// バナー広告
if ($spot_data['adver_block_flg'] == 1) {
if (!empty($spot_data['orig_billboard'])) {
$billboard_out = htmlspecialchars_decode($spot_data['orig_billboard']);
} else {
// 代替ビルボード
$billboard_out = '
';
}
if (!empty($spot_data['orig_sky'])) {
$sky_out = htmlspecialchars_decode($spot_data['orig_sky']);
} else {
// 代替スカイスクレイパー
$sky_out = '
';
}
$smarty->assign("ADVER_01", $billboard_out);
$smarty->assign("ADVER_02", $sky_out);
}
// エラー文字列
$smarty->assign("ERR_STR", $err_str);
if (!empty($err_str) || $preview == 1) {
header("HTTP/1.0 404 Not Found");
}
// ブラウザキャッシュ対策
if ($err_str === "") {
header('Etag: ' . md5($spot_data['id'] . '-' . time()));
}
// Smarty Cache
$cache_id = '';
if ($err_str === "" && $preview != 1) {
$smarty = getSmartyCache($smarty);
$cache_id = getSmartyCacheId($spot_data, array('id', 'update_stamp', 'isSP'));
}
/* 出 力 */
$smarty->display('spot/osusume/index.tpl', $cache_id);