Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $('.adicionar').on('click','a',function(){
- var id_p=$(this).attr("rel");
- $.ajax({
- type:"GET",
- url:"carrinho.php",
- data:{id_p:id_p,acao:"mais"},
- success: function(atual){
- $(".car").html(atual);
- }
- });
- return false
- });
- $('.remover').on('click','a',function(){
- var id_p=$(this).attr("rel");
- $.ajax({
- type:"GET",
- url:"carrinho.php",
- data:{id_p:id_p,acao:"menos"},
- success: function(atual){
- $(".car").html(atual);
- }
- });
- return false
- });
- $(".txtqtd").blur(function(){
- var id_p=$(this).attr("id");
- var idqtd=$(this).val();
- $.ajax({
- type:"GET",
- url:"carrinho.php",
- data:{id_p:id_p, acao:"up", idqtd:idqtd},
- success: function(atual){
- $(".car").html(atual)
- }
- });
- return false
- });
- $(function(){
- $("a[rel~=external]").attr("target","_blank");
- });
- $(document).on('click','#btnenviar',function(){
- var nome = $("#cliente_cli").val();
- var email = $("#email_cli").val();
- var end = $("#end_cli").val();
- var bairro = $("#bairro_cli").val();
- var cidade = $("#cidade_cli").val();
- var est = $("#est_cli").val();
- var cep = $("#cep").val();
- var tel = $("#tel_cli").val();
- var cel = $("#cel_cli").val();
- if(nome=="" || email=="" || end=="" || bairro=="" || cidade=="" || est=="" || cep=="" || tel=="" || cel=="" ){
- alert("O preenchimento dos campos do formulário é obrigatório");
- } else {
- $.ajax({
- type:"GET",
- url:"new_pedido_template.php",
- data:{cliente_cli:nome, email_cli:email, end_cli:end, bairro_cli:bairro, cid_cli:cidade, est_cli:est, cep:cep, tel_cli:tel, cel_cli:cel,},
- success: function(atual){
- $("#btnenviar").hide('slow');
- alert("Pedido enviado com sucesso!");
- window.close();
- }
- });
- }
- return false
- });
- $(document).on("click",'#f_pedido',function(){
- window.close();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement