hjkhghopjkertteerterterterertertrtoirh
bnmbertsurhetertertertertertertertpdf'tdfg
/
srv
/
www
/
virtual
/
dev1.wccweb.jp.dac4.biz
/
web
/
biva.webapp
/
site
/
app
/
api
/
Upload FileeE
HOME
<?php /** * api/information.php * * @author Mitsutoshi Nakamura <mitsutoshi.nakamura.jp@gmail.com> */ /** * Request URL * * /api/information/iframe/wccweb1/[ top | all ] * /api/information/iframe/wccweb2/[ top | all ] * /api/information/iframe/fmw/[ top | all ] * /api/information/iframe/fmwg/[ top | all ] * /api/information/iframe/fm_wedding/ */ require(BV_APPROOT . 'site/app/api/_core.php'); class information extends core { public function __construct() { parent::__construct(); } public function pageIndex() { $this->biva->error('Invalid access'); } /** * /api/information/iframe/wccweb/all/ (一覧) * /api/information/iframe/wccweb1/top/ * /api/information/iframe/wccweb2/top/ * /api/information/iframe/wccweb1/all/ * /api/information/iframe/wccweb2/all/ */ public function pageIframe() { $uri = bvUriScheme() . bvUriDomain(); $this->tplvar['icon']['name'] = array( 1 => '新製品', 2 => 'フェア', 4 => 'イベント', 8 => 'ショップ', 16 => 'その他' ); $this->tplvar['icon']['path'] = array( 1 => $uri . '/assets/img/icn_newitem.gif', 2 => $uri . '/assets/img/icn_fair.gif', 4 => $uri . '/assets/img/icn_event.gif', 8 => $uri . '/assets/img/icn_shop.gif', 16 => $uri . '/assets/img/icn_other.gif' ); switch (@$this->biva->params[0]) { case 'wccweb': $this->wccweb(); break; // WCCWEB topics except event / fair case 'wccweb1': $this->wccweb1(); break; // WCCWEB event / fair case 'wccweb2': $this->wccweb2(); break; case 'fmw': $this->fmw(); break; case 'fmwg': $this->fmwg(); break; case 'fm_wedding': $this->fm_wedding(); break; default: $this->biva->error('Invalid request'); break; } } /** * WCCWEB topics */ private function wccweb() { $p2 = @$this->biva->params[1]; if (!$p2) { $this->biva->error('Invalid request'); } $where = array("date_fr <= '" . date('Y-m-d H:i:s') . "'", 'target & 1', 'config & 8', 'status & 1'); $limit = $p2 == 'top' ? ' LIMIT 25' : ''; $sql_base = "SELECT * FROM p_news WHERE %s ORDER BY date_fr DESC, id DESC%s"; $sql = sprintf($sql_base, join(' AND ', $where), $limit); //echo $sql; exit; $r_sql = $this->biva->Db->query($sql); $this->tplvar['list'] = $this->biva->Db->fetchAll($r_sql); //bvPr($this->tplvar['list']); exit; $this->biva->setCss('information/iframe.wccweb.min'); $this->biva->view('iframe.wccweb'); } /** * WCCWEB topics except event / fair */ private function wccweb1() { $p2 = @$this->biva->params[1]; if (!$p2) { $this->biva->error('Invalid request'); } $where = array("date_fr <= '" . date('Y-m-d H:i:s') . "'", 'target & 1', 'cat & (1 | 8 | 16)', 'config & 8', 'status & 1'); $limit = $p2 == 'top' ? ' LIMIT 25' : ''; $sql_base = "SELECT * FROM p_news WHERE %s ORDER BY date_fr DESC, id DESC%s"; $sql = sprintf($sql_base, join(' AND ', $where), $limit); //echo $sql; exit; $r_sql = $this->biva->Db->query($sql); $this->tplvar['list'] = $this->biva->Db->fetchAll($r_sql); //bvPr($this->tplvar['list']); exit; header("Access-Control-Allow-Origin: *"); $this->biva->setCss('information/iframe.wccweb.min'); $this->biva->view('iframe.wccweb'); } /** * WCCWEB event / fair */ private function wccweb2() { $p2 = @$this->biva->params[1]; if (!$p2) { $this->biva->error('Invalid request'); } $where = array("date_fr <= '" . date('Y-m-d H:i:s') . "'", 'target & 1', 'cat & (2 | 4)', 'config & 8', 'status & 1'); $limit = $p2 == 'top' ? ' LIMIT 25' : ''; $sql_base = "SELECT * FROM p_news WHERE %s ORDER BY date_fr DESC, id DESC%s"; $sql = sprintf($sql_base, join(' AND ', $where), $limit); //echo $sql; exit; $r_sql = $this->biva->Db->query($sql); $this->tplvar['list'] = $this->biva->Db->fetchAll($r_sql); //bvPr($this->tplvar['list']); exit; header("Access-Control-Allow-Origin: *"); $this->biva->setCss('information/iframe.wccweb.min'); $this->biva->view('iframe.wccweb'); } /** * FMW */ private function fmw() { $p2 = @$this->biva->params[1]; if (!$p2) { $this->biva->error('Invalid request'); } $data[] = $this->fmwShop(2); $data[] = $this->fmwShop(4); $data[] = $this->fmwShop(8); $data[] = $this->fmwShop(32768); // Sort by date_fr foreach ($data as $d) { $this->tplvar['list'][$d['date_fr']] = $d; } krsort($this->tplvar['list']); // bvPr($this->tplvar['list']); exit; //$this->biva->setCss('information/iframe.fmw.min'); $this->biva->setCss('../../../../../assets/css/api/information/iframe.fmw.min'); $this->biva->view('iframe.fmw'); } private function fmwShop($shopId) { $where = array("date_fr <= '" . date('Y-m-d H:i:s') . "'", 'target & ' . $shopId, 'status & 1'); $sql_base = "SELECT * FROM p_news WHERE %s ORDER BY date_fr DESC, id DESC LIMIT 1"; $sql = sprintf($sql_base, join(' AND ', $where), $limit); // echo $sql; exit; $r_sql = $this->biva->Db->query($sql); $data = $this->biva->Db->fetchAll($r_sql); return $data[0]; } /** * FMWG */ private function fmwg() { $p2 = @$this->biva->params[1]; if (!$p2) { $this->biva->error('Invalid request'); } $where = array("date_fr <= '" . date('Y-m-d H:i:s') . "'", 'target & (16 | 32)', 'status & 1'); $limit = $p2 == 'top' ? ' LIMIT 2' : ''; $sql_base = "SELECT * FROM p_news WHERE %s ORDER BY date_fr DESC, id DESC%s"; $sql = sprintf($sql_base, join(' AND ', $where), $limit); //echo $sql; exit; $r_sql = $this->biva->Db->query($sql); $this->tplvar['list'] = $this->biva->Db->fetchAll($r_sql); //bvPr($this->tplvar['list']); exit; //$this->biva->setCss('information/iframe.fmwg.min'); $this->biva->setCss('../../../../../assets/css/api/information/iframe.fmwg.min'); $this->biva->view('iframe.fmwg'); } /** * FM WEDDING */ private function fm_wedding() { header('Access-Control-Allow-Origin: *'); $where = array("date_fr <= '" . date('Y-m-d H:i:s') . "'", 'target & 16384', 'status & 1'); $sql_base = "SELECT * FROM p_news WHERE %s ORDER BY date_fr DESC, id DESC"; $sql = sprintf($sql_base, join(' AND ', $where)); //echo $sql; exit; $r_sql = $this->biva->Db->query($sql); $this->tplvar['list'] = $this->biva->Db->fetchAll($r_sql); //bvPr($this->tplvar['list']); exit; $this->biva->setCss('../../../../../assets/css/api/information/iframe.fm_wedding'); $this->biva->view('iframe.fm_wedding'); } }