Skip to content

Instantly share code, notes, and snippets.

View danillo10's full-sized avatar

Danillo danillo10

  • Belo Horizonte
View GitHub Profile
function progress(){
$("#progressBar").show();
var intervalo = setInterval(function(){
$.ajax("/progress").done(function(data){
$("#progressBar").attr("data-percent", data)
$("#messageBar").html(data + "% completo");
$('#progressBar').progress();
if(data == 100){
clearInterval(intervalo)
}
<form method="POST" id="cliente" class="ui form">
<h4 class="ui dividing header">Cadastro Cliente</h4>
<div class="ui error message"></div>
<h5><b>Dados</b></h5>
<div class="fields">
<div class="four wide field">
<label for="cnpjcpf">CNPJ / CPF *</label>
<div class="ui icon input cliente">
CREATE TABLE IF NOT EXISTS `estado` (
`id_estado` INT(16) NOT NULL,
`nome_estado` VARCHAR(64) NOT NULL,
`uf_estado` VARCHAR(2) NOT NULL,
`codigo_estado` CHAR(2) NOT NULL,
`ICMS` INTEGER NULL,
`FCP` INTEGER NULL,
`updated_at` TIMESTAMP() NULL,
`created_at` TIMESTAMP() NULL,
PRIMARY KEY (`id_estado`)
pesquisaCPF(cpf){
this.clienteService.pesquisaCPF(cpf)
.subscribe((data)=>{
this.dados.push(data)
if(this.dados[0].status == 1){
this.clienteService.pesquisaCPF(cpf)
.subscribe((data)=>{
console.log(JSON.stringify(data))
this.resposta = data;
$.prompt("O CPF informado pertence ao cliente/fornecedor " + this.resposta.cliente[0].nome_fantasia, {
$nfe = new \NFePHP\NFe\Make();
$std = new \stdClass();
// $std->versao = '3.10';
$std->versao = '4.00';
$nfe->taginfNFe($std);
$std = new \stdClass();
$std->cUF = 21;
$std->cNF = '80070008';
// Javascript
function progress(data){
timer = setInterval(readCookie, 100)
}
function readCookie(cookie){
$.ajax({
url: '/progress',
success: function(data){
// JAVASCRIPT
function readCookie(cookie){
var num = 0;
timer = setInterval(function(){
var cookie = getCookie('loading')
console.log(cookie)
$('.progress-bar').css({'width':cookie+'%'}).html(cookie+'%')
},500)
public function cadastrarEmpresa(Request $request)
{
$empresa = new Empresa;
foreach($request->all() as $dados => $value){
(($dados == '_token') ? '' : $empresa->$dados = $request->$dados);
}
$empresa->save();
}
$noticias->filter('article > div > h4 > a')->each(function ($response) {
$noticia = $response->text();
});
//HomeController
public function enviarContato(Request $request)
{
Mail::to($request->email)
->cc('contato@adonaicoc.com.br')
->send(new Contato);
$errors = new MessageBag(['mensagem' => ['E-mail enviado com sucesso.']]);
return Redirect::back()->withErrors($errors)->withInput(Input::except('mensagem'));