<?php
require('../cfg/res.php');
//$sql_drtr2='select *from drgd0 where enti_referidox like "0915379374%"';

$sql_drtr2='select * from drgd0 where (enti_referidox="'.$_POST['indx'].'" or drtr="'.$_POST['indx'].'") and enti_codigo not in (select enti_codigo from enti0 where enti_referidox!="'.$_POST['indx'].'" and enti_referidox>"" and enti_referidox is not null ) order by enti_descri, enti_codigo  ';

$res_drtr2=mysql_query($sql_drtr2,$link_vcrx);
?>

<div style=" max-height:500px; overflow-y:scroll; margin-top:5px;">

<table width="100%" border="1" cellspacing="0" cellpadding="2" style="border-collapse:collapse;font-size:12px; border:#000000 solid 1px;">
	<tr>
    <th></th>
    <th>CI</th>
    <th>Nombres</th>
    <th>Prov/Ciudad</th>
    <th>Clave</th>
    <th>Datos</th>
    </tr>
<?php
while($r_drtr2=mysql_fetch_assoc($res_drtr2))
{
?>
	<tr>
    <td align="center"></td>
    <td align="left"><?php echo $r_drtr2['enti_codigo'];?></td>
    <td><div style="max-width:200px; word-wrap:break-word;"><?php echo $r_drtr2['enti_descri'];?></div></td>
    <td align="left"><?php echo $r_drtr2['prvc_descri'].' /'.$r_drtr2['cdad_descri'];?></td>
	<td align="center">
        <?php
	if(empty($r_drtr2['user_cedula']))
	{echo 'No';}
	else
	{echo 'Si';
	}
	?>
	</td>

	<td align="center">
        <?php
	if(empty($r_drtr2['enti_referidox']))
	{echo '-';}
	else
	{echo 'Ok';
	}
	?>
	</td>





    </td>
    
    
    
    
    
    
    </tr>

	
<?php	
}
?>


</table>
<div>