Ir para conteúdo
Fórum Script Brasil
  • 0

update firebird


ivan_bohne

Pergunta

Bom dia a todos estou precisando o seguinte fazer um update apenas em um botão conferido em uma lista de dados do banco ai em baixo vai o meu codigo

<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; ISO-8859-1">
<link rel="stylesheet" type="text/css" href="../estilos/estilos.css">
<title>Documento sem t&iacute;tulo</title>
</head>

<body>
<form name="form2" method="post" action="">
<table width="614" border="1">
  <tr>
    <td width="316"><label for="pesquisa"></label>
      <input name="pesquisa" type="text" id="pesquisa" size="60">
      <input type="submit" name="Pesquisar" id="Pesquisar" value="Pesquisar"></td>
  </tr>
</table>
<?php


 require "../CONECTA/CONECTA.php"; 
 require "../CONECTA/funcoes.php";


$sql = "
SELECT TMOV_1.NUMEROMOV, TMOVCOMPL_1.PROT,
       TMOVITENS_1.CAMPOLIVRE, 
       TMOVCOMPL_1.SAFEWEB, FCFO_1.CODCFO, 
       FCFO_1.NOME, FCFO_1.CGCCFO, 
       FCFO_1.INSCRESTADUAL, TMOV_1.DATAEMISSAO, 
       TMOV_1.DATAEXTRA1, 
       TMOV_1.VALORTOTALPRODUTO 
       
FROM TMOV TMOV_1 LEFT OUTER JOIN FCFO FCFO_1 ON 
     (FCFO_1.CODEMPRESA = TMOV_1.CODEMPRESA)
      AND (FCFO_1.CODCFO = TMOV_1.CODCFO)
      LEFT OUTER JOIN TMOVCOMPL TMOVCOMPL_1 ON 
     (TMOVCOMPL_1.IDMOV = TMOV_1.IDMOV)
      LEFT OUTER JOIN TMOVITENS TMOVITENS_1 ON 
     (TMOVITENS_1.CODEMPRESA = TMOV_1.CODEMPRESA)
      AND (TMOVITENS_1.IDMOV = TMOV_1.IDMOV)
WHERE ( TMOV_1.CODTMV = '2.2.03' )
       AND ( TMOV_1.STATUS <> 'C' )
       AND ( TMOV_1.DATAEXTRA1 BETWEEN '02/01/2012' AND '02/29/2012' )
ORDER BY TMOVCOMPL_1.PROT
";

$resultado = ibase_query ( $conexao , $sql ); 
while ( $row = ibase_fetch_object ( $resultado)) {  
?>

<table width="880" border="0">
<div class="grid">
<tr>
  <td id="id" width="1" style="font-size:0px;"><?php echo $row->IDMOV; ?></td>
  <td width="17" style="font-size:10px;"  ><div align="left"><?php echo $row->NUMEROMOV; ?></div></td>
  <td width="100" style="font-size:11px;"  ><div align="left"><?php echo $row->PROT; ?></div></td>
  <td width="30"><input type="checkbox" name="conferido" id="conferido">
    <label for="conferido"></label></td>
  <td width="17" style="font-size:10px;" ><div align="left"><?php echo $row->CODCFO; ?></div></td>
  <td width="350" align="left" style="font-size:10px;" ><div align="left"><?php echo $row->NOME; ?>
  </div>
    <div align="left"></div></td>
  <td width="75"  style="font-size:10px;"><div align="left"><?php echo $row->CGCCFO; ?></div></td>
  <td width="50"  style="font-size:10px;"><div align="left"><?php echo $row->DATAEMISSAO; ?></div></td>
  <td width="50"  style="font-size:10px;"><div align="left"><?php echo $row->DATAEXTRA1; ?></div></td>
</tr>
</div>
</table>
<label for="ID"></label>
<?php // Fechando conexao
} 
ibase_free_result ( $resultado ); 
ibase_close ( $conexao ); 
?>
<table width="879" border="0" class="grid">
  <tr>
    <td align="center">

      <input type="submit" name="Salvar" id="Salvar" value="salvar" >
      <input type="hidden" name="acao" value="
          
          <?php

        $conf = $_REQUEST['conf'];
        $sql2 = "insert into TMOVCOMPL (SAFEWEB) values (".$conf.")";
        $resultado = ibase_query($conexao, $sql2);
        ibase_close($conexao);

          ?>" />
    </td>
  </tr>
</table>
</form>
</body>
</html>

Já esta listando os dados tudo ok só não estou conseguindo criar a pesquisa e o update do campo chekbos conferido exemplo se tiver marcado grava sim no banco se tiver desmarcado grava não.

Link para o comentário
Compartilhar em outros sites

0 respostass a esta questão

Posts Recomendados

Até agora não há respostas para essa pergunta

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...