<? //session_start();?>
<?php

require_once("../../comun/conexion3.php");

require_once("../../comun/actions.php");

require_once("../../comun/funciones.php");

$action = new actions();
if($_POST['idcontacto']!=''){
$idcontacto = $_POST['idcontacto'];
}

if($_POST['idcontactoA']!=''){
$idcontacto = $_POST['idcontacto'];
}
//$action->alert($idalias);

$query=mysqli_query("select * from contactos where id = '$idcontacto'");
$row=mysqli_fetch_array($query);
$action->text("contacto",strtoupper($row[contacto]));
$action->text("telefono_contacto",$row[telefono_contacto]);
$action->text("email_contacto",$row[email_contacto]);
$action->checked("mailing_itinerarios",($row[mailing_itinerarios]==1 ? true : false) );
$action->checked("mailing_tarifarios",($row[mailing_tarifarios]==1 ? true : false) );
$action->text("puesto",strtoupper($row[puesto]));
$c0=$row[visible_en_comercial]==1 ? true : false;
$c1=$row[visible_en_expo]==1 ? true : false;
$c2=$row[visible_en_impo]==1 ? true : false;
$action->add_js_code("document.getElementById('area[2]').checked='".$c2."' " );
$action->add_js_code("document.getElementById('area[1]').checked='".$c1."' " );
$action->add_js_code("document.getElementById('area[0]').checked='".$c0."' " );

$action->text("idusuarioA",$row[usuarioCreo]);

$action->text("creo",strtoupper(busquedaB("select area from areas where abreviatura = '".$row['area']."'","area")));
if($row[usuarioCreo]!=''){
$action->text("usuarioCreo",busquedaB("select User from usuarios_int where id = '".$row[usuarioCreo]."'","User"));}
//$action->alert($row["visible_en_comercial"]);
//$action->alert($idcontacto);

$idalias = $row['idalias'];

//$action->alert($idalias);

$query=mysqli_query("select * from alias where id = '$idalias'");
$row=mysqli_fetch_array($query);
$action->text("idalias",$row[id]);
$action->text("alias",strtoupper($row[socialreason]));
$action->text("nickname",strtoupper($row[nickname]));
$action->text("telefono",$row[tel1]);
$action->text("fax",$row[fax]);
$action->text("direccion",strtoupper($row[direction]));
$action->text("no_interior",strtoupper($row[no_interior]));
$action->text("no_exterior",strtoupper($row[no_exterior]));
$action->text("colonia",strtoupper($row[city]));
$action->text("cp",strtoupper($row[zip]));
$action->text("municipio",strtoupper($row[county]));
$action->text("estado",strtoupper($row[state]));
$action->text("pais",strtoupper($row[country]));
$action->checked("credito",($row[credito]==1 ? true : false) );
$action->text("monto_credito",$row[montocredito]);
$action->text("dias_credito",$row[diascredito]);
$action->checked("cuenta_wwa",($row[cuentawwa]==1 ? true : false) );

$action->text("invoice_no_interior",strtoupper($row[invoice_no_interior]));
$action->text("invoice_no_exterior",strtoupper($row[invoice_no_exterior]));
$action->text("invoice_city",strtoupper($row[invoice_city]));
$action->text("invoice_county",strtoupper($row[invoice_county]));
$action->text("invoice_direction",strtoupper($row[invoice_direction]));

$action->text("invoice_zip",strtoupper($row[invoice_zip]));
$action->text("invoice_state",strtoupper($row[invoice_state]));
$action->text("invoice_country",strtoupper($row[invoice_country]));
$action->text("rfc",strtoupper($row[rfc]));
$action->text("facturar_a",strtoupper($row[facturar_a]));
$action->text("notificar_a",strtoupper($row[notificar_a]));


$action->text("email_facturas",$row[email_facturas]);
$action->text("bl_direction",strtoupper($row[bl_direction]));
$action->text("bl_city",strtoupper($row[bl_city]));
$action->text("bl_no_interior",strtoupper($row[bl_no_interior]));
$action->text("bl_no_exterior",strtoupper($row[bl_no_exterior]));
$action->text("bl_city",strtoupper($row[bl_city]));
$action->text("bl_county",strtoupper($row[bl_county]));
			
$action->text("bl_zip",strtoupper($row[bl_zip]));
$action->text("bl_state",strtoupper($row[bl_state]));
$action->text("bl_country",strtoupper($row[bl_country]));

$action->text("idcliente",$row[idcliente]);

$action->send_response();

return;

?>