<?php
class DocLabel extends AppModel {
	var $name = 'DocLabel';
		

 	### Returns the Report Labels for a QST-X Report
	# 	$type_rep = 1 - Claim Message
	#  				2 - Follow Up Message
	#  				3	Employees's doctor
	#				4	Incomplete Questionnaire
	#				5 - DSP Report
	#				6 - HSQ Report
	#				7 - Completed test SLF
	# 	$language = 1(English) or 0 (French)
	#   $categorie = 1 / 2
	function labelsQSTXReport($type_rep, $language, $categorie, $ctrlLabels){

		if($ctrlLabels == 1) {
			if ($language == 1){
			# Ingles
				$field_language = 'name_eng';
			}else{
			# French
				$field_language = 'name_fre';
			}	
			return $this->find('all', array('fields' => array('paragraph','serie', $field_language), 
											'conditions' =>  array('type_doc' => $type_rep, 'categorie' => $categorie),
											'order' => array('id ASC')
										)
								);		
		}elseif($ctrlLabels == 0) {
			return $this->find('all', array('fields' => array('paragraph','serie', 'name_eng', 'name_fre'), 
											'conditions' =>  array('type_doc' => $type_rep, 'categorie' => $categorie),
											'order' => array('id ASC')
										)
								);			
		}
	}
	
	function labelsEmail($type_rep, $categorie, $lang_id){
		if ($lang_id == 1){
		# Ingles
			$field_language = 'name_eng';
		} elseif ($lang_id == 0) {
		# French
			$field_language = 'name_fre';
		}	
		return $this->find('all', array('fields' => array('paragraph','serie', 'name_eng', 'name_fre'), 
										'conditions' =>  array('type_doc' => $type_rep, 'categorie' => $categorie),
										'order' => array('id ASC')
									)
							);
	}	
}
?>