<commit_before><?php

namespace Machigai\GameBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Machigai\GameBundle\Controller\BaseController;

class HelpController extends BaseController
{
    public function indexAction()
    {
    	$user = $this->getUser();

		return $this->render('MachigaiGameBundle:Help:index.html.twig',array('user'=>$user));
    }

    public function howtoplayAction()
    {
	return $this->render('MachigaiGameBundle:Help:howtoplay.html.twig');
    }

    public function termsAction()
    {
	return $this->render('MachigaiGameBundle:Help:terms.html.twig');
    }

    public function formAction()
    {
	$request = $this->getRequest();
        $form = $this->createFormBuilder()
		 ->setMethod('GET')
		 ->add('title', 'text',array('label'=>false))
		 ->add('email', 'email',array('label'=>false))
		 ->add('content', 'textarea',array('label'=>false))
		 ->add('confirm', 'submit', array('label'=>'入力内容確認'))
		 ->getForm();
	$form->handleRequest($request);		
	if( $form->get('confirm')->isClicked() ){
	 $data = $form->getData();
	 $form = $this->createFormBuilder()
		 ->setAction($this->generateUrl('HelpInquiryFormDo'))
		 ->setMethod('POST')
		 ->add('title', 'hidden',array('label'=>false))
		 ->add('email', 'hidden',array('label'=>false))
		 ->add('content', 'hidden',array('label'=>false))
		 ->add('do', 'submit', array('label'=>'登録'))
		 ->add('ammend','button',array('label'=>'修正', 'attr'=>array('onclick'=>'history.back()')))
		 ->getForm();
	 $form->setData($data);
	 $form->bind($request);
     $inquiryData = $form->getData();
         return $this->render('MachigaiGameBundle:Help:confirm.html.twig', array('form' => $form->createView(),'inquiryData'=>$inquiryData) );
	}else{
	// 通常のGETリクエスト
         return $this->render('MachigaiGameBundle:Help:form.html.twig', array('form' => $form->createView()) );
	}
    }
    
    public function inquiryFormDoAction(){
	$request = $this->getRequest();
        $form = $this->createFormBuilder()
		 ->add('title', 'text',array('label'=>'件名'))
		 ->add('email', 'email',array('label'=>'メールアドレス'))
		 ->add('content', 'textarea',array('label'=>'お問い合わせ内容'))
		 ->add('do', 'submit', array('label'=>'登録'))
		 ->getForm();
	$form->bind($request);
	$inquiryData = $form->getData();

		if ( $form->get('do')->isClicked() && $form->isValid()){
			
			$message = \Swift_Message::newInstance()
	        ->setSubject('【まちがいさがし放題】お客様からのお問い合わせ')
	        ->setFrom($inquiryData['email'])
	        ->setTo('<EMAIL>')
	        ->setBody("件名:".$inquiryData['title']."\n"."メールアドレス:".$inquiryData['email']."\n"."本文:".$inquiryData['content']);
	        
	        $this->get('mailer')->send($message);

			return $this->redirect($this->generateUrl('HelpInquiryFormComplete'));
		}
    }
    public function inquiryFormCompleteAction(){
		return $this->render('MachigaiGameBundle:Help:inquiryFormComplete.html.twig');
    }
    public function inquiryAction()
    {
		return $this->render('MachigaiGameBundle:Help:inquiry.html.twig');
    }
    public function privacyPolicyAction(){
		return $this->render('MachigaiGameBundle:Help:privacyPolicy.html.twig');
    }

}<commit_msg>refs #192 【ヘルプ】お問い合わせの送信先の設定<commit_after><?php

namespace Machigai\GameBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Machigai\GameBundle\Controller\BaseController;

class HelpController extends BaseController
{
    public function indexAction()
    {
    	$user = $this->getUser();

		return $this->render('MachigaiGameBundle:Help:index.html.twig',array('user'=>$user));
    }

    public function howtoplayAction()
    {
	return $this->render('MachigaiGameBundle:Help:howtoplay.html.twig');
    }

    public function termsAction()
    {
	return $this->render('MachigaiGameBundle:Help:terms.html.twig');
    }

    public function formAction()
    {
	$request = $this->getRequest();
        $form = $this->createFormBuilder()
		 ->setMethod('GET')
		 ->add('title', 'text',array('label'=>false))
		 ->add('email', 'email',array('label'=>false))
		 ->add('content', 'textarea',array('label'=>false))
		 ->add('confirm', 'submit', array('label'=>'入力内容確認'))
		 ->getForm();
	$form->handleRequest($request);		
	if( $form->get('confirm')->isClicked() ){
	 $data = $form->getData();
	 $form = $this->createFormBuilder()
		 ->setAction($this->generateUrl('HelpInquiryFormDo'))
		 ->setMethod('POST')
		 ->add('title', 'hidden',array('label'=>false))
		 ->add('email', 'hidden',array('label'=>false))
		 ->add('content', 'hidden',array('label'=>false))
		 ->add('do', 'submit', array('label'=>'登録'))
		 ->add('ammend','button',array('label'=>'修正', 'attr'=>array('onclick'=>'history.back()')))
		 ->getForm();
	 $form->setData($data);
	 $form->bind($request);
     $inquiryData = $form->getData();
         return $this->render('MachigaiGameBundle:Help:confirm.html.twig', array('form' => $form->createView(),'inquiryData'=>$inquiryData) );
	}else{
	// 通常のGETリクエスト
         return $this->render('MachigaiGameBundle:Help:form.html.twig', array('form' => $form->createView()) );
	}
    }
    
    public function inquiryFormDoAction(){
	$request = $this->getRequest();
        $form = $this->createFormBuilder()
		 ->add('title', 'text',array('label'=>'件名'))
		 ->add('email', 'email',array('label'=>'メールアドレス'))
		 ->add('content', 'textarea',array('label'=>'お問い合わせ内容'))
		 ->add('do', 'submit', array('label'=>'登録'))
		 ->getForm();
	$form->bind($request);
	$inquiryData = $form->getData();

		if ( $form->get('do')->isClicked() && $form->isValid()){
			
			$message = \Swift_Message::newInstance()
	        ->setSubject('【まちがいさがし放題】お客様からのお問い合わせ')
	        ->setFrom($inquiryData['email'])
	        ->setTo('<EMAIL>')
	        ->setBody("件名:".$inquiryData['title']."\n"."メールアドレス:".$inquiryData['email']."\n"."本文:".$inquiryData['content']);
	        
	        $this->get('mailer')->send($message);

			return $this->redirect($this->generateUrl('HelpInquiryFormComplete'));
		}
    }
    public function inquiryFormCompleteAction(){
		return $this->render('MachigaiGameBundle:Help:inquiryFormComplete.html.twig');
    }
    public function inquiryAction()
    {
		return $this->render('MachigaiGameBundle:Help:inquiry.html.twig');
    }
    public function privacyPolicyAction(){
		return $this->render('MachigaiGameBundle:Help:privacyPolicy.html.twig');
    }

}
{'fraction_non_alphanumeric': 0.22017916077322017, 'fraction_numerical': 0.0004714757190004715, 'mean_word_length': 4.728172817281728, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 155, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5103089', 'n_tokens_mistral': 2255, 'n_tokens_neox': 2147, 'n_words': 258}