""){ $strWhere .= " and newsId like '%" . $search["newsId"] . "%' "; } if ($search["newsDate"] <> ""){ $strWhere .= " and newsDate like '%" . $search["newsDate"] . "%' "; } if ($search["title"] <> ""){ $strWhere .= " and title like '%" . $search["title"] . "%' "; } if ($search["kind"] <> ""){ $strWhere .= " and kind like '%" . $search["kind"] . "%' "; } if ($search["url"] <> ""){ $strWhere .= " and url like '%" . $search["url"] . "%' "; } $strWhere .= " and stopFlag = '' "; //ページングの設定 $sql = "select * from oj_news where " . $strWhere; if (!($rs = mysql_query($sql, $cn))) { die("newslistページング取得エラー$sql"); } // MySQL レコード数 $resultNum = mysql_num_rows($rs); if ( trim($_GET['p']) <> "" ){ $nowPage = trim($_GET['p']); } else if ( trim($_POST['p']) <> "" ){ $nowPage = trim($_POST['p']); } else { $nowPage = 0; } $paging = GetPaging($resultNum, $nowPage); if ( trim($nowPage) <> "" ){ $p = intval($nowPage) * LIST_PAGING; $strOrder = " newsDate desc,newsId desc LIMIT $p, " . LIST_PAGING; } else { $strOrder = " newsDate desc,newsId desc LIMIT 0, " . LIST_PAGING; } GetNewsList($newsList, $strWhere, $strOrder, $cn, TRUE); GetNameList("kind", $kindListCode, $kindListName, $cn, TRUE, "1"); //var_dump($newsList); mysql_close($cn); // ページを表示する $templateTitle = "お知らせ一覧"; $templateCss = "news.css"; $bodyId = "results"; $smarty->assign( 'kindListCode', $kindListCode); $smarty->assign( 'kindListName', $kindListName); $smarty->assign( 'p', "$p"); $smarty->assign( 'paging', $paging); $smarty->assign( 'newsList', $newsList); $smarty->assign( 'search' , $search); $smarty->assign( "scriptName" , "scriptnews.js"); // 固定設定 $tmp = explode("/",$_SERVER['REQUEST_URI']); $homepage = $tmp[count($tmp)-1]; $smarty->assign( 'homepage', "$homepage"); $smarty->assign( 'message', "$message"); $templateName = basename(dirname($_SERVER['PHP_SELF'])) . basename(__FILE__, ".html").".tpl"; $smarty->assign( "templateCss" , "$templateCss"); $smarty->assign( "templateTitle", "$templateTitle"); $smarty->assign( "templateName" , "$templateName"); $smarty->display( 'base.tpl' ); ?>