$name,'kana'=>$kana,'pref'=>$pref,'phone'=>$phone,'email'=>$email,'com'=>$com); $smarty -> assign('list',$list); $smarty -> display('inq_index.html'); break; case "confirm": if(isset($_POST['reset'])){ $name = ""; $kana = ""; $pref = ""; $phone = ""; $email = ""; $com = ""; header( "Location: ./inq.html"); exit; } if(isset($_POST['form'])){ $name = $_POST['name']; if(empty($name)){ $error1 = _ER_1_; } $kana = $_POST['kana']; if(empty($kana)){ $error2 = _ER_1_; } else{ $kana_b = str_replace(" ","",$kana); $kana_b = str_replace(" ","",$kana_b); $kana_b = mb_convert_kana($kana_b,"CKV","UTF-8"); if(C_Kata($kana_b)){ $error3 = _ER_5_; } else{ $kana = mb_convert_kana($kana,"CKV","UTF-8"); } } $pref = $_POST['pref']; $phone = $_POST['phone']; if(!empty($phone)){ if(PHONE0($phone)){ $error3 = _ER_3_; } } $email = $_POST['email']; if(empty($email)){ $error4 = _ER_1_; } elseif(MATCH_EMAIL($email)){ $error4 = _ER_4_; } $com = $_POST['com']; if(empty($com)){ $error5 = _ER_1_; } $smarty = new MySmarty; $list = array('name'=>$name,'kana'=>$kana,'pref'=>$pref,'phone'=>$phone,'email'=>$email,'com'=>$com); $error = array('error1'=>$error1,'error2'=>$error2,'error3'=>$error3,'error4'=>$error4,'error5'=>$error5); $smarty -> assign('list',$list); $smarty -> assign('elist',$error); $smarty -> display('inq_confirm.html'); exit; } break; case "complete": if(isset($_POST['form'])){ $name = $_POST['name']; $kana = $_POST['kana']; $phone = $_POST['phone']; $email = $_POST['email']; $com = $_POST['com']; $pref = $_POST['pref']; mb_language("Ja") ; mb_internal_encoding("UTF-8") ; $mailto = $email; $mailfrom = _FROM_MAIL; $mailfromname = _FROM_NAME; $subject = "お問合わせフォーム送信(控え)"; $mailto = mb_convert_kana($mailto,"a","UTF-8"); $mailfrom = mb_convert_kana($mailfrom,"a","UTF-8"); if (trim($mailfromname)==""){$mailfromname=$mailfrom;} $content .=$name." 様\n"; $content .="\n"; $content .="\n"; $content .="お問い合わせありがとうございます。\n"; $content .="このメールは自動送信されております。\n"; $content .="3営業日以内のご回答を心掛けておりますが、これを過ぎても何ら返信がない場合は\n"; $content .="お手数でも今一度このメールに返信の形、若しくはお電話にてご連絡をお願いします。\n"; $content .="\n"; $content .="\n"; $content .="------------------------------\n"; $content .="ご氏名:".$name."(".$kana.")様\n"; $content .="お住まいの地域:".$pref."\n"; $content .="連絡先電話番:".$phone."\n"; $content .="メールアドレス:".$email."\n"; $content .="ご質問内容:".$com."\n"; $content .="------------------------------\n"; $content .="\n"; $content .="リサイクルプロショップ (有限会社玲菜貿易)\n"; $content .="〒142-0064 東京都品川区旗の台6-27-11\n"; $content .="フリーダイヤル : 0120-56-0609\n"; $content .="http://www.kinkaitori-pro.com/\n"; $content .="info@kinkaitori-pro.com\n"; $content .="\n"; $header="From:" .mb_encode_mimeheader($mailfromname) ."<" .$mailfrom .">"; $mailformaction = mb_send_mail($mailto,$subject,$content,$header,$mailfrom); if($mailformaction){ header( "Location: ./inq.html?mode=v"); exit; } else{ $error1 = _NG_11_; } } else{ $error1 = _ER_ACCESS_; } $smarty = new MySmarty; $error = array('error1'=>$error1); $smarty -> assign('elist',$error); $smarty -> display('inq_complete.html'); exit; break; case "v": $error1 = _OK_11_; $smarty = new MySmarty; $error = array('error1'=>$error1); $smarty -> assign('elist',$error); $smarty -> display('inq_complete.html'); break; } ?>