<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(URL::asset('js/views/cadastro/caso.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('pagina'); ?>
    
<div class="content-wrapper">
    <input type="hidden" id="hdnUsuario" name="usuario" data="<?php echo e(Auth::user()->getId()); ?>"/>
    <input type="hidden" id="hdnUnidade" name="unidade" data="<?php echo e(Auth::user()->getUnidade()); ?>"/>
    <input type="hidden" id="hdnCaso" name="hdncaso" data=""/>
    <input type="hidden" id="hdnId" name="id" data=""/>
    <input type="hidden" id="hdnIdParte" name="idparte" data=""/>
    <input type="hidden" id="hdnIdAdvogado" name="idadvogado" data=""/>
    <input type="hidden" id="hdnIdAtividade" name="idatividade" data=""/>
    
    <div class="container-fluid mt-2">
        <?php if(session('mensagem')): ?>
            <?php if(session('mensagem')): ?>
                <div id="mensagem" class=" card-body alert alert-success text-center">
                    <i><?php echo e(session('mensagem')); ?></i>
                </div>
            <?php endif; ?>
        <?php elseif(session('exclusao')): ?>
            <?php if(session('exclusao')): ?>
                <div id="exclusao" class=" card-body alert alert-danger text-center">
                    <i><?php echo e(session('exclusao')); ?></i>
                </div>
            <?php endif; ?>
        <?php endif; ?>
        <div id="filtro" class="card mt-2" style="display: none; background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
            <div class="card-body">
                <div class="row"  style="padding-right: 2px;">
                    <div class="col col-md-2 col-4">
                        <label for="cbStatusPesq" class="col-form-label text-md-left">Status</label>
                        <br/>
                        <select id="cbStatusPesq" class="form-control" name="statuspesq" required>
                            <option value="">...TODOS</option>
                            <option value="G">AGUARDANDO</option>
                            <option value="A">ANDAMENTO</option>
                            <option value="E">ENCERRADO</option>
                        </select>
                    </div>
                    <div class="col col-md-2 col-8">
                        <label for="cbTipoPesq" class="col-form-label text-md-left">Tipo</label>
                        <br/>
                        <select id="cbTipoPesq" class="form-control" name="tipopesq" required>
                            
                        </select>
                    </div>
                    
                    <div class="col col-md-5 col-12">
                        <label id="txtPalavra_label" for="txtPalavra"  class="col-form-label text-md-left">Título</label>
                        <input id="txtPalavra" class="form-control" name="palavra" type="text" maxlength="50" value="" required/>
                    </div>
                    
                    <div class="col col-sm-3 col-12 text-right">
                        <label for="btnPesquisar" class="col-form-label text-md-left">&nbsp;</label>
                        <br/>
                        <button id="btnPesquisar" type="button" class="btn btn-outline-secondary" aria-label="Left Align" >
                            <i class="fas fa-search"></i> Pesquisar
                        </button>
                    </div>
                </div>
            </div>
        </div>
        
        <div id="cadastro" class="card mt-2" style="display: none; background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
            
            <?php echo csrf_field(); ?>
            <input type="hidden" id="hdnId" name="id" data=""/>
            
            <div class="card-body">
                <div class="row" style="padding-right: 2px;">
                    <div class="col-md-6">
                        <h4 style="color:#056367;"><i class="fas fa-balance-scale"></i> Casos</h4>
                    </div>
                    <div class="col-md-6">
                        <div class="col text-right">
                            <button id="btnVoltar" type="button" class="btn btn-outline-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar
                            </button>

                            <button id="btnSalvarCaso" type="button" data="" class="btn btn-success" aria-label="Left Align" >
                                <i class="fas fa-save"></i> Salvar
                            </button>

                            <button id="btnExcluir" type="button" data="" class="btn btn-outline-danger" aria-label="Left Align" >
                                <i class="fas fa-trash-alt"></i> Excluir
                            </button>
                            
                        </div>
                    </div>
                    
                </div>
                <hr></hr>
                <div class="row" >
                    <div class="col col-md-12 col-12">
                        <label id="txtTitulo_label" for="txtTitulo"  class="col-form-label text-md-left">Título</label>
                        <input id="txtTitulo" class="form-control" name="titulo" type="text" maxlength="50" value="" required/>
                    </div>
                </div>
                <div class="row" >
                    <div class="col col-md-3 col-12">
                        <label id="txtProcesso_label" for="txtProcesso"  class="col-form-label text-md-left">Nº Processo</label>
                        <input id="txtProcesso" class="form-control" name="processo" type="text" maxlength="50" value="" />
                    </div>
                    <div class="col col-md-2 col-5">
                        <label id="txtData_label" for="txtData"  class="col-form-label text-md-left">Data</label>
                        <input id="txtData" class="form-control" name="data" type="text" onKeyUp="mascara_data(this)" maxlength="10" value="" required/>
                    </div>
                    <div class="col col-md-3 col-7">
                        <label for="cbTipo" class="col-form-label text-md-left">Tipo</label>
                        <br/>
                        <select id="cbTipo" class="form-control" name="tipo" required>
                            
                        </select>
                    </div>
                    <div class="col col-md-2 col-5">
                        <label id="txtPasta_label" for="txtPasta"  class="col-form-label text-md-left">Pasta</label>
                        <input id="txtPasta" class="form-control" name="pasta" type="text" maxlength="10" value=""/>
                    </div>
                    <div class="col col-md-2 col-7">
                        <label for="cbStatus" class="col-form-label text-md-left">Status</label>
                        <br/>
                        <select id="cbStatus" class="form-control" name="status" required>
                            <option value="G">AGUARDANDO</option>
                            <option value="A">ANDAMENTO</option>
                            <option value="E">ENCERRADO</option>
                        </select>
                    </div>
                </div>
                
                <div class="row" >
                    <div class="col col-md-6 col-12">
                        <label id="txtDescricao_label" for="txtDescricao"  class="col-form-label text-md-left">Descrição</label>
                        <textarea id="txtDescricao" class="form-control" rows = "3" name = "descricao" value="" maxlength="2000"></textarea>
                    </div>
                    <div class="col col-md-6 col-12">
                        <label id="txtObs_label" for="txtObs"  class="col-form-label text-md-left">Observação</label>
                        <textarea id="txtObs" class="form-control" rows = "3" name = "obs" value="" maxlength="2000"></textarea>
                    </div>
                </div>
            </div>
        </div>

        <div id="lista">
            <div class="card mt-2" style="background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
                <div class="card-body">
                    <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                        <div class="col-md-6">
                            <h4 style="color:#056367;"><i class="fas fa-balance-scale"></i> Casos</h4>
                        </div>
                        <div class="col-md-6 text-right">
                            <button id="btnFiltro" type="button" class="btn btn-outline-secondary" aria-label="Left Align" >
                                <i class="fas fa-filter"></i> Filtro
                            </button>
                            <button id="btnLimpaFiltro" type="button" class="btn btn-outline-warning" aria-label="Left Align" >
                                <i class="fas fa-filter"></i> Limpa Filtro
                            </button>
                            <button id="btnNovo" type="button" class="btn btn-outline-primary" aria-label="Left Align" >
                                <i class="fas fa-plus-circle"></i> Novo Caso
                            </button>
                        </div>
                        
                    </div>
                    <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                        <div class="col-lg-12 col-12">
                            <table id="tbCaso" class="table table-striped table-bordered text-left mt-2" style="background-color:#fff; color:#056367;">
                                <thead  style="background-color:#404040; color: #ccc; font-weight: bold;">
                                    <tr>
                                        <th><i class="fas fa-gavel"></i> CASOS NO SEU ESCRITÓRIO</th>
                                        <th></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    

                                </tbody>
                            </table>
                            <br>
                        </div> 
                    </div>
                </div>
            </div>

        </div>

        <div id="partes">
            <div class="card mt-2" style="background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
                <div class="card-body">
                    <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                        <div class="col-md-2 col-12">
                            <h4 style="color:#056367;"><i class="fas fa-balance-scale"></i> Casos</h4>
                        </div>
                        <div class="col-md-7 col-12">
                            <div class="card" style="background-color:#fff; color:#056367; border-radius: 10px 0px 10px 0px;">
                                <div id="titulo1" class="card-body">
                                    
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3 col-12 text-right">
                            <button id="btnVoltar2" type="button" class="btn btn-outline-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar aos Casos
                            </button>
                            <button id="btnNovaParte" type="button" class="btn btn-outline-primary" aria-label="Left Align" >
                                <i class="fas fa-plus-circle"></i> Nova Parte
                            </button>
                        </div>
                        
                    </div>
                    <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                        <div class="col-lg-12 col-12">
                            <table id="tbPartes" class="table table-striped table-bordered text-left mt-2" style="background-color:#fff; color:#056367;">
                                <thead  style="background-color:#404040; color: #ccc; font-weight: bold;">
                                    <tr>
                                        <th><i class="fas fa-users"></i>  PARTES NO CASO</th>
                                        <th></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    

                                </tbody>
                            </table>
                            <br>
                        </div> 
                    </div>
                </div>
            </div>

        </div>

        
        <div id="cadpartes" class="card mt-2" style="display: none; background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
            <?php echo csrf_field(); ?>
            
            
            <div class="card-body">
                <div class="row" style="padding-right: 2px;">
                    <div class="col-md-2">
                        <h4 style="color:#056367;"><i class="fas fa-balance-scale"></i> Casos - Partes</h4>
                    </div>
                    <div class="col-md-6 col-12">
                        <div class="card" style="background-color:#fff; color:#056367; border-radius: 10px 0px 10px 0px;">
                            <div id="titulo2" class="card-body">
                                <p>Título do Caso...</p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4 col-12">
                        <div class="col text-right">
                            <button id="btnVoltar3" type="button" class="btn btn-outline-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar para Partes
                            </button>
                            <button id="btnSalvarParte" type="button" class="btn btn-success" aria-label="Left Align" >
                                <i class="far fa-save"></i> Salvar
                            </button>
                            <button id="btnExcluirParte" type="button" data="" class="btn btn-outline-danger" aria-label="Left Align" >
                                <i class="fas fa-trash-alt"></i> Excluir
                            </button>
                        </div>
                    </div>
                </div>
                <hr></hr>
                <div class="row" >
                    <div class="col col-md-6 col-12">
                        <label for="cbParte" class="col-form-label text-md-left">Parte</label>
                        <br/>
                        <select id="cbParte" class="form-control" name="parte" required>
                            
                        </select>
                    </div>
                </div>
                <div class="row" >
                    <div class="col col-md-3 col-12">
                        <label for="cbTipoParte" class="col-form-label text-md-left">Tipo</label>
                        <br/>
                        <select id="cbTipoParte" class="form-control" name="tipoparte" required>
                            <option value="1">POLO ATIVO</option>
                            <option value="2">POLO PASSIVO</option>
                        </select>
                    </div>
                </div>
                
            </div>
        </div>


        <div id="advogados">
            <div class="card mt-2" style="background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
                <div class="card-body">
                    <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                        <div class="col-md-2 col-12">
                            <h4 style="color:#056367;"><i class="fas fa-balance-scale"></i> Casos</h4>
                        </div>
                        <div class="col-md-7 col-12">
                            <div class="card" style="background-color:#fff; color:#056367; border-radius: 10px 0px 10px 0px;">
                                <div id="titulo3" class="card-body">
                                    
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3 col-12 text-right">
                            <button id="btnVoltar4" type="button" class="btn btn-outline-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar aos Casos
                            </button>
                            <button id="btnNovoAdv" type="button" class="btn btn-outline-primary" aria-label="Left Align" >
                                <i class="fas fa-plus-circle"></i> Novo Advogado
                            </button>
                        </div>
                        
                    </div>
                    <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                        <div class="col-lg-12 col-12">
                            <table id="tbAdvogado" class="table table-striped table-bordered text-left mt-2" style="background-color:#fff; color:#056367;">
                                <thead  style="background-color:#404040; color: #ccc; font-weight: bold;">
                                    <tr>
                                        <th><i class="fab fa-earlybirds"></i>  ADVOGADOS NO CASO</th>
                                        <th></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    

                                </tbody>
                            </table>
                            <br>
                        </div> 
                    </div>
                </div>
            </div>

        </div>

        <div id="cadadvogado" class="card mt-2" style="display: none; background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
            <?php echo csrf_field(); ?>
            
            
            <div class="card-body">
                <div class="row" style="padding-right: 2px;">
                    <div class="col-md-2">
                        <h4 style="color:#056367;"><i class="fas fa-balance-scale"></i> Casos - Partes</h4>
                    </div>
                    <div class="col-md-6 col-12">
                        <div class="card" style="background-color:#fff; color:#056367; border-radius: 10px 0px 10px 0px;">
                            <div id="titulo4" class="card-body">
                                <p></p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4 col-12">
                        <div class="col text-right">
                            <button id="btnVoltar5" type="button" class="btn btn-outline-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar para Advogados
                            </button>
                            <button id="btnSalvarAdv" type="button" class="btn btn-success" aria-label="Left Align" >
                                <i class="far fa-save"></i> Salvar
                            </button>
                            <button id="btnExcluirAdv" type="button" data="" class="btn btn-outline-danger" aria-label="Left Align" >
                                <i class="fas fa-trash-alt"></i> Excluir
                            </button>
                        </div>
                    </div>
                </div>
                <hr></hr>
                <div class="row" >
                    <div class="col col-md-6 col-12">
                        <label for="cbAdvogado" class="col-form-label text-md-left">Advogado</label>
                        <br/>
                        <select id="cbAdvogado" class="form-control" name="parte" required>
                            
                        </select>
                    </div>
                </div>
                
            </div>
        </div>

        <div id="atividade">
            <div class="card mt-2" style="background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
                <div class="card-body">
                    <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                        <div class="col-md-2 col-12">
                            <h4 style="color:#056367;"><i class="fas fa-balance-scale"></i> Casos</h4>
                        </div>
                        <div class="col-md-7 col-12">
                            <div class="card" style="background-color:#fff; color:#056367; border-radius: 10px 0px 10px 0px;">
                                <div id="titulo5" class="card-body">
                                    
                                </div>
                            </div>
                        </div>
                        <div class="col-md-3 col-12 text-right">
                            <button id="btnVoltar6" type="button" class="btn btn-outline-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar aos Casos
                            </button>
                            <button id="btnNovoAtiv" type="button" class="btn btn-outline-primary" aria-label="Left Align" >
                                <i class="fas fa-plus-circle"></i> Nova Atividade
                            </button>
                        </div>
                        
                    </div>
                    <div class="row" style="padding-bottom: 5px; padding-right: 2px;">
                        <div class="col-lg-12 col-12">
                            <table id="tbAtividade" class="table table-striped table-bordered text-left mt-2" style="background-color:#fff; color:#056367;">
                                <thead  style="background-color:#404040; color: #ccc; font-weight: bold;">
                                    <tr>
                                        <th><i class="fas fa-copy"></i>  ATIVIDADES DO CASO</th>
                                        <th></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    

                                </tbody>
                            </table>
                            <br>
                        </div> 
                    </div>
                </div>
            </div>

        </div>


        <div id="cadatividade" class="card mt-2" style="display: none; background-color:#fff; color:#056367; border-radius: 20px 0px 20px 0px;">
            
            <?php echo csrf_field(); ?>
            
            <div class="card-body">
                <div class="row" style="padding-right: 2px;">
                    
                    <div class="col-md-2">
                        <h4 style="color:#056367;"><i class="fas fa-balance-scale"></i> Casos - Atividades</h4>
                    </div>
                    <div class="col-md-6 col-12">
                        <div class="card" style="background-color:#fff; color:#056367; border-radius: 10px 0px 10px 0px;">
                            <div id="titulo7" class="card-body">
                                <p></p>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-4">
                        <div class="col text-right">
                            <button id="btnVoltar7" type="button" class="btn btn-outline-secondary" aria-label="Left Align" >
                                <i class="fas fa-arrow-left"></i> Voltar
                            </button>

                            <button id="btnSalvarAtiv" type="submit" class="btn btn-success" aria-label="Left Align" >
                            <i class="far fa-save"></i> Salvar
                            </button>
                            
                            <button id="btnExcluirAtiv" type="button" data="" class="btn btn-outline-danger" aria-label="Left Align" >
                                <i class="fas fa-trash-alt"></i> Excluir
                            </button>
                            
                        </div>
                    </div>
                    
                </div>
                <hr></hr>
                
                <div class="row" >
                    
                    <div class="col col-md-2 col-6">
                        <label id="txtData_label" for="txtData"  class="col-form-label text-md-left">Data</label>
                        <input id="txtDataAtiv" class="form-control" name="data" type="text" onKeyUp="mascara_data(this)" maxlength="10" value="" required/>
                    </div>
                   
                    <div class="col col-md-2 col-6">
                        <label for="cbStatus" class="col-form-label text-md-left">Status</label>
                        <br/>
                        <select id="cbStatusAtiv" class="form-control" name="statusativ" required>
                            <option value="P">PENDENTE</option>
                            <option value="R">REALIZADO</option>
                            <option value="C">CANCELADO</option>
                        </select>
                    </div>
                </div>
                
                <div class="row" >
                    <div class="col col-md-12 col-12">
                        <label id="txtDescricao_label" for="txtDescricao"  class="col-form-label text-md-left">Descrição</label>
                        <textarea id="txtDescricaoAtiv" class="form-control" rows = "3" name = "descricao" value="" maxlength="2000"></textarea>
                    </div>
                   
                </div>
                
            </div>
            
        </div>


    </div>
</div>

<script>

    function mascara_data(campo) {
        if (campo.value.length == 2) {
            campo.value += '/';
        }
        if (campo.value.length == 5) {
            campo.value += '/';
        }
    }

    function mascara_hora(campo) {
        if (campo.value.length == 2) {
            campo.value += ':';
        }
    }
</script>



<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), array('__data', '__path')))->render(); ?>