1 && !$_REQUEST[editfield] && $_REQUEST[action] == 'sendmail') { $now = jst_time(time(), 7); $head = " No.[ $_REQUEST[mailID] ] $now --"; $index = 1; $mf = 0; $Csv = array($_REQUEST[mailID], $now); foreach ($Fields as $line) { $field = dbfields($line); $key = $field[Que]; $Csv[] = $_REQUEST[$key]; if (!$mf && $field[Type] == 11) { $from = $_REQUEST[$key]; $returnTo = $_REQUEST[$key]; $mf++; } elseif ($field[Type] == 12) { if ($attach) { $attach .= ",$System[path]/$System[datadir]/mail/upload/$_REQUEST[$key]"; } else { $attach = "$System[path]/$System[datadir]/mail/upload/$_REQUEST[$key]"; } } $body .= " [$key]: $_REQUEST[$key]"; $index++; } $subject = mb_convert_encoding($Setup[Title], 'JIS', 'UTF-8'); $mailbody = str_replace("\t", "", "$head$body"); $mailbody = str_replace("\r", "\n", $mailbody); $mailbody = mb_convert_encoding($mailbody, 'JIS', 'UTF-8'); $to = $Setup[To]; $Signature = $Setup[Signature]; if (!$to) { $Init[Adminmail]; $Signature = $Init[Signature]; } if (!$from) { list($id, $domain) = split("@", $to); $from = "nobody\@$domain"; } send_email($Init[sendmail], $subject, $from, $to, $mailbody, $Setup[Cc], $Setup[Bcc], $attach); if ($fp = fopen("$System[path]/$System[datadir]/mail/$_REQUEST[ID].cgi", 'a')) { fputcsv($fp, $Csv); } if ($returnTo && $Setup['Return']) { $subject = mb_convert_encoding("RE: $Setup[Title]", 'JIS', 'UTF-8'); $mailbody = " $head $Setup[Returnmessage] -- $body $Signature"; $mailbody = str_replace("\t", "", $mailbody); $mailbody = str_replace("\r", "\n", $mailbody); $mailbody = mb_convert_encoding($mailbody, 'JIS', 'UTF-8'); $attach = ""; $Setup[File] && $attach = "$_SERVER[DOCUMENT_ROOT]$Setup[File]"; send_email($Init[sendmail], $subject, $to, $from, $mailbody, '', '', $attach); } } if (!$Setup[Template]) { list($Setup[Template], $val) = split(":", $Template[0]); } $template = "$_SERVER[DOCUMENT_ROOT]$Setup[Template]"; $inport = 0; if (is_file($template)) { $Html = file($template); foreach ($Html as $line) { $line = mb_convert_encoding($line, 'UTF-8', $Init[Encode]); $doc[Subject] = tag_decode($doc[Subject], true); $title = strip_tags($doc[Subject]); $line = preg_replace("//i", $Setup[Title], $line); if (preg_match("//", $line, $m)) { list($left,$right) = split($m[0], $line); $line = $left. file_get_contents("$protocol$_SERVER[SERVER_NAME]$m[1]"). $right; } elseif (preg_match("//", $line, $m)) { $inport = 0; list($left,$right) = split($m[0], $line); $line = $right; } elseif (preg_match("//", $line, $m)) { !$_REQUEST[mailID] && $_REQUEST[mailID] = createid(); $inport = 1; list($left,$right) = split($m[0], $line); if (!$Setup[nonStyle]) { if ($Setup[formAlign] == 1) { $formAlign = "align=\"center\""; } elseif ($Setup[formAlign] == 2) { $formAlign = "align=\"right\""; } else { $formAlign = "align=\"left\""; } if ($Setup[groupAlign] == 1) { $groupAlign = "center"; } elseif ($Setup[groupAlign] == 2) { $groupAlign = "right"; } else { $groupAlign = "left"; } if ($Setup[formBorder]) { $formtable =<<<_ #clientform #mailformtable {border-right:solid #$Setup[formBorder] 1px;border-bottom:solid #$Setup[formBorder] 1px;} #clientform #mailformtable td {border-top:solid #$Setup[formBorder] 1px;border-left:solid #$Setup[formBorder] 1px;} #clientform #mailformtable th {border-top:solid #$Setup[formBorder] 1px;border-left:solid #$Setup[formBorder] 1px;} _; } $Setup[formBgcolor] && $Setup[formBgcolor] = "#$Setup[formBgcolor]"; $Setup[queBgcolor] && $Setup[queBgcolor] = "#$Setup[queBgcolor]"; $Setup[queColor] && $Setup[queColor] = "#$Setup[queColor]"; $Setup[queBorder] && $queBorder = "outset 1px"; $Setup[valBgcolor] && $Setup[valBgcolor] = "#$Setup[valBgcolor]"; $Setup[valColor] && $Setup[valColor] = "#$Setup[valColor]"; $Setup[errBgcolor] && $Setup[errBgcolor] = "#$Setup[errBgcolor]"; $Setup[comColor] && $Setup[comColor] = "#$Setup[comColor]"; $Setup[groupBgcolor] && $Setup[groupBgcolor] = "#$Setup[groupBgcolor]"; $Setup[groupColor] && $Setup[groupColor] = "#$Setup[groupColor]"; $Setup[groupBorder] && $groupBorder = "outset 1px"; $Setup[areaHeight] && $Setup[areaHeight] = "$Setup[areaHeight]px"; $Setup[areaBorder] && $Setup[areaBorder] = "outset 1px"; !$Setup[lineHeight] && $Setup[lineHeight] = "20"; $Setup[lineHeight] && $Setup[lineHeight] = "$Setup[lineHeight]px"; $stylesheet =<<<_ _; } $Setup[Header] = tag_decode($Setup[Header], 1); $form =<<<_ $stylesheet
$Setup[Header]
印は必須項目です。
_; $Setup[lineColor] && $Setup[lineColor] = "#$Setup[lineColor]"; $index = 1; if (is_array($Fields)) { foreach ($Fields as $line) { $field = dbfields($line); if ($field[Group]) { $form .= " "; } $Required = ""; $dataflag = false; $field[Required] && $Required = ""; if ($Setup[formType] == 1) { $form .= " "; } elseif ($Setup[formType] == 2) { $form .= " "; } else { $form .= " "; } $name = $field[Que]; if ($_FILES[$name][name]) { $filename = $_FILES[$name][name]; list($fname, $ext) = split("[.]", $filename); $fname = createid(); $filename = "$fname$i.$ext"; $filepath = "$System[path]/$System[datadir]/mail/upload/$filename"; move_uploaded_file($_FILES[$name][tmp_name], $filepath); chmod($filepath, 0644); $value = $filename; } elseif (is_array($_REQUEST[$name])) { $value = join("/", $_REQUEST[$name]); $value = preg_replace("/\/$/", "", $value); } else { $value = trim($_REQUEST[$name]); } if (!$value) { if ($field[Type] >= 6 && $field[Type] <= 9) { if (is_array($_REQUEST[$name])) { $value = join("/", $_REQUEST[$name]); } else { $value = $_REQUEST[$name]; } } elseif ($field[Type] == 10) { $value = $_REQUEST["$name-zip"]; $_REQUEST["$name-pre"] && $value .= " ". $_REQUEST["$name-pre"]; $_REQUEST["$name-city"] && $value .= " ". $_REQUEST["$name-city"]; $_REQUEST["$name-addr"] && $value .= " ". $_REQUEST["$name-addr"]; } elseif ($field[Type] == 13 || $field[Type] == 14) { $value = $_REQUEST["$name-year"]; $_REQUEST["$name-month"] && $value .= "/". $_REQUEST["$name-month"]; $_REQUEST["$name-day"] && $value .= "/". $_REQUEST["$name-day"]; } else { $value = $_REQUEST[$name]; } } $value = trim($value); if (!$Required) { $dataflag = true; } else { if ($field[Type] == 11 && preg_match("/[\w\.\-]+\@[\w\.\-]+/", $value) && $value == $_REQUEST[$field["$name-2"]]) { $dataflag = true; } elseif ($value) { $dataflag = true; } } if ($_REQUEST[status] > 1 && $dataflag) { $form .= ""; if ($Setup[lineSpace]) { $form .= ""; } $index++; } } if ($Setup[prevImg]) { $prevButton = ""; } else { !$Setup[prevButton] && $Setup[prevButton] = "戻る"; $prevButton = ""; } if ($editfield || $_REQUEST[status] == 1) { if ($Setup[nextImg]) { $sendButton = ""; } else { !$Setup[nextButton] && $Setup[nextButton] = "確認ページへ"; $sendButton = ""; } } else { if ($Setup[sendImg]) { $sendButton = ""; } else { !$Setup[sendButton] && $Setup[sendButton] = "確認OK!! 送信する"; $sendButton = ""; if ($Setup[Policy]) { $str = "当サイトのプライバシーポリシーや利用規約に同意"; $Setup[policyPage] && $str = "$str"; $policy =<<<_ $str _; $check =<<<_ if (!document.getElementById('Policy').checked) { alert('当サイトのプライバシーポリシーと利用規約にご同意ください。'); return; } _; } } } $form .=<<<_
$field[Group]
Q$index $Required $field[longQue]
Q$index $Required $field[longQue]
$field[Que] $Required $value"; } else { $editfield++; $valfield = 'valfield'; $_REQUEST[status] > 1 && $valfield = 'errfield'; $form .= "". mailfield($field); } $form .= " $field[Unit]
"; if (!$Setup[lineImg]) { $form .= "
"; } $form .= "
$prevButton $policy $sendButton
_; $html .= $left. $form. $right; } !$inport && $html .= $line; } echo_encode($html); } else { errorpage(); } ?>