'$s_cliente_id'"); // print mysql_error (); // //print $q; // if (mysql_num_rows ($res) > 1): // $cpf_em_uso = 1; // if ($_POST['pais'] != 'Brasil') { // $cpf_em_uso = 0; // $_POST['cpf_cnpj'] = ''; // } // endif; // } if ($cpf_em_uso == 0): $query = "UPDATE cliente SET "; while(list($key,$value) = each($_POST)): if($key != "Submit" && $key != "x" && $key !="y"): if($key != "o"): if($key != "categoria_id"): if($key != "editora_id"): if($key != "email_id"): $query .= "$key='$value',"; endif; endif; endif; endif; endif; endwhile; $query = substr($query,0,strlen($query)-1); $query .= " WHERE cliente_id='".$_SESSION['s_cliente_id']."'"; //echo $query; include "add-ons/lib_professor.php"; enviaEmailAlteracaoCadastroCliente($s_cliente_id); $result = mysql_query($query); //Apagar as categorias $query = "DELETE FROM email_categoria WHERE email_id LIKE '".$_POST["email_id"]."'"; $result = mysql_query($query); //Inserir as novas $c = count($_POST["categoria_id"]); for ($index = 0; $index < $c; $index++) { $query = "INSERT INTO email_categoria SET email_id='".$_POST["email_id"]."',categoria_id='".$_POST["categoria_id"][$index]."'"; $result = mysql_query($query); } //Apagar as editoras $query = "DELETE FROM email_editora WHERE email_id LIKE '".$_POST["email_id"]."'"; $result = mysql_query($query); //Inserir as novas $c = count($_POST["editora_id"]); for($index = 0; $index < $c; $index++) { $query = "INSERT INTO email_editora SET email_id='".$_POST["email_id"]."',editora_id='".$_POST["editora_id"][$index]."'"; $result = mysql_query($query); } if($_SESSION['s_uf_frete'] != $_POST["uf_ent"]): $s_uf_frete = $_POST["uf_ent"]; $_SESSION['s_uf_frete'] = $s_uf_frete; endif; if ($_GET['tipo'] == 2) { echo ''; exit; } else { $aviso = "Dados alterados com sucesso"; } else: AlertaJs ("CPF/CNPJ já existe em nosso banco de dados. Contacte-nos informando este problema."); endif; endif; $query = "SELECT * FROM cliente WHERE cliente_id='".$_SESSION['s_cliente_id']."'"; $result = Query($query); $row = mysql_fetch_object($result); //print_r($row); //Pegar o email $query = "SELECT email_id FROM email WHERE email LIKE '".$row->email."'"; $email_id = mysql_result(mysql_query($query),0,"email_id"); //Pegar a categoria $query = "SELECT email_categoria.categoria_id FROM email_categoria WHERE email_categoria.email_id = '".$email_id."'"; $result = mysql_query($query); while($r = mysql_fetch_object($result)) { $categoria_id[] = $r->categoria_id; } //Pegar a editora $query = "SELECT email_editora.editora_id FROM email_editora WHERE email_editora.email_id = '".$email_id."'"; $result = mysql_query($query); while($r = mysql_fetch_object($result)) { $editora_id[] = $r->editora_id; } include "includes/header.php"; include "includes/barra_principal_gruposummus.php"; include "includes/barra_esquerda.php"; ?>

bookAlterar Dados Cadastrais

'.$aviso.'

'; } ?>
Nome: *
tipo_pessoa);?>
Endereço: *
Bairro: (somente para residentes no Brasil)
CEP: *
Cidade: *
Estado: * uf?"#UF":$row->uf,"uf","class=\"texto8\"");?> international orders. type your state/province
País: *