template_dir = "./"; $Smarty->compile_dir = BASE_PATH."templates_c/careers"; session_start(); /*--------------------------------------------------------------------------------------*/ //入力チェック /*--------------------------------------------------------------------------------------*/ if($_POST['mode']=="check" || $_POST['mode']=="input"){ $error = $Entry->inputCheck($_POST); if($error){ $Smarty->assign('error',$error); unset($_POST['mode']); } } /*--------------------------------------------------------------------------------------*/ //チケット確認 /*--------------------------------------------------------------------------------------*/ if($_POST['mode']=="check" || $_POST['mode']=="input"){ if(empty($_SESSION['ticket']) || $_POST['ticket']!=$_SESSION['ticket']){ header("Location: index.php"); exit; } } /*--------------------------------------------------------------------------------------*/ //送信処理 /*--------------------------------------------------------------------------------------*/ if($_POST['mode']=="check"){ $subject = "ヒガシマル 採用情報エントリー"; $body = $Entry->mailFormat($_POST); $from = $_POST['email']; $fromname = $_POST['name']; $mail = new PHPMailer(); $mail->CharSet = "iso-2022-jp"; $mail->Encoding = "7bit"; mb_language("japanese"); mb_internal_encoding("SJIS"); $mail->AddAddress(ENTRY_TO); $mail->From = $from; $mail->FromName = mb_encode_mimeheader(mb_convert_encoding($fromname,"JIS","UTF-8")); $mail->Subject = mb_encode_mimeheader(mb_convert_encoding($subject,"JIS","UTF-8")); $mail->Body = mb_convert_encoding($body,"JIS","UTF-8"); if(!$mail->Send()){ echo "システムエラーによりメールの送信に失敗しました"; exit; } //セッションクリア session_unset(); //完了画面へ header("Location: thanks.html"); exit; /*--------------------------------------------------------------------------------------*/ //確認画面 /*--------------------------------------------------------------------------------------*/ }else if($_POST['mode']=="input"){ //hidden生成 $hidden = $Entry->makeHiddens($_POST); $Smarty->assign('hidden',$hidden); //出力用 $output['birth'] = date("Y-m-d",makeTimeStampArray($_POST['birth'])); $Smarty->assign('output',$output); //出力 $Smarty->display('entry02.tpl'); exit; /*--------------------------------------------------------------------------------------*/ //入力画面 /*--------------------------------------------------------------------------------------*/ }else{ //チケット生成 $ticket = make_ticket(); $_SESSION['ticket'] = $ticket; $Smarty->assign('ticket',$ticket); //生年月日 if($_POST){ $input['birth'] = date("Y-m-d",makeTimeStampArray($_POST['birth'])); }else{ $input['birth'] = "1975-01-01"; } //都道府県選択 $input['pref'] = makePrefSelect(); $Smarty->assign('input',$input); //出力 $Smarty->display('entry01.tpl'); exit; } /*--------------------------------------------------------------------------------------*/ ?>