Example #1
0
function validate()
{
    if (!isset($_POST['codigo']) || $_POST['codigo'] == "") {
        return false;
    }
    if (!isset($_POST['nome']) || $_POST['nome'] == "") {
        return false;
    }
    if (!isset($_POST['cpf']) || $_POST['cpf'] == "") {
        return false;
    }
    if (!isset($_POST['telefone']) || $_POST['telefone'] == "") {
        return false;
    }
    if (!isset($_POST['valor_custo']) || $_POST['valor_custo'] == "") {
        return false;
    }
    if (!isset($_POST['tipo_custo']) || $_POST['tipo_custo'] == "") {
        return false;
    }
    if (!isset($_POST['email']) || $_POST['email'] == "") {
        return false;
    }
    // if(!isset($_POST['senha']) || $_POST['senha'] == ""){
    //     return false;
    // }
    if (!isset($_POST['empresa_filial']) || $_POST['empresa_filial'] == "Selecione a empresa_filial") {
        return false;
    }
    if (!isset($_POST['turno']) || $_POST['turno'] == "Selecione um turno") {
        return false;
    }
    if (!isset($_POST['cbo']) || $_POST['cbo'] == "Selecione um cbo") {
        return false;
    }
    if (!isset($_POST['rua']) || $_POST['rua'] == "") {
        return false;
    }
    if (!isset($_POST['num']) || $_POST['num'] == "") {
        return false;
    }
    if (!isset($_POST['estado']) || $_POST['estado'] == "Selecione um estado") {
        return false;
    }
    if (isset($_POST['tipo']) && $_POST['tipo'] == "cadastrar" && Funcionario::verificaCodDup($_POST['codigo'])) {
        echo "<script>alert('Codigo Duplicado');</script>";
        return false;
    }
    return true;
}