<?php 
ini_set('display_errors','On');
require_once($_SERVER['DOCUMENT_ROOT'].'/shine/datos/clsQuery.php');
	class lider extends Query 
	{
		var $filas = NULL;
		function __construct()  
		{
			parent::__construct();
			parent::MET_Conectar();
		}      
		
		function MET_consulta($identificacion)  {
			$sql = "
				SELECT 
				  cod_cia,
				  CONCAT(TRIM(nom_cia), \' \', TRIM(ape_cia)) AS nom_cia,
				  trim(a.dir_cia) as dir_cia,
				  tel_casa,
				  tel_movil 
				FROM
				  M_CLIENTE a 
				WHERE cod_lider = \'$identificacion\' 
				  AND est_cia = \'A\' 
				  ORDER BY 2;
			";
			//$sql = mysql_escape_string($sql);
			//		echo $sql;exit;
			parent::__set('sql', $sql);
			$registros = parent::MET_Select();
//                        print_r($registros);exit;
			return $registros;
		} // end MET_consultaLibro
	
	function MET_fillTable($identificacion)  {
			$registros = $this->MET_consulta($identificacion);
			if (!$registros) 
			{
			$this->filas = '<tr> 
    		<td><div align="center" colspan="5"> '.$this->msj_query.'</div></td>
    				</tr>';	
			}
			else
			{
			foreach($registros as $ind => $reg) 
				{
				if(($ind%2)==0){
					$etiq_tr= '<tr class="filapar_consulta"';
				}else{
					$etiq_tr = '<tr class="filaimpar_consulta"';
				}
				$this->filas .=	'
				<tr '.$etiq_tr.'>
				<td>'.$reg['cod_cia'].'</td>
				<td>'.$reg['nom_cia'].'</td>
				<td>'.$reg['dir_cia'].'</td>
				<td align=center>'.$reg['tel_casa'].'</td>
				<td align=center>'.$reg['tel_movil'].'</td>
  				</tr>
				';	
				} //end foreach
			}//end if
			return $this->filas;			
		} // end MET_fillCombo*/	
	}//end class
?>