<?php
/* Smarty version 4.5.3, created on 2026-05-21 04:22:39
  from '/var/www/html/billing/system/plugin/ui/marketing_scheduler_list.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_6a0e888fa3f622_63084701',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '9b9b5141719589ed2ff92bb72bf24a8d113beb7d' => 
    array (
      0 => '/var/www/html/billing/system/plugin/ui/marketing_scheduler_list.tpl',
      1 => 1778148879,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:sections/header.tpl' => 1,
    'file:sections/footer.tpl' => 1,
  ),
),false)) {
function content_6a0e888fa3f622_63084701 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:sections/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
?>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css">

<div class="row">
    <div class="col-sm-12">

        <?php if ($_GET['s'] == 's') {?>
            <div class="alert alert-success alert-dismissible">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                <i class="fa fa-check-circle"></i> <?php echo $_GET['m'];?>

            </div>
        <?php } elseif ($_GET['s'] == 'e') {?>
            <div class="alert alert-danger alert-dismissible">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                <i class="fa fa-exclamation-circle"></i> <?php echo $_GET['m'];?>

            </div>
        <?php } elseif ($_GET['s'] == 'w') {?>
            <div class="alert alert-warning alert-dismissible">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                <i class="fa fa-exclamation-triangle"></i> <?php echo $_GET['m'];?>

            </div>
        <?php }?>

        <div class="panel panel-primary panel-hovered mb20">
            <div class="panel-heading">
                <div class="pull-right">
                    <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler/add" class="btn btn-success btn-sm">
                        <i class="fa fa-plus"></i> New Campaign
                    </a>
                </div>
                <i class="fa fa-calendar"></i> Marketing Campaigns
            </div>
            <div class="panel-body">
                <div class="table-responsive">
                    <table id="campaignsTable" class="table table-bordered table-striped table-hover table-condensed">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>Title</th>
                                <th>Scheduled At</th>
                                <th>Target Group</th>
                                <th>Via</th>
                                <th>Status</th>
                                <th>Sent / Failed</th>
                                <th>Actions</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['campaigns']->value, 'c');
$_smarty_tpl->tpl_vars['c']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['c']->value) {
$_smarty_tpl->tpl_vars['c']->do_else = false;
?>
                            <tr>
                                <td><?php echo $_smarty_tpl->tpl_vars['c']->value['id'];?>
</td>
                                <td><strong><?php echo $_smarty_tpl->tpl_vars['c']->value['title'];?>
</strong></td>
                                <td><?php echo $_smarty_tpl->tpl_vars['c']->value['scheduled_at'];?>
</td>
                                <td>
                                    <?php echo $_smarty_tpl->tpl_vars['c']->value['group_filter'];?>

                                    <?php if (!empty($_smarty_tpl->tpl_vars['c']->value['router_filter'])) {?>
                                        <span class="text-muted">/ <?php echo $_smarty_tpl->tpl_vars['c']->value['router_filter'];?>
</span>
                                    <?php }?>
                                </td>
                                <td>
                                    <?php if ($_smarty_tpl->tpl_vars['c']->value['via'] == 'sms') {?>
                                        <span class="label label-info">SMS</span>
                                    <?php } elseif ($_smarty_tpl->tpl_vars['c']->value['via'] == 'wa') {?>
                                        <span class="label label-success">WhatsApp</span>
                                    <?php } else { ?>
                                        <span class="label label-primary">SMS + WA</span>
                                    <?php }?>
                                </td>
                                <td>
                                    <?php if ($_smarty_tpl->tpl_vars['c']->value['status'] == 'pending') {?>
                                        <span class="label label-warning"><i class="fa fa-clock-o"></i> Pending</span>
                                    <?php } elseif ($_smarty_tpl->tpl_vars['c']->value['status'] == 'running') {?>
                                        <span class="label label-info"><i class="fa fa-spinner fa-spin"></i> Running</span>
                                    <?php } elseif ($_smarty_tpl->tpl_vars['c']->value['status'] == 'sent') {?>
                                        <span class="label label-success"><i class="fa fa-check"></i> Sent</span>
                                    <?php } elseif ($_smarty_tpl->tpl_vars['c']->value['status'] == 'cancelled') {?>
                                        <span class="label label-default"><i class="fa fa-ban"></i> Cancelled</span>
                                    <?php } elseif ($_smarty_tpl->tpl_vars['c']->value['status'] == 'failed') {?>
                                        <span class="label label-danger"><i class="fa fa-times"></i> Failed</span>
                                    <?php } else { ?>
                                        <span class="label label-default"><?php echo $_smarty_tpl->tpl_vars['c']->value['status'];?>
</span>
                                    <?php }?>
                                </td>
                                <td>
                                    <?php if ($_smarty_tpl->tpl_vars['c']->value['status'] == 'sent' || $_smarty_tpl->tpl_vars['c']->value['status'] == 'failed') {?>
                                        <span class="text-success"><?php echo $_smarty_tpl->tpl_vars['c']->value['total_sent'];?>
</span>
                                        /
                                        <span class="text-danger"><?php echo $_smarty_tpl->tpl_vars['c']->value['total_failed'];?>
</span>
                                        <br><small class="text-muted"><?php echo $_smarty_tpl->tpl_vars['c']->value['total_recipients'];?>
 total</small>
                                    <?php } else { ?>
                                        <span class="text-muted">—</span>
                                    <?php }?>
                                </td>
                                <td nowrap>
                                    <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler/view/<?php echo $_smarty_tpl->tpl_vars['c']->value['id'];?>
"
                                       class="btn btn-xs btn-info" title="View Details">
                                        <i class="fa fa-eye"></i>
                                    </a>
                                    <?php if ($_smarty_tpl->tpl_vars['c']->value['status'] == 'pending') {?>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler/edit/<?php echo $_smarty_tpl->tpl_vars['c']->value['id'];?>
"
                                           class="btn btn-xs btn-warning" title="Edit">
                                            <i class="fa fa-pencil"></i>
                                        </a>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler/send_now/<?php echo $_smarty_tpl->tpl_vars['c']->value['id'];?>
"
                                           class="btn btn-xs btn-success"
                                           onclick="return confirm('Send this campaign right now?')"
                                           title="Send Now">
                                            <i class="fa fa-send"></i>
                                        </a>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler/cancel/<?php echo $_smarty_tpl->tpl_vars['c']->value['id'];?>
"
                                           class="btn btn-xs btn-default"
                                           onclick="return confirm('Cancel this campaign?')"
                                           title="Cancel">
                                            <i class="fa fa-ban"></i>
                                        </a>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['c']->value['status'] == 'failed') {?>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler/send_now/<?php echo $_smarty_tpl->tpl_vars['c']->value['id'];?>
"
                                           class="btn btn-xs btn-success"
                                           onclick="return confirm('Retry sending this campaign now?')"
                                           title="Retry">
                                            <i class="fa fa-refresh"></i> Retry
                                        </a>
                                    <?php }?>
                                    <?php if ($_smarty_tpl->tpl_vars['c']->value['status'] != 'running') {?>
                                        <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler/delete/<?php echo $_smarty_tpl->tpl_vars['c']->value['id'];?>
"
                                           class="btn btn-xs btn-danger"
                                           onclick="return confirm('Permanently delete this campaign?')"
                                           title="Delete">
                                            <i class="fa fa-trash"></i>
                                        </a>
                                    <?php }?>
                                </td>
                            </tr>
                            <?php
}
if ($_smarty_tpl->tpl_vars['c']->do_else) {
?>
                            <tr>
                                <td colspan="8" class="text-center text-muted" style="padding:30px;">
                                    <i class="fa fa-calendar-o fa-2x"></i><br><br>
                                    No campaigns yet.
                                    <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler/add">Create your first campaign</a>
                                </td>
                            </tr>
                            <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

<?php echo '<script'; ?>
 src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"><?php echo '</script'; ?>
>
<?php echo '<script'; ?>
>
$(document).ready(function () {
    $('#campaignsTable').DataTable({
        order: [[2, 'desc']],
        pageLength: 25,
        columnDefs: [{ orderable: false, targets: 7 }]
    });
});
<?php echo '</script'; ?>
>

<?php $_smarty_tpl->_subTemplateRender("file:sections/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
}
}
