- Fórum WMO
- → Gui 1's Content
Gui 1's Content
There have been 68 items by Gui 1 (Search limited from 29/04/2023)
#500892 Sistema De Login Para Múltiplos Usuários
Posted by Gui 1 on 14/12/2004, 16:59 in PHP
#500339 Sistema De Login Para Múltiplos Usuários
Posted by Gui 1 on 13/12/2004, 20:38 in PHP
#499835 Sistema De Login Para Múltiplos Usuários
Posted by Gui 1 on 13/12/2004, 06:42 in PHP
if ($user=$admin) {
echo "você será redirecionado para página adinistrativa"
}
Assim?
Dai cada um é redirecionado para uma página, e lá ter´seus dados e as opções disponiveis!!!!!!!!!
#499581 Sistema De Login Para Múltiplos Usuários
Posted by Gui 1 on 12/12/2004, 14:04 in PHP
É um site d euma alainça de um jogo online chamado Meteorus,se alguem jogar,via saber como é
#390646 Na Onde Acho Photo Shop 7 Trial Português?
Posted by Gui 1 on 23/06/2004, 21:11 in Editores Bitmap
Não existe versão trial do 7 ou CS em Português!!!!
Só achei Inglês!!!
#390597 Na Onde Acho Photo Shop 7 Trial Português?
Posted by Gui 1 on 23/06/2004, 19:49 in Editores Bitmap
#387595 Brush Com Textura?
Posted by Gui 1 on 18/06/2004, 14:51 in Editores Bitmap
Valeu
P PS 7 é melhor??? QUais as vantagens e qual o preço?
#387084 Brush Com Textura?
Posted by Gui 1 on 17/06/2004, 19:10 in Editores Bitmap
É nesta que coloco o nome
Dai coloquei o nome
E não entnedi o resto, fiz assim:
Cliquei ali na onde coloca os brushes,no ultimo que criei, e agora, como colcoa textura nele?
Obs: Apertei F5 e num deu nada
Obs2: AirBrush ... 300 Não tem no PS 6 né?
Se alguem puder solucionar como colcoar textura netse brush...me ajuda !!!
#386925 Brush Com Textura?
Posted by Gui 1 on 17/06/2004, 14:48 in Editores Bitmap
Mas neste tutorial ele pede pra fazer isto:
Abra e opçao Edit > Define Pattern e vá na opçao Texture da brush tool
Traduzindo: Editar > Definir Pincel
Mas se vou nisso da outra tela que num tem nada a ver,ela é pra por nome na Brush!!!
O Photo Shop do cara é CS Inglês
O meu é o 6 em Português
Alguem em ajuda como colcoar Brush com Textura???quero um resultado como este:
E no final ficar com um resultado como este:
http://gallery.artof...ges/planet2.jpg
Alguem sabe como fazer?
Tirado detse site: http://www.webtutori...69.html&cut=394
Lá não tem para Dwnlod e só aquela figura,como tranforma-lá em Brush?
#385099 Problema Em Código
Posted by Gui 1 on 14/06/2004, 17:46 in PHP
<form name="frmCarrinho" method="post">
<input type="hidden" name="opc_excluir">
<input type="hidden" name="opc_atualizar">
<input type="hidden" name="opc_finalizar">
Será que este erro ocorre por que o if está no começo da página e a form no fim?
#384014 Problema Em Código
Posted by Gui 1 on 12/06/2004, 22:45 in PHP
Notice: Undefined index: opc_atualizar in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\carrinho.php on line 5 Notice: Undefined index: opc_excluir in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\carrinho.php on line 25 Notice: Undefined variable: cesta in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\carrinho.php on line 65Alguem sabe como funcionar?
#383900 Problema Em Código
Posted by Gui 1 on 12/06/2004, 19:57 in PHP
Mas tenta fazer uma compra
Já tentei com,sme aspas,tentei tudo e não funfaolha só, na página carrinho.php:
Carrinho.php
<? session_start(); if('$_POST['opc_atualizar']') { //RECEBE OS PRODUTOS CHECADOS PARA ATUALIZAÇÃO $v_atualiza = $_POST['a_prod']; //PEGA A CHAVE DO ARRAY $chave = array_keys('$v_atualiza'); //EXIBE for($i=0; $i<sizeof('$chave'); $i++) { //PEGA O INDICE DO PRODUTO $indice = $chave['$i']; //ALTERA A QUANTIDADE DO PRODUTO SELECIONADO $_SESSION['cesta']['$indice']['QTDE'] = $v_atualiza['$indice']['QTDE']; }//FECHA FOR }//FECHA IF //VERIFICA SE A OPÇÃO EXCLUIR FOI SELECIONADA elseif('$_POST['opc_excluir']') { //RECEBE OS PRODUTOS CHECADOS PARA EXCLUSÃO $excluir = $_POST['check']; //EXIBE for($i=0; $i<sizeof('$excluir'); $i++) { //PEGA O INDICE DO PRODUTO $indice = $excluir['$i']; //DESTRÓI A VARIÁVEL ESPECIFICADA unset($_SESSION['cesta']['$indice']); }//FECHA FOR }//FECHA IF //RECEBE O PEDIDO DO USUÁRIO elseif($_POST['opc_efetivar']) { //RECEBE AS VARIÁVEIS $v_prod = $_POST['txtprod']; //PEGA A CHAVE DO ARRAY $chave = array_keys($v_prod); //EXIBE for($i=0; $i<sizeof('$chave'); $i++) { $indice = $chave["$i"]; //VERIFICA if(!empty($v_prod['$indice']['QTDE'])) { //GRAVA NO ARRAY CESTA $cesta[$indice][ARTISTA] = $v_prod[$indice][ARTISTA]; $cesta[$indice][ALBUM] = $v_prod[$indice][ALBUM]; $cesta[$indice][PRECO] = $v_prod[$indice][PRECO]; $cesta[$indice][QTDE] = $v_prod[$indice][QTDE]; }//FECHA IF }//FECHA FOR //GRAVA NA SESSÃO $_SESSION['cesta'] = $cesta; }//FECHA ELSE //VERIFICA SE TEM PRODUTO NO CARRINHO PARA PUXAR if(count($_SESSION['cesta']) > 0) { //PEGA A CHAVE DO ARRAY $chave = array_keys($_SESSION['cesta']); //PEGA OS DADOS DA SESSÃO for($i=0; $i<sizeof('$chave'); $i++) { //ÍNDICE $indice = $chave['$i']; //ATRIBUI $cesta['$indice']['ARTISTA'] = $_SESSION['cesta']['$indice']['ARTISTA']; $cesta['$indice']['ALBUM'] = $_SESSION['cesta']['$indice']['ALBUM']; $cesta[$indice]['PRECO'] = $_SESSION['cesta']['$indice']['PRECO']; $cesta[$indice]['QTDE'] = $_SESSION['cesta']['$indice']['QTDE']; }//FECHA FOR }//FECHA IF ?> <html> <head> <title>Carrinho</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style2 { color: #000000; font-weight: bold; } .style5 {color: #FFFFFF; font-weight: bold; } --> <STYLE type="text/css"> <!-- BODY { scrollbar-face-color: #000000; scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #C0C0C0; scrollbar-darkshadow-color: #404040; scrollbar-shadow-color: #808080; scrollbar-arrow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; } </style> <script language="JavaScript"> <!-- function enviar(opcao) { //OPÇÃO EXCLUIR SELECIONADA if(opcao == 'E') { document.forms[0].opc_excluir.value = 1; document.forms[0].submit(); }//FECHA IF //OPÇÃO ATUALIZAR SELECIONADA if(opcao == 'A') { document.forms[0].opc_atualizar.value = 1; document.forms[0].submit(); }//FECHA IF //OPÇÃO FINALIZAR SELECIONADA if(opcao == 'F') { document.forms[0].opc_finalizar.value = 1; document.forms[0].action = "finalizar.php"; document.forms[0].submit(); }//FECHA IF }//FECHA FUNCTION //--> </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <body bgcolor="#FFCC99"> <table width="773" border="0" cellspacing="0" cellpadding="0"> <tr> <td><br> <br> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align='center'><div align="left"><font face='Arial' size='4'><b>Carrinho de Compras</b></font></div></td> </tr> </table> <br> <br> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><font size="2" face="Arial">Veja abaixo os produtos solicitados:</font></td> </tr> </table> <? //EXIBE O CARRINHO SE TIVER PRODUTOS if(count($_SESSION['cesta']) > 0) { ?> <form name="frmCarrinho" method="post"> <input type="hidden" name="opc_excluir"> <input type="hidden" name="opc_atualizar"> <input type="hidden" name="opc_finalizar"> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr bgcolor="#CCCCCC"> <td width="4%"> </td> <td width="8%"><span class="style2">Qtde</span></td> <td width="51%"><span class="style2">Produto</span></td> <td width="19%"><span class="style2">Valor</span></td> <td width="18%"><span class="style2">Subtotal</span></td> </tr> <? //PEGA A CHAVE $chave_cesta = @array_keys($_SESSION['cesta']); //EXIBE OS PRODUTOS DA CESTA for($i=0; $i<sizeof('$chave_cesta'); $i++) { $indice = $chave_cesta['$i']; //SUBTOTAIS DE CADA PRODUTO $subtotal = $_SESSION['cesta']['$indice']['QTDE'] * ereg_replace(",",".",$_SESSION['cesta']['$indice']['PRECO']); //TOTAL GERAL $total += $subtotal; ?> <tr> <td height="25"><input name="check[]" type="checkbox" value="<? echo $indice; ?>"></td> <td height="25"><font face='Arial' size='2'> <input type="text" name="a_prod[<? echo "$indice"; ?>][QTDE]" value="<? echo $_SESSION[cesta][$indice][QTDE]; ?>" size="3"></font></td> <td height="25"><font face='Arial' size='2'><? echo $_SESSION['cesta']['$indice']['ARTISTA']; ?> - <? echo $_SESSION['cesta']['$indice']['ALBUM']; ?></font></td> <td height="25"><font face='Arial' size='2'>R$ <? echo $_SESSION['cesta']['$indice']['PRECO']; ?></font></td> <td width="18%" height="25"><font face='Arial' size='2'> R$ <? echo number_format($subtotal,2,',','.'); ?></font></td> </tr> <? }//FECHA FOR ?> <tr> <td height="25" colspan="3"> <input type="image" name="btnExcluir" src="excluir.gif" onClick="enviar('E');"> <input type="image" name="btnAtualiza" src="atualizar.gif" onClick="enviar('A');"></td> <td height="25" bgcolor="#FF0000"><span class="style5"> Total à pagar: </span></td> <td height="25" bgcolor="#FFF0F0" class="style2"> R$ <b><? echo number_format($total,2,',','.'); ?></b></td> </tr> <tr> <td height="25" colspan="3"><div align="center"><a class="link" href="../index.htm" target="_parent">Continuar Compra</a></div></td> <td height="40" colspan="2"><div align="center"> <input type="image" name="btnFinaliza" src="finaliza.gif" onClick="enviar('F');"></div></td> </tr> </table> </form> <? }//FECHA IF(count) else { ?><br><br><br> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align='center'><font face='Arial' size='2' color="#006666"><b>Desculpe, mas no momento você não possui nenhum produto.</b></td> </tr> </table><br><br> <? }//FECHA ELSE (count)?> <table width="70%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align='center'><font face='Arial' size='2'><a href="../index.htm"><< Voltar </a></font></td> </tr> </table> <br> </td> </tr> <tr> <td> </td> </tr> </table> </body> </html>
Olha o erro que dá:
Notice: Undefined index: opc_atualizar in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\carrinho.php on line 5 Notice: Undefined index: opc_excluir in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\carrinho.php on line 25 Notice: Undefined variable: cesta in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\carrinho.php on line 65
Tentei de tudo mais não funfou,como faz?
#383324 Problema Em Código
Posted by Gui 1 on 11/06/2004, 21:37 in PHP
Em casa funfa normal, mais no server não?$indice = $chave["$i"];
$codigo = $produto["$indice"]["CODIGO"];
$artista = $produto["$indice"]["ARTISTA"];
$album = $produto["$indice"]["ALBUM"];
$preco = $produto["$indice"]["PRECO"];
$imagem = $produto["$indice"]["IMAGEM"];
Como faço?
#383081 Problema Em Código
Posted by Gui 1 on 11/06/2004, 12:01 in PHP
<? /************************************************************************ ARQUIVO .........: Carrinho de compras simples: usado no web site da Acalifa Flores BY ..............: Guilherme Moreira Lizardo - guilhermeboby@ibest.com.br ************************************************************************/ //MONTA O ARRAY DE PRODUTOS $produto[1]['CODIGO'] = "00001"; $produto[1]['ARTISTA'] = "Arranjo Amarelo de Flores"; $produto[1]['ALBUM'] = "Arranjos"; $produto[1]['PRECO'] = "15,25"; $produto[1]['IMAGEM'] = "../floriculturas/arranjoamarelo.jpg"; $produto[2]['CODIGO'] = "00002"; $produto[2]['ARTISTA'] = "Arranjo Bambus"; $produto[2]['ALBUM'] = "Arranjos"; $produto[2]['PRECO'] = "28,35"; $produto[2]['IMAGEM'] = "../floriculturas/arranjocombambus.jpg"; $produto[3]['CODIGO'] = "00003"; $produto[3]['ARTISTA'] = "Canteiro - Completo"; $produto[3]['ALBUM'] = "Canteiros"; $produto[3]['PRECO'] = "75,99"; $produto[3]['IMAGEM'] = "../floriculturas/canteiro.jpg"; $produto[4]['CODIGO'] = "00004"; $produto[4]['ARTISTA'] = "Coqueiros"; $produto[4]['ALBUM'] = "Árvores"; $produto[4]['PRECO'] = "30,00"; $produto[4]['IMAGEM'] = "../floriculturas/cantocoqueirinhos.jpg"; //TOTAL DE PRODUTOS POR LINHA $total = 2; ?> <html> <head> <title>Vendas</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } <STYLE type="text/css"> <!-- BODY { scrollbar-face-color: #000000; scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #C0C0C0; scrollbar-darkshadow-color: #404040; scrollbar-shadow-color: #808080; scrollbar-arrow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; } --> </STYLE> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <body bgcolor="#FFCC99"> <table width="773" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <br> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align='center'><div align="left"><font face='Arial' size='4'><b>Vendas</b></font></div></td> </tr> </table> <br> <br> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><font face='Arial' size='2'>Confira abaixo, os últimos produtos selecioandos no site:</font></td> </tr> </table> <br> <form action="carrinho.php" method="post" name="frmcarrinho"> <input type="hidden" name="opc_efetivar" value="1"> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <? //PEGA A CHAVE DO ARRAY $chave = array_keys($produto); //EXIBE OS PRODUTOS for($i=0; $i<sizeof($chave); $i++) { $indice = $chave["$i"]; $codigo = $produto["$indice"]["CODIGO"]; $artista = $produto["$indice"]["ARTISTA"]; $album = $produto["$indice"]["ALBUM"]; $preco = $produto["$indice"]["PRECO"]; $imagem = $produto["$indice"]["IMAGEM"]; //VERIFICA if('$total == $atual') { echo "</tr><tr>"; $atual = 0; } ?> <td width="14%" height="100"><img src="<? echo $imagem; ?>" width="80" height="80" border="1"></td> <td width="36%"> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><font face='Arial' size='2'><? echo $artista; ?></font></td> </tr> <tr> <td><font face='Arial' size='2'><? echo $album; ?></font></td> </tr> <tr> <td><font face='Arial' size='2'>R$ <? echo $preco; ?></font></td> </tr> <tr> <td> <input type="hidden" name="txtprod[<? echo $indice;?>][CODIGO]" value="<? echo $codigo; ?>"> <input type="hidden" name="txtprod[<? echo $indice;?>][ARTISTA]" value="<? echo $artista; ?>"> <input type="hidden" name="txtprod[<? echo $indice;?>][ALBUM]" value="<? echo $album; ?>"> <input type="hidden" name="txtprod[<? echo $indice;?>][PRECO]" value="<? echo $preco; ?>"> <input type="text" name="txtprod[<? echo $indice;?>][QTDE]" size="3" maxlength="3"> <input type="image" src="carrinho.gif" onClick="javascript: document.forms[0].submit();"></td> </tr> </table></td> <? //SOMA 1 A VARIÁVEL CONTROLADORA $atual++; }//FEHA FOR ?> </tr> </table> </form></td> </tr> <tr> <td> </td> </tr> </table> </body> </html>
Aqui está ele completo!!!
#383070 Problema Em Código
Posted by Gui 1 on 11/06/2004, 11:46 in PHP
www.acalifaflores.com.br
Olha o erro que dá:
Notice: Undefined index: $i in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 92
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 93
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 94
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 95
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 96
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 97
R$
Notice: Undefined index: $i in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 92
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 93
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 94
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 95
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 96
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 97
R$
Notice: Undefined index: $i in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 92
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 93
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 94
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 95
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 96
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 97
R$
Notice: Undefined index: $i in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 92
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 93
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 94
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 95
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 96
Notice: Undefined index: $indice in d:\corp\system\4tje8jiah9618604p2o7\web\vendas\index.php on line 97
Vou postar o código destas linhas:
$indice = $chave["$i"]; $codigo = $produto["$indice"]["CODIGO"]; $artista = $produto["$indice"]["ARTISTA"]; $album = $produto["$indice"]["ALBUM"]; $preco = $produto["$indice"]["PRECO"]; $imagem = $produto["$indice"]["IMAGEM"];
Alguem sabe como solucionar?
#379550 Problemas Em Código
Posted by Gui 1 on 05/06/2004, 19:22 in PHP
Acalifa Flores
Tudo verde
Mas da um erro na página, ohem lá
Vou postar o script:
<? /************************************************************************ ARQUIVO .........: Carrinho de compras simples: usado no web site da Acalifa Flores BY ..............: Guilherme Moreira Lizardo - guilhermeboby@ibest.com.br ************************************************************************/ //MONTA O ARRAY DE PRODUTOS $produto[1][CODIGO] = "00001"; $produto[1][ARTISTA] = "Arranjo Amarelo de Flores"; $produto[1][ALBUM] = "Arranjos"; $produto[1][PRECO] = "15,25"; $produto[1][IMAGEM] = "../floriculturas/arranjoamarelo.jpg"; $produto[2][CODIGO] = "00002"; $produto[2][ARTISTA] = "Arranjo Bambus"; $produto[2][ALBUM] = "Arranjos"; $produto[2][PRECO] = "28,35"; $produto[2][IMAGEM] = "../floriculturas/arranjocombambus.jpg"; $produto[3][CODIGO] = "00003"; $produto[3][ARTISTA] = "Canteiro - Completo"; $produto[3][ALBUM] = "Canteiros"; $produto[3][PRECO] = "75,99"; $produto[3][IMAGEM] = "../floriculturas/canteiro.jpg"; $produto[4][CODIGO] = "00004"; $produto[4][ARTISTA] = "Coqueiros"; $produto[4][ALBUM] = "Árvores"; $produto[4][PRECO] = "30,00"; $produto[4][IMAGEM] = "../floriculturas/cantocoqueirinhos.jpg"; //TOTAL DE PRODUTOS POR LINHA $total = 2; ?> <html> <head> <title>Vendas</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } <STYLE type="text/css"> <!-- BODY { scrollbar-face-color: #000000; scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #C0C0C0; scrollbar-darkshadow-color: #404040; scrollbar-shadow-color: #808080; scrollbar-arrow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; } --> </STYLE> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <body bgcolor="#FFCC99"> <table width="773" border="0" cellspacing="0" cellpadding="0"> <tr> <td> <br> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align='center'><div align="left"><font face='Arial' size='4'><b>Vendas</b></font></div></td> </tr> </table> <br> <br> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><font face='Arial' size='2'>Confira abaixo, os últimos produtos selecioandos no site:</font></td> </tr> </table> <br> <form action="carrinho.php" method="post" name="frmcarrinho"> <input type="hidden" name="opc_efetivar" value="1"> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <? //PEGA A CHAVE DO ARRAY $chave = array_keys($produto); //EXIBE OS PRODUTOS for($i=0; $i<sizeof($chave); $i++) { $indice = $chave[$i]; $codigo = $produto[$indice][CODIGO]; $artista = $produto[$indice][ARTISTA]; $album = $produto[$indice][ALBUM]; $preco = $produto[$indice][PRECO]; $imagem = $produto[$indice][IMAGEM]; //VERIFICA if($total == $atual) { echo "</tr><tr>"; $atual = 0; } ?> <td width="14%" height="100"><img src="<? echo $imagem; ?>" width="80" height="80" border="1"></td> <td width="36%"> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><font face='Arial' size='2'><? echo $artista; ?></font></td> </tr> <tr> <td><font face='Arial' size='2'><? echo $album; ?></font></td> </tr> <tr> <td><font face='Arial' size='2'>R$ <? echo $preco; ?></font></td> </tr> <tr> <td> <input type="hidden" name="txtprod[<? echo $indice;?>][CODIGO]" value="<? echo $codigo; ?>"> <input type="hidden" name="txtprod[<? echo $indice;?>][ARTISTA]" value="<? echo $artista; ?>"> <input type="hidden" name="txtprod[<? echo $indice;?>][ALBUM]" value="<? echo $album; ?>"> <input type="hidden" name="txtprod[<? echo $indice;?>][PRECO]" value="<? echo $preco; ?>"> <input type="text" name="txtprod[<? echo $indice;?>][QTDE]" size="3" maxlength="3"> <input type="image" src="carrinho.gif" onClick="javascript: document.forms[0].submit();"></td> </tr> </table></td> <? //SOMA 1 A VARIÁVEL CONTROLADORA $atual++; }//FEHA FOR ?> </tr> </table> </form></td> </tr> <tr> <td> </td> </tr> </table> </body> </html>
A página Carrinho.php
<? session_start(); if($_POST[opc_atualizar]) { //RECEBE OS PRODUTOS CHECADOS PARA ATUALIZAÇÃO $v_atualiza = $_POST[a_prod]; //PEGA A CHAVE DO ARRAY $chave = array_keys($v_atualiza); //EXIBE for($i=0; $i<sizeof($chave); $i++) { //PEGA O INDICE DO PRODUTO $indice = $chave[$i]; //ALTERA A QUANTIDADE DO PRODUTO SELECIONADO $_SESSION[cesta][$indice][QTDE] = $v_atualiza[$indice][QTDE]; }//FECHA FOR }//FECHA IF //VERIFICA SE A OPÇÃO EXCLUIR FOI SELECIONADA elseif($_POST[opc_excluir]) { //RECEBE OS PRODUTOS CHECADOS PARA EXCLUSÃO $excluir = $_POST[check]; //EXIBE for($i=0; $i<sizeof($excluir); $i++) { //PEGA O INDICE DO PRODUTO $indice = $excluir[$i]; //DESTRÓI A VARIÁVEL ESPECIFICADA unset($_SESSION[cesta][$indice]); }//FECHA FOR }//FECHA IF //RECEBE O PEDIDO DO USUÁRIO elseif($_POST[opc_efetivar]) { //RECEBE AS VARIÁVEIS $v_prod = $_POST[txtprod]; //PEGA A CHAVE DO ARRAY $chave = array_keys($v_prod); //EXIBE for($i=0; $i<sizeof($chave); $i++) { $indice = $chave[$i]; //VERIFICA if(!empty($v_prod[$indice][QTDE]) ) { //GRAVA NO ARRAY CESTA $cesta[$indice][ARTISTA] = $v_prod[$indice][ARTISTA]; $cesta[$indice][ALBUM] = $v_prod[$indice][ALBUM]; $cesta[$indice][PRECO] = $v_prod[$indice][PRECO]; $cesta[$indice][QTDE] = $v_prod[$indice][QTDE]; }//FECHA IF }//FECHA FOR //GRAVA NA SESSÃO $_SESSION[cesta] = $cesta; }//FECHA ELSE //VERIFICA SE TEM PRODUTO NO CARRINHO PARA PUXAR if(count($_SESSION[cesta]) > 0) { //PEGA A CHAVE DO ARRAY $chave = array_keys($_SESSION[cesta]); //PEGA OS DADOS DA SESSÃO for($i=0; $i<sizeof($chave); $i++) { //ÍNDICE $indice = $chave[$i]; //ATRIBUI $cesta[$indice][ARTISTA] = $_SESSION[cesta][$indice][ARTISTA]; $cesta[$indice][ALBUM] = $_SESSION[cesta][$indice][ALBUM]; $cesta[$indice][PRECO] = $_SESSION[cesta][$indice][PRECO]; $cesta[$indice][QTDE] = $_SESSION[cesta][$indice][QTDE]; }//FECHA FOR }//FECHA IF ?> <html> <head> <title>Carrinho</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; } .style2 { color: #000000; font-weight: bold; } .style5 {color: #FFFFFF; font-weight: bold; } --> <STYLE type="text/css"> <!-- BODY { scrollbar-face-color: #000000; scrollbar-highlight-color: #FFFFFF; scrollbar-3dlight-color: #C0C0C0; scrollbar-darkshadow-color: #404040; scrollbar-shadow-color: #808080; scrollbar-arrow-color: #FFFFFF; scrollbar-track-color: #FFFFFF; } </style> <script language="JavaScript"> <!-- function enviar(opcao) { //OPÇÃO EXCLUIR SELECIONADA if(opcao == 'E') { document.forms[0].opc_excluir.value = 1; document.forms[0].submit(); }//FECHA IF //OPÇÃO ATUALIZAR SELECIONADA if(opcao == 'A') { document.forms[0].opc_atualizar.value = 1; document.forms[0].submit(); }//FECHA IF //OPÇÃO FINALIZAR SELECIONADA if(opcao == 'F') { document.forms[0].opc_finalizar.value = 1; document.forms[0].action = "finalizar.php"; document.forms[0].submit(); }//FECHA IF }//FECHA FUNCTION //--> </script> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head> <body bgcolor="#FFCC99"> <table width="773" border="0" cellspacing="0" cellpadding="0"> <tr> <td><br> <br> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align='center'><div align="left"><font face='Arial' size='4'><b>Carrinho de Compras</b></font></div></td> </tr> </table> <br> <br> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td><font size="2" face="Arial">Veja abaixo os produtos solicitados:</font></td> </tr> </table> <? //EXIBE O CARRINHO SE TIVER PRODUTOS if(count($_SESSION[cesta]) > 0) { ?> <form name="frmCarrinho" method="post"> <input type="hidden" name="opc_excluir"> <input type="hidden" name="opc_atualizar"> <input type="hidden" name="opc_finalizar"> <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr bgcolor="#CCCCCC"> <td width="4%"> </td> <td width="8%"><span class="style2">Qtde</span></td> <td width="51%"><span class="style2">Produto</span></td> <td width="19%"><span class="style2">Valor</span></td> <td width="18%"><span class="style2">Subtotal</span></td> </tr> <? //PEGA A CHAVE $chave_cesta = @array_keys($_SESSION[cesta]); //EXIBE OS PRODUTOS DA CESTA for($i=0; $i<sizeof($chave_cesta); $i++) { $indice = $chave_cesta[$i]; //SUBTOTAIS DE CADA PRODUTO $subtotal = $_SESSION[cesta][$indice][QTDE] * ereg_replace(",",".",$_SESSION[cesta][$indice][PRECO]); //TOTAL GERAL $total += $subtotal; ?> <tr> <td height="25"><input name="check[]" type="checkbox" value="<? echo $indice; ?>"></td> <td height="25"><font face='Arial' size='2'> <input type="text" name="a_prod[<? echo $indice; ?>][QTDE]" value="<? echo $_SESSION[cesta][$indice][QTDE]; ?>" size="3"></font></td> <td height="25"><font face='Arial' size='2'><? echo $_SESSION[cesta][$indice][ARTISTA]; ?> - <? echo $_SESSION[cesta][$indice][ALBUM]; ?></font></td> <td height="25"><font face='Arial' size='2'>R$ <? echo $_SESSION[cesta][$indice][PRECO]; ?></font></td> <td width="18%" height="25"><font face='Arial' size='2'> R$ <? echo number_format($subtotal,2,',','.'); ?></font></td> </tr> <? }//FECHA FOR ?> <tr> <td height="25" colspan="3"> <input type="image" name="btnExcluir" src="excluir.gif" onClick="enviar('E');"> <input type="image" name="btnAtualiza" src="atualizar.gif" onClick="enviar('A');"></td> <td height="25" bgcolor="#FF0000"><span class="style5"> Total à pagar: </span></td> <td height="25" bgcolor="#FFF0F0" class="style2"> R$ <b><? echo number_format($total,2,',','.'); ?></b></td> </tr> <tr> <td height="25" colspan="3"><div align="center"><a class="link" href="../index.htm" target="_parent">Continuar Compra</a></div></td> <td height="40" colspan="2"><div align="center"> <input type="image" name="btnFinaliza" src="finaliza.gif" onClick="enviar('F');"></div></td> </tr> </table> </form> <? }//FECHA IF(count) else { ?><br><br><br> <table width="90%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align='center'><font face='Arial' size='2' color="#006666"><b>Desculpe, mas no momento você não possui nenhum produto.</b></td> </tr> </table><br><br> <? }//FECHA ELSE (count)?> <table width="70%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td align='center'><font face='Arial' size='2'><a href="../index.htm"><< Voltar </a></font></td> </tr> </table> <br> </td> </tr> <tr> <td> </td> </tr> </table> </body> </html>
Alguem sabe como solucionar?
Obs: *Testei em minha casa e no server não,alguem sabe como solucionar?
Obs2: Hehehehe, explicado direitnho né?
#360753 Como Fazer Um Sistema Tipo Este!
Posted by Gui 1 on 09/05/2004, 22:15 in PHP
A pessoa tem de se cadastrar,dai crio uma tabela d de cadastros,coloco um camo de Preço, e a cada compra aumenta ou diminue este preço,mas como fazer isto no BD?
- Fórum WMO
- → Gui 1's Content
- Privacy Policy
- Regras ·