<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<?php 



class poll extends CI_Controller {



	function poll()	 

	{  

   parent::__construct();	

    $this->load->library('session');

    $this->load->Model('polls_model', 'p_mod');  //function in model 

       $this->load->Model('functions', 'fun');  //function in model 

   	



    } 

	public function send_poll($pollid,$ans)

	{

	$ip = $_SERVER['REMOTE_ADDR'];  

			if($ans=='')

			{

			//

			}

			else

			{

			$data=array(

	    'pollid'=>$pollid,

	    'answerid'=>$ans,

	    'ip'=>$ip

	    	  	    );



		      $this->p_mod->add_poll_ans($data);  /////model class --->model func

		      

		   }



	}







function get_result()

{

    $poll_q= $this->p_mod->get_poll();

	$data['poll']=$poll_q;

	

	foreach($poll_q->result() as $rr):

	$poll_id=$rr->id;

	endforeach;

	

	$poll_ans_count= $this->p_mod->get_poll_answer_count($poll_id);

	$data['poll_user_count']=$poll_ans_count;

	

	 $poll_ans= $this->p_mod->get_poll_answer($poll_id);

	$data['poll_ans']=$poll_ans;

	

			$this->load->view('poll_result',$data);





}







function archieve()

{



$menu=array();

    $menu_q= $this->fun->getall('posts','center');

	$menu['center']=$menu_q;

	$menu_q22= $this->fun->getall('posts','legan');

	$menu['legan']=$menu_q22;

	$menu_q23= $this->fun->getall_limit('posts','news',9);

	$menu['news']=$menu_q23;

	

	$slid_q22= $this->fun->getall('posts','slider');

	$menu['sliders']=$slid_q22;




 $menu_q223= $this->fun->getall('posts','menu');
	$menu['main_menu']=$menu_q223;

	 $social_q= $this->fun->get_setting();
	$menu['social']=$social_q;
$this->load->view('header',$menu);

		

		$data=array();

		$menu_q= $this->fun->getone('posts','16');

		$data['welcome']=$menu_q;

		$menu_q2= $this->fun->getall_limit('posts','conf','5');

		$data['confs']=$menu_q2;

		$menu_q3= $this->fun->getall_limit('posts','meets','5');

		$data['meets']=$menu_q3;		

		$menu_q4= $this->fun->getall_limit('posts','mon','5');

		$data['mons']=$menu_q4;

		$sites_q4= $this->fun->getall_limit('posts','sites','5');

		$data['sites']=$sites_q4;





    $poll_q= $this->fun->get_poll();

	$data['poll']=$poll_q;

	

	foreach($poll_q->result() as $rr):

	$poll_id=$rr->id;

	endforeach;

	

	 $poll_ans= $this->fun->get_poll_answer($poll_id);

	$data['poll_ans']=$poll_ans;



	

 $sites_q24= $this->fun->getall_limit('posts','models','3');

	$data['models']=$sites_q24;















    $p_q=$this->p_mod->get_all_polls();

	$data['polls']=$p_q;

			

	$this->load->view('archieve',$data);

	$this->load->view('footer');





}







}

/* End of file welcome.php */

/* Location: ./application/controllers/welcome.php */

?>