<? include("../comun/conexion3.php"); $linkI=con_impo();?>
<link rel="stylesheet" type="text/css" href="../../../style.css" media="all" />
<style type="text/css">
body,td,th {
	font-family: Verdana, Geneva, sans-serif;
}
</style>
<script language="Javascript">

function preguntar(inst1,dato){

eliminar=confirm("Do you really want to delete it ? " + dato);

if (eliminar)

window.location.href = inst1; 

//else

//alert('No se ha podido eliminar el registro...')

}

</script>

<div align="justify" style="line-height:18px;  position:absolute;width: 1500px; height:100%;background:url(../../../images/mundo.jpg) ">
<br /><span style="color:#00AF4B">Change Customs Agents Contact Details&raquo;</span><br /><br />
<?

 
	//echo 'idaa '.$_GET[idaa];
$txtidaa=($_GET[idaa]!='' ? $_GET[idaa]: $_POST[txtidaa]); //$_GET[idaa];
   	$txtpatente=($_GET['patente']=='' ? $_POST[patente] : $_GET[patente]);
	$agency=($_GET['agency']=='' ? $_POST[agency] : $_GET[agency]);
	
	?>

<table width="48%"  border="0" align="left" style="line-height:25px">
<form name="formcto" method="post" action="guardacambiocustomerctoexpint.php">
<input name="txtpatente" type="hidden" id="txtpatente" value="<? echo"$txtpatente"?>">  
<input name="agency" type="hidden" id="agency" value="<? echo"$agency"?>">  
<input type="hidden" id="txtidaa" name="txtidaa" value="<?=($_GET[idaa]!='' ? $_GET[idaa]: $_POST[txtidaa])?>" />

<? 
$qoficina=mysqli_query($linkI,"select registro from agentes_aduanales where id ='$txtidaa'");
$roficina=mysqli_fetch_array($qoficina);
$oficina=$roficina[0];
if($_GET[oficina]!=''){
	$oficina=$_GET[oficina];
}
if($oficina=='') $oficina=$_POST[txtregistro];

?>
<input name="txtregistro"   type="hidden" id="txtregistro" value="<? echo"$oficina"?>">
  <tr bordercolor="#FFFFFF">
    <td colspan="2" >
    <? echo $txtpatente .'         '.$agency;?><br />
    The Agency: <?= ($agency=='' ? 'DOES NOT HAVE NAME' : $agency)?><br />
    *****<?=$oficina?>*****
    </td>
    </tr>
  <tr bordercolor="#FFFFFF"> 
    
    <td width="22%" >Name contact</td>
    
    <td width="78%"><input name="txtnombre_contacto" size="50" type="text" id="txtnombre_contacto" value="<? echo"$txtnombre_contacto"?>"></td>
    
  </tr>

  <tr bordercolor="#FFFFFF"> 

    <td >Phone contact</td>

    <td><input name="txttelefono_contacto" size="50" type="text" id="txttelefono_contacto " value="<? echo"$txttelefono_contacto"?>"></td>

  </tr>

  <tr bordercolor="#FFFFFF"> 

    <td >Email contact</td>

    <td><input name="txtemail_contacto" size="50" type="text" id="txtemail_contacto" value="<? echo"$txtemail_contacto"?>"></td>

  </tr>

 
  <tr bordercolor="#FFFFFF">
    <td colspan="2" ><input type="submit" name="Submit" value="Create" /></td>
  </tr>
  </form>
  <tr bordercolor="#FFFFFF">
    <td colspan="2" >
    <? // echo 'ofcina'.$oficina;?>
    <form method="post" action="customsagentexpint.php">
    <input name="txtregistro"   type="hidden" id="txtregistro" value="<? echo"$oficina"?>">
    
    <input type="submit" name="Submit2" value="Regresar " />
    </form>
    </td>
  </tr>
  <tr bordercolor="#FFFFFF">
    <td colspan="2" >&nbsp;</td>
  </tr>

</table>

<table width="100%">
<tr bordercolor="#FFFFFF">
    <td colspan="2" >
    
    
    <?
//$result = mysqli_query($link,"SELECT * FROM contactos_agentes_aduanales where patente = '$txtpatente' order by nombre_contacto"); 
$result = mysqli_query($linkI,"SELECT * FROM contactos_agentes_aduanales where idaa = '$txtidaa' order by nombre_contacto"); 
 
if ($row = mysqli_fetch_array($result)){ 

 ?>

<table align="left"  class="tablas_con_bordes_" bordercolorlight="#0000FF" style="font-family:Arial, Helvetica, sans-serif; font-size:11px" bgcolor="#CCFFFF" >
<?

$i=0;

//encabezado

printf("<TR  class='yellow'>
	   <TD><strong><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Name</TD>
	   <TD><strong><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Tel</TD>
	   <TD><strong><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Email</TD>
	   <TD><strong><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Delete</TD>
	   <TD><strong><font size=\"1\" face=\"Arial, Helvetica, sans-serif\">Change</TD>
	   </TR>");

do {

	$i=$i+1; 

?>
<TR class='comun'>
	   <TD <?=$row[idaa]!='' ? 'style="color:green"' : ''?>><font size="1" face="Arial, Helvetica, sans-serif"><?=$row["nombre_contacto"]?></TD>
	   <TD><font size="1" face="Arial, Helvetica, sans-serif"><?=$row["telefono_contacto"]?></TD>
	   <TD><font size="1" face="Arial, Helvetica, sans-serif"><?=$row["email_contacto"]?></TD>
 	   <TD>
       <a href="javascript:preguntar('borractoexpint.php?id=<?=$row["idcto"]?>&patente=<?=$txtpatente?>&agency=<?=$agency?>','<?=$row["idcto"]?>')">
       Delete
       </a>
       </TD>

       <TD><a href="cambioctoexpint.php?idcto=<?=$row["idcto"]?>&patente=<?=$txtpatente?>&agency=<?=$agency?>">Change</a>
       </TD>
       
       </TR>
       

<?

   } while ($row = mysqli_fetch_array($result)); 

   echo  "</table>" ;



}

  
?>


    </td>
  </tr>

</table></div>