
<!--Cabecalho -->
<?php $this->load->view('commons/cabecalho'); ?>
<?php $this->load->view('commons/header'); ?>
<?php $this->load->view('commons/menu'); ?>

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <h1>Editar Assinaturas</h1>
    </section>

    <!-- Main content -->
    <section class="content container-fluid">
        <div class="box">
            <div class="box-body">
                <?php echo $this->session->flashdata('sucesso-upload'); ?>
                <?php echo $this->session->flashdata('erro-assinatura'); ?>
                <?php if ($assinatura != NULL) { ?>
                    <div class="assinatura">
                        <p>Assinatura atual</p>    
                        <?php if ($assinatura['ativo'] == 0) { ?>
                            <img class="img-responsive" src="<?= $assinatura['assinatura'] ?>" style="max-height: 300px;">
                        <?php } ?>
                        <br>
                        <div class="row">

                            <div class="col-md-1" style="width: 14.5%;">
                                <form id="ativarassinatura">
                                    <?php if ($assinatura['ativo'] == 0) { ?>
                                        <input type="hidden" name="ativar" value="1">
                                        <input type="hidden" name="id" value="<?= $this->criptografia->codifica($assinatura['id']) ?>">
                                        <button type="submit" class="btn btn-curso btn-primary" > <i class="fa fa-check" aria-hidden="true"></i> Ativar Assinatura</button>
                                    <?php } else { ?>
                                        <input type="hidden" name="ativar" value="0">
                                        <input type="hidden" name="id" value="<?= $this->criptografia->codifica($assinatura['id']) ?>">
                                        <button type="submit" class="btn btn-curso btn-primary"> <i class="fa fa-exclamation-circle" aria-hidden="true"></i> Editar Novamente</button>
                                        &nbsp;&nbsp;&nbsp;&nbsp;
                                    <?php } ?>
                                </form>
                            </div>
                            <?php if ($assinatura['ativo'] == 0) { ?>
                                <div class="col-md-1" style="width: 15.5%;">
                                    <form id="indeferir-assinatura">
                                        <input type="hidden" name="id" value="<?= $this->criptografia->codifica($assinatura['id']) ?>">
                                        <input type="hidden" name="indeferir" value="2">
                                        <button type="submit" class="btn btn-curso btn-danger"> <i class="fa fa-exclamation-circle" aria-hidden="true"></i> Indeferir Assinatura</button>
                                    </form>
                                </div>
                                <div class="col-md-6">
                                    <form method="POST" action="<?= base_url('upload') ?>" enctype="multipart/form-data">
                                        <div class="input-group">
                                            <input type="hidden" name="assinatura" value="<?= $this->criptografia->codifica($assinatura['assinatura']) ?>">
                                            <input type="hidden" name="id" value="<?= $this->criptografia->codifica($assinatura['id']) ?>">
                                            <input type="file"  name="assinatura_alunos" id="assinatura-aluno" style="cursor: pointer" >
                                            &nbsp;&nbsp;<button type="submit" class="btn btn-flat btn-botao btn-upl disabled"><i class="fa fa-upload" aria-hidden="true"></i> Enviar</button>

                                        </div> 
                                    </form>
                                </div>
                            <?php } ?>
                        </div>
                    </div>
                <?php } else { ?>

                    <span style="font-size: 13pt;">  <i class="fa fa-info-circle" aria-hidden="true"></i> Nenhum registro encontrado</span>
                <?php } ?>
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('commons/rodape'); ?>
