<?php
/**
 * survey_template_model.php - Page survey_template model
 *
 * @author $Author: dtong $
 * @version $Id: survey_template_model.php,v 1.3 2011/02/11 09:09:26 dtong Exp $
 * @copyright Copyright (c) 2010, Tiller Software Co., Ltd.
*/

class survey_template_model extends CI_Model {

	function __construct() {
		parent::__construct();
   }

 	function get_survey_template($surveyid=FALSE) {
 		if ( !is_numeric($surveyid) )
			return FALSE;
		$table_survey_template = $this->db->dbprefix('survey_template');
		$this->db->select('*');
	   $this->db->from($table_survey_template);
	   $this->db->where('surveyid', $surveyid);
		$res = $this->db->get();
		if ( $res->num_rows()<= 0 )
			return FALSE;
		$result = $res->result();
		return $result[0];
	}
}