<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Survey extends CI_Controller
{
	public function __construct()
	{ 
		parent:: __construct();
		$this->load->model('common_model');
		$this->load->library('Utility');
	}
	public function index()
	{
		$langId = 2;
		if(get_cookie('lang'))
		{
			$langId = get_cookie('lang');
		}

		if($this->input->post())
		{
			//print_r($this->input->post()); die;
			//$to = 'testdevloper007@gmail.com';
			$to = 'sophie@castleevents.com';

			$sub = 'SURVEY FORM';
			$body= '<h2>SURVEY FOR GUESTS AND MEMBERS OF CASTLEEVENTS</h2>';
			
			$body.= '<h4 style="margin:0; line-height: 20px;">Does corona affect your need and desire to travel?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('radio-group').'</p>';

			/*$body.= '<h4 style="margin:0; line-height: 20px;">From which month would you like to travel again for a weekend trip or combined with a vacation?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('travel_month').'</p>';*/

			$body.= '<h4 style="margin:0; line-height: 20px;">Have you already attended one of our parties?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('radio-group1').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">If yes, how often?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('radio-group2').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Which of the following months you prefer the most for attending Castleevents?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.implode(' <br/> ',$this->input->post('months')).'</p>';

			/*$body.= '<h4 style="margin:0; line-height: 20px;">Which of the following parties would you like to attend?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.implode(' <br/> ',$this->input->post('radio-group4')).'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Would you agree to a quick corona test after arrival at the hotel, before admission to the party?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('radio-group5').'</p>';*/

			$body.= '<h4 style="margin:0; line-height: 20px;">Would you like to get to know other participants already the evening before?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('night-group').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Dinner</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('dinner').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Would you be interested in more parties and other theme?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('additional-parties').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Would a nun costume awakens erotic fantasies and would you (female) wearing it?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('costume').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Other ideas</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('other_ideas').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Me/My partner like the following dress code</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('dress_code').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Would you like to share meetings with other selected guests in addition to the castle events?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('radio-group3').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">If yes, which venue?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.implode(' <br/> ',$this->input->post('venue')).'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">The following would be an amazing place we recommend</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('location').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">We are very satisfied and happy with the parties of castleevents. From a scale of 1-10 which grade do you give us?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('party-rates').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">That would be desirable</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('desirable').'</p>';

			/*$body.= '<h4 style="margin:0; line-height: 20px;">Could you imagine sharing videos with other members?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('web-relaunch').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Would you like to receive or watch videos from other members?</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('watch-video').'</p>';*/

			$body.= '<h4 style="margin:0; line-height: 20px;">The most important functions for me are as follow.</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.implode(' <br/> ',$this->input->post('most-important')).'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">Suggestions for the future website:</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('future_website').'</p>';

			$body.= '<h4 style="margin:0; line-height: 20px;">We are</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; ">'.$this->input->post('we-are').'</p>';


			$body.= '<div style="border: 1px solid #b3975b; padding: 10px; margin: 10px 0">
						<ul style="list-style-type: none; padding: 0; margin: 0;">';

			$body.= '<li style="margin: 0 0 10px; padding:0; line-height: 10px;"><h4 style="margin: 0; margin-right:10px; line-height: 20px; display: inline-block; font-size: 16px;">My Name</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; display: inline-block; ">'.$this->input->post('name').'</p></li>';

			$body.= '<li style="margin: 0 0 10px; padding:0; line-height: 10px;"><h4 style="margin: 0; margin-right:10px; line-height: 20px; display: inline-block; font-size: 16px;">Name of my partner</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; display: inline-block; ">'.$this->input->post('partner_name').'</p></li>';


			$body.= '<li style="margin: 0 0 10px; padding:0; line-height: 10px;"><h4 style="margin: 0; margin-right:10px; line-height: 20px; display: inline-block; font-size: 16px;">If you’re already registered your Username</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; display: inline-block;">'.$this->input->post('username').'</p></li>';


			$body.= '<li style="margin: 0 0 10px; padding:0; line-height: 10px;"><h4 style="margin: 0; margin-right:10px; line-height: 20px; display: inline-block; font-size: 16px;">Your E-Mail</h4>';
			$body.= '<p style="margin:0; line-height: 20px; margin-bottom: 15px; display: inline-block;">'.$this->input->post('email').'</p></li>';
			$body.= '</ul></div>';
			//echo count($dataInfo);
			//echo $body;die;
			$bodys=' <table cellspacing="0" cellpadding="0" border="0" align="center" bgcolor="#fff" width="100%" style="max-width: 600px;">
                <tr>
                   <td>
                      <table cellspacing="0" cellpadding="0" border="0" width="100%">
                         <tr>
                            <td style="font-family: sans-serif; color: #000; padding: 0px 40px 40px; font-size: 16px; line-height: 30px;">
                               '.$body.'
                            </td>
                         </tr>
                      </table>
                   </td>
                </tr>
            </table>';//echo $bodys;die;
            $this->utility->sendCIMail($to,$sub,$bodys,'','',$eMail);
            $this->session->set_userdata('setMSG',1);
			/********Admin mail***************/
			redirect(base_url().'survey');
		}
		$this->load->view('survey');
	}
	
}
