$enddate)) { header("Location:../"); exit; } !isset($_REQUEST['CMD']) && $_REQUEST['CMD'] = ''; if ($_REQUEST['CMD'] != "escape" && (isset($_REQUEST['nonconfirm']) || isset($_REQUEST['nonconfirm2']))) { if (isset($_REQUEST['nonconfirm'])) unset($_REQUEST['nonconfirm']); if (isset($_REQUEST['nonconfirm2'])) unset($_REQUEST['nonconfirm2']); $_REQUEST['CMD'] = "regist"; } $COMMAND_VALUES = array(); $REQUEST_VALUES = array(); $dbconnect = false; $scriptname = $_SERVER['SCRIPT_NAME']; $IP = $_SERVER['REMOTE_ADDR']; $continuously && $cookiename = ""; if (!isset($Button['Close']) || !$Button['Close']) { $Button['Close'] = "閉じる"; } $adminmode = ""; if ($_REQUEST['pw'] == $root || $_REQUEST['pw'] == $admin) $adminmode = true; if ($cookiename && $_COOKIE[$cookiename] && !$adminmode) { $Msg = array( "mode" => "err", "caption" => "Double post", "icon" => $erroricon, "body" => $doublepost, "buttons" => $Button['Close']. "|window.close();" ); } else { REQUEST_Purse(); mb_convert_variables("UTF-8", "auto", $_REQUEST); if ($servername && $username && $dbname) { $err = ""; if ($_REQUEST['CMD'] == "createdb") { if ($err = createDB($servername, $username, $password, $dbname)) { $Msg = array( "mode" => "err", "caption" => "データベースエラー", "icon" => $erroricon, "body" => "データベースの作成に失敗しました。
新しいデータベースを作成する権限が無いか、作成可能なデータベース数に制限があることが考えられます。 詳しくはサーバ管理者にお問い合せください。", "buttons" => $Button['Close']. "|window.close();" ); } } if (!$err) { if ($dbh = mysql_connect($servername, $username, $password, $dbname)) { mysql_select_db($dbname); mysql_query("SET NAMES 'utf8'"); $dbconnect = true; if ($tablename && $groupname) { $Tables = getTABLEname($dbname); if (!in_array("SystemClientTable", $Tables)) { $sql = " CREATE TABLE `SystemClientTable` ( `ID` VARCHAR( 14 ) NOT NULL , `Date` DATETIME DEFAULT NULL COMMENT '日付', `Client` VARCHAR( 200) DEFAULT NULL COMMENT 'クライアント名', `Tablename` VARCHAR( 24 ) NOT NULL COMMENT 'テーブル名', PRIMARY KEY ( `ID` ) ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;"; mysql_query($sql); } $rs = mysql_query("SELECT * FROM `SystemClientTable` WHERE `Tablename`='$tablename';"); if (!mysql_num_rows($rs)) { $ID = createid(); $now = jst_time(time(), 7); mysql_query(" REPLACE `SystemClientTable` SET `ID`='$ID', `Date`='$now', `Client`='$clientname', `Tablename`='$tablename';" ); mysql_query(" CREATE TABLE `$tablename` ( `ID` VARCHAR( 14 ) NOT NULL , `Group` VARCHAR( 20 ) DEFAULT NULL COMMENT 'グループ', `Date` DATETIME DEFAULT NULL COMMENT '日付', `Data` text COMMENT 'フィールドとデータ', PRIMARY KEY ( `ID` ) ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_unicode_ci;" ); } } else { $Msg = array( "mode" => "err", "caption" => "データベースエラー", "icon" => $erroricon, "body" => "クライアント用アカウント(tablename)または、グループ名(griupname)が設定されていません。
アカウントはクライアントごとに異なる名称を半角英数字で、 グループ名は所属や言語ごとに集計する名称です。グループが1つしかない場合でも「jp」など、 必ず設定しなければなりません。", "buttons" => "戻る|history.back();,閉じる|window.close();,データベースの作成|location.href='$scriptname?CMD=createdb';" ); } } else { $Msg = array( "mode" => "err", "caption" => "データベースエラー", "icon" => $erroricon, "body" => "データベースの接続に失敗しました。
指定のデータベース「 $dbname 」を作成しますか?", "buttons" => "戻る|history.back();,閉じる|window.close();,データベースの作成|location.href='$scriptname?CMD=createdb';" ); } } } if (isset($_REQUEST['ajax'])) { if ($_REQUEST[ajax] == 'relation') { $text = getrelation($_REQUEST[key], 0); } elseif ($_REQUEST['ajax'] == "summary_table" && ($counter_admin || $_REQUEST['pw'] == $root)) { include_once $_SERVER['DOCUMENT_ROOT']. "/survey/system-inc/summarytable.inc"; } header("Content-type:text/plain; charset=utf-8;"); echo $text; exit; } $_REQUEST['CMD_status']++; if (!$adminmode && $onetime && $_REQUEST['CMD_status'] == 1) { /* ワンタイムURL使用時の処理 キーが未指定の場合や既に回答済の場合はエラー表示 */ if (!$_REQUEST['key']) { header("Location:../"); exit; } else { is_file("../$onetime_url") && $Onetimelist = file("../$onetime_url"); $checked = array_values(preg_grep("/^". $_REQUEST['key']. "\t/", $Onetimelist)); if (count($checked) < 1) { header("Location:../?key=". $_REQUEST['key']); exit; } else { $rs = mysql_query("SELECT * FROM `$tablename` WHERE `Data` LIKE '%Key=". $_REQUEST['key']. "\t%'"); if (mysql_num_rows($rs)) { $Msg = array( "mode" => "err", "caption" => "Double post", "icon" => $erroricon, "body" => $doublepost, "buttons" => $Button['Close']. "|window.close();" ); } } } } if ($root && $_REQUEST['pw'] == $root && $_REQUEST['CMD'] == "csv") { $tablename = $_REQUEST['table']; $sql = "SELECT * FROM `$tablename`"; if ($_REQUEST['group']) { $sql .= " WHERE `Group`='". $_REQUEST['group']. "'"; } $rs = mysql_query($sql); if ($fh = fopen($tablename. ".csv", 'w+')) { $row = 0; while($Data = mysql_fetch_assoc($rs)) { $Fields = split("\t", $Data['Data']); if (!$row) { $line = ""; foreach ($Fields as $field) { list($key, $val) = split("=", $field); $line && $line .= ","; $line .= "\"$key\""; } fwrite($fh, "$line\n"); } $line = ""; foreach ($Fields as $field) { list($key, $val) = split("=", $field); $line && $line .= ","; $line .= "\"$val\""; } !isset($_REQUEST['utf']) && $line = mb_convert_encoding($line, "SJIS", "UTF-8"); $line = str_replace(" ", " ", $line); fwrite($fh, "$line\n"); $row++; } fclose($fh); } header("Location:$tablename.csv"); exit; } else if ($root && $_REQUEST['pw'] == $root && $_REQUEST['CMD'] == "data") { $tablename = $_REQUEST['table']; $rs = mysql_query("SELECT * FROM `$tablename`;"); if ($fh = fopen("$tablename.data", 'w')) { while($Data = mysql_fetch_assoc($rs)) { $line = "\"".$Data['ID']. "\",\"". $Data['Group']."\",\"".$Data['Date']. "\",\"". $Data['Data']."\"\n"; fwrite($fh, $line); } fclose($fh); } header("Location:$tablename.data"); exit; } /* 設問の並べ替えが設定されていれば */ $sorted && ksort($_REQUEST); $keys = array_keys($_REQUEST); foreach ($keys as $key) { if (!$sorted && $key == 'CMD_middle') break; if (!isset($_COOKIE[$key]) && !isset($_FILE[$key])) { if (preg_match("/^(CGI|CMD|pw|src)/", $key, $m)) { $COMMAND_VALUES[] = "$key\t$_REQUEST[$key]"; } else { $newKey = str_replace(":", ":", $key); if (is_array($_REQUEST[$key])) { $REQUEST_VALUES[] = "$newKey\t". join("/", $_REQUEST[$key]); } else { $REQUEST_VALUES[] = "$newKey\t$_REQUEST[$key]"; } } } if ($_REQUEST['CMD_middle'] && preg_match("/^$end_que:/", $key)) break; } if ($_REQUEST['CMD'] == "regist" && (!$upw || $upw == $_REQUEST['CMD_upw'])) { /* メールの送信とデータの保存 */ $ID = $_REQUEST['CMD_ID']; $now = jst_time(time(), 7); if ($localarea && !$_REQUEST['CMD_lat'] && !$_REQUEST['CMD_lon']) { $url = "http://utf.trycms.net/geoip/geocity.php?ip=$IP&lang="; list($ip,$cnCode,$cnCode3,$cnName,$region,$pre,$city,$jpCode,$Pre,$Lat,$Lon) = split(",", file_get_contents($url)); $_REQUEST['CMD_pre'] = $pre; $_REQUEST['CMD_city'] = $city; $_REQUEST['CMD_lat'] = $Lat; $_REQUEST['CMD_lon'] = $Lon; } $body = "[$now] --"; $data = "File=$groupname\tDate=$now"; if ($relation && is_file($relation)) { $text = getrelation($_REQUEST[$relay_field], 1); $data .= "\t$text"; $Data = split("\t", $text); foreach ($Data as $line) { list($key, $val) = split("=", $line); $body .= " $key : $val"; } $body .= " --"; } foreach ($REQUEST_VALUES as $value) { list($key, $ans) = split("\t", $value); list($no, $que) = split(":", $key); $data .= "\t$no=$ans"; $body .= " [$no]=$ans"; } $data .= "\tKey=". $_REQUEST['CMD_key']. "\tIP=$IP"; if ($localarea) { $data .= "\tAddr=". $_REQUEST['CMD_pre']. $_REQUEST['CMD_city']. "\tCoordinate=". $_REQUEST['CMD_lat']. ",". $_REQUEST['CMD_lon']; } $body .= " --"; $sql = " REPLACE `$tablename` SET `ID`='$ID', `Group`='$groupname', `Date`='$now', `Data`='$data'; "; $flag = mysql_query($sql); $cookiename && setcookie($cookiename, $ID, time()+ $cookietime * 60, $cookiepath); $Msg = array( "mode" => "msg", "caption" => "Transmission completion", "icon" => $completeicon, "body" => $completemsg, "buttons" => $Button['Close']. "|window.close();" ); if ($continuously) { $Msg['buttons'] .= ",Next >>|location.href='survey.php'"; } if ($sendmailpasth && preg_match("/^[\w\.\-]+\@[\w\-]+\.[\w\.\-]+$/", $mailto)) { /* $mailEncode の設定でiso2022jpに加え、utf-8での送信にも対応 */ $body = preg_replace("/[\t]/", "", $body); $subject = "$pagetitle | $clientname"; if (preg_match("/utf/i", $mailEncode)) { $mailbody = $body; } else { $subject = subjectiso2022($subject, "UTF-8"); $mailbody = mb_convert_encoding($body, "JIS", "UTF-8"); } if (send_email($sendmailpasth, $subject, $from, $mailto, $body, $cc, $bcc)) { $Msg = array( "mode" => "err", "caption" => "Send mail Error", "icon" => $erroricon, "body" => $senderrmsg, "buttons" => $Button['Close']. "|window.close();" ); } } } elseif ($_REQUEST['CMD'] == "escape") { !is_dir("escape") && mkdir("escape"); $fieldData = array(); foreach ($REQUEST_VALUES as $value) { list($key, $ans) = split("\t", str_replace(":", ":", $value)); $ans = preg_replace("/\/$/", "", $ans); list($no, $que) = split(":", $key); $fieldData[] = "$no=$ans"; } file_put_contents("escape/". $_REQUEST['CMD_ID']. ".dat", join("\t", $fieldData)); $Msg = array( "mode" => "msg", "caption" => "一時中止", "icon" => $completeicon, "body" => "アンケートを一時中止しました。
再開時には次のキーが必要になります。
キー:[". $_REQUEST['CMD_ID']. "]
再開キーを忘れてしまうと最初からご回答いただかねければなりません。 必ず控えておいてください。", "buttons" => "Close|window.close();" ); } !isset($_REQUEST['status']) && $_REQUEST['status'] = 1; $_REQUEST['status']++; } $html = ""; !$_REQUEST['CMD'] && $_REQUEST['CMD_ID'] = createid(); $html = ""; $sauce = preg_replace("/[\t\r\n]/", "", file_get_contents($saucefile)); $sauce = preg_replace("/()/i", "\n$1\n", $sauce); $sauce = preg_replace("/(<\/textarea>)/i", "$1\n", $sauce); $sauce = preg_replace("/()/i", "\n$1", $sauce); $sauce = preg_replace("/()/i", "\n$1\n", $sauce); $Html = split("\n", $sauce); if ($escape && $_REQUEST['CMDreopeningID']) { if (is_file("escape/". $_REQUEST['CMDreopeningID']. ".dat")) { $_REQUEST['CMD_ID'] = $_REQUEST['CMDreopeningID']; $buffer = file_get_contents("escape/". $_REQUEST['CMDreopeningID']. ".dat"); $values = preg_split("/[\t\n]/", $buffer); foreach($values as $line) { list($key, $val) = split("=", $line); $Data[$key] = $val; if (preg_match("/\//", $val)) { $$key = split("\/", $val); } } header("Content-type:text/html; charset=utf-8;"); foreach ($Html as $line) { if (preg_match("//", $line, $m)) { $inp = $m[0]; $key = $m[1]; if ($Data[$key] != '') { if (preg_match("/type=\"(\w+?)\"/i", $inp, $n)) { $type = $n[1]; if (preg_match("/text/i", $type)) { if (is_array($$key)) { $value = join("/", $$key); } else { $value = $Data[$key]; } $line = preg_replace("/()/", "$1$value$2", $line); } elseif (preg_match("/radio/i", $type)) { preg_match("/value=\"(.+?)\"/i", $inp, $o); if ($Data[$key] == $o[1]) { $line = preg_replace("/()/", "$1 checked$2", $line); } } elseif (preg_match("/checkbox/i", $type)) { preg_match("/value=\"(.+?)\"/i", $inp, $o); if (is_array($$key) && in_array($o[1], $$key)) { $line = preg_replace("/()/", "$1 checked$2", $line); $i = array_search($o[1], $$key); array_splice($$key, $i, 1); } } } } } elseif (preg_match("/().*(<\/textarea?>)/", $line, $m)) { $inp = $m[0]; $key = $m[2]; if ($Data[$key] != '') { $line = preg_replace("/().*(<\/textarea?>)/", $m[1]. $Data[$key]. $m[4], $line); } } elseif (preg_match("/.*<\/select?>/", $line, $m)) { $inp = $m[0]; $key = $m[1]; if ($Data[$key] != '') { $array = split("\/", $Data[$key]); foreach ($array as $l) { $line = preg_replace("/value=\"$l\"/i", "selected value=\"$l\"", $line); } } } $newHtml[] = $line; } $Html = $newHtml; } else { $Msg = array( "mode" => "err", "caption" => "Resumption Error", "icon" => $erroricon, "body" => $escape_err_msg, "buttons" => $Button['Close']. "|window.close();" ); } } $cgimode = false; foreach ($Html as $line) { $line = preg_replace("//", "$clientname $pagetitle", $line); $line = preg_replace("/()/i", "", $line); if ($_REQUEST['CMD'] || isset($Msg) || ($upw && $upw != $_REQUEST['CMD_upw']) || (isset($_REQUEST['pw']) && ($_REQUEST['pw'] == $root || $_REQUEST['pw'] == $admin))) { 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); $html .= $left; if ($upw && $upw != $_REQUEST['CMD_upw']) { $loginmsg = preg_replace("/(\r\n|[\r\n])/", "
", $loginmsg); $html .= "

ログイン

$loginmsg


パスワード:




"; } elseif ($_REQUEST['CMD'] == "confirm") { /* * 確認画面の表示 * */ $html .= "
"; if ($localarea) { $html .= " "; } $html .= "
$confirm_header
"; if ($relation && $_REQUEST[$relay_field] != '') { $html .= "
関連情報
"; $html .= getrelation($_REQUEST[$relay_field], 0); $html .= "

"; } $html .=<<<_ _; $i = 1; $section = 0; foreach ($REQUEST_VALUES as $value) { list($name, $val) = split("\t", $value); while(preg_match("/\/$/", $val)) { $val = preg_replace("/\/$/", '', $val); } if (!preg_match("/^CMD/", $name)) { if ($i % 2 == 0) { $odd = "even"; } else { $odd = "odd"; } $val = str_replace('_', ' ', $val); $que = str_replace('_', ' ', $name); list($no, $q) = split(":", $que); if ($no == $prev) { $class= "p3em"; $trclass = "sameSection"; $que = $q; } else { $section++; $class= "str"; $trclass = "newSection"; $que = "$no: $q"; } if ($section % 2 == 0) { $sectionClass = "sectionEven"; } else { $sectionClass = "sectionOdd"; } $prev = $no; $que = preg_replace("/^(.+):/", "$1: ", $que); if ($br) { $que = preg_replace("/$br/", "
", $que); $name = preg_replace("/$br/", "", $name); } $html .= " "; $i++; } } $html .= "
$fieldtitle $anstitle
$que
"; if ($val != '') { if (count($Legend) && ($val == '0' || strlen($val) == 1 && ($val >= 1 && $val <= 5))) { $html .= $Legend[$val]; } else { $val = str_replace("\r", "
", $val); $html .= $val; } } else { $html .= " "; } $html .= "

$confirmmsg
"; } elseif (isset($Msg['caption'])) { /* * 全てのメッセージの生成と表示 * */ $html .= "
". $Msg['caption']. "
". $Msg['body']. "

"; $Buttons = split(",", $Msg['buttons']); foreach ($Buttons as $val) { list($name, $action) = split("\|", $val); $html .= " "; } $html .= "
"; } elseif(isset($_REQUEST['pw']) && ($_REQUEST['pw'] == $root || $_REQUEST['pw'] == $admin)) { if ($_REQUEST['pw'] == $root) { if ($_REQUEST['CMD'] == "del") { $sql = "DELETE FROM `$tablename` WHERE `ID`='". $_REQUEST['ID']. "';"; mysql_query($sql); $_REQUEST['CMD'] = "anslistview"; } elseif ($_REQUEST['CMD'] == "deleteTable") { mysql_query("DELETE FROM `SystemClientTable` WHERE `ID`='". $_REQUEST['id']. "';"); mysql_query("DROP TABLE `". $_REQUEST['table']. "`;"); $_REQUEST['CMD'] = "tablelist"; } } $html .= "

"; if (($_REQUEST['pw'] == $root || $anslistview) && $_REQUEST['CMD'] == 'anslistview') { /* 回答一覧の表示 */ $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; $html .= "
現在までの総回答数 $max 件 "; foreach ($listfields as $line) { list($key, $title, $align) = split(",", $line); $html .= " "; } if ($_REQUEST['pw'] == $root) { $html .= " "; } $html .= ""; while($Data = mysql_fetch_assoc($rs)) { $data = dbfields($Data['Data']); $html .= " "; 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]; } */ $html .= " "; } if ($_REQUEST['pw'] == $root) { $html .= " "; } $html .= ""; $no++; } $html .= "
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 = ""; } $html .=<<<_
$firstbutton $prevbutton $nextbutton $lastbutton
_; } $html .= "
"; } elseif ($onetime && ($_REQUEST['CMD'] == 'targetlist' || $_REQUEST['CMD'] == 'onetimelist')) { is_file("../$onetime_url") && $Onetimelist = file("../$onetime_url"); $onetimeCnt = count($Onetimelist); $pageview = 50; !isset($_REQUEST['start']) && $_REQUEST['start'] = 0; $sql = "SELECT * FROM `$tablename`"; $rs = mysql_query($sql); $ansCnt = mysql_num_rows($rs); if ($_REQUEST['CMD'] == 'targetlist') { if ($_REQUEST['flg']) { $listtitle = "アンケート対象者一覧表"; } else { $listtitle = "未回答対象者一覧表"; } } else { $listtitle = "発行済みワンタイム一覧表"; } $html .= "

$listtitle

"; if ($onetime_csv && is_file("../$onetime_csv")) { $Target = file("../$onetime_csv"); $targetCnt = count($Target); $html .= " アンケート対象者 $targetCnt 名中、"; } $html .= " 現在までのワンタイム発行数 $onetimeCnt 件、回答数 $ansCnt 件"; if ($_REQUEST['CMD'] == 'targetlist' && !$targetonry && $_REQUEST['flg']) { $html .= "

※未登録のメールアドレスを受け付ける設定になっていますので、一覧内でも他のメールアドレスで回答済みの場合があります。

"; } $html .= " "; $_REQUEST['CMD'] != 'targetlist' && $html .= " "; $html .= " "; if ($_REQUEST['CMD'] == 'targetlist') { $html .= " "; } $html .= " "; !$_REQUEST['start'] && $_REQUEST['start'] = 0; $i = $_REQUEST['start']; if ($_REQUEST['CMD'] == 'targetlist') { /* 対象者名簿が有る場合 */ $row = 1; $handle = fopen("../$onetime_csv", "r"); while (($data = fgetcsv($handle)) !== FALSE) { $view = 1; $one = " "; $ans = " "; if ($onetimekey = array_values(preg_grep("/\t$data[1]\t/", $Onetimelist))) { list($key, $mail, $date) = split("\t", $onetimekey[0]); list($one, $time) = split(" ", $date); list($key, $mail) = split("\t", $onetimekey[0]); $rset = mysql_query("SELECT * FROM `$tablename` WHERE `Data` LIKE '%\tkey=$key\t%'"); if (mysql_num_rows($rset)) { $ans = "済"; $_REQUEST['flg'] && $view = 0; } } if ($view) { $html .= " "; $row++; } } fclose($handle); } else { /* 対象者名簿が無い場合 */ $row = 1; foreach ($Onetimelist as $line) { $ans = " "; $id = " "; list($key, $mail, $date, $name, $dummy) = preg_split("/[\t\n]/", $line); if ($target = array_values(preg_grep("/,(|\")$mail(|\")/", $Target))) { list($id, $email, $name, $dummy) = split(",", $target[0]); $id = str_replace('"', '', $id); $name = str_replace('"', '', mb_convert_encoding($name, "UTF-8", "SJIS")); } !$name && $name = " "; $rset = mysql_query("SELECT * FROM `$tablename` WHERE `Data` LIKE '%\tkey=$key\t%'"); if (mysql_num_rows($rset)) $ans = "済"; $html .= " "; $row++; } } $html .= "
No. コード発行日時E-Mail 氏名ワンタイム回答
$row ". $data[0]. " ". $data[1]. " ". mb_convert_encoding($data[2], "UTF-8", "SJIS"). " $one $ans
$row $id $date $mail $name $ans
"; } elseif ($_REQUEST['pw'] == $root && $_REQUEST['CMD'] == "list") { $html .= "
"; !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']. ", 100"; $rs = mysql_query($sql); $view = mysql_num_rows($rs); $no = $_REQUEST['start'] + 1; while($Data = mysql_fetch_assoc($rs)) { $Tabs = split("\t", $Data['Data']); $data = ""; for($i = 0; $i <= 5; $i++) { list($a, $b) = split("=", $Tabs[$i]); $data && $data .= "    "; $data .= $b; } $data .= "..."; $html .= " "; $no++; } $nextbutton = ""; $next = $_REQUEST['start'] + $view; if ($max > $next) { $nextbutton = ""; } $html .= "
No. Data
$no $data
$nextbutton
"; } elseif ($_REQUEST['pw'] == $root && $_REQUEST['CMD'] == "tablelist") { $rs = mysql_query("SELECT * FROM `SystemClientTable`"); $html .= " "; $no = 1; while($User = mysql_fetch_assoc($rs)) { $html .= " "; $no++; } $html .= "
No. Table Name 企業/団体名 回答数 コマンド
$no ". $User['Tablename']. " ". $User['Client']. " ". $Tb['Cnt']. "
"; } else { $html .= "
    "; if ($_REQUEST['pw'] == $root) { $html .= "
  • 監理者専用モードです。 システムの動作環境は、initialize.phpを開き、直接設定してください。
  • MySQLデータベース専用のシステムですのでCSVやデータファイルを設定する必要は有りません。 データのバックアップやCSV出力は、データベースがリアルタイムに生成してダウンロードすることができます。
  • バックアップはCSVデータと異なり、万一の場合にデータベースにインポート可能な形式です。 巨大なデータの場合は、定期的に保存しておくことをお勧めします。
  • [クライアント一覧]では、すべてのクライアント情報の参照とバックアップ、削除を行えます。 削除は、データベースから物理的に削除されますので、削除前には必ずバックアップをおとりください。
  • "; } else { $html .= "
  • こちらは、管理者専用モードで、さまざまな情報の閲覧が可能です。
  • "; } $html .= "
  • 集計表は、全体はもちろん、分類している場合は、それぞれを集計できます。
  • 回答一覧は、回答内容の一部を抜粋して一覧で表示します。
  • 対象者一覧では、アンケート対象者の名簿をご提供いただいた場合に、 各対象者が、ワンタイムURLを既に発行済み及び、既にアンケートにもお答えいただいているなどの詳細を表示します。
  • 未回答対象者は、アンケート対象者名簿に基き、未回答の方を一覧で表示します。 対象者名簿以外のメールアドレスも受け付ける設定の場合は、他のメールアドレスでアンケートにお答えいただいている場合がありますのでご注意ください。
  • ワンタイムボタンは、ワンタイム発行済みのメールアドレスの一覧を表示します。 発行済みにもかかわらず、未回答の方もマークが付けられていますので一目で識別できます。
"; } } } } else { /* * 設問htmlにワンタイムURLのキーを挿入 */ $line = str_replace('id="CMD_key" value=""', 'id="CMD_key" value="'. $_REQUEST['key']. '"', $line); $line = str_replace('id="CMD_upw" value=""', 'id="CMD_upw" value="'. $_REQUEST['CMD_upw']. '"', $line); } if (!$cgimode) $html .= $line. "\n"; } header("Content-type:text/html; charset=utf-8;"); if (!isset($_REQUEST['src'])) { /* $html = preg_replace("/[\t\r]/", "", $html); $html = str_replace("\n", " ", $html); $html = str_replace("> <", "><", $html); */ } echo $html; exit; function getrelation($key, $op) { $text = ""; $data = ""; global $relation, $relation_column; if ($relation && is_file($relation)) { $Csv = file($relation); $headers = array_shift($Csv); $headers = preg_replace("/[\r\n\"]/", "" , $headers); $Legend = split(",", $headers); foreach ($Csv as $c) { $c = preg_replace("/[\r\n\"]/", "", $c); $Columns = split(",", $c); $idx = $relation_column - 1; if ($Columns[$idx] == $key) { $i = 0; $j = 1; foreach ($Legend as $col) { $data && ($data .= "\t"); $data .= "$col=$Columns[$i]"; $text .= "

$col

:

$Columns[$i]

"; $i++; $j++; } $text .= "
"; break; } } } $op && ($text = $data); return($text); } ?>