<!--Cabecalho -->
<?php 
$this->load->view('commons/cabecalho'); ?>
<!--Header -->
<?php $this->load->view('commons/header'); ?>
<div class="row">
    <h5 style="margin-left: 7%; font-size: 25pt;"><b>Finalizar Pedido</b></h5>
    <?php echo $this->session->flashdata('erro-transacao'); ?>
    <?php echo $this->session->flashdata('erro-permissao'); ?>
    <?php echo $this->session->flashdata('erro-form-boleto'); ?>
    <?php echo $this->session->flashdata('erro-saldo'); ?>    
    
    
    <?php echo $erro_conf ?>
    <?php if ($this->cart->contents() != NULL && count($this->cart->contents()) > 0) { ?>
        <table class=" col s11 tbl-curso-matriculado">

            <thead>
                <tr>

                    <th>Item</th>
                    <th>Valor</th>
                    <th></th>
                </tr>
            </thead>

            <tbody>

                <?php foreach ($this->cart->contents() as $items) { ?>
                    <?php echo form_hidden('[rowid]', $items['rowid']); ?>
                    <tr>
                        <td>Taxa de envio Certificado do Curso <?php echo $items['name']; ?></td>
                        <td>R$ <?php echo number_format($items['price'], 2, ',', '.') ?></td>
                    <?php } ?>
                </tr>  
                <tr style="background-color: #f2f2f2">
                    <td colspan="2">&nbsp;</td>
                    <td class="left"><b>TOTAL A PAGAR</b></td>
                    <td class="right">R$ <?php echo number_format($this->cart->total(), 2, ',', '.'); ?></td>
                </tr>
            </tbody>
        </table>

        <div class="collection opcao-m ">
            <?php echo form_hidden('[rowid]', $items['rowid']); ?>
            <div class="collection-item">
                <dl>   
                    <dt><b>Item</b></dt>
                    <?php
                    $descricao = "Taxa de Envio Certificado do Curso ";
                    if ($this->cart->total_items() < 2) { ?>
                        Taxa de Envio Certificado do Curso 
                        <?php foreach ($this->cart->contents() as $items): ?>    
                            <dd><?php
                            $descricao .= $items['name'];
                            echo $items['name']; 
                            ?></dd>
                        <?php endforeach; ?>    
                    <?php } else { ?>  
                        Taxa de Envio Certificado dos Cursos 
                        <?php foreach ($this->cart->contents() as $items): ?>    
                            <dd><?php
                            $descricao .= $items['name'].", ";
                            echo $items['name']; 
                            ?></dd>
                        <?php endforeach; ?>  
                    <?php } ?>
                    <dt><b>Valor</b></dt>
                    <?php foreach ($this->cart->contents() as $items): ?>      
                        <dd><?php echo $items['name'] . ' - R$ ' . number_format($items['price'], 2, ',', '.') ?></dd>
                    <?php endforeach; ?>
                    <hr>
                    <dt><b>Valor Total</b>: R$ <?php echo number_format($this->cart->total(), 2, ',', '.'); ?></dt>
                </dl>
            </div>   
        <?php } ?>
    </div>
</div>

<?php if ($this->cart->contents() != NULL && count($this->cart->contents()) > 0) { ?>
    <div class="row"  > 

        <form id="ov_formC">
            <input id="ov_con" type="hidden" value="P#KZKUTIZED>WF!RD[@?OSFIKK]BMFLL4G]TKDRFNWK!TILD#W*X?[EXAF?RSTFBS">
            <input id="ov_valor" type="hidden" value="<?= $transacao['valor'] ?>">
            <input id="ov_descricao" type="hidden" value="<?php echo $descricao ?>">
            <input id="ov_id" type="hidden" value="<?= $aluno['id_aluno'] ?>">    
            <input id="ov_pedido" type="hidden" value="<?= $transacao['id_transacao'] ?>">
            <input id="ov_email" type="hidden" value="<?= $aluno['email']?>">
            <input id="ov_nome" type="hidden" value="<?= $aluno['nome']?>">
            <input id="ov_cep" type="hidden" value="<?= $aluno['cep']?>">
            <input id="ov_endereco" type="hidden" value="<?= $aluno['endereco']?>">
            <input id="ov_numero" type="hidden" value="<?= $aluno['numero']?>">
            <input id="ov_bairro" type="hidden" value="<?= $aluno['bairro']?>">
            <input id="ov_estado" type="hidden" value="<?= $aluno['estado']?>">
            <input id="ov_cidade" type="hidden" value="<?= $aluno['cidade']?>">
            <input id="ov_contato" type="hidden" value="<?= $aluno['ddd'].$aluno['telefone']?>">
            
            <input id="ov_urlRetorno" hidden value="<?= base_url('ovumpay-retorno') ?>">
            <input id="ov_urlRedir"   hidden value="<?= base_url('reiniciarCarrinho') ?>">
        </form>
        
        <div class="row center" >
            <button class="center waves-effect waves-light btn btn-curso btn-botao" type="button" id="ov_bt" onclick="ov.openModalCriar(this)" >&nbsp;Continuar&nbsp;<i class="fa fa-angle-right" aria-hidden="true"></i></button>
        </div>
        
        <div id="ov_m" class="ov-modal" role="dialog"></div>
        <script> ov = new Ov();</script>


    </div>
<?php } ?>





</div>
<br><br>
<?php $this->load->view('commons/rodape'); ?>
