$style,'ksize'=>$ksize, 'item_name'=>$item_name,'item_num'=>$item_num,'item_com'=>$item_com, 'name'=>$name,'kana'=>$kana, 'pcode1'=>$pcode1,'pcode2'=>$pcode2, 'pref'=>$pref,'addr'=>$addr, 'phone'=>$phone,'email'=>$email,'cont'=>$cont,'com'=>$com); $smarty -> assign('list',$list); $smarty -> display('k-form_index.html'); break; case "confirm": if(isset($_POST['reset'])){ $style = ""; $ksize = ""; $item_name = ""; $item_num = ""; $item_com = ""; $name = ""; $kana = ""; $pcode1 = ""; $pcode2 = ""; $pref = ""; $addr = ""; $phone = ""; $email = ""; $cont = ""; $com = ""; header( "Location: ./k-form.html"); exit; } else{ $style = $_POST['style']; $ksize = $_POST['ksize']; $item_name = $_POST['item_name']; $item_num = $_POST['item_num']; $item_com = $_POST['item_com']; if(empty($item_com)){ $error1 = _ER_1_; } $name = $_POST['name']; if(empty($name)){ $error2 = _ER_1_; } $kana = $_POST['kana']; if(empty($kana)){ $error3 = _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"); } } $pcode1 = $_POST['pcode1']; $pcode2 = $_POST['pcode2']; if(empty($pcode1) || empty($pcode2)){ $error4 = _ER_1_; } elseif(POSTCODE3($pcode1)){ $error4 = _ER_6_; } elseif(POSTCODE4($pcode2)){ $error4 = _ER_6_; } $pref = $_POST['pref']; if(empty($pref)){ $error5 = _ER_2_; } $addr = $_POST['addr']; if(empty($addr)){ $error6 = _ER_1_; } $phone = $_POST['phone']; if(!empty($phone)){ if(PHONE0($phone)){ $error7 = _ER_3_; } } $email = $_POST['email']; if(empty($email)){ $error8 = _ER_1_; } elseif(MATCH_EMAIL($email)){ $error8 = _ER_4_; } $cont = $_POST['cont']; $com = $_POST['com']; $smarty = new MySmarty; $list = array('style'=>$style,'ksize'=>$ksize, 'item_name'=>$item_name,'item_num'=>$item_num,'item_com'=>$item_com, 'name'=>$name,'kana'=>$kana, 'pcode1'=>$pcode1,'pcode2'=>$pcode2, 'pref'=>$pref,'addr'=>$addr, 'phone'=>$phone,'email'=>$email,'cont'=>$cont,'com'=>$com); $error = array('error1'=>$error1,'error2'=>$error2,'error3'=>$error3,'error4'=>$error4,'error5'=>$error5, 'error6'=>$error6,'error7'=>$error7,'error8'=>$error8); $smarty -> assign('list',$list); $smarty -> assign('elist',$error); $smarty -> display('k-form_confirm.html'); exit; } break; case "complete": if(isset($_POST['form'])){ $style = $_POST['style']; $ksize = $_POST['ksize']; $item_name = $_POST['item_name']; $item_num = $_POST['item_num']; $item_com = $_POST['item_com']; $name = $_POST['name']; $kana = $_POST['kana']; $pcode1 = $_POST['pcode1']; $pcode2 = $_POST['pcode2']; $pref = $_POST['pref']; $addr = $_POST['addr']; $phone = $_POST['phone']; $email = $_POST['email']; $cont = $_POST['cont']; $com = $_POST['com']; 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 .="買取希望スタイル:".$style."\n"; $content .="キットサイズ:".$ksize."\n"; $content .="商品名・数量:".$item_name."(".$item_num.")\n"; $content .="詳細情報:".$item_com."\n"; $content .="\n"; $content .="ご氏名:".$name."(".$kana.")様\n"; $content .="郵便番号:".$pcode1."-".$pcode2."\n"; $content .="ご住所:".$pref.$addr."\n"; $content .="連絡先電話番号:".$phone."\n"; $content .="メールアドレス:".$email."\n"; $content .="ご連絡方法:".$cont."\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: ./k-form.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('k-form_complete.html'); exit; break; case "v": $error1 = _OK_11_; $smarty = new MySmarty; $error = array('error1'=>$error1); $smarty -> assign('elist',$error); $smarty -> display('k-form_complete.html'); break; } ?>