$html = '';
$search = false;
if(isset($_GET['sw']) && $_GET['sw']){
$this->search->set($_GET['sw']);
$search = true;
}
if($rows = $this->post->get_posts('home',null,'up_date desc')){
$html .= '
';
if($search){
$html .= '
検索結果';
if($this->search->cond) $html .= ' 【'.$this->search->cond.'】 ';
$html .= '
';
$rows = $this->search->find($rows);
}else{
$html .= '
掲載施設一覧
';
}
if($rows){
$html .= '
'."\n";
foreach($rows as $row){
$first_image = $main_image = '';
if($row['image']){
$image_list = $this->post->image_list($row['post_id'],'jpg','cube');
$first_image = array_shift($image_list);
$first_image = $this->img->convertImageMode($first_image,'cube_s');
$i=0;
foreach($image_list as $k=>$v){
$cap = $this->get_caption($data['post_id'],$k+2);
if($cap!='main') continue;
$main_image = $this->img->convertImageMode($v,'cube_s');
break;
}
if(!$main_image) $main_image = $first_image;
}
$link = $this->home.'/施設案内/'.$row['title'];
$html .= '- ';
if($row['area']) $html .= '【'.$row['area'].'】';
if($row['title']) $html .= ''.$row['title'].'';
if($main_image) $html .= '
';
if($row['category']) $html .= ''.$row['category'].'';
if($row['catch']) $html .= ''.$row['catch'].'';
if($row['addr1']) $html .= ''.$row['addr1'].'';
$html .= '
';
$html .= ' '."\n";
}
$html .= '
'."\n";
}else{
$html .= '
* 該当する施設が見つかりませんでした。
';
}
$html .= '
';
}
return $html;