Ir para conteúdo
Fórum Script Brasil

nbr2004

Membros
  • Total de itens

    97
  • Registro em

  • Última visita

Posts postados por nbr2004

  1. Eu queria dicas para modificar de venda de produtos (que tem frete) para vendas de ingressos.

    Ele mostra os eventos a serem realizados e libera para compra com opções de ingressos

    exemplo

    Luan Santana dia 11/05/2011

    Pista

    VIP

    Camarote

    Outra coisa que eu queria colocar era assim

    Pista = Ingresso R$ 10,00 + 1,00 de taxa do site = 11,00

    VIP = Ingresso R$ 20,00 + 2,00 de taxa di site = 22,00

    Camarote = ingresso R$ 200 + 5,00 de taxa do site = 205,00

    Quando for dia 12/05/2011 ele já não aceita vender mais os ingressos porque o show passou aí vai ficar um link com os eventos realizados no histórico

    Em relação ao PHP e OSCommerceeu entendo um pouco, não muito

  2. Boa tarde pessoal, eu estou pensando em montar uma loja virtual de venda de ingressos, porém não achei nenhum script parecido, alguém poderia me ajudar?

    Eu tava pensando em pegar a Loja oscommerce e modifica-lá para vender ingressos, mais estou tendo dificuldades, por exemplo

    quando chegasse a data do show, ele teria que encerrar as vendas, e colocar em shows realizados somente para a pessoa visualizar que teve aquele show, alguém poderia me ajudar, dá dicas?

  3. BOa tarde pessoal eu tenho 1 controle de estoque, que segue o código abaixo e eu gostaria de fazer 1 modificação colocando assim

    Coca cola Preço de custo = 1,00

    Preço de Venda = 1,00

    Lucro = 0,50

    E depois me mostrar o lucro total de todos os produtos

    veja a imagem abaixo

    estoque1.th.jpg

    <? session_start(); ?>
    <html>
    <head>
    <title>SIG - Módulo Controle de Estoque</title>
    <style type="text/css">
      body {
        background-color: #FFFFFF;
        color: #000000;
        font-family: Arial;
        font-size: 12px;
        margin-left: 0px;
        margin-top: 0px;
        margin-right: 0px;
        margin-bottom: 0px;
      }
      .bd {
        background-color: #FFFFFF;
        color: #000000;
        font-family: Arial;
        font-size: 12px;
      }
      .tbl {
        background-color: #FFFFFF;
      }
      a:link { 
        color: #FF0000;
        font-family: Arial;
        font-size: 12px;
      }
      a:active { 
        color: #0000FF;
        font-family: Arial;
        font-size: 12px;
      }
      a:visited { 
        color: #800080;
        font-family: Arial;
        font-size: 12px;
      }
      .hr {
        background-color: #808080;
        color: #FFFFFF;
        font-family: Arial;
        font-size: 12px;
      }
      a.hr:link {
        color: #FFFFFF;
        font-family: Arial;
        font-size: 12px;
      }
      a.hr:active {
        color: #FFFFFF;
        font-family: Arial;
        font-size: 12px;
      }
      a.hr:visited {
        color: #FFFFFF;
        font-family: Arial;
        font-size: 12px;
      }
      .dr {
        background-color: #FFFFFF;
        color: #000000;
        font-family: Arial;
        font-size: 12px;
      }
      .sr {
        background-color: #EEEEEE;
        color: #000000;
        font-family: Arial;
        font-size: 12px;
      }
    </style>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
    <body>
    <style>
    margin:0px;
    </style>
    <table class="bd" width="100%"><tr><td bgcolor="#000000" style="backgroundColor:#000000"><table width="601" border="0" align="left" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="../Imagens/Logo_r1_c1.jpg" width="58" height="94"></td>
        <td><img src="../Imagens/Logo_r1_c2.jpg" width="88" height="94"></td>
        <td><img src="../Imagens/Logo_r1_c3.jpg" width="86" height="94"></td>
        <td><img src="../Imagens/Logo_r1_c4.jpg" width="82" height="94"></td>
        <td><img src="../Imagens/Logo_r1_c5.jpg" width="85" height="94"></td>
        <td><img src="../Imagens/Logo_r1_c6.jpg" width="100" height="94"></td>
        <td><img src="../Imagens/Logo_r1_c7.jpg" width="102" height="94"></td>
      </tr>
    </table></td></tr></table>
    <?
      if (!login()) exit;
    ?>
    <div style="float: right">[Usuário Logado: <font color="#003366"><b><? echo $_SESSION['usuarioLogado']; ?></b>]</font>    <a href="produtos.php?a=logout">[ Sair do Sistema ]</a></div>
    <br>
    <?
      $conn = connect();
      $showrecs = 100;
      $pagerange = 10;
    
      $a = @$_GET["a"];
      $recid = @$_GET["recid"];
      if (isset($_GET["order"])) $order = @$_GET["order"];
      if (isset($_GET["type"])) $ordtype = @$_GET["type"];
    
      if (isset($_POST["filter"])) $filter = @$_POST["filter"];
      if (isset($_POST["filter_field"])) $filterfield = @$_POST["filter_field"];
      $wholeonly = false;
      if (isset($_POST["wholeonly"])) $wholeonly = @$_POST["wholeonly"];
    
      if (!isset($order) && isset($_SESSION["order"])) $order = $_SESSION["order"];
      if (!isset($ordtype) && isset($_SESSION["type"])) $ordtype = $_SESSION["type"];
      if (!isset($filter) && isset($_SESSION["filter"])) $filter = $_SESSION["filter"];
      if (!isset($filterfield) && isset($_SESSION["filter_field"])) $filterfield = $_SESSION["filter_field"];
    
      $page = @$_GET["page"];
      if (!isset($page)) $page = 1;
    
      $sql = @$_POST["sql"];
    
      switch ($sql) {
        case "insert":
          sql_insert();
          break;
        case "update":
          sql_update();
          break;
        case "delete":
          sql_delete();
          break;
      }
    
      switch ($a) {
        case "add":
          addrec();
          break;
        case "view":
          viewrec($recid);
          break;
        case "edit":
          editrec($recid);
          break;
        case "del":
          deleterec($recid);
          break;
        default:
          select();
          break;
      }
    
      if (isset($order)) $_SESSION["order"] = $order;
      if (isset($ordtype)) $_SESSION["type"] = $ordtype;
      if (isset($filter)) $_SESSION["filter"] = $filter;
      if (isset($filterfield)) $_SESSION["filter_field"] = $filterfield;
      if (isset($wholeonly)) $_SESSION["wholeonly"] = $wholeonly;
    
      mysql_close($conn);
    ?>
    <table class="bd" width="100%" style="backgroundColor:#000000"><tr>
      <td bgcolor="#000000" style="backgroundColor:#000000;color:#FFFFFF;"><strong>SIG - Sistema Integrado de Gerenciamento - Por: Renato X. </strong></td>
    </tr></table>
    </body>
    </html>
    
    <? function select()
      {
      global $a;
      global $showrecs;
      global $page;
      global $filter;
      global $filterfield;
      global $wholeonly;
      global $order;
      global $ordtype;
    
    
      if ($a == "reset") {
        $filter = "";
        $filterfield = "";
        $wholeonly = "";
        $order = "";
        $ordtype = "";
      }
    
      $checkstr = "";
      if ($wholeonly) $checkstr = " checked";
      if ($ordtype == "asc") { $ordtypestr = "desc"; } else { $ordtypestr = "asc"; }
      $res = sql_select();
      $count = sql_getrecordcount();
      if ($count % $showrecs != 0) {
        $pagecount = intval($count / $showrecs) + 1;
      }
      else {
        $pagecount = intval($count / $showrecs);
      }
      $startrec = $showrecs * ($page - 1);
      if ($startrec < $count) {mysql_data_seek($res, $startrec);}
      $reccount = min($showrecs * $page, $count);
      $fields = array(
        "idPRODUTOS" => "ID Produto",
        "PRODUTO" => "Produto",
        "QUANTIDADECOMPRADA" => "Quantidade Comprada",
        "QUANTIDADEEMESTOQUE" => "Quantidade em Estoque",
        "QUANTIDADEVENDIDA" => "Quantidade Vendida",
        "VALOR" => "Valor Unitário",
        "VALORTOTALVENDIDO" => "Valor Total Vendas");
    ?>
    <table class="bd" border="0" cellspacing="1" cellpadding="4">
    <tr><td>Tabela: produtos</td></tr>
    <tr><td>Exibindo Registros <? echo $startrec + 1 ?> - <? echo $reccount ?> de <? echo $count ?></td></tr>
    </table>
    <hr size="1" noshade>
    <form action="produtos.php" method="post">
    <table class="bd" border="0" cellspacing="1" cellpadding="4">
    <tr>
    <td><b>Busca Personalizada</b> </td>
    <td><input type="text" name="filter" value="<? echo $filter ?>"></td>
    <td><select name="filter_field">
    <option value="">Todos Campos</option>
    <?
      reset($fields);
      foreach($fields as $val => $caption) {
        if ($val == $filterfield) {$selstr = " selected"; } else {$selstr = ""; }
    ?>
    <option value="<? echo $val ?>"<? echo $selstr ?>><? echo htmlspecialchars($caption) ?></option>
    <? } ?>
    </select></td>
    <td><input type="checkbox" name="wholeonly"<? echo $checkstr ?>>Sintaxe Completa                Valor Total Vendas Mês: <b><font size="+3">R$
    <?
      $conn = mysql_connect("localhost", "sig", "teste");
      mysql_select_db("sig");
      
      $totalDias = cal_days_in_month(CAL_GREGORIAN, date('m'), date('Y')); 
      $proximoDia = date("Y-m-d",mktime(0,0,0,date("m"),date("d")+1,date("Y")));
       $sqlTotalVendido = "SELECT SUM(VALOR) as total FROM relatoriovendas WHERE DATAVENDA BETWEEN ('".date('Y-m')."-01') AND ('".$proximoDia."')";
      mysql_query($sqlTotalVendido);
      $sqlTotalVendido = mysql_query($sqlTotalVendido);
      $totalVendidos = mysql_fetch_array($sqlTotalVendido);
    ?>
    
     <? echo $totalVendidos['total']; ?></font></b></td>
    </td></tr>
    <tr>
    <td></td>
    <td><input type="submit" name="action" value="Buscar"></td>
    <td><a href="produtos.php?a=reset">Limpar Busca</a></td>
    </tr>
    </table>
    </form>
    <hr size="1" noshade>
    <? showpagenav($page, $pagecount); ?>
    <br>
    <table class="tbl" border="0" cellspacing="1" cellpadding="5"width="100%">
    <tr>
    <?
      reset($fields);
      foreach($fields as $val => $caption) {
    ?>
    <td class="hr"><a class="hr" href="produtos.php?order=<? echo $val ?>&type=<? echo $ordtypestr ?>"><? echo htmlspecialchars($caption) ?></a></td>
    <? } ?>
    <td class="hr"> </td>
    <td class="hr"> </td>
    <td class="hr"> </td>
    </tr>
    <?
      for ($i = $startrec; $i < $reccount; $i++)
      {
        $row = mysql_fetch_assoc($res);
        $style = "dr";
        if ($i % 2 != 0) {
          $style = "sr";
        }
    ?>
    <tr onClick="window.location.href='produtos.php?a=edit&recid=<? echo $i ?>';" onMouseOver="this.style.cursor='pointer';">
    <?
      reset($fields);
      foreach($fields as $val => $caption) {
    ?>
    <td class="<? echo $style ?>"><? echo htmlspecialchars($row[$val]) ?></td>
    <? } ?>
    <td class="<? echo $style ?>"><a href="produtos.php?a=view&recid=<? echo $i ?>">Visualizar</a></td>
    <td class="<? echo $style ?>"><a href="produtos.php?a=edit&recid=<? echo $i ?>">Editar</a></td>
    <td class="<? echo $style ?>"><a href="produtos.php?a=del&recid=<? echo $i ?>">Apagar</a></td>
    </tr>
    <?
      }
      mysql_free_result($res);
    ?>
    </table>
    <br>
    <? showpagenav($page, $pagecount); ?>
    <? } ?>
    
    <? function login()
    {
      global $_POST;
      global $_SESSION;
      
      
    
      global $_GET;
      if (isset($_GET["a"]) && ($_GET["a"] == 'logout')) $_SESSION["logged_in"] = false;
      if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
      if (!$_SESSION["logged_in"]) {
        $login = "";
        $password = "";
        if (isset($_POST["login"])) $login = @$_POST["login"];
        if (isset($_POST["password"])) $password = @$_POST["password"];
        $_SESSION['usuarioLogado'] = $login;
        if (($login != "") && ($password != "")) {
          $conn = mysql_connect("localhost", "sig", "teste");
          mysql_select_db("sig");
          $sql = "select SENHA from `usuarios` where USERNAME = '" .$login ."'";
          $res = mysql_query($sql, $conn) or die(mysql_error());
          $row = mysql_fetch_assoc($res) or $row = array(0 => "");;
          if (isset($row)) reset($row);
    
          if (isset($password) && ($password == trim(current($row)))) {
            $_SESSION["logged_in"] = true;
        }
        else {
    ?>
    <p><b><font color="-1">Senha ou Usuário Invalido</font></b></p>
    <? } } }if (isset($_SESSION["logged_in"]) && (!$_SESSION["logged_in"])) { ?>
    <form action="produtos.php" method="post">
    <table class="bd" border="0" cellspacing="1" cellpadding="4">
    <tr>
    <td>Usuário</td>
    <td><input type="text" name="login" value="<? echo $login ?>"></td>
    </tr>
    <tr>
    <td>Senha</td>
    <td><input type="password" name="password" value="<? echo $password ?>"></td>
    </tr>
    <tr>
    <td><input type="submit" name="action" value="Logar"></td>
    </tr>
    </table>
    </form>
    <?
      }
      if (!isset($_SESSION["logged_in"])) $_SESSION["logged_in"] = false;
      return $_SESSION["logged_in"];
    } ?>
    
    <? function showrow($row)
      {
    ?>
    <table class="tbl" border="0" cellspacing="1" cellpadding="5"width="50%">
    <tr>
    <td class="hr"><? echo htmlspecialchars("idPRODUTOS")." " ?></td>
    <td class="dr"><? echo htmlspecialchars($row["idPRODUTOS"]) ?></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("PRODUTO")." " ?></td>
    <td class="dr"><? echo htmlspecialchars($row["PRODUTO"]) ?></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("QUANTIDADECOMPRADA")." " ?></td>
    <td class="dr"><? echo htmlspecialchars($row["QUANTIDADECOMPRADA"]) ?></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("QUANTIDADEEMESTOQUE")." " ?></td>
    <td class="dr"><? echo htmlspecialchars($row["QUANTIDADEEMESTOQUE"]) ?></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("QUANTIDADEVENDIDA")." " ?></td>
    <td class="dr"><? echo htmlspecialchars($row["QUANTIDADEVENDIDA"]) ?></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("VALOR")." " ?></td>
    <td class="dr"><? echo htmlspecialchars($row["VALOR"]) ?></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("VALORTOTALVENDIDO")." " ?></td>
    <td class="dr"><? echo htmlspecialchars($row["VALORTOTALVENDIDO"]) ?></td>
    </tr>
    </table>
    <? } ?>
    
    <? function showroweditor($row)
      {
      global $conn;
    ?>
    <table class="tbl" border="0" cellspacing="1" cellpadding="5"width="50%">
    <tr>
    <td class="hr"><? echo htmlspecialchars("idPRODUTOS")." " ?></td>
    <td class="dr"><input type="text" name="idPRODUTOS" readonly="readonly" value="<? echo str_replace('"', '"', trim($row["idPRODUTOS"])) ?>"></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("PRODUTO")." " ?></td>
    <td class="dr"><textarea cols="35" rows="4" name="PRODUTO" maxlength="255"><? echo str_replace('"', '"', trim($row["PRODUTO"])) ?></textarea></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("QUANTIDADECOMPRADA")." " ?></td>
    <td class="dr"><input type="text" name="QUANTIDADECOMPRADA" onBlur="document.getElementById('QUANTIDADEEMESTOQUE').value= document.getElementById('QUANTIDADECOMPRADA').value - document.getElementById('QUANTIDADEVENDIDA').value;"  value="<? echo str_replace('"', '"', trim($row["QUANTIDADECOMPRADA"])) ?>"></td>
    </tr>
    &lt;script>
    function vendaProduto(){
    
    if(document.getElementById('QUANTIDADEVENDIDA').value != document.getElementById('QUANTIDADECOMPRADA').value){
    
    var soma = document.getElementById('QUANTIDADEVENDIDA').value++;
    
    document.getElementById('QUANTIDADEVENDIDA').value = soma+1;
    
    document.getElementById('QUANTIDADEEMESTOQUE').value = document.getElementById('QUANTIDADECOMPRADA').value - document.getElementById('QUANTIDADEVENDIDA').value;
    
    var somaQuantidadeVendida = document.getElementById('edtQuantidadeVendida').value++;
    document.getElementById('edtQuantidadeVendida').value = somaQuantidadeVendida+1;
    document.getElementById('edtValorVendido').value = document.getElementById('edtQuantidadeVendida').value * document.getElementById('VALOR').value;
    
    valorTotalVendido();
    }else{
    alert('Erro: A quantidade de produtos em estoque se esgotou. Não é possivel efetuar a venda!');
    }
    }
    
    function vendaProdutoB(){
    var v1 = document.getElementById('QUANTIDADEVENDIDA').value;
    var v2 = parseInt(document.getElementById('QUANTIDADECOMPRADA').value)+1; 
    if(parseInt(v1) < parseInt(v2)){
    var soma = document.getElementById('QUANTIDADEVENDIDA').value++;
    
    document.getElementById('QUANTIDADEVENDIDA').value = soma;
    
    document.getElementById('QUANTIDADEEMESTOQUE').value = document.getElementById('QUANTIDADECOMPRADA').value - document.getElementById('QUANTIDADEVENDIDA').value;
    
    var somaQuantidadeVendida = document.getElementById('edtQuantidadeVendida').value++;
    document.getElementById('edtQuantidadeVendida').value = somaQuantidadeVendida+1;
    document.getElementById('edtValorVendido').value = document.getElementById('edtQuantidadeVendida').value * document.getElementById('VALOR').value;
    
    valorTotalVendido();
    }else{
    alert('Erro: A quantidade de produtos em estoque se esgotou. Não é possivel efetuar a venda!');
    document.getElementById('QUANTIDADEVENDIDA').value = document.getElementById('QUANTIDADECOMPRADA').value;
    }
    }
    
    function devolveProduto(){
    
    if(document.getElementById('QUANTIDADEVENDIDA').value > 0){
    
    document.getElementById('QUANTIDADEVENDIDA').value = (document.getElementById('QUANTIDADEVENDIDA').value)-1;
    
    document.getElementById('QUANTIDADEEMESTOQUE').value= document.getElementById('QUANTIDADECOMPRADA').value - document.getElementById('QUANTIDADEVENDIDA').value;
    
    document.getElementById('edtQuantidadeVendida').value = document.getElementById('edtQuantidadeVendida').value - 1;
    document.getElementById('edtValorVendido').value = document.getElementById('edtQuantidadeVendida').value * document.getElementById('VALOR').value;
    
    valorTotalVendido();
    }else{
    alert('Erro: A quantidade de produtos em estoque é igual à quantidade de produtos comprados.');
    }
    }
    
    function valorTotalVendido(){
    var soma = document.getElementById('VALOR').value * document.getElementById('QUANTIDADEVENDIDA').value;
    soma = ''+soma;
    document.getElementById('VALORTOTALVENDIDO').value = soma.substr(0,5);
    }
    </script>
    <tr>
    <td class="hr"><? echo htmlspecialchars("QUANTIDADEEMESTOQUE")." " ?></td>
    <td class="dr"><input type="text" name="QUANTIDADEEMESTOQUE" readonly="readonly" value="<? echo str_replace('"', '"', trim($row["QUANTIDADEEMESTOQUE"])) ?>"></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("QUANTIDADEVENDIDA")." " ?><input type="hidden" name="edtQuantidadeVendida"><input type="hidden" name="edtValorVendido"></td>
    <td class="dr"><table cellpadding="0" cellspacing="0"><tr><td><input type="text" onBlur="vendaProdutoB();" name="QUANTIDADEVENDIDA"  value="<? echo str_replace('"', '"', trim($row["QUANTIDADEVENDIDA"])) ?>"></td><td><img src="../Imagens/adiciona.jpg" align="right" onClick="vendaProduto();" style="cursor:pointer"></td><td><img src="../Imagens/remove.jpg" align="right" onClick="devolveProduto();" style="cursor:pointer"></td></tr></table></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("VALOR")." " ?></td>
    <td class="dr"><textarea cols="35" rows="4" name="VALOR" maxlength="255"><? echo str_replace('"', '"', trim($row["VALOR"])) ?></textarea></td>
    </tr>
    <tr>
    <td class="hr"><? echo htmlspecialchars("VALORTOTALVENDIDO")." " ?></td>
    <td class="dr"><textarea cols="35" rows="4" name="VALORTOTALVENDIDO" maxlength="255"><? echo str_replace('"', '"', trim($row["VALORTOTALVENDIDO"])) ?></textarea></td>
    </tr>
    <?
    $idProduto = trim($row["idPRODUTOS"]); 
    $estoque = trim($row["QUANTIDADEEMESTOQUE"]);
    $sqlMes = "SELECT SUM(QUANTIDADE) AS TOTAL FROM relatoriovendas WHERE IDPRODUTO = '".$idProduto."'";
    $sqlMes = mysql_query($sqlMes);
    $total = mysql_fetch_array($sqlMes);
    $total = $total['TOTAL'];
    if(empty($total)){
    $total = 0;
    }
    ?> 
    <tr><td colspan="2">Estoque Início Mês:<b> <? echo $total+$estoque; ?></b>     Quantidade Vendida Mês: <b> <? echo $total; ?></b></td></tr>
    </table>
    <? } ?>
    
    <? function showpagenav($page, $pagecount)
    {
    ?>
    <table class="bd" border="0" cellspacing="1" cellpadding="4">
    <tr>
    <td><a href="produtos.php?a=add">Cadastrar Produto</a> </td>
    <? if ($page > 1) { ?>
    <td><a href="produtos.php?page=<? echo $page - 1 ?>"><< Anterior</a> </td>
    <? } ?>
    <?
      global $pagerange;
    
      if ($pagecount > 1) {
    
      if ($pagecount % $pagerange != 0) {
        $rangecount = intval($pagecount / $pagerange) + 1;
      }
      else {
        $rangecount = intval($pagecount / $pagerange);
      }
      for ($i = 1; $i < $rangecount + 1; $i++) {
        $startpage = (($i - 1) * $pagerange) + 1;
        $count = min($i * $pagerange, $pagecount);
    
        if ((($page >= $startpage) && ($page <= ($i * $pagerange)))) {
          for ($j = $startpage; $j < $count + 1; $j++) {
            if ($j == $page) {
    ?>
    <td><b><? echo $j ?></b></td>
    <? } else { ?>
    <td><a href="produtos.php?page=<? echo $j ?>"><? echo $j ?></a></td>
    <? } } } else { ?>
    <td><a href="produtos.php?page=<? echo $startpage ?>"><? echo $startpage ."..." .$count ?></a></td>
    <? } } } ?>
    <? if ($page < $pagecount) { ?>
    <td> <a href="produtos.php?page=<? echo $page + 1 ?>">Proximo >></a> </td>
    <? } ?>
    </tr>
    </table>
    <? } ?>
    
    <? function showrecnav($a, $recid, $count)
    {
    ?>
    <table class="bd" border="0" cellspacing="1" cellpadding="4">
    <tr>
    <td><a href="produtos.php">Home</a></td>
    <? if ($recid > 0) { ?>
    <td><a href="produtos.php?a=<? echo $a ?>&recid=<? echo $recid - 1 ?>">Registro Anterior</a></td>
    <? } if ($recid < $count) { ?>
    <td><a href="produtos.php?a=<? echo $a ?>&recid=<? echo $recid + 1 ?>">Próximo Registro</a></td>
    <? } ?>
    </tr>
    </table>
    <hr size="1" noshade>
    <? } ?>
    
    <? function addrec()
    {
    ?>
    <table class="bd" border="0" cellspacing="1" cellpadding="4">
    <tr>
    <td><a href="produtos.php">Home</a></td>
    </tr>
    </table>
    <hr size="1" noshade>
    <form action="produtos.php" method="post">
    <p><input type="hidden" name="sql" value="insert"></p>
    <?
    $row = array(
      "idPRODUTOS" => "",
      "PRODUTO" => "",
      "QUANTIDADECOMPRADA" => "",
      "QUANTIDADEEMESTOQUE" => "",
      "QUANTIDADEVENDIDA" => "",
      "VALOR" => "",
      "VALORTOTALVENDIDO" => "");
    showroweditor($row)
    ?>
    <p><input type="submit" name="action" value="Cadastrar"></p>
    </form>
    <? } ?>
    
    <? function viewrec($recid)
    {
      $res = sql_select();
      $count = sql_getrecordcount();
      mysql_data_seek($res, $recid);
      $row = mysql_fetch_assoc($res);
      showrecnav("view", $recid, $count);
    ?>
    <br>
    <? showrow($row) ?>
    <br>
    <hr size="1" noshade>
    <table class="bd" border="0" cellspacing="1" cellpadding="4">
    <tr>
    <td><a href="produtos.php?a=add">Cadastrar Produto</a></td>
    <td><a href="produtos.php?a=edit&recid=<? echo $recid ?>">Editar Produto</a></td>
    <td><a href="produtos.php?a=del&recid=<? echo $recid ?>">Apagar Produto</a></td>
    </tr>
    </table>
    <?
      mysql_free_result($res);
    } ?>
    
    <? function editrec($recid)
    {
      $res = sql_select();
      $count = sql_getrecordcount();
      mysql_data_seek($res, $recid);
      $row = mysql_fetch_assoc($res);
      showrecnav("edit", $recid, $count);
    ?>
    <br>
    <form action="produtos.php" method="post">
    <input type="hidden" name="sql" value="update">
    <input type="hidden" name="xidPRODUTOS" value="<? echo $row["idPRODUTOS"] ?>">
    <? showroweditor($row) ?>
    <p><input type="submit" name="action" value="Cadastrar"></p>
    </form>
    <?
      mysql_free_result($res);
    } ?>
    
    <? function deleterec($recid)
    {
      $res = sql_select();
      $count = sql_getrecordcount();
      mysql_data_seek($res, $recid);
      $row = mysql_fetch_assoc($res);
      showrecnav("del", $recid, $count);
    ?>
    <br>
    <form action="produtos.php" method="post">
    <input type="hidden" name="sql" value="delete">
    <input type="hidden" name="xidPRODUTOS" value="<? echo $row["idPRODUTOS"] ?>">
    <? showrow($row) ?>
    <p><input type="submit" name="action" value="Confirmar"></p>
    </form>
    <?
      mysql_free_result($res);
    } ?>
    
    <? function connect()
    {
      $conn = mysql_connect("localhost", "sig", "teste");
      mysql_select_db("sig");
      return $conn;
    }
    
    function sqlvalue($val, $quote)
    {
      if ($quote)
        $tmp = sqlstr($val);
      else
        $tmp = $val;
      if ($tmp == "")
        $tmp = "NULL";
      elseif ($quote)
        $tmp = "'".$tmp."'";
      return $tmp;
    }
    
    function sqlstr($val)
    {
      return str_replace("'", "''", $val);
    }
    
    function sql_select()
    {
      global $conn;
      global $order;
      global $ordtype;
      global $filter;
      global $filterfield;
      global $wholeonly;
    
      $filterstr = sqlstr($filter);
      if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%";
      $sql = "select `idPRODUTOS`, PRODUTO, QUANTIDADECOMPRADA, QUANTIDADEEMESTOQUE, QUANTIDADEVENDIDA, VALOR, VALORTOTALVENDIDO from `produtos`";
      if (isset($filterstr) && $filterstr!='' && isset($filterfield) && $filterfield!='') {
        $sql .= " where " .sqlstr($filterfield) ." like '" .$filterstr ."'";
      } elseif (isset($filterstr) && $filterstr!='') {
        $sql .= " where (`idPRODUTOS` like '" .$filterstr ."') or (PRODUTO like '" .$filterstr ."') or (QUANTIDADECOMPRADA like '" .$filterstr ."') or (QUANTIDADEEMESTOQUE like '" .$filterstr ."') or (QUANTIDADEVENDIDA like '" .$filterstr ."') or (VALOR like '" .$filterstr ."') or (VALORTOTALVENDIDO like '" .$filterstr ."')";
      }
      if (isset($order) && $order!='') $sql .= " order by \"" .sqlstr($order) ."\"";
      if (isset($ordtype) && $ordtype!='') $sql .= " " .sqlstr($ordtype);
      $res = mysql_query($sql, $conn) or die(mysql_error());
      return $res;
    }
    
    function sql_getrecordcount()
    {
      global $conn;
      global $order;
      global $ordtype;
      global $filter;
      global $filterfield;
      global $wholeonly;
    
      $filterstr = sqlstr($filter);
      if (!$wholeonly && isset($wholeonly) && $filterstr!='') $filterstr = "%" .$filterstr ."%";
      $sql = "select count(*) from `produtos`";
      if (isset($filterstr) && $filterstr!='' && isset($filterfield) && $filterfield!='') {
        $sql .= " where " .sqlstr($filterfield) ." like '" .$filterstr ."'";
      } elseif (isset($filterstr) && $filterstr!='') {
        $sql .= " where (`idPRODUTOS` like '" .$filterstr ."') or (PRODUTO like '" .$filterstr ."') or (QUANTIDADECOMPRADA like '" .$filterstr ."') or (QUANTIDADEEMESTOQUE like '" .$filterstr ."') or (QUANTIDADEVENDIDA like '" .$filterstr ."') or (VALOR like '" .$filterstr ."') or (VALORTOTALVENDIDO like '" .$filterstr ."')";
      }
      $res = mysql_query($sql, $conn) or die(mysql_error());
      $row = mysql_fetch_assoc($res);
      reset($row);
      return current($row);
    }
    
    function sql_insert()
    {
      global $conn;
      global $_POST;
    
      $sql = "insert into `produtos` (`idPRODUTOS`, PRODUTO, QUANTIDADECOMPRADA, QUANTIDADEEMESTOQUE, QUANTIDADEVENDIDA, VALOR, VALORTOTALVENDIDO) values (" .sqlvalue(@$_POST["idPRODUTOS"], false) .", " .sqlvalue(@$_POST["PRODUTO"], true) .", " .sqlvalue(@$_POST["QUANTIDADECOMPRADA"], false) .", " .sqlvalue(@$_POST["QUANTIDADEEMESTOQUE"], false) .", " .sqlvalue(@$_POST["QUANTIDADEVENDIDA"], false) .", " .sqlvalue(@$_POST["VALOR"], true) .", " .sqlvalue(@$_POST["VALORTOTALVENDIDO"], true) .")";
      mysql_query($sql, $conn) or die(mysql_error());
    }
    
    function sql_update()
    {
      global $conn;
      global $_POST;
    
      $sql = "update `produtos` set `idPRODUTOS`=" .sqlvalue(@$_POST["idPRODUTOS"], false) .", PRODUTO=" .sqlvalue(@$_POST["PRODUTO"], true) .", QUANTIDADECOMPRADA=" .sqlvalue(@$_POST["QUANTIDADECOMPRADA"], false) .", QUANTIDADEEMESTOQUE=" .sqlvalue(@$_POST["QUANTIDADEEMESTOQUE"], false) .", QUANTIDADEVENDIDA=" .sqlvalue(@$_POST["QUANTIDADEVENDIDA"], false) .", VALOR=" .sqlvalue(@$_POST["VALOR"], true) .", VALORTOTALVENDIDO=" .sqlvalue(@$_POST["VALORTOTALVENDIDO"], true) ." where " ."(`idPRODUTOS`=" .sqlvalue(@$_POST["xidPRODUTOS"], false) .")";
      mysql_query($sql, $conn) or die(mysql_error());
      
    $sqlRelatorios = "insert into relatorioVendas(ID,DATAVENDA,VENDEDOR,IDPRODUTO,PRODUTO,QUANTIDADE,VALOR) VALUES ('','".date('Y-m-d H:i:s')."','".$_SESSION['usuarioLogado']."','".$_POST['idPRODUTOS']."','".$_POST["PRODUTO"]."','".$_POST["edtQuantidadeVendida"]."','".$_POST["edtValorVendido"]."')"; 
    
     $sqlRelatorios = mysql_query($sqlRelatorios);
    }
    
    function sql_delete()
    {
      global $conn;
      global $_POST;
    
      $sql = "delete from `produtos` where " ."(`idPRODUTOS`=" .sqlvalue(@$_POST["xidPRODUTOS"], false) .")";
      mysql_query($sql, $conn) or die(mysql_error());
    } ?>

  4. mas nas outras não dá pra eu adicionar nada, está assim

    Catalago_categorias

    id categoria

    1 Agropecuária

    2 Alimentação

    3 Assessorias

    4 Associações

    5 Construção

    6 Cultura

    Catalago_subcategorias

    id categoria subcategoria

    1 Agropecuária Agrimensura e Topografia

    2 Agropecuária Agronomia

    3 Agropecuária Aquários

    4 Agropecuária Aviação Agrícola

    5 Agropecuária Avicultura

    6 Agropecuária Cereais

    catalago_empresas

    id categoria subcategoria imagem imagemgrande empresa endereco

    1 Publicidade Luminosos imagens/ imagens/ Uniplaca Herculano de Oliveira e Silva Nº34

    2 Publicidade Plotters imagens/ imagens/ UNIPLACA Herculano de Oliveira e Silva Nº 34 Centro

    agora como associar desse jeito que você me falou não consigo, ou melhor não estou conseguindo captar a sua mensagem

  5. eu não entendi muito bem, mas dessa forma iria mostrar que ela está cadastrada apenas 1 vez??

    ai nessa outra eu iria chama-la por exemplo de

    catalago_secoes

    e colocaria

    idempresa | idcategoria ??

    1(correios) 2(finaças)??

    poderia me explicar melhor?

  6. Olá Pessoal estou fazendo um guia comercial, e depois de de tudo pronto surgiu uma duvida, vejam só

    no meu banco de dados eu tenho as tabelas

    catalago_categorias

    catalago_subcategorias

    catalago_empresas

    em categorias está assim

    id | categoria

    em subcategorias esta

    id | categoria | subcategoria

    e em empresas tem

    id | categoria | subcategoria | empresas e mais um monte de dados

    Até aí tudo bem, está normal mas o que ocorre é que por exemplo

    a empresa Correios, tem vários lugares que pode se encaixado como:

    'Finanças', 'Correios'

    'Serviços Públicos', 'Correios'

    'Telecomunicações', 'Correios'

    'Transportes', 'Correios'

    então o que eu fiz, cadastrei o correios, 4 vezes 1 vez em categoria e subcategoria diferente, porem eu não vou ter controle de quantas empresas eu tenho cadastradas pois correio é somente 1 empresa e está cadastrada mais de 1 vez, e quando a pessoa for pagar, nos detalhes exibe assim por TIPO = Pago

    E a Empresa cadastrada na categoria X e na subcategoria X, do jeito que estou fazendo não deu certo porque se eu colocar as 4 empresas correios como pago, dá erro,

    resulmindo, estou precisando que em 1 cadastro só ele fica em vários lugares diferente cadastrado

    alguém poderia me ajudar

  7. a imagem é esse topo ai

    www.guiaunai.com.br

    e o codigo é esse

    <table width="777" height="98" border="0" align="center" cellpadding="0" cellspacing="0" background="../imagens/<? echo $_SESSION['TopoA'] ?>">

    <tr>

    <td height="81">&nbsp;</td>

    </tr>

    </table>

    e ai eu não consegui colocar link!!

  8. Olá Pessoal estou com um problema, vejam só estou pegando uma categoria e dentro dela é pra exibir as subcategorias, exemplo:

    Categoria: Alimentação

    Subcategoria: Biscoito

    até aí tudo bem,

    ele gera esse link

    http://guiaunai.com.br/empresas.php?cat=Al...ubcat=Biscoitos

    só que quando tem espaço na categoria dá errado, veja

    Categoria: Engenharia e arquitetura

    Subcategoria: Agronomia

    ele gera esse link

    http://guiaunai.com.br/empresas.php?cat=Engenharia

    ele não completa o resto, poderiam me ajudar?

    Segue o codigo abaixo

    <? $numcat = $_GET['categoria']?>
     <?  include "conexao.php";?>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title><? include "includes/titulo.php"; ?></title>
    <link href="estilos/estilos.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <script language="javascript" src="js/funcoes.js"></script>
    <?
    include "includes/topo.php";
    ?>
    <table width="777" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="5"></td>
      </tr>
    
    </table>
    
    <table width="777" border="0" align="center" cellpadding="0" cellspacing="0">
    
      <tr>
    
        <td width="172" valign="top"><table width="172" height="20" border="0" cellpadding="0" cellspacing="1">
    
          <tr>
    
            <td width="172" background="imagens/fundo_categoria.jpg">&nbsp;</td>
    
          </tr>
          <?
          $sql = mysql_query("SELECT * FROM catalago_categorias ORDER BY categoria") or die ('Falha exibindo categorias');
          while($linha = mysql_fetch_array($sql))
          {
                $id = $linha["id"];
              $categoria = $linha["categoria"];
              echo "<tr>";
              echo "<td width='172' height='20' background='imagens/fundo_categorias.jpg' class='style1'>&nbsp;&nbsp;<a href='secao.php?categoria=".$id."'><span class='style3'>".$categoria."</span></a></td>";
              echo "</tr>";
          }
          ?>
        </table></td>
        <td width="500" valign="top"><table width="499" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#BFDFF0">
          <tr>
            <th scope="col"><table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="100%" height="18"></td>
              </tr>
            </table>
              <table width="90%" align="center">
                <tr>
                  <td width="188" valign="top"><?
    $sql2 = mysql_query("SELECT * FROM catalago_categorias where id = '$numcat'") or die ('Falha na Query');
    while ($linha2=mysql_fetch_array($sql2)) {
    $qualcat = $linha2["categoria"];
    }
    
    $sql3 = mysql_query("SELECT * FROM catalago_subcategorias where categoria = '$qualcat' order by subcategoria limit 0,30") or die ('Falha na Query');
    while ($linha3=mysql_fetch_array($sql3)) {
    $subcat = $linha3["subcategoria"];
    echo "<font face=verdana size=1>&nbsp;&nbsp;<img src=imagens/seta.gif>&nbsp;<a href=empresas.php?cat=$qualcat&subcat=$subcat>$subcat</a></font><br>";
    }
    ?>
                  </td>
                  <td width="189" valign="top"><?
    $sql4 = mysql_query("SELECT * FROM catalago_subcategorias where categoria = '$qualcat' order by subcategoria limit 30,60") or die ('Falha na Query');
    while ($linha4=mysql_fetch_array($sql4)) {
    $subcat = $linha4["subcategoria"];
    echo "<font face=verdana size=1>&nbsp;&nbsp;<img src=imagens/seta.gif>&nbsp;<a href=empresas.php?cat=$qualcat&subcat=$subcat>$subcat</a></font><br>";
    }
    ?>
                  </td>
                </tr>
              </table></th>
          </tr>
        </table></td>
        <td width="105" valign="top"><table width="105" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="center" valign="top"><?
    
    include "includes/menu_direito.php";
    
    ?>
            </td>
          </tr>
        </table></td>
    
      </tr>
    
    </table>
    
    <?
    
    include "includes/rodape.php";
    
    ?>
    
    </body>
    
    </html>
    
    

  9. Eu tenho o mapa da cidade, em Corel Draw, é só exportar para algum formato, mas eu não quero colocar a distancia, e sim, colocar só o mapa para a pessoa percorrer e tambem colocar as ruas que vao ser percorrida, mas sem distancia!!

  10. Boa noite pessoal eu estava visitando o seguinte site Telelistas.netClique aqui pra ver, lá tem uma opçao chamada "Ache um Caminho" Onde você colocar A Origem e o Destino, exemplo

    ORIGEM

    R. Rio de Janeiro, 79

    DESTINO

    R. Brasil, 30

    veja as fotos abaixo

    01.jpg

    02.jpg

    Eu estava querendo fazer um parecido, como eu faço, alguém tem ideia de como começar? de por pontos. etc??

    Eu já tenho as ruas cadastrada no meu bd, se alguém pude me ajudar ficarei grato..

  11. Olá, eu fiz do jeito que você me falou.. coloquei

    Tipo "A" e "P" nivel 1

    Tipo "B" nivel 2

    Só que na hora de exibir, está exibindo primeiro o A depois o P

    So que A e P seriam igual teor,

    no meu sql está assim oh

    SELECT * FROM catalago_empresas WHERE empresa like '%$strSearch%' or produtos like '%$strSearch%' or categoria like '%$strSearch%' or subcategoria like '%$strSearch%' order by nivel ASC"; }

    Era pra está exibindo por ordem alfabetica, do Nivel 1 e depois do nivel 2? mas noa está exibindo.. :(

  12. Olá pessoal estou com esse código aqui, e eu queria fazer paginação nele, eu sou iniciante em php e não sei como faz isso, alguém poderia me ajudar?

    <? 
    $cat = $_GET['cat'];
    $subcat = $_GET['subcat'];?>
     <?  include "conexao.php";?>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title><? include "includes/titulo.php"; ?></title>
    <link href="estilos/estilos.css" rel="stylesheet" type="text/css">
    </head>
    <body>
    <script language="javascript" src="js/funcoes.js"></script>
    <?
    include "includes/topo.php";
    ?>
    <table width="777" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="5"></td>
      </tr>
    
    </table>
    
    <table width="777" border="0" align="center" cellpadding="0" cellspacing="0">
    
      <tr>
    
        <td width="172" valign="top"><table width="172" height="20" border="0" cellpadding="0" cellspacing="1">
    
          <tr>
    
            <td width="172" background="imagens/fundo_categoria.jpg">&nbsp;</td>
    
          </tr>
          <?
          $sql = mysql_query("SELECT * FROM catalago_categorias ORDER BY categoria") or die ('Falha exibindo categorias');
          while($linha = mysql_fetch_array($sql))
          {
                $id = $linha["id"];
              $categoria = $linha["categoria"];
              echo "<tr>";
              echo "<td width='172' height='20' background='imagens/fundo_categorias.jpg' class='style1'>&nbsp;&nbsp;<a href='secao.php?categoria=".$id."'><span class='style3'>".$categoria."</span></a></td>";
              echo "</tr>";
          }
          ?>
        </table></td>
        <td width="500" valign="top"><table width="499" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#BFDFF0">
          <tr>
            <th scope="col"><?
    $sql3 = mysql_query("SELECT * FROM catalago_empresas where categoria like'%$cat%' and subcategoria like '%$subcat%' order by tipo") or die ('Falha na Query');
    while ($linha3=mysql_fetch_array($sql3)) {
    $id = $linha3["id"];
    $subcategoria = $linha3["subcategoria"];
    $imagem = $linha3["imagem"];
    $empresa = $linha3["empresa"];
    $endereco = $linha3["endereco"];
    $bairro = $linha3["bairro"];
    $fone = $linha3["fone"];
    $cidade = $linha3["cidade"];
    $tipo = $linha3["tipo"];
    ?>
              <table width="89%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="392" height="50" valign="top"><table width="114" border="0" align="left">
                      <tr>
                        <? if($tipo == "C") { echo "<td width=108 height=50>"; } else { ?>
                        <td width="108"><a href="../detalhes.php?id=<? echo $id; ?>"> <img src="<? echo $imagem; ?>" width="100" height="50" border="0" align="top"></a>
                            <? } ?>
                        </td>
                      </tr>
                    </table>
                      <? 
                                    echo "<font face=verdana size=1><br><b>";
                                    if($tipo == "C") { echo "$empresa</b><br>
                                    $endereco
                                    $bairro<br><b>Fone:</b> $fone &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <b>Cidade: </b>$cidade</font><hr size=1>"; } else {
                                    echo "<font face=verdana size=1><a href=../detalhes.php?id=$id>$empresa</a></b><br>
                                    $endereco
                                    $bairro<br><b>Fone:</b> $fone &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                    <b>Cidade: </b>$cidade</font><hr size=1>"; }
                                    ?>
                  </td>
                </tr>
              </table>
              <?  } if(mysql_num_rows($sql3)==0) {
              echo "<br><center><font face=verdana size=1 color=gray>Nenhuma empresa cadastrada nessa categoria</font></center>"; }
    ?>
              <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="100%" height="18"></td>
                </tr>
              </table>
              <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="100%" height="18"><div align="center"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong><a href="java script:history.go(-1)">Voltar</a></strong></font></div></td>
                </tr>
              </table>
              <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="100%" height="18"></td>
                </tr>
              </table></th>
          </tr>
        </table></td>
    
        <td width="105" valign="top"><table width="105" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td align="center" valign="top"><?
    
    include "includes/menu_direito.php";
    
    ?>
            </td>
          </tr>
        </table></td>
    
      </tr>
    
    </table>
    
    <?
    
    include "includes/rodape.php";
    
    ?>
    
    </body>
    
    </html>
    
    

  13. o que tem de errado no codigo que não está pegando a id??

    <? 
    include('../conexao.php');
     ?>
    
    <? 
    $query_noticias_ultimas = "select * from catalago_boleto where pago = 'N' ORDER BY nossonumero";
    $resultado_ultimas = mysql_query($query_noticias_ultimas);
    echo"  <table width='600' border='1' align='center' cellpadding='0' cellspacing='0'>
      <tr>
        <th width='89' scope='col'>Pago</th>
        <th width='114' scope='col'>Nosso numero </th>
        <th width='133' scope='col'>Cliente</th>
        <th width='58' scope='col'>Valor</th>
        <th width='96' scope='col'>Gerado em </th>
        <th width='96' scope='col'>Vencimento</th>
      </tr>
     </table> ";
    while ($linhas_pala1 = @mysql_fetch_array($resultado_ultimas))
        {
            $id            = $linhas_pala1["id"];
            $empresa         = $linhas_pala1["empresa"];
            $valor             = $linhas_pala1["valor"];
            $vencimento            = $linhas_pala1["vencimento"];
            $nossonumero            = $linhas_pala1["nossonumero"];
            $gerado = date('d/m/Y', strtotime($data['gerado'])); 
            
    echo" 
    <table width='600' border='1' align='center' cellpadding='0' cellspacing='0'>
    
      <tr>
        <td width='89' scope='col'>
    <div align='center'><font color='#000000' face='Verdana, Arial, Helvetica, sans-serif' size='1'><font color='#FF0000' size='2'><sup>
         <form name='form1' method='post' action='?acao=mudar&id='id''>
    <select name='acao' id='acao' class='unnamed1'>
            <option value='N'>Não</option>
            <option value='S'>Sim</option>
          </select>
              <input type='hidden' name='id' value='$id'>
              <input type='submit' name='Submit' value='Informar!'>
      </form>
            </sup></font></font></div></td>
        <td width='114' scope='col'>
    <div align='center'>$nossonumero</div></td>
        <td width='133' scope='col'>
    <div align='center'>$empresa</div></td>
        <td width='58' scope='col'>
    <div align='center'>$valor</div></td>
        <td width='96' scope='col'>
    <div align='center'>$gerado</div></td>
        <td width='96' scope='col'>
    <div align='center'>$vencimento</div></td>
      </tr>
    </table>
    "; 
        };?>
    
    <?
    $id = $_POST['id'];
    if($acao == "mudar"){
    mysql_query("UPDATE catalago_boleto SET pago = 'S' WHERE id = '$id'");
    echo "alterado com sucesso";
    }
    
    ?>

  14. eu coloquei pela id e deu certo, eu não entedi, qual a questao que você usou do "nossonumero"

    no altera.php eu coloquei assim

    <?

    include('../conexao.php');

    ?>

    <?php

    $id = $_POST['id'];

    mysql_query("UPDATE catalago_boleto SET pago = 'S' WHERE id = '$id'");

    echo "alterado com sucesso";

    ?>

×
×
  • Criar Novo...