<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
?>
 <table class="table table-bordered table-condensed" style="font-size: 8pt">
        <thead>
        <th>Data Cadastro</th>
        <th>#ID</th>
        <th>Revenda</th>
        <th>Forma Pagamento</th>
        <th>Valor Pagamento</th>
        <th>Detalhes</th>
        <th>Status</th>
        <th>&nbsp;</th>
        </thead>
        <tbody>           
<?php foreach ($transacoes_revendas as $tr): ?>
                <tr>
                    <td><?= date('d/m/Y', strtotime($tr['data_cad'])); ?></td>
                    <td>#<?= $tr['id'] ?></td>
                    <td><?= ($tr['username'] != "")?$tr['username'] : '<span style="color: red">Revenda Removida</span>' ?></td>
                    <td><?= $pagamento[$tr['tipo']] ?></td>
                    <td>R$ <?= $tr['valor_pagamento'] ?></td>
                    <td><?= $tr['detalhes'] ?></td>
                    <td><?= $status[$tr['status']] ?></td>
                    <td><?php if ($tr['status'] != "0" && $tr['status'] != "3"){ ?>[<a href="transacoes.alterar_status.php?trans=revenda&id=<?= $tr['id'] ?>" class="altera_status_revenda">Alterar Status</a>]<?php } ?>&nbsp;[<a href="transacoes.php?remove_trans_revenda&id=<?= $tr['id'] ?>" class="remover_revenda">Remover</a>]</td>
                </tr>
<?php endforeach; ?>
        </tbody>
    </table>
<script>
    $(document).ready(function () {

        $('.altera_status_revenda').janelaCentro({
            w: 400,
            h: 300
        });

        $('.remover_revenda').janelaCentro({
            w: 400,
            h: 250,
            confirma: function () {
                return window.confirm('Deseja Mesmo Remover Este Registro?');
            }
        });
        
    });
</script>