<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<!------ Include the above in your HEAD tag ---------->


<!--BEGIN HEAD-->
<!--<small>-->
<div id="container" style="width:95%; margin-left:2vw">
    <div class="card border-info mb-3 text-center">
        <div class="card-header">
            <h5 class="card-title text-dark">RELATÓRIO DE VENDAS</h5>
        </div>

        <div class="card-header" style="background-color: #9e9e9e">
            <h5 class="card-title">Relatório de Vendas</h5>
        </div>
        <div class="card-body">
            <table class="table table-hover group table-striped">
                <table class="table table-hover group table-striped">
                    <thead>
                    <tr style="font-size: x-small">
<!--                        <th width="30">#</th>-->
                        <th width="30">N.&ordm; Pedido</th>
                        <th>Data Pedido</th>
                        <th>Data Previsão PGTO</th>
                        <th>Vendedor</th>
                        <th>Produto</th>
                        <th>Cliente</th>
                        <th>Valor R$</th>
                        <th>Status</th>
                        <th>Quitado</th>
                    </tr>
                    </thead>
                    <tbody>

                    <?php

                    $totalvendas = 0;
                    foreach ($manutencoes as $r) { ?>

                        <?php




                        $totalvendas += $r->VL_PEDIDO;

                           $statusPreventiva= (strtotime($r->DT_PREVISAO_PAGAMENTO) > strtotime(date('Y-m-d')))?'green':'red';



                        ?>

                        <tr>
<!--                            <td style="font-size:x-small">--><?php //echo $r->ID_NOTA ?><!--</td>-->
                            <td><?php echo $r->NU_PEDIDO ?></td>
                            <td style="font-size:x-small"><?php echo date('d/m/Y', strtotime($r->DT_NOTA)) ?></td>
                            <td style="color: <?php echo $statusPreventiva ?>"><?php echo is_null($r->DT_PREVISAO_PAGAMENTO)?"":date('d/m/Y', strtotime($r->DT_PREVISAO_PAGAMENTO)) ?></td>
                            <td><?php echo $r->NM_VENDEDOR ?></td>
                            <td><?php echo $r->NM_PRODUTO ?></td>
                            <!--                    <td>-->
                            <?php //echo $r->DS_TIPO_MANUTENCAO=="P"?"Preventiva":"Corretiva" ?><!--</td>-->
                            <td><?php echo $r->CLIENTE_ID ?></td>
                            <td><?php echo number_format($r->VL_PEDIDO, 2, ',', '.') ?></td>

                            <td>
                                <span class="label label-table label-<?php echo is_null($r->DT_QUITADO) ? 'warning' : 'success' ?>"><?php echo is_null($r->DT_QUITADO) ? 'Pedente' : 'Quitado' ?></span>
                            </td>
                            <td ><?php echo is_null($r->DT_QUITADO)?'':date('d/m/Y', strtotime($r->DT_QUITADO)) ?></td>

                        </tr>
                    <?php } ?>
                    <tr>

                        <td colspan="2" align="center"><strong>Total de Registros/Valor </strong></td>
                        <td colspan="4" align="center"><strong><?php echo count($manutencoes); ?></strong></td>
                        <td colspan="4" align="center"><strong>R$: <?php echo number_format($totalvendas, 2, ',', '.'); ?></strong></td>
                        <!--                        <td colspan="2" align="center"><strong>Valor Total das Vendas </strong></td>-->

                    </tr>
                    </tr>

                    </tbody>
                </table>

                <div class="card-footer text-muted">

                </div>
        </div>


    </div>
</div>


