<?php
   class clsComb extends BDConexion
   {
     function clsComb()
     {
       $this->conectar();
     } 
	 	 
	 function ListTrans($varTrans,$val_trans,$tipo,$disabled=0){
		 $sql="Select CONCAT(mat_trans,' - ',tipo_trans)as transporte, transporte.* from transporte  WHERE activo_trans = '1' AND tipo='$tipo' order by mat_trans  asc";
		 $sql2="Select * from lugares order by nom_lugar ASC";
		 $result = $this->BDConsulta($sql);
		 $result2 = $this->BDConsulta($sql2);
		 $disabled = ($disabled) ? "disabled" : "";
		 echo "<select name=\"$varTrans\" size=\"1\" $disabled >";
	     $i=0;
		 if ($tipo=='LOCACION'){
					 while($fila=$this->NextRow($result2)){
								$selected = "";
						   if ($fila['nom_lugar'] == $val_trans) 
								 $selected = "selected";
								echo "<option $selected value=".str_replace(" ","",$fila['nom_lugar']).">".$fila['nom_lugar']."</option>";
						   }
		 
		 }else{
		 
		      if($tipo=='OTROS'){
		            echo "<option $selected value='OTROS'>".'OTROS'."</option>";
		    
		 		}else{

					 while($fila=$this->NextRow($result)){
								$selected = "";
						   if ($fila['mat_trans'] == $val_trans) 
								 $selected = "selected";
								echo "<option $selected value=".str_replace(" ","",$fila['mat_trans']).">".$fila['transporte']."</option>";
						   }
			         }
			 }
			   echo "</select>";
		}  
		
		function CombolugarLocacion($varUniLoc,$val_Loc,$disabled=0){
			
					$sql="Select * from lugares order by nom_lugar";
					$result = $this->BDConsulta($sql);
					$disabled = ($disabled) ? "disabled" : "";
					$num = $this->totalrows($result);
					echo "<select name=\"$varUniLoc\" size=\"1\" $disabled class='lblForm'>";
					$i=1;
		 
		 			while($fila=$this->NextRow($result)){
			        	$selected = "";
			   
						if (($fila[1] == $val_Loc)|| ($fila[1] == 'LBC')) 
							 $selected = "selected";
							
							echo "<option $selected value=\"$fila[1]\">$fila[1]</option>";
							$i+=1;
			   			}
			   		echo "</select>";
				}
     }
	?>