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

class Welcome extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
		$this->load->view('welcome_message');
	}
	public function signup($whitelabelid=1, $subscription_type, $package_id)
	{

		$menu['active_nav_tab'] = '';
		$data['package_id']= $package_id;
		$data['subscription_type'] = $subscription_type;
		//echo $package_id;
		$this->load->model ( 'administration/package_model', 'Package_model', TRUE );
		
	    $data['packageInfo']= $this->Package_model->getPackage ( $data ['package_id'] );
		/* echo '<pre>';
		print_r($data['packageInfo']);
		echo '</pre>'; 
		die('Here I am'); */

		$data['header'] = $this->load->view('header',$menu, TRUE);
		//$data['homepageslider'] = $this->load->view('homepageslider',NULL, TRUE);
		//$data['service_and_testimonial'] = $this->load->view('service_testimonial',NULL, TRUE);
		//$data['pricing_table'] = $this->load->view('pricing',NULL, TRUE);
		$data['footer'] = $this->load->view('footer',NULL, TRUE);
		$page_contents = $this->load->view('signup',$data,TRUE);



		/*
		$page['contents'] = preg_replace(
				array(
						'/ {2,}/',
						'/<!--.*?-->|\t|(?:\r?\n[ \t]*)+/s'
				),
				array(
						' ',
						''
				),
				$page_contents);
		*/

		$page['contents'] = $page_contents;

		$this->load->view('template',$page);
	}


	public function successful()
	{
		$menu['active_nav_tab'] = '';

		$data['header'] = $this->load->view('header',$menu, TRUE);
		$data['footer'] = $this->load->view('footer',NULL, TRUE);
		$data['pageheadertitle'] = 'CONGRATULATION !!!!';
		$page_contents = $this->load->view('successful',$data,TRUE);



		$page['contents'] = preg_replace(
			array(
				'/ {2,}/',
				'/<!--.*?-->|\t|(?:\r?\n[ \t]*)+/s'
			),
			array(
				' ',
				''
			),
			$page_contents);

		//$page['contents'] = $page_contents;

		$this->load->view('template',$page);
	}
}
