arquvio Editar
<?php @ini_set('display_errors', '1'); error_reporting(E_ALL); $acesso = $_GET["acesso"]; settype($id, "integer"); mysql_connect("localhost", "root", "senha"); mysql_select_db("BDBD"); $resultado = mysql_query("select * from livrodevisitas where acesso = $acesso"); $dados = mysql_fetch_array($resultado); mysql_close(); ?> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table width="93%" border="0" align="center"> <tr> <td width="668"><div align="center" class="te_preto"> AREA RESTRITA </div></td> </tr> <tr> <td height="586"> <p align="left"> </p> <form id="form1" name="form1" method="post" action="salvar_edicao.php"> <input type="hidden" name="acesso" acesso="acesso" value="<?php echo $id;?>" /> <h2 align="center"><strong>Edição de Cadastro PHP/MYSQL</strong></h2> <p align="center"> </p> <table width="295" border="0" align="center" id="table1" style="border-collapse: collapse"> <tr> <td width="131" height="33"> <p align="left"><font face="Century Gothic" size="2">Filial:</font></td> <td width="154"> <p align="left" style="margin-top: 3px"><font face="Century Gothic" size="2"> <input name="filial" type="text" id="filial" value="<?php echo $dados["filial"];?>" /> </font></td> </tr> <tr> <td height="15"><div align="left"><font face="Century Gothic" size="2">Regional: </font></div></td> <td width="154"><font face="Century Gothic" size="2"> <select name="regional" size="1" > <option>Selecione</option> <option value="<?php echo $dados["regional"];?>" />>Minas Gerais <option value="<?php echo $dados["regional"];?>" />Rio de Janeiro <option value="<?php echo $dados["regional"];?>" />Espirito Santo <option value="<?php echo $dados["regional"];?>" />Bahia <option value="<?php echo $dados["regional"];?>" />Centro Oeste </select> </font></td> </tr> <tr> <td height="30"><font face="Century Gothic" size="2">Pedido: </font></td> <td width="154"><font face="Century Gothic" size="2"> <input name="regional" type="text" id="regional" value="<?php echo $dados["regional"];?>" /> </font></td> </tr> <tr> <td height="35"><font face="Century Gothic" size="2">Data da Pedido:</font></td> <td width="154"><font face="Century Gothic" size="2"> <input name="pedido" type="text" id="pedido" value="<?php echo $dados["pedido"];?>" /> </font></td> </tr> <tr> <td height="35"><div align="left"><font face="Century Gothic" size="2">Data da Ativação:</font></div></td> <td width="154"><font face="Century Gothic" size="2"> <input name="dtpedido" type="text" id="dtpedido" value="<?php echo $dados["dtpedido"];?>" /> </font></td> </tr> <tr> <td height="31"><font size="2" face="Century Gothic">Nº Acesso:</font></td> <td width="154"><font face="Century Gothic" size="2"> <input name="cliente" type="text" id="cliente" value="<?php echo $dados["cliente"];?>" /> </font></td> </tr> <tr> <td height="28"><div align="left"><font face="Century Gothic" size="2">Nome Cliente:</font></div></td> <td width="154"><font face="Century Gothic" size="2"> <input name="cliente" type="text" id="cliente" value="<?php echo $dados["cliente"];?>" /> </font></td> </tr> <tr> <td height="31"><font size="2" face="Century Gothic">CPF:</font></td> <td width="154"><font face="Century Gothic" size="2"> <input name="cpf" type="text" id="cpf" value="<?php echo $dados["cpf"];?>" /> </font></td> </tr> <tr> <td height="36"><div align="left"><font size="2" face="Century Gothic">Plano:</font></div></td> <td width="154"><select name="plano" > <option value="<?php echo $dados["plano"];?>" />Bandal Larga <option value="<?php echo $dados["plano"];?>" />Recarga Programada </select></td> </tr> <tr> <td height="24"> <p align="left"><font size="2" face="Century Gothic">Backoffice</font></td> <td><select name="backoffice" size="1" > <option value="<?php echo $dados["backoffice"];?>" />Selecione <option value="<?php echo $dados["backoffice"];?>" />Fernanda M <option value="<?php echo $dados["backoffice"];?>" />Fernanda T <option value="<?php echo $dados["backoffice"];?>" />Marcos <option value="<?php echo $dados["backoffice"];?>" />Rafael <option value="<?php echo $dados["backoffice"];?>" />Stephanie <option value="<?php echo $dados["backoffice"];?>" />Milene <option value="<?php echo $dados["backoffice"];?>" />Henrique <option value="<?php echo $dados["backoffice"];?>" />Shirley <option value="<?php echo $dados["backoffice"];?>" />Juliana <option value="<?php echo $dados["backoffice"];?>" />Marlene </select> </td> </tr> <tr> <td height="24"><div align="center"> <input type="submit" value="Enviar Vendas" name="B12"> </div></td> <td><div align="center"> <input type="reset" value="Limpar dados" name="B22"> </div></td> </tr> <tr> <td height="24" colspan="2"><div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><a href="painel.php">Retornar ao Menu</a></font></div></td> </tr> </table> <p align="center"> </p> </form></td> </tr> </table> </body> </html>
Salva_edicao
<?php @ini_set('display_errors', '1'); error_reporting(E_ALL); $filial = $_POST ['filial']; $regional = $_POST ['regional']; $pedido = $_POST ['pedido']; $dtpedido = $_POST ['dtpedido']; $data = $_POST ['data']; $acesso = $_POST ['acesso']; $cliente = $_POST ['cliente']; $cpf = $_POST ['cpf']; $plano = $_POST ['plano']; $backoffice = $_POST ['backoffice']; mysql_connect("localhost", "root", "senha"); mysql_select_db("bDBD"); mysql_query("UPDATE livrodevisitas SET filial = '$filial', regional = '$regional', pedido = '$pedido', dtpedido = '$dtpedido', data = '$data', acesso = '$acesso', cliente = '$cliente', cpf = '$cpf', plano = '$plano', backoffice = '$backoffice' WHERE livrodevisitas.acesso= $id"); mysql_close(); header("Location: leitura.php"); ?>