This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Celular | |
jQuery.validator.addMethod('celular', function (value, element) { | |
value = value.replace("(",""); | |
value = value.replace(")", ""); | |
value = value.replace("-", ""); | |
value = value.replace(" ", "").trim(); | |
if (value == '0000000000') { | |
return (this.optional(element) || false); | |
} else if (value == '00000000000') { | |
return (this.optional(element) || false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Estrutura da tabela `pais` | |
-- | |
CREATE TABLE IF NOT EXISTS `pais` ( | |
`paisId` tinyint(3) unsigned NOT NULL AUTO_INCREMENT, | |
`paisNome` varchar(50) NOT NULL, | |
`paisName` varchar(50) NOT NULL, | |
PRIMARY KEY (`paisId`) | |
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=253 ; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.validator.addMethod("verificaCPF", function(value, element) { | |
value = value.replace('.',''); | |
value = value.replace('.',''); | |
cpf = value.replace('-',''); | |
while(cpf.length < 11) cpf = "0"+ cpf; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.validator.addMethod("cnpj", function(cnpj, element) { | |
cnpj = jQuery.trim(cnpj);// retira espaços em branco | |
// DEIXA APENAS OS NÚMEROS | |
cnpj = cnpj.replace('/',''); | |
cnpj = cnpj.replace('.',''); | |
cnpj = cnpj.replace('.',''); | |
cnpj = cnpj.replace('-',''); | |
var numeros, digitos, soma, i, resultado, pos, tamanho, digitos_iguais; | |
digitos_iguais = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery.validator.addMethod("greaterThan", | |
function(value, element, params) { | |
if (!/Invalid|NaN/.test(new Date(value))) { | |
return new Date(value) > new Date($(params).val()); | |
} | |
return isNaN(value) && isNaN($(params).val()) | |
|| (Number(value) > Number($(params).val())); | |
},'Must be greater than {0}.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Valida se a data fina é maior que a data inicio | |
*/ | |
jQuery.validator.addMethod("greaterThan", | |
function(value, element, params) { | |
var temp = value.split("/"); | |
var temp2 = $(params).val().split("/"); | |
if (!/Invalid|NaN/.test(new Date(temp[2], (temp[1] - 1), temp[0]))) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//var_dump($modelo->respDate); | |
//var_dump($modelo->respData); | |
//CARREGAR TODAS AS DATAS DO PERIODO SELECIONADO | |
//var_dump($modelo->respRawDate); | |
$dataUnix = $modelo->respRawDate; | |
$j = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT UNIX_TIMESTAMP(dt_criacao) AS 'dt_criacao' | |
FROM ( | |
SELECT | |
@row := @row +1 AS rownum, dt_criacao | |
FROM ( | |
SELECT @row :=0) r, tb_dados WHERE num_sim = '1' AND dt_criacao BETWEEN '2017-02-01' AND '2017-02-09' | |
) ranked | |
WHERE rownum %30 =1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- ATUALIZANDO A QUERY PARA VERSÃO 5.7 --> | |
-- Seleciona a cada dia | |
SELECT a.* | |
FROM tb_dados a | |
INNER JOIN ( | |
SELECT DATE(dt_criacao) date, DAY(dt_criacao) day, MIN(dt_criacao) min_date | |
FROM tb_dados GROUP BY DATE(dt_criacao),DAY(dt_criacao) ) b | |
ON DATE(a.dt_criacao) = b.date AND DAY(a.dt_criacao) = b.day AND a.dt_criacao = b.min_date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function resizeImage($file, $savePath){ | |
define ('MAX_WIDTH', 2500);//max image width | |
define ('MAX_HEIGHT', 2500);//max image height | |
define ('MAX_FILE_SIZE', 10485760); | |
//iamge save path | |
$path = $savePath.'/'; | |
//size of the resize image |
OlderNewer