<div class="m-b-md">
    <h3 class="m-b-none">Cadastro de Funcionários</h3>
</div>
<div class="row">

</div>

<section class="panel panel-default">

    <div class="panel-body">
        <?php
        $attributes = array('class' => 'form-horizontal', 'id' => 'formFuncionario');
        echo form_open_multipart("funcionario/adicionar/", $attributes);
        ?>


        <div class="form-group">
            <label class="col-sm-2 control-label">Datas</label>

            <div class="col-sm-10">
                <div class="row">
                    <div class="col-md-4">

                        <input id="dataEntrada" class="form-control datepicker" type="text" name="dataEntrada"
                               placeholder="Data da Entrada"/>
                    </div>
                    <div class="col-md-4">

                        <input id="dataNascimento" class="form-control datepicker" type="text" name="dataNascimento"
                               placeholder="Data de Nascimento"/>
                    </div>

                    <div class="col-md-4">
                        <input id="dataProximaFerias" class="form-control datepicker" type="text"
                               name="dataProximaFerias" placeholder="Próximas data de Férias"/>
                    </div>


                </div>
            </div>
        </div>

        <div class="line line-dashed b-b line-lg pull-in"></div>

        <div class="form-group">
            <label class="col-sm-2 control-label">Nome</label>

            <div class="col-sm-10">
                <div class="row">
                    <div class="col-md-3">
                        <input name="nomeFuncionario" id="nomeFuncionario" type="text" maxlength="20"
                               class="form-control" placeholder="Escreva Somente o nome">
                    </div>

                    <div class="col-md-6">
                        <input name="sobreNome" id="sobreNome" type="text" style="" class="form-control"
                               placeholder="Escreva o Sobrenome">
                    </div>
                    <div class="col-md-3">

                        <select name="funcao" class="form-control">
                            <option value="">Selecione uma Função</option>
                            <option value="Porteiro">Porteiro</option>
                            <option value="Jardineiro">Jardineiro</option>
                            <option value="Manutencao">Manutenção</option>
                        </select>
                    </div>

                </div>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-2 control-label">Endereço</label>

            <div class="col-sm-10">
                <div class="row">
                    <div class="col-md-8">
                        <input name="endereco" id="endereco" type="text" style="" class="form-control"
                               placeholder="Digite o Endereço">
                    </div>

                    <div class="col-md-4">
                        <input name="bairro" id="bairro" type="text" style="" class="form-control"
                               placeholder="Digite o Bairro">
                    </div>

                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">Cidade</label>

            <div class="col-sm-10">
                <div class="row">
                    <div class="col-md-6">
                        <input name="cidade" id="cidade" type="text" style="" class="form-control" placeholder="Cidade">
                    </div>

                    <div class="col-md-3">

                        <select name="uf" class="form-control ">
                            <option value="">Selecione um Estado</option>
                            <option value="Goiás">Goiás</option>
                            <option value="Distrito Federal">Distrito Federal</option>
                            <option value="Minas Gerais">Minas Gerais</option>
                        </select>
                    </div>

                    <div class="col-md-3">
                        <input name="cep" id="titulo_not" type="cep" style="" class="form-control" placeholder="Cep"
                               maxlength="9" onKeyDown="Mascara(this, Cep);" onKeyPress="Mascara(this, Cep);"
                               onKeyUp="Mascara(this, Cep);">
                    </div>

                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">Documentos</label>

            <div class="col-sm-10">
                <div class="row">

                    <div class="col-md-4">
                        <input id="cpfFuncionario" name="cpfFuncionario" type="text" class="form-control"
                               placeholder="Digite o CPF" maxlength="14" onKeyDown="Mascara(this, Cpf);"
                               onKeyPress="Mascara(this, Cpf);" onKeyUp="Mascara(this, Cpf);">
                    </div>

                    <div class="col-md-4">
                        <input id="rgFuncionario" name="rgFuncionario" type="text" class="form-control"
                               placeholder="Digite o RG" maxlength="14" onKeyDown="Mascara(this, rga);"
                               onKeyPress="Mascara(this, rga);" onKeyUp="Mascara(this, rga);">
                    </div>

                    <div class="col-md-4">
                        <input id="orgaoEmissorRgFuncionario" name="orgaoEmissorRgFuncionario" type="text"
                               class="form-control" placeholder="Orgão Expeditor RG" maxlength="20">
                    </div>

                </div>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-2 control-label">Telefones</label>

            <div class="col-sm-10">
                <div class="row">
                    <div class="col-md-4">
                        <input id="telCelular" name="telCelular" type="tel" class="form-control" placeholder="Celular"
                               maxlength="14" onKeyDown="Mascara(this, Telefone);" onKeyPress="Mascara(this, Telefone);"
                               onKeyUp="Mascara(this, Telefone);">
                    </div>

                    <div class="col-md-4">
                        <input id="telResidencial" name="telResidencial" type="tel" class="form-control"
                               placeholder="Residencial" maxlength="14" onKeyDown="Mascara(this, Telefone);"
                               onKeyPress="Mascara(this, Telefone);" onKeyUp="Mascara(this, Telefone);">
                    </div>
                    <div class="col-md-4">
                        <input id="telRecados" name="telRecados" type="text" class="form-control" placeholder="Recados"
                               maxlength="14" onKeyDown="Mascara(this, Telefone);" onKeyPress="Mascara(this, Telefone);"
                               onKeyUp="Mascara(this, Telefone);">
                    </div>

                </div>
            </div>
        </div>


        <div class="form-group">
            <label class="col-sm-2 control-label">Jornada de Trabalho</label>

            <div class="col-sm-10">
                <div class="row">
                    <div class="col-md-4">
                        <select name="jornada" class="form-control">
                            <option value="8">8 Horas/Dia</option>
                            <option value="12">12 Horas/Dia</option>
                        </select>
                    </div>
                    <div class="col-md-4">
                        <input id="matricula" id="matricula" type="text" class="form-control"
                               placeholder="Matricula Funcionario">
                    </div>
                    <div class="col-sm-4">
                        <select name="situacao" class="form-control">
                            <option>Ativo</option>
                            <option>Inativo</option>

                        </select>

                    </div>


                </div>
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label">Grau de Instrução</label>

            <div class="col-sm-10">
                <div class="row">
                    <div class="col-md-4">
                        <select name="grauInstrucao" class="form-control">

                            <option>Fundamental Completo</option>
                            <option>Médio Incompleto</option>
                            <option>Médio Completo</option>
                            <option>Superior Incompleto</option>
                            <option>Superior Completo</option>
                        </select>
                    </div>
                    <div class="col-md-4">
                        <select name="sexo" class="form-control ">
                            <option value="">Selecione o Sexo</option>
                            <option value="Masculino">Masculino</option>
                            <option value="Feminino">Feminino</option>
                        </select>
                    </div>

                    <div class="col-md-4">
                        <select name="estadoCivil" class="form-control ">

                            <option value="">Selecione o Estado Civil</option>
                            <option value="Casado">Casado</option>
                            <option value="Solteiro">Solteiro</option>
                            <option value="Divorciado">Divorciado</option>
                        </select>
                    </div>

                </div>
            </div>
        </div>

        <div class="line line-dashed b-b line-lg pull-in"></div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="Nome">Email</label>

            <div class="col-sm-10">
                <input type="text" class="form-control" id="email" name="email">
            </div>
        </div>
        <div class="line line-dashed b-b line-lg pull-in"></div>
        <div class="form-group">
            <label class="col-sm-2 control-label" for="Nome">Imagem do Funcionário</label>

            <div class="col-sm-10">
                <input type="file" class="form-control" id="imagemFuncionario" name="imagemFuncionario"  accept=".png, .jpg, .jpeg">
            </div>
        </div>


        <div class="line line-dashed b-b line-lg pull-in"></div>
        <div class="form-group">
            <div class="col-sm-4 col-sm-offset-2">
                <a href="<?php echo base_url() ?>funcionario" id="" class="btn btn-dark"><i
                        class="icon-arrow-left"></i> Voltar</a>
                <button class="btn btn-primary"><i class="fa fa-save"></i> Cadastrar</button>
            </div>
        </div>
        <!--</form>-->

    </div>

</section>


<script type="text/javascript">
    $(document).ready(function () {
        $("#formFuncionario").validate({
            rules: {
                nomeFuncionario: {required: true},
                funcao: {required: true},
                dataEntrada: {required: true},
                telCelular: {required: true}
            },
            messages: {
                nomeFuncionario: {required: 'Campo Requerido.'},
                funcao: {required: 'Campo Requerido.'},
                dataEntrada: {required: 'Campo Requerido.'},
                telCelular: {required: 'Campo Requerido.'}
            },
            errorClass: "help-inline",
            errorElement: "span",
            highlight: function (element, errorClass, validClass) {
                $(element).parents('.control-group').addClass('error');
            },
            unhighlight: function (element, errorClass, validClass) {
                $(element).parents('.control-group').removeClass('error');
                $(element).parents('.control-group').addClass('success');
            }
        });

        $(".datepicker").datepicker({dateFormat: 'dd/mm/yy'});


    });

</script>
