<?
session_start();
if($v==1){
include("stilos/config.inc.php");
}
?>
<html>
<head>
<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<link href="Estilos.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="640" border="1" cellpadding="0" cellspacing="0" bordercolor="<?=$bordetabla?>" bgcolor="<?=$c_fondo['fondo tabla']?>" style="<?=$stylo['tabla']?>">  
  <tr class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
    <td width="28"><div align="center">#</div></td>
    <td width="162"><div align="center">tipo personal </div></td>
    <td width="162" ><div align="center">Fecha Inicio </div></td>
    <td width="162"><div align="center">Fecha Termino </div></td>
    <td width="106">Costo diario</td> 
    <td width="20"><div align="right"></div></td>
  </tr>
<?php 
  if($q==1){	   
$rsd=$objPer->getDatosTransPer($mat_trans);	
while($rowd=$objPer->NextRow($rsd)){
$tipoper=$rowd['tipoper'];
$mat_trans=$rowd['mat_trans'];
$fechaini_tp=$rowd['fechaini_tp'];
$fechafin_tp=$rowd['fechafin_tp'];
$costod=$rowd['costod'];
$cod_transper=$rowd['cod_transper'];

						
$transper_d1[]=array("$tipoper",$fechaini_tp,$fechafin_tp,$costod,$cod_transper);
}$objPer->Liberar($rsd);  
}	
$n=0;
$k=0;

if (isset($transper_d1)){
$contarItem = count($transper_d1);
while(list($clave,$valor)=each($transper_d1)){
$tipoper=$valor[0];
$fechaini_tp=$valor[1];
$fechafin_tp=$valor[2];											
$costod=$valor[3];
$cod_transper=$valor[4];
?>
  <tr>
    <td><div align="center"><?php echo ++$n ?></div></td>
    <td><div align="center">
      <? if($cod_transper!=""){?><select onFocus="Focus(this.id, this.options[this.options.selectedIndex].value)" onBlur="Blur(this.id, this.options[this.options.selectedIndex].value, 'tipoper', <?=$cod_transper;?>, '<?=$mat_trans;?>', '1', '<?=$clave;?>' )" class="inputoff" id="a<?=$cod_transper;?>">
        <option value="PILOTO" <? if($tipoper=="PILOTO"){?> selected <? }?> class="inputoff">PILOTO</option>
        <option value="COPILOTO" <? if($tipoper=="COPILOTO"){?> selected <? }?> class="inputoff">COPILOTO</option>
		<option value="MECANICO" <? if($tipoper=="MECANICO"){?> selected <? }?> class="inputoff">MECANICO</option>
      </select> 
	  <? }else{ echo $tipoper;}?>     
	</div></td>
    <td><div align="center"><? if($cod_transper!=""){?>
	<input onFocus="Focus(this.id, this.value)" onBlur="Blur(this.id, this.value, 'fechaini_tp', <?=$cod_transper;?>, '<?=$mat_trans;?>', '1', '<?=$clave;?>')" class="inputoff" id="b<?=$cod_transper;?>" value="<?=$fechaini_tp;?>">    
	<? }else{ echo $fechaini_tp;}?>
    </div></td>
    <td><div align="center"><? if($cod_transper!=""){?>
	<input onFocus="Focus(this.id, this.value)" onBlur="Blur(this.id, this.value, 'fechafin_tp', <?=$cod_transper;?>, '<?=$mat_trans;?>', '1', '<?=$clave;?>')" class="inputoff" id="c<?=$cod_transper;?>" value="<?=$fechafin_tp;?>">
	<? }else{ echo $fechafin_tp;}?>
    </div></td>
    <td><div align="center">
	<? if($cod_transper!=""){?>
	<input  onFocus="Focus(this.id, this.value)" onBlur="Blur(this.id, this.value, 'costod', <?=$cod_transper;?>, '<?=$mat_trans;?>', '1', '<?=$clave;?>')" class="inputoff" id="d<?=$cod_transper;?>"  value="<?=$costod;?>">	
	<? }else{ echo $costod;}?>
	<? $costototalper=$costototalper+$costod;?>
</div></td> 
    <td><div align="center">
	<? if($cod_transper!=""){?>
	<a href="#" onClick="DatosDeleteItemDetalle('<?=$clave?>','<?=$cod_transper;?>')"><img src="../imagenes/btn_eliminar.gif" width="15" height="15" border="0"></a>
	<? }else{?>
	<a href="#" onClick="DatosDeleteItemDetalle1('<?=$clave?>')"><img src="../imagenes/btn_eliminar.gif" width="15" height="15" border="0"></a>
	<? }?>
	</div></td>
  </tr>  
  <?php }}?>
  <tr class="lblCampo">
    <td colspan="3"><div align="center">
    </div></td>
    <td><div align="center">Total</div></td>
    <td>          
	<div id="costott" align="center">
      <?=$_SESSION['costototper']=$costototalper?>
</div></td>
    <td><input name="detalle_per" type="hidden" size="3" id="detalle_per" value="<?=$contarItem=count($transper_d1)?>">    </td>
  </tr>
</table>
</body>
</html>
