Skip to content

Commit

Permalink
Merge branch 'pre-release' into nicolly2024
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolly015 authored Jun 19, 2024
2 parents 85b7285 + 58fa252 commit 3e0a75e
Show file tree
Hide file tree
Showing 145 changed files with 20,433 additions and 9,166 deletions.
31 changes: 30 additions & 1 deletion BD/wegia001.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,35 @@ CREATE TABLE IF NOT EXISTS `wegia`.`saude_fichamedica_descricoes` (
ENGINE = InnoDB;


-- Table `wegia`.`saude_fichamedica_historico`

CREATE TABLE IF NOT EXISTS `wegia`.`saude_fichamedica_historico` (
`id_fichamedica_historico` INT NOT NULL AUTO_INCREMENT,
`id_pessoa` INT(11) NOT NULL,
`data` DATETIME NOT NULL,
PRIMARY KEY (`id_fichamedica_historico`),
INDEX `fk_saude_fichamedica_historico_pessoa1_idx` (`id_pessoa` ASC),
CONSTRAINT `fk_saude_fichamedica_historico_pessoa1`
FOREIGN KEY (`id_pessoa`)
REFERENCES `wegia`.`pessoa` (`id_pessoa`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;

-- Table `wegia`.`saude_fichamedica_historico_descricoes`

CREATE TABLE IF NOT EXISTS `wegia`.`saude_fichamedica_historico_descricoes` (
`id_fichamedica_historico_descricao` INT NOT NULL AUTO_INCREMENT,
`id_fichamedica_historico` INT(11) NOT NULL,
`descricao` VARCHAR(2048) NOT NULL,
PRIMARY KEY (`id_fichamedica_historico_descricao`),
INDEX `fk_ficha_medica_historico_descricoes_ficha_medica_idx` (`id_fichamedica_historico` ASC),
CONSTRAINT `fk_fichamedica_historico_descricoes`
FOREIGN KEY (`id_fichamedica_historico`) REFERENCES `wegia`.`saude_fichamedica_historico` (`id_fichamedica_historico`)
ON DELETE CASCADE
ON UPDATE CASCADE)
ENGINE = InnoDB;


-- -----------------------------------------------------
-- Table `wegia`.`saude_tabelacid`
Expand Down Expand Up @@ -1856,7 +1885,7 @@ CREATE TABLE IF NOT EXISTS `wegia`.`aviso`(
ON DELETE CASCADE
ON UPDATE CASCADE,
FOREIGN KEY (`id_pessoa_atendida`)
REFERENCES `wegia`.`atendido` (`pessoa_id_pessoa`)
REFERENCES `wegia`.`pessoa` (`id_pessoa`)
ON DELETE CASCADE
ON UPDATE CASCADE)

Expand Down
21 changes: 21 additions & 0 deletions Functions/testaCPF.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function testaCPF(strCPF) {
var strCPF = strCPF.replace(/[^\d]+/g, ''); // Limpa a string do CPF removendo espaços em branco e caracteres especiais.
var Soma;
var Resto;
Soma = 0;
if (strCPF == "00000000000") return false;

for (i = 1; i <= 9; i++) Soma = Soma + parseInt(strCPF.substring(i - 1, i)) * (11 - i);
Resto = (Soma * 10) % 11;

if ((Resto == 10) || (Resto == 11)) Resto = 0;
if (Resto != parseInt(strCPF.substring(9, 10))) return false;

Soma = 0;
for (i = 1; i <= 10; i++) Soma = Soma + parseInt(strCPF.substring(i - 1, i)) * (12 - i);
Resto = (Soma * 10) % 11;

if ((Resto == 10) || (Resto == 11)) Resto = 0;
if (Resto != parseInt(strCPF.substring(10, 11))) return false;
return true;
}
Loading

0 comments on commit 3e0a75e

Please sign in to comment.