<html>
    <body>
        <form id="formclearsale" method="post" action="<?php echo $clearsale_url; ?>" target="iFrameStart">      
            <input type="hidden" name="CodigoIntegracao" value="<?php echo $codigointegracao; ?>"/>
            <input type="hidden" name="PedidoID" value="<?php echo $PedidoID; ?>" />
            <input type="hidden" name="Data" value="<?php echo $data; ?>" />
            <input type="hidden" name="IP" value="<?php echo $ip; ?>" />
            <input type="hidden" name="Total" value="<?php echo $totalpedido; ?>" />
            <input type="hidden" name="TipoPagamento" value="<?php echo $tipopagamento; ?>" />
            <input type="hidden" name="Parcelas" value="<?php echo $parcelas; ?>" />
            <input type="hidden" name="Cartao_Bin" value="<?php echo $ncartaoini; ?>" />
            <input type="hidden" name="Cartao_Fim" value="<?php echo $ncartaofim; ?>" />
            <input type="hidden" name="Cartao_Numero_Mascarado" value="<?php echo $ncartaomascarado; ?>" />
            <!--DADOS DA COMPRA -->
            <input type="hidden" name="Cobranca_Nome" value="<?php echo $cob_nome; ?>" />
            <input type="hidden" name="Cobranca_Nascimento" value="<?php echo $cob_nascimento; ?>" />
            <input type="hidden" name="Cobranca_Email" value="<?php echo $cob_email; ?>" />
            <input type="hidden" name="Cobranca_Documento" value="<?php echo $cob_documento; ?>" />
            <input type="hidden" name="Cobranca_Logradouro" value="<?php echo $cob_logradouro; ?>" />
            <input type="hidden" name="Cobranca_Logradouro_Numero" value="<?php echo $cob_logradouro_numero; ?>" />
            <input type="hidden" name="Cobranca_Logradouro_Complemento" value="<?php echo $cob_logradouro_complemento; ?>" />
            <input type="hidden" name="Cobranca_Bairro" value="<?php echo $cob_bairro; ?>" />
            <input type="hidden" name="Cobranca_Cidade" value="<?php echo $cob_cidade; ?>" />
            <input type="hidden" name="Cobranca_Estado" value="<?php echo $cob_estado; ?>" />
            <input type="hidden" name="Cobranca_CEP" value="<?php echo $cob_cep; ?>" />
            <input type="hidden" name="Cobranca_Pais" value="<?php echo $cob_pais?>" />
            <input type="hidden" name="Cobranca_DDD_Telefone" value="<?php echo $cob_DDDTel; ?>" />
            <input type="hidden" name="cobranca_telefone" value="<?php echo $cob_telefone; ?>" />            
            <input type="hidden" name="Cobranca_DDD_Telefone_1" value="<?php echo $cob_DDDTel; ?>" />
            <input type="hidden" name="Cobranca_Telefone_1" value="<?php echo $cob_telefone; ?>" />
            <input type="hidden" name="Cobranca_DDD_Celular" value="<?php echo $cob_DDDCel?>" />
            <input type="hidden" name="Cobranca_Celular" value="<?php echo $cob_celular; ?>" />
            <!--ENTREGA -->
            <input type="hidden" name="Entrega_Nome" value="<?php echo $ent_nome; ?>" />
            <input type="hidden" name="Entrega_Nascimento" value="<?php echo $ent_nascimento; ?>" />
            <input type="hidden" name="Entrega_Email" value="<?php echo $ent_email; ?>" />
            <input type="hidden" name="Entrega_Documento" value="<?php echo $ent_documento; ?>" />
            <input type="hidden" name="Entrega_Logradouro" value="<?php echo $ent_logradouro; ?>" />
            <input type="hidden" name="Entrega_Logradouro_Numero" value="<?php echo $ent_logradouro_numero; ?>" />
            <input type="hidden" name="Entrega_Logradouro_Complemento" value="<?php echo $ent_logradouro_complemento; ?>" />
            <input type="hidden" name="Entrega_Bairro" value="<?php echo $ent_bairro; ?>" />
            <input type="hidden" name="Entrega_Cidade" value="<?php echo $ent_cidade; ?>" />
            <input type="hidden" name="Entrega_Estado" value="<?php echo $ent_estado; ?>" />
            <input type="hidden" name="Entrega_CEP" value="<?php echo $ent_cep; ?>" />
            <input type="hidden" name="Entrega_Pais" value="<?php echo $ent_pais; ?>" />
            <input type="hidden" name="Entrega_DDD_Telefone_1" value="<?php echo $ent_DDDTel; ?>" />
            <input type="hidden" name="Entrega_Telefone_1" value="<?php echo $ent_telefone; ?>" />
            <input type="hidden" name="Entrega_DDD_Celular" value="<?php echo $ent_DDDCel; ?>" />
            <input type="hidden" name="Entrega_Celular" value="<?php echo $ent_celular; ?>" />
            <!--PRODUTOS -->
            <?php
                $fieldIndex = 0;
                foreach ($products as $product) {
                    $fieldIndex = $fieldIndex+1;
            ?>
                <input type="hidden" name="Item_ID_<?php echo $fieldIndex; ?>" value="<?php echo $product['product_id']; ?>" />
                <input type="hidden" name="Item_Nome_<?php echo $fieldIndex; ?>" value="<?php echo $product['name']; ?>" />
                <input type="hidden" name="Item_Qtd_<?php echo $fieldIndex; ?>" value="<?php echo $product['quantity']; ?>" />
                <input type="hidden" name="Item_Valor_<?php echo $fieldIndex; ?>" value="<?php echo $product['total']; ?>" />
                <input type="hidden" name="Item_Categoria_<?php echo $fieldIndex; ?>" value="" />
            <?php } ?>
            <!--<input type="submit" value="Enviar"/> -->
        </form>
    </body>
</html>
