MOON
Server: Apache
System: Linux server1.studioinfinity.com.br 2.6.32-954.3.5.lve1.4.90.el6.x86_64 #1 SMP Tue Feb 21 12:26:30 UTC 2023 x86_64
User: artinside (517)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/artinside/www/finance/themes/admin/widgets/coupon/home.php
<?php $v->layout("_admin"); ?>

<section class="wrapper">


    <div class="row">

        <div class="col-12 text-center my-4 text-sm-center">
            <h3> Consulta de Cupons</h3>
            <p>Consulte os Cupons no sistema</p>
        </div>
        <div class="col-lg-12">
            <section class="card">
                <header class="card-header">
                    <div class="task-progress" style="padding: 15px 0;">
                        <h1>Consulta de Cupons percentuais</h1>
                    </div>
                </header>
                <table class="table table-striped table-advance table-hover">

                    <?php if($coupons):?>
                    <thead>
                    <tr>
                        <th><i class="fa fa-heading"></i> Nome </th>
                        <th><i class="fa fa-code"></i> Código </th>
                        <th class="hidden-phone"><i class="fa fa-calendar"></i> Válido Até</th>
                        <th class="text-center"><i class="fa fa-tally"></i> Qtd.</th>
                        <th class="text-center"><i class=" fa fa-tally"></i> Usos</th>
                        <th></th>
                    </tr>
                    </thead>
                    <tbody>

                    <?php

                    foreach ($coupons as $c):?>
                        <tr>
                            <td><b><?= $c->title ?></b></td>
                            <td class="hidden-phone"><?= $c->code ?></td>
                            <td><?= date_fmt($c->valid_at)?></td>
                            <td class="text-center"><?= $c->quantity ?></td>
                            <td class="text-center"><?= $c->uses ?></td>
                            <td class="j_actions">

                                <a class="btn btn-info btn-sm" href="<?= url("/admin/coupon/coupon/{$c->id}"); ?>"><i class="fal fa-pencil"></i></a>
                                <a class="btn btn-danger btn-sm"
                                   href="#"
                                   data-post="<?= url("/admin/coupon/coupon"); ?>"
                                   data-action="delete"
                                   data-confirm="Tem certeza que deseja deletar?"
                                   data-coupon_id="<?= $c->id; ?>"><i class="fal fa-trash"></i></a>
                            </td>
                        </tr>

                    <?php endforeach;

                    else:?>
                        <tr>
                            <td class="text-center font-medium">Não existem Cupons criados</td>
                        </tr>
                    <?php endif;?>


                    </tbody>
                </table>

                <?= $paginator; ?>

            </section>
        </div>
    </div>

    <a href="<?= url("/admin/coupon/coupon"); ?>" class="btn btn-round btn-success btn-cadastrar"><i class="fa fa-plus"></i> Cadastrar</a>

</section>

<?php
$v->start("scripts");
?>
<script>
    $(".j_actions").on("click","#j_shipment_code", function (e) {
        e.preventDefault();
        var id = $(this).data("id");
        var formatedId = $(this).data("order");
        $("#form_order_id").val(id);
        $(".j_order_id_number").html("Pedido Número: <b>[#"+formatedId+"]</b>");
    })


</script>
<?php

$v->end();
$v->insert("views/modals/shipment-code");
?>