Quantcast
Channel: Últimos conteúdos
Viewing all articles
Browse latest Browse all 14190

Formulário é carregado corretamente para uns e para outros não!

$
0
0

Bom dia gente,

Tenho um formulário de pedido que cada dia carregar um da semana, depois de muitos testes eu coloquei ele hoje no ar para o meu cliente, por azar e desespero meu, está dando algum erro.

Para algumas pessoas, quando elas se logan, aparece o cardápio da segunda feira, para outras (não sei como) carrega o de quarta-feira.

Tem esse script criando por um programador que ao digitar o cep a pessoa vai para o form:

function delivery(){
  var cep1 = document.getElementById("cep1").value;
  var cep2 = document.getElementById("cep2").value;
  var cep = cep1 + "-" + cep2;
  var data = new Date();
  var mes = data.getMonth() + 1; 
  var diaMes = data.getDate();
  var hoje = diaMes + "/" + mes;
  var diaSemana = data.getDay();
  var hora = data.getHours();
  if(feriados.indexOf(hoje) != -1 || diaSemana == 0 || diaSemana == 6){
	  $("#data").venobox().trigger('click');
  }else if(hora < 7 || hora > 14){
	  $("#hora").venobox().trigger('click');
  }else if(ceps.indexOf(cep) == -1){
	  $("#cep").venobox().trigger('click');
  }else{
	  if (diaSemana == 1){
		  location.assign("http://bardananatural.com.br/pedido_online/index_segunda.php");
	  } else if (diaSemana == 2){
		  location.assign("http://bardananatural.com.br/pedido_online/index_terca.php");
	  } else if (diaSemana == 3){
		  location.assign("http://bardananatural.com.br/pedido_online/index_quat.php");
	  } else if (diaSemana == 4){
		  location.assign("http://bardananatural.com.br/pedido_online/index_quin.php");
	  } else if (diaSemana == 5){
		  location.assign("http://bardananatural.com.br/pedido_online/index_sext.php");
	  } else {
		  $("#hora").venobox().trigger('click');
	  };
  };
 }

Lá ela coloca os dados para logar, ou se não tiver cadastro se cadastrar (abaixo o index_segunda.php):

<!doctype html>
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta charset="utf-8">
<title>BARDANA | Login</title>
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:700' rel='stylesheet' type='text/css'>
<link href='form.css' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="pagina">
  <div class="barra" style="text-align: center">ACESSO AO PEDIDO</div>
<h3><span class="titulo">Basta inserir o seu e-mail cadastrado para acessar o pedido!</span><br>
</h3>
<div>
  <form action="logar_seg.php" method="post" id="form1">
    
  <table width="700" border="0">
  <tr>
    <td width="129">E-mail:</td>
    <td width="241"><input id="email" name="email" type="text" size="35"></td>
    <td width="316" rowspan="3" align="center" valign="top"><img src="http://www.ramosdesign.com.br/bardana/images/cozinheira_novo_logo.png" width="300" height="185" alt=""/></td>
  </tr>
  <tr>
    <td colspan="2"> </td>
    </tr>
  <tr>
    <td align="center" valign="middle"><input name="Submit" type="submit" class="submit" value="entrar"></td>
    <td> </td>
    </tr>
  </table>
  <br>
    <span style="font-size: 12px">Ainda não é nosso cliente? Clique <a href="cadastro02.php">aqui</a> para se cadastrar. (menos de 30 segundos). </span>
  </form>
</div>
</div> 
</body>
</html>

Abaixo o cadastro segunda.php

<!doctype html>
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta charset="utf-8">
<title>BARDANA</title>
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:700' rel='stylesheet' type='text/css'>
<link href='form.css' rel='stylesheet' type='text/css'>
</head>
<body>
<div id="pagina">
<img src="images/logo_cardapio.png">
<div class="barra">CADASTRO DE CLIENTES</div>
<h3><span class="titulo">Informações:</span><br>
</h3>
<div>
  <form action="cadastro_db02.php" method="post" id="form">
    
  <table width="700" border="0">
  <tr>
    <td>Nome:</td>
    <td><input id="nome" name="nome" type="text" size="60"></td>
  </tr>
  <tr>
    <td>Endereço:</td>
    <td><input id="endereco" name="endereco" type="text" size="60"></td>
  </tr>
  <tr>
    <td>CEP:</td>
    <td><input name="cep" type="text" id="cep" size="60"></td>
  </tr>
  <tr>
    <td>Telefone(s):</td>
    <td><input id="telefone" name="telefone" type="text" size="60"></td>
  </tr>
  <tr>
    <td>Email:</td>
    <td><input id="email" name="email" type="text" size="60"></td>
  </tr>
  </table>
  <p>
    <input type="submit" class="submit" name="Submit" value="Cadastrar">
  </p>
  <p><span style="font-size: 12px">Você já é cadastrado? Clique <a href="index_segunda.php">aqui</a> para acessar o pedido onlie.</span></p>
  </form>
</div>
</div> 
</body>
</html>

A pessoa se cadastrando volta para index_segunda02.php que é igual ao index_segunda.php apenas tem uma mensagem de cadastro com sucesso!

Ela inseri o email e vai para o formulário segunda.php (pedido)

<? include "login_senha.php";
  include ("verifica02.php");
  
$email = $_SESSION['email_usuario'];

$sql = mysql_query("SELECT * FROM usuarios WHERE email = '$email'");
while($linha = mysql_fetch_array($sql)) {
	$nome = $linha['nome'];
	$endereco = $linha['endereco'];
	$cep = $linha['cep'];
	$telefone = $linha['telefone'];
	$email = $linha['email'];
	$pagamento = $linha['pagamento'];
}
?>
<!doctype html>
<html lang="pt-BR">
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<meta charset="utf-8">
<title>BARDANA | Segunda</title>
<link href='http://fonts.googleapis.com/css?family=Lato:400,700,900' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Roboto+Slab:700' rel='stylesheet' type='text/css'>
<link href='form.css' rel='stylesheet' type='text/css'>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="form.js"></script>
</head>
<body>
<div id="pagina">
<img src="images/logo_cardapio.png">
<div class="barra">CARDÁPIO | SEGUNDA-FEIRA</div>
<h3>Agora ficou fácil de fazer o seu pedido, experimente!<br>
  <em>Pedidos feitos até as 11hs serão entregues no máximo às 11:50</em> </h3>
 

<!-- OPÇÕES -->
<h1>1</h1>
<div id="opcoes">
<span class="titulo">Escolha a sua opção:</span><br>
<div id="op1"><input type="radio" name="promo" value="17.90" op="1"> <strong>Opção 1:</strong> 3 Quentes e 3 Saladas - R$ 17,90<br></div>
<div id="op2"><input type="radio" name="promo" value="20.90" op="2"> <strong>Opção 2:</strong> 4 Quentes e 4 Saladas - R$ 20,90<br></div>
<div id="op3"><input type="radio" name="promo" value="22.90" op="3"> <strong>Opção 3:</strong> 5 Quentes e 5 Saladas - R$ 22,90<br></div>
<div id="op4"><input type="radio" name="promo" value="0.00"  op="4"> <strong>Opção 4: Monte seu prato à vontade</strong> (mínimo de 6 itens)<br></div>
</div>
<input type="button" id="mudaopcao" class="botao" value=" Mudar a minha opção ">
<br>

<div id="titulo2">
<h1>2</h1>
<span class="titulo">Escolha os itens:</span><br><br>
</div>

<!-- PRATOS QUENTES -->
<div id="quentes">
<div class="titulo">Pratos quentes:</div><br>
<div><input type="checkbox" value="3.50"> <strong>Arroz Cateto Integral</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Arroz Cateto Integral com Brócolis </strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Feijão Carioquinha (P)</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Farofa de Cenoura</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Batata Sauté</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Proteína de Soja Refogada com Alho, Cenoura e Manjericão (P)</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Tofu de Panela – molho de tomate, cenoura rodelas e batata (P)</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Legumes à Moda China</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Espaguete Integral ao Molho Betacaroteno com Azeitonas Pretas (G)</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Bolinho de Abóbora com Queijo e Milho ao Molho Apimentado (G)(L)</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Torta Maravilha de Palmito (G)</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
</div>
<br>

<!-- SALADAS -->
<div id="saladas">
<div class="titulo">Saladas:</div><br>
<div><input type="checkbox" value="3.50"> <strong>Alfaces</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Tomate com Cebolinha</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Rúcula</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Salada de Chicória ao Molho de Manga</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Salada de Cevadinha com Hortelã e Tomatinho (P)(G)</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Berinjela ao Açafrão e Alho Porró</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Aipo, Cenoura e Maçã ao Gergelim</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Couve-flor ao Vinagrete de Curry</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Vagem ao Shoyu e Cebolas</strong><span>: R$ 3,50 - Quant.: <select></select></span></div>
<div><input type="checkbox" value="3.50"> <strong>Frutas</strong><span>: R$ 3,50 - Quant.: <select></select>
</span>*</div>
</div>
<br>
<form action="mail.php" method="post">
 <td><strong>Tem alguma observação sobre a salada de frutas? </strong></td>
    <td><input name="obsfruta" type="text" id="obsfruta" value=" Nenhuma" size="90"></td>
<p>
  <strong>Legenda:</strong><br>
  L = contém lactose<br>
  G = contém glúten<br>
  P = fonte de proteína vegetal<br>
  A = contém açucar<br>
  <br>
  
  <!-- SOBREMESAS -->
<div id="sobremesas">
<span class="titulo">Sobremesas:</span><br>
<div><input type="checkbox" value="5.50"> <strong>Torta Integral de Banana A G</strong>: R$ 5,50 - Quant.: <select></select></div>
<div><input type="checkbox" value="5.50"> <strong>Torta Integral de Banana c/ Chocolate Meio Amargo A G</strong>: R$ 5,50 - Quant.: <select></select></div>
<div><input type="checkbox" value="5.50"> <strong>Torta Integral de Banana s/ Açúcar G</strong>: R$ 5,50 - Quant.: <select></select></div>
<div><input type="checkbox" value="5.50"> <strong>Torta Integral de Morango  (A)(G)</strong>: R$ 5,50 - Quant.: <select></select></div>
</div>
<br>

<!-- SUCOS -->
<div id="sucos">
<span class="titulo">Sucos:</span><br>
<div><input type="checkbox"> <strong>Laranja</strong>: <input type="radio" name="suco1" l="300ml" value="4.50">300ml(R$ 4,50) <input type="radio" name="suco1" l="500ml" value="5.90" checked>500ml(R$ 5,90) - Quant.: <select></select></div>
<div><input type="checkbox"> <strong>Cacau com Morango</strong>: <input type="radio" name="suco2" l="300ml" value="4.50">300ml(R$ 4,50) <input type="radio" name="suco2" l="500ml" value="5.90" checked>500ml(R$ 5,90) - Quant.: <select></select></div>
<div><input type="checkbox"> <strong>Manga com Abacaxi</strong>: <input type="radio" name="suco3" l="300ml" value="4.50">300ml(R$ 4,50) <input type="radio" name="suco3" l="500ml" value="5.90" checked>500ml(R$ 5,90) - Quant.: <select></select></div>
<div><input type="checkbox"> <strong>Suco Verde*</strong>: <input type="radio" name="suco5" l="300ml" value="4.90">300ml(R$ 4,90) <input type="radio" name="suco5" l="500ml" value="6.90" checked>500ml(R$ 6,90) - Quant.: <select></select></div>
<br>
<div>*Verde: Laranja, Melão, Maçã, Limão, Couve e Hortelã</div>
</div>
<br><br>

<h1>3</h1>
<span class="titulo">Acrescente outros itens:</span><br><br>

<!-- BEBIDAS -->
<div id="bebidas">
<span class="titulo">Bebidas:</span><br>
<div><input type="checkbox" value="3.90"> <strong>Mate Leão Sabores - Copo 250ml</strong>: R$ 3,90 - Quant.: <select></select></div>
<div><input type="checkbox" value="2.90"> <strong>Água Mineral - Garrafa 300ml</strong>: R$ 2,90 - Quant.: <select></select></div>
<div><input type="checkbox" value="3.90"> <strong>Coca Cola Zero - Lata</strong>: R$ 3,90 - Quant.: <select></select></div>
<div><input type="checkbox" value="3.90"> <strong>Guaraná Zero - Lata</strong>: R$ 3,90 - Quant.: <select></select></div>
</div>
<br>

<!-- SOPAS -->
<div id="sopas">
<span class="titulo">Sopas:</span><br>
<div><input type="checkbox" value="11.90"> 
<strong>Inhame com Agrião</strong>: R$ 11,90 - Quant.: 
<select></select></div>
</div>
<br><br>

<h1>4</h1>
<span class="titulo">Gostaria de conhecer o nosso Empório? <input type="button" id="btemporio" class="botao" value=" Clique aqui "></span><br>

<!-- EMPORIO -->
<div id="emporio">
<!--<span class="titulo">Empório:</span><br>-->
<div><input type="checkbox" value="0.00"> <strong>Em breve</strong>: R$ 0,00 - Quant.: <select></select></div>
<div><input type="checkbox" value="0.00"> <strong>Em breve</strong>: R$ 0,00 - Quant.: <select></select></div>
<div><input type="checkbox" value="0.00"> <strong>Em breve</strong>: R$ 0,00 - Quant.: <select></select></div>
</div>
<br><br>

<h1>5</h1>
<span class="titulo">Informações:</span><br>

<form action="mail.php" method="post">

<table width="700" border="0">
  <tr>
    <td>Total do seu pedido:</td>
    <td><span id="total2"></span></td>
  </tr>
  <tr>
    <td style="width:200px;">Qual a forma de pagamento?</td>
    <td>       
     <select id="pagamento" name="pagamento">
        <option value="Dinheiro">Dinheiro</option>
        <option value="Cartão de Débito - Elo">Cartão de Débito - Elo</option>
        <option value="Cartão de Débito - Visa">Cartão de Débito - Visa</option>
        <option value="Cartão de Débito - Redeshop">Cartão de Débito - Redeshop</option>
        <option value="Cartão de Débito - Master">Cartão de Débito - Master</option>
        <option value="Cartão de Crédito - American">Cartão de Crédito - American</option>
        <option value="Cartão de Crédito - Diners">Cartão de Crédito - Diners</option>
        <option value="Cartão de Crédito - Visa">Cartão de Crédito - Visa</option>
        <option value="Cartão de Crédito - Master">Cartão de Crédito - Master</option>
        <option value="Vale-Refeição - Green Vale">Voucher - Green Vale</option>
        <option value="Vale-Refeição - Plan Vale">Voucher - Plan Vale</option>
        <option value="Vale-Refeição - Visa Vale">Voucher - Visa Vale</option>
        <option value="Vale-Refeição - Ticket Refeição">Voucher - Ticket Refeição</option>
        <option value="Vale-Refeição - Sodexo">Voucher - Sodexo</option>
     </select>
   </td>
  </tr>
  <tr>
    <td>Precisa de troco?</td>
    <td><input id="troco" name="troco" type="text" size="60"></td>
  </tr>
  <tr>
    <td>Nome:</td>
    <td><input id="nome" name="nome" type="text" size="60" value="<? echo $nome ?>"></td>
  </tr>
  <tr>
    <td>Endereço:</td>
    <td><input id="endereco" name="endereco" type="text" size="60" value="<? echo $endereco ?>"></td>
  </tr>
  <tr>
    <td>CEP:</td>
    <td><input id="cep" name="cep" type="text" size="60" value="<? echo $cep ?>"></td>
  </tr>
  <tr>
    <td>Telefone(s):</td>
    <td><input id="telefone" name="telefone" type="text" size="60" value="<? echo $telefone ?>"></td>
  </tr>
  <tr>
    <td>Email:</td>
    <td><input id="email" name="email" type="text" size="60" value="<? echo $email ?>"></td>
  </tr>
</table>
<br><br>

	<!--<input type="hidden" name="mensagem" value="">-->
    <input type="hidden" name="data" value="">
    <input type="hidden" name="mtotal" value="">
    <input type="hidden" name="nop" value="">
    <input type="hidden" name="op" value="">
    <input type="hidden" name="quentes" value="">
    <input type="hidden" name="saladas" value="">
    <input type="hidden" name="sopas" value="">
    <input type="hidden" name="sobremesas" value="">
    <input type="hidden" name="sucos" value="">
    <input type="hidden" name="bebidas" value="">
    <input type="hidden" name="emporio" value="">
	<input type="submit" class="submit" name="Submit" value="Faça seu pedido!">
</form>
<br><br>

<div id="total"></div>

<div id="alerta"></div>

<div id="atencao"></div>

<div id="msg"></div>

</div> <!-- pagina -->

<script type="text/javascript">
function setaData() {
     localtime = new Date();
     document.getElementById("id_do_txtbox").value = localtime;
}
</script>
</body>
</html>

Não consigo entender como algumas pessoas estão indo para quarta-feira e outras, corretamente, para segunda!

Alguem pode me ajudar?

Peço desculpas a todos os profissionais aqui, eu sou leigo, entendo pouco, mas eu consegui fazer isso sozinho com ajuda dos tutoriais e video aulas, testei, está ok, para mim aparece perfeito, não entendo pq para algumas pessoas dá esse erro. Carrega outro formulário e não esse do dia certo.


Viewing all articles
Browse latest Browse all 14190

Trending Articles