<!--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

    ?>
    
    <div   id="ovumpay-transaparente" style="height: 1200px;" class="col s12 m12 l12">
        <iframe id="frame_id" width="100%" height="100%" frameborder="0" style="border:0; margin-top: -9%" src='<?= URL_OVUMPAY_TRANSPARENTE.$this->session->userdata("codigo_opayt") ?>'></iframe>
        <script type="text/javascript">
            $(document).ready(function(){
                $('#aguarde').css('display', 'block');
            });
            
           // Here's how you'd do this with plain old Javascript
            const iframe = document.querySelector('#frame_id');
            iframe.onload = () => {
              $('#aguarde').css('display', 'none');
            }

        </script>
    </div>
   
    </div>
<?php // $this->session->set_userdata("codigo_opayt", NULL)
$mobile = FALSE;
   $user_agents = array("iPhone","iPad","Android","webOS","BlackBerry","iPod","Symbian","IsGeneric");
 
   foreach($user_agents as $user_agent){
     if (strpos($_SERVER['HTTP_USER_AGENT'], $user_agent) !== FALSE) {
        $mobile = TRUE;
	$modelo	= $user_agent;
	break;
     }
   }
 
   if ($mobile){
     
   }else{
     $this->load->view('commons/rodape'); 
   }
 ?>
