\t\torder by \t\t\tentryDay desc, \t\t\tqaID DESC \t\tlimit 5) ORDER BY \tcategoryID, \tentryDay desc, \tqaID DESC _SQL_; $dataArray = $db->getArray($sql, 'ASSOC'); //アイテムHTML作成 $currentID = 0; foreach ($dataArray as $line) { foreach ($line as $key => $val) { ${$key} = htmlspecialchars(trim(getValueText($columnItem, $key, $val))); } $entryNum = substr('0000' . $qaID, -4); $userInfo = $title . ' '; $itemArray[$line['categoryID']] .= "\t\t\t" . '<li><a href="/faq/' . $entryNum . '.html">' . $userInfo . '</a></li>' . "\n"; } //リストHTML作成 foreach ($itemArray as $key => $val) { $itemHTML .= '<h3 class="titBw"><a href="/faq/cate' . $key . '.html">' . $categoryIDList[$key] . '</a></h3>' . "\n"; $itemHTML .= '<ul class="qaList">' . "\n"; $itemHTML .= $val; $itemHTML .= '</ul>' . "\n"; } //トピックパス $topicpath = ' <li>よくあるご質問</li>'; }
$HTML .= '<th class="userBtnTh"> </th>' . "\n"; } $i++; if (array_search($itemName, $targetDbColumn) === false) { continue; } $HTML .= "<th class=\"" . $itemName . "Th\">" . $columnItem[$itemName]['name'] . '<br>'; $HTML .= "<a href=\"?sort={$itemName}&sortfor=asc" . $plusGet . "\" class=\"sortArrow\" title=\"昇順で並び替える\">▲</a><a href=\"?sort={$itemName}&sortfor=desc" . $plusGet . "\" class=\"sortArrow\" title=\"降順で並び替える\">▼</a></th>\n"; } $HTML .= "</tr>\n"; } $HTML .= "<tr>\n"; $i = 1; foreach ($targetListItem as $itemName) { if ($i == 1) { $HTML .= '<td class="userBtnTd"><a href="new.php?md=rewrite&userID=' . $line['userID'] . '" class="rewrite">修正</a>' . "\n"; $HTML .= '<a href="?md=delete&userID=' . $line['userID'] . '" class="delete">削除</a></td>' . "\n"; } $i++; if (array_search($itemName, $targetDbColumn) === false) { continue; } $HTML .= '<td class="' . $itemName . 'Td">' . getValueText($columnItem, $itemName, $line[$itemName]) . "</td>\n"; } $itemNum++; } $HTML .= "</table>\n"; $HTML .= '<a href="new.php">[+]新規追加はこちら</a>'; $HTML .= $pagerHTML; displayOutput($HTML); }
} //GETの値を引き継ぐ $plusGet = ""; foreach ($_GET as $key => $val) { if ($key == 'sort' || $key == "sortfor") { continue; } $plusGet .= '&' . $key . '=' . $val; } $itemNum = 0; $HTML .= "<div class=\"noreplyList\">\n"; $HTML .= "<table>\n"; //qaID,name,title,question,activeFlag,entryDay foreach ($dataArray as $line) { foreach ($line as $key => $val) { ${$key} = getValueText($columnItem, $key, $val); $titleName = $key . 'Title'; ${$titleName} = $columnItem[$key]['name']; } $age = $age ? $age : '??'; $sex = $sex ? $sex : '?性'; $question = nl2br($question); $HTML .= <<<_HTML_ <tr class="oneLine"> <td class="userBtnTd" rowspan="5"> 【 {$qaID} 】<br /> <a href="new.php?md=rewrite&qaID={$qaID}" class="rewrite">返答</a> <a href="./?md=delete&qaID={$qaID}" class="delete">削除</a> </td> <th class="nameTh">投稿者</th> <td class="nameTd">{$name} [ <a href="mailto:{$mail}">{$mail}</a> ]