<!--Cabecalho -->
<?php $this->load->view('commons/cabecalho'); ?>
<!--Header -->
<?php $this->load->view('commons/header'); ?>
<div class="row">
    <h4 style="margin-left: 7%; font-size: 30pt;"><b>Finalizar Pedido</b></h4>
<?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) { ?>
        <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 if ($this->cart->total_items() < 2) { ?>
                        Taxa de Envio Certificado do Curso 
                        <?php foreach ($this->cart->contents() as $items): ?>    
                            <dd><?php echo $items['name']; ?></dd>
                        <?php endforeach; ?>    
                    <?php } else { ?>  
                        Taxa de Envio Certificado dos Cursos 
                        <?php foreach ($this->cart->contents() as $items): ?>    
                            <dd><?php 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>
   
    
    <span><i class="fa fa-info-circle btn-grupo" aria-hidden="true"></i> Escolha uma das opções de pagamento</span><br><br>    

    <button class="waves-effect waves-light btn light-blue btn-botao btn-grupo" id="btn-credito"><i class="fa fa-credit-card" aria-hidden="true"></i>&nbsp;Crédito&nbsp;</button>
    <button class="waves-effect waves-light btn amber darken-3 btn-botao btn-grupo" style="margin-left: 1%;" id="btn-boleto"><i class="fa fa-barcode" aria-hidden="true"></i>&nbsp;Boleto&nbsp;</button>
    <button class="waves-effect waves-light btn grey darken-1 btn-botao btn-grupo" style="margin-left: 1%;" id="btn-debito"><i class="fa fa-credit-card-alt" aria-hidden="true"></i>&nbsp;Débito&nbsp;</button>   
    
    <?php $this->load->view('commons/pagamento/boleto'); ?>
    <?php $this->load->view('commons/pagamento/credito'); ?>
    <?php $this->load->view('commons/pagamento/debito'); ?>
    

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