PabloMota 0 Denunciar post Postado Outubro 4, 2010 Boa tarde Galera estou com uma duvida aki tipo estou na pagina result.php visualizando um registro e tipo é direcionado para pagina funcao_mov.php para fazer o INSERT ae tipo quando é feito uso o header('Location: index2.php?pg=result'); para retornar mais so q retorna para pagina result vazia, gostaria de retorna para pagina, tipo so uma atualização, ñ sei se expliquei direito. result.php <?php require_once('Connections/config.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO cadastro (id) VALUES (%s)", GetSQLValueString($_POST['hiddenField'], "int")); mysql_select_db($database_config, $config); $Result1 = mysql_query($insertSQL, $config) or die(mysql_error()); $insertGoTo = "index2.php"; if (isset($_SERVER['QUERY_STRING'])) { $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?"; $insertGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $insertGoTo)); } $colname_visualizacao = "-1"; if (isset($_GET['id'])) { $colname_visualizacao = $_GET['id']; } mysql_select_db($database_config, $config); $query_visualizacao = sprintf("SELECT * FROM cadastro WHERE id = %s ORDER BY id ASC", GetSQLValueString($colname_visualizacao, "int")); $visualizacao = mysql_query($query_visualizacao, $config) or die(mysql_error()); $row_visualizacao = mysql_fetch_assoc($visualizacao); $totalRows_visualizacao = mysql_num_rows($visualizacao); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>SisAdvog</title> <style type="text/css"> <!-- .style1 { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } .style2 {color: #CCCCCC} .style5 {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color: #FF0000 } .style6 {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; color:#000099; } --> </style> <script src="../SpryAssets/SpryValidationTextField.js" type="text/javascript"></script> <link href="../SpryAssets/SpryValidationTextField.css" rel="stylesheet" type="text/css" /> <link href="../includes/skins/mxkollection3.css" rel="stylesheet" type="text/css" media="all" /> <script src="../includes/common/js/base.js" type="text/javascript"></script> <script src="../includes/common/js/utility.js" type="text/javascript"></script> <script src="../includes/skins/style.js" type="text/javascript"></script> </head> <?php include "css.php";?> <?php include "config.php";?> <body> <div id="conteudo_cadastro"> <div id="form_cadastro"> <table width="100%" border="0"> <tr> <td><div align="center"><em><strong>DADOS CLIENTE</strong></em></div></td> </tr> <tr> <td><table width="576" border="0"> <tr> <td width="250">NOME*</td> <td width="100">CPF/CNPJ*</td> <td width="100">RG</td> <td width="150"> </td> </tr> <tr> <td><input name="nomecliente" type="text" class="style1" id="nomecliente" value="<?php echo $row_visualizacao['nomecliente']; ?>" size="50" readonly="readonly"/></td> <td><input name="cpfcliente" type="text" class="style1" id="cpfcliente" value="<?php echo $row_visualizacao['cpfcliente']; ?>" size="20" readonly="readonly"/></td> <td><input name="rgcliente" type="text" class="style1" id="rgcliente" value="<?php echo $row_visualizacao['rgcliente']; ?>" size="20" readonly="readonly"/></td> <td><label></label></td> </tr> </table> <label></label></td> </tr> <tr> <td><table width="100" border="0"> <tr> <td width="143">ENDEREÇO</td> <td width="30"><span class="style2">BAIRRO</span></td> <td width="19"> </td> <td width="6">BAIRRO</td> <td width="6">CIDADE</td> <td width="6">CEP</td> <td width="6">UF</td> </tr> <tr> <th colspan="3" scope="row"><input name="endcliente" type="text" class="style1" id="endcliente" value="<?php echo $row_visualizacao['endcliente']; ?>" size="55" readonly="readonly"/></th> <td><label> <input name="bairro" type="text" class="style1" id="bairro" value="<?php echo $row_visualizacao['bairro']; ?>" readonly="readonly"/> </label></td> <td><label> <input name="cidade" type="text" class="style1" id="cidade" value="<?php echo $row_visualizacao['cidade']; ?>" readonly="readonly"/> </label></td> <td><span id="sprytextfield1"> <label> <input name="cep" type="text" class="style1" id="cep" value="<?php echo $row_visualizacao['cep']; ?>" size="10" readonly="readonly"/> </label> </span></td> <td><label class="style1"> <input name="uf" type="text" class="style1" id="uf" value="<?php echo $row_visualizacao['uf']; ?>" size="4" readonly="readonly"/> </label></td> </tr> </table> <label></label> <label></label></td> </tr> <tr> <td><table width="100" border="0"> <tr> <td>TELEFONE*</td> <td>CELULAR</td> <td>E-MAIL</td> <td> </td> </tr> <tr> <td><span id="sprytextfield2"> <input name="telefonecliente" type="text" class="style1" id="telefonecliente" value="<?php echo $row_visualizacao['telefonecliente']; ?>" size="20" readonly="readonly"/> </span></td> <td><span id="sprytextfield3"> <input name="celularcliente" type="text" class="style1" id="celularcliente" value="<?php echo $row_visualizacao['celularcliente']; ?>" size="20" readonly="readonly"/> </span></td> <td><span id="sprytextfield4"> <input name="email" type="text" class="style1" id="email" value="<?php echo $row_visualizacao['email']; ?>" size="50" readonly="readonly"/> </span></td> <td> </td> </tr> </table></td> </tr> <tr> <td><div align="center"><em><strong>DADOS DO PROCESSO</strong></em></div></td> </tr> <tr> <td><label></label> <label></label> <label></label> <label></label> <table width="100" border="0"> <tr> <td>Nº PROCESSO*</td> <td>STATUS</td> <td>VARA*</td> <td>JUIZ*</td> </tr> <tr> <td><input name="nprocesso" type="text" class="style6" id="nprocesso" value="<?php echo $row_visualizacao['nprocesso']; ?>" size="20" readonly="readonly"/></td> <td><label> <input name="statusprocesso" type="text" class="style1" id="statusprocesso" value="<?php echo $row_visualizacao['statusprocesso']; ?>" size="15" readonly="readonly"/> </label></td> <td><input name="varaprocesso" type="text" class="style1" id="varaprocesso" value="<?php echo $row_visualizacao['varaprocesso']; ?>" size="50" readonly="readonly"/></td> <td><input name="nomejuiz" type="text" class="style1" id="nomejuiz" value="<?php echo $row_visualizacao['nomejuiz']; ?>" size="45" readonly="readonly"/></td> </tr> </table></td> </tr> <tr> <td><table width="100" border="0"> <tr> <td>DATA DO PROCESSO</td> <td>DATA DA PETIÇÃO</td> <td>DATA DA AUDIÊNCIA</td> <td>HORÁRIO</td> <td><em>PARTE CONTRÁRIA*</em></td> <td> </td> <td> </td> </tr> <tr> <td><input name="dtprocesso" type="text" class="style1" id="dtprocesso" value="<?php echo $row_visualizacao['dtprocesso']; ?>" size="15" readonly="readonly"/></td> <td><span id="sprytextfield5"> <label> <input name="dtpeticao" type="text" class="style1" id="dtpeticao" value="<?php echo $row_visualizacao['dtpeticao']; ?>" size="15" readonly="readonly"/> </label> </span></td> <td><span id="sprytextfield6"> <input name="dtaudiencia" type="text" class="style1" id="dtaudiencia" value="<?php echo $row_visualizacao['dtaudiencia']; ?>" size="15" readonly="readonly"/> </span></td> <td><span id="sprytextfield7"> <label> <input name="horaaud" type="text" class="style1" id="horaaud" value="<?php echo $row_visualizacao['horaaud']; ?>" size="15" readonly="readonly"/> </label> </span></td> <td><label> <input name="partecontraria" type="text" class="style1" id="partecontraria" value="<?php echo $row_visualizacao['partecontraria']; ?>" size="64" readonly="readonly"/> </label></td> <td><label></label></td> <td><label></label></td> </tr> <tr> <td>TIPO DE AÇÃO</td> <td> </td> <td> </td> <td> </td> <td>OBSERVAÇÃO</td> <td> </td> <td> </td> </tr> <tr> <td colspan="4"><input name="tipodeacao" type="text" class="style1" id="tipodeacao" value="<?php echo $row_visualizacao['tipodeacao']; ?>" size="70" readonly="readonly"/></td> <td rowspan="3"><label> <textarea name="observacao" cols="64" rows="4" class="style1" id="observacao" readonly="readonly"><?php echo $row_visualizacao['observacao']; ?></textarea> </label></td> <td> </td> <td> </td> </tr> <tr> <td colspan="3"><em>ADVOGADO</em></td> <td><em>TELEFONE</em></td> <td> </td> <td> </td> </tr> <tr> <td colspan="3"><input name="advogado" type="text" class="style1" id="advogado" value="<?php echo $row_visualizacao['advogado']; ?>" size="54" readonly="readonly"/></td> <td><span id="sprytextfield8"> <input name="teladvog" type="text" class="style1" id="teladvog" value="<?php echo $row_visualizacao['teladvog']; ?>" size="15" readonly="readonly"/> <span class="textfieldRequiredMsg"></span></span></td> <td> </td> <td> </td> </tr> </table></td> </tr> <tr> <td><table width="100" border="0"> <tr> <td colspan="2">CONTROLE INTERNO<img src="imagens/icones/folder.png" width="16" height="16" hspace="0" vspace="0" align="absmiddle" /></td> <td> </td> <td><label></label></td> <td> </td> <td> </td> </tr> <tr> <td>PASTA</td> <td><label> <input name="pasta" type="text" class="style5" id="pasta" value="<?php echo $row_visualizacao['pasta']; ?>" size="35" readonly="readonly"/> </label></td> <td><a href="index2.php?pg=alterarprocesso&id=<?php echo $colname_visualizacao ?>" style="color:#000000"><img src="imagens/icones/edit.png" border="0" align="absbottom"></a></td> <td><a href="index2.php?pg=alterarprocesso&id=<?php echo $colname_visualizacao ?>" style="color:#000000"><img src="imagens/icones/edit.png" border="0" align="absbottom"></a></td> <td><a href="delcad.php?funcao=excluir&id=<?php echo $colname_visualizacao ?>" style="color:#000000"><img src="imagens/icones/delete.png" border="0" align="absbottom"></a></td> <td><a href="impressao.php?id=<?php echo $colname_visualizacao ?>" style="color:#000000" target="_blank"><img src="imagens/icones/print.png" border="0" align="absbottom"></a></td> </tr> </table></td> </tr> </table> </div><!-- form_cadastro --> </div><!-- conteudo_cadastro --> <div id="andamento"> <div id="topo_andamento"> </div><!-- topo_andamento --> <div id="listagem_andamento"> <?php include "config.php"; $id = $_GET['id']; $id_andamento = $_GET['id_andamento']; $sql_mov = mysql_query("SELECT * FROM movimentacoes where id_processo = '$id' ORDER BY id_andamento DESC"); $c = 2; $cores = array("#CCCCCC","#ffffff"); while($linha = mysql_fetch_array($sql_mov)){ $index = $c % 2; $c++; $cor = $cores[$index]; $tabela = '<table width="100%" border="0" cellspacing="0" cellpadding="5">'; $tabela .= '<tr bgcolor="'.$cor.'">'; $tabela .= '<td width="5%"><div align="left">'.$linha['id_andamento'].'</div></td>'; $tabela .= '<td width="15%"><div align="left">'.$linha['data'].'</div></td>'; $tabela .= '<td width="50%"><div align="center">'.$linha['andamento'].'</div></td>'; $tabela .= '<td width="2%"><div align="center"><a href="'.$linha['documento'].'" target="_blank"><img src="imagens/icones/doc.png" border="0" align="absbottom"></a></div></td>'; $tabela .= '<td width="2%"><div align="center"><a href="deland.php?funcao=excluir&id='.$linha['id_andamento'].'" style="color:#000000"><img src="imagens/icones/delete.png" border="0" align="absbottom"></a></div></td>'; $tabela .= '<td width="2%"><div align="center"><a href="alteraracessoscc.php?id='.$linha['id'].'">" style="color:#000000"><img src="imagens/icones/vis.png" border="0" align="absbottom"></a></div></td>'; $tabela .= '</tr>'; $tabela .= '</table>'; echo $tabela; } ?> </div><!-- listagem_andamento --> <div id="cadastro_andamento"> <?php $id = $_GET['id']?> <form id="form7" name="form7" method="post" action="funcao_mov.php?id_processo=<?php echo $id ?>"> <table width="400" border="0" align="center"> <tr> <th colspan="2" class="style1" scope="row">ANDAMENTO DO PROCESSO</th> </tr> <tr> <th scope="row"><div align="left" class="style1">DATA</div></th> <td><label> <input name="data" type="text" class="style1" id="data" value="<?php echo date ("d-m-Y, H:i:s"); ?>" /> </label></td> </tr> <tr> <th scope="row"><div align="left" class="style1">STATUS</div></th> <td><label> <textarea name="andamento" cols="60" rows="5" class="style1" id="andamento2"></textarea> </label></td> </tr> <tr> <th class="style1" scope="row">DOCUMENTO:</th> <td><label> <input name="documento" type="text" class="style1" id="documento" size="60" /> </label></td> </tr> <tr> <th scope="row"> </th> <td><input type="submit" name="button" id="button" value="Cadastrar" /></td> </tr> </table> </form> </div><!-- cadastro_andamento --> </div><!-- andamento --> <div style="clear:both"></div> <script type="text/javascript"> <!-- var sprytextfield1 = new Spry.Widget.ValidationTextField("sprytextfield1", "custom", {pattern:"00.000-000", useCharacterMasking:true, isRequired:false}); var sprytextfield2 = new Spry.Widget.ValidationTextField("sprytextfield2", "custom", {pattern:"(00) 0000-0000", useCharacterMasking:true}); var sprytextfield3 = new Spry.Widget.ValidationTextField("sprytextfield3", "custom", {pattern:"(00) 0000-0000", useCharacterMasking:true, isRequired:false}); var sprytextfield4 = new Spry.Widget.ValidationTextField("sprytextfield4", "email", {isRequired:false, useCharacterMasking:true}); var sprytextfield5 = new Spry.Widget.ValidationTextField("sprytextfield5", "custom", {pattern:"00/00/0000", useCharacterMasking:true, isRequired:false}); var sprytextfield6 = new Spry.Widget.ValidationTextField("sprytextfield6", "custom", {pattern:"00/00/0000", useCharacterMasking:true, isRequired:false}); var sprytextfield7 = new Spry.Widget.ValidationTextField("sprytextfield7", "custom", {pattern:"00:00", useCharacterMasking:true, isRequired:false}); var sprytextfield8 = new Spry.Widget.ValidationTextField("sprytextfield8", "custom", {pattern:"(00) 0000-0000", useCharacterMasking:true}); //--> </script> </body> </html> funcao_mov.php <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <?php include "config.php"; $data = $_POST['data']; $andamento = $_POST['andamento']; $documento = $_POST['documento']; $id_processo = $_GET['id_processo']; $sql = mysql_query("INSERT INTO movimentacoes (id_processo, data, andamento, documento) value ('$id_processo','$data','$andamento','$documento')"); header('Location: index2.php?pg=result'); ?> queria tipo so efetuar o insert e retornar para pagina, tipo so uma atualização exemplo: estou visualizando essa index2.php?pg=result&id=23 ae faz o insert e retorna para msm. Espero q alguem possa me ajudar. ;) Compartilhar este post Link para o post Compartilhar em outros sites
Estaleiro 0 Denunciar post Postado Outubro 4, 2010 E aí Pablo, se o id do processo for o parametro de consulta da sua página é só acrescentar ele no header location após o result $id_processo = $_GET['id_processo']; $sql = mysql_query("INSERT INTO movimentacoes (id_processo, data, andamento, documento) value ('$id_processo','$data','$andamento','$documento')"); header('Location: index2.php?pg=result&id='.$id_processo.''); acho que isso deve resolver, tenta aí! Compartilhar este post Link para o post Compartilhar em outros sites
PabloMota 0 Denunciar post Postado Outubro 4, 2010 Brother vlw ae! deu certo http://forum.imasters.com.br/public/style_emoticons/default/joia.gif Compartilhar este post Link para o post Compartilhar em outros sites