ここから本文です。
0 ){ while( $row_sel = mysqli_fetch_array( $res_sel ) ){ $tmp_kind = $row_sel['c_list']; $lst_ncate = explode(",", $tmp_kind); } } $count_cate = count($lst_ncate); $onepage = 10; if($num == ""){ //---------------------- 一覧表示 -------------------------------------------------------------- $into_type = ""; if($type){ $count_type = count($check_cate); for($i=0;$i<=$count_type;$i++){ $into_type .= " AND (n_cate like '%".$check_cate[$i]."%') "; } } $tmp = 0; $list = array(); $dsp_nocount = ""; $sql_sel = "SELECT * FROM newstbl WHERE flg_del='0' AND n_stat='2'".$into_type; $sql_sel .= "AND (n_open ='1' OR '$now' >= n_opend) ORDER BY CASE WHEN n_open='1' THEN n_date WHEN n_open='2' THEN n_opend END DESC"; $res_sel = mysqli_query( $DBID_sel,"$sql_sel" ); $num_sel = mysqli_num_rows( $res_sel ); if( $num_sel > 0 ){ while( $row_sel = mysqli_fetch_array( $res_sel ) ){ $n_num = $row_sel[ 'n_num' ]; $n_date = $row_sel[ 'n_date' ]; $n_open = $row_sel[ 'n_open' ]; $n_opend = $row_sel[ 'n_opend' ]; $n_title = $row_sel[ 'n_title' ]; $tmp_cate = $row_sel['n_cate']; $tlist = array( $n_num,$n_date,$n_open,$n_opend,$n_title,$tmp_cate ); $list[$tmp] = implode( '|=boundary=|', $tlist ); $tmp++; } }else{ $dsp_nocount = '
条件に当てはまるお知らせはありません。
'; } $tmp_array = array(); $end = count( $list ); $num = array(); $title = array(); $dsp_date = array(); $dsp_cate = array(); for( $i=0; $i<$end; $i++ ){ list( $n_num,$n_date,$n_open,$n_opend,$n_title,$tmp_cate ) = explode( '|=boundary=|', $list[$i] ); if($n_open == '2'){ $n_date = $n_opend; } $n_date = substr( $n_date, 0, 16 ); list( $date, $time ) = explode( ' ', $n_date ); list( $year, $month, $day ) = explode( '-', $date ); $youbi = date('w',mktime(0,0,0,$month,$day,$year)); $month = abs( $month ); $day = abs( $day ); $youbi = date('w',mktime(0,0,0,$month,$day,$year)); $dsp_date[$i] = $year.'.'.$month.'.'.$day.'('.$lst_week[$youbi].')'; $n_cate = explode(",",$tmp_cate); $dsp_cate[$i] = ""; for($j=0;$j<$count_cate;$j++){ if($lst_ncate[$j] != ""){ if(in_array($lst_ncate[$j],$n_cate)){ $dsp_cate[$i] .= ''.$lst_ncate[$j].''; } } } $num[$i] = $n_num; $title[$i] = $n_title; $n_title = str_replace('札幌大同のイベントや情報をお知らせします!
ここから本文です。