"err", "caption" => "データベースエラー", "icon" => $erroricon, "body" => "データベースの接続に失敗しました。
指定のデータベース「 $dbname 」を作成しますか?", "buttons" => "戻る|history.back();,閉じる|window.close();" ); } if (count($Samplings) == 1) { $_REQUEST['group'] = "all"; } if ($_REQUEST['cmd'] == "limit_edit" && $_REQUEST['pw'] && ($_REQUEST['pw'] == $root || $_REQUEST['pw'] == $admin)) { $init = file_get_contents($inifile); $init = str_replace("\n", " ", $init); $limit = $_REQUEST['limit']; $init = preg_replace("/(sampling.*\"$_REQUEST[key]\".*$_REQUEST[name]:)($_REQUEST[old])([\"\,\s]+)/", "$1!$limit$3", $init); $init = str_replace(":!", ":", $init); $init = str_replace(" ", "\n", $init); file_put_contents($inifile, $init); header("Location:". $_SERVER['SCRIPT_NAME']. "?pw=$_REQUEST[pw]&group=$_REQUEST[group]&id=$_REQUEST[id]"); exit; } !$template && $template = $saucefile; $text = ""; $Html = file($template); $cgimode = false; foreach ($Html as $line) { if (preg_match("//", $line, $m)) { $cgimode = false; list($left, $right) = split($m[0], $line); $line = " $right"; } elseif (preg_match("//", $line, $m)) { $cgimode = true; list($left, $right) = split($m[0], $line); $text .= "$left
"; if (isset($Msg['caption'])) { /* * 全てのメッセージの生成と表示 * */ $text .= "
". $Msg['caption']. "
". $Msg['body']. "

"; $Buttons = split(",", $Msg['buttons']); foreach ($Buttons as $val) { list($name, $action) = split("\|", $val); $text .= " "; } $text .= "
"; } elseif ($anslistview && $_REQUEST['cmd'] == "list" && $_REQUEST['pw'] && ($_REQUEST['pw'] == $root || $_REQUEST['pw'] == $admin)) { $pageview = 50; !isset($_REQUEST['start']) && $_REQUEST['start'] = 0; $sql = "SELECT * FROM `$tablename`"; $rs = mysql_query($sql); $max = mysql_num_rows($rs); $sql .= " ORDER BY `Date` DESC LIMIT ". $_REQUEST['start']. ", $pageview"; $rs = mysql_query($sql); $view = mysql_num_rows($rs); $no = $_REQUEST['start'] + 1; $text .= "
"; foreach ($listfields as $line) { list($key, $title, $align) = split(",", $line); $text .= " "; } $text .= ""; while($Data = mysql_fetch_assoc($rs)) { $data = dbfields($Data['Data']); $text .= " "; foreach ($listfields as $line) { list($key, $title, $align) = split(",", $line); $val = $data[$key]; if (preg_match("/^(\d+\/\d+\/\d+) ([\d\:]+)$/", $val, $m)) { $val = $m[1]; } $text .= " "; } $text .= ""; $no++; } $text .= "
No.$title
$no$val
"; if ($max) { if ($_REQUEST[start]) { $firstbutton = ""; $prevbutton = ""; } if ($_REQUEST[start] + $view < $max) { $p = ceil($max / $pageview); $ls = ($p - 1) * $pageview; $nextbutton = "\" onclick=\" this.form.start.value=". ($_REQUEST[start] + $pageview)."; this.form.submit();\" />"; $lastbutton = ""; } $text .=<<<_
$firstbutton $prevbutton $nextbutton $lastbutton
_; } $text .= "
"; } else { if ($anslistview && $_REQUEST['pw'] && ($_REQUEST['pw'] == $root || $_REQUEST['pw'] == $admin)) { $text .= "
回答一覧
"; } include_once $_SERVER['DOCUMENT_ROOT']. "/system-inc/summarytable.inc"; } } if (!$cgimode) $text .= $line; } header("Content-type:text/html; charset=utf-8;"); echo $text; exit; ?>