setAlias(_TABLE_WORKSHOP_REMARK.'.'.$is_end_name, 'is_end');//終了フラグ $EO->setAlias(_TABLE_WORKSHOP_REMARK.'.'.$remarks_name, 'remarks');//終了文言 $EO->setNumSearch('id', 1);//id1決め打ち $EO->search(); $EO->fetch(); if(!$EO->get('is_end')){ //検索オブジェクト $SO = new SQLSearch($DB, _TABLE_WORKSHOP); //表示用ラベル// $SO->setLabel('course', App::custom('workshop_cate01'));//講習会 $SO->setLabel('division', App::custom('workshop_cate02'));//区分 $SO->setLabel('pref', App::custom('workshop_pref'));//都道府県 $SO->setLabel('web', array('0'=>'-', '1'=>'対応'));//Web申込 //検索条件 $SO->setNumSearch('course', $conditions['course']);//講習会 if($conditions['division']) $SO->setNumSearch('division', $conditions['division']);//区分 if($conditions['pref']){//都道府県 if($conditions['pref']=='all'){//指定なし }elseif(strlen($conditions['pref'])==2){ $SO->setStrSearch('pref', $conditions['pref']);//都道府県で検索 } else if(strlen($conditions['pref'])==3){ $SO->setStrSearch('pref', App::custom('area', $conditions['pref']));//地方で検索 } } if($conditions['month']=='all'){//指定なし }elseif($conditions['month']){//開催月 $month_first = $conditions['month'].'-01'; $month_last = Util::changeDateFormat($conditions['month'].'-01', 'Y-m-t'); $month_where = array(); $sql = " term_form >= " . $DB->sqlStr($month_first); $sql .= " AND term_form <= " . $DB->sqlStr($month_last); $month_where[] = "({$sql})"; $sql = " term_to IS NOT NULL "; $sql .= " AND term_to >= " . $DB->sqlStr($month_first); $sql .= " AND term_to <= " . $DB->sqlStr($month_last); $month_where[] = "({$sql})"; $sql = " term_to IS NOT NULL "; $sql .= " AND term_form <= " . $DB->sqlStr($month_first); $sql .= " AND term_to >= " . $DB->sqlStr($month_last); $month_where[] = "({$sql})"; $sql = implode(' OR ', $month_where); $SO->setWhere('('.$sql.')'); } if ($conditions['web']) $SO->setNumSearch('web', 1);//Web申込 //ソートの種類 $SO->setSortType('number', array('number'), array('number DESC'));//番号 //検索実行 $SO->search($conditions['page'], $conditions['sort']); $SO->setAdditionalParams($conditions); } else { $thisYear = Util::changeDateFormat(Util::getFiscalYear().'-01-01', "WnWY年度");//当年度を和暦で取得 } } ?> 講習会・研修会 | 公益財団法人 日本産業廃棄物処理振興センター