<?php
/* Smarty version 4.5.3, created on 2026-05-21 08:20:40
  from '/var/www/html/billing/system/plugin/ui/marketing_scheduler_form.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_6a0ec0585d48a8_95083354',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '1b51ef318c88268f5f6576b228cd9788166beeff' => 
    array (
      0 => '/var/www/html/billing/system/plugin/ui/marketing_scheduler_form.tpl',
      1 => 1778148879,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:sections/header.tpl' => 1,
    'file:sections/footer.tpl' => 1,
  ),
),false)) {
function content_6a0ec0585d48a8_95083354 (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);
?>

<div class="row">
    <div class="col-sm-12 col-md-10 col-md-offset-1">

        <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" class="btn btn-default btn-sm">
                        <i class="fa fa-arrow-left"></i> Back to Campaigns
                    </a>
                </div>
                <i class="fa fa-calendar-plus-o"></i>
                <?php if ($_smarty_tpl->tpl_vars['campaign']->value) {?>Edit Campaign<?php } else { ?>New Marketing Campaign<?php }?>
            </div>
            <div class="panel-body">

                <form method="post"
                      action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler/save<?php if ($_smarty_tpl->tpl_vars['campaign']->value) {?>/<?php echo $_smarty_tpl->tpl_vars['campaign']->value['id'];
}?>"
                      class="form-horizontal">

                    <!-- Campaign Title -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">Campaign Title <span class="text-danger">*</span></label>
                        <div class="col-md-8">
                            <input type="text" class="form-control" name="title"
                                   placeholder="e.g. Friday Morning Promo"
                                   value="<?php if ($_smarty_tpl->tpl_vars['campaign']->value) {
echo $_smarty_tpl->tpl_vars['campaign']->value['title'];
}?>" required>
                        </div>
                    </div>

                    <!-- Scheduled Date & Time -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">Scheduled Date &amp; Time <span class="text-danger">*</span></label>
                        <div class="col-md-8">
                            <input type="datetime-local" class="form-control" name="scheduled_at"
                                   value="<?php if ($_smarty_tpl->tpl_vars['campaign']->value) {
echo $_smarty_tpl->tpl_vars['campaign']->value['scheduled_at_local'];
}?>" required>
                            <span class="help-block">
                                <i class="fa fa-clock-o"></i> Server current time: <strong><?php echo $_smarty_tpl->tpl_vars['server_time']->value;?>
</strong>
                                &nbsp;— schedule in the future for auto-send via cron.
                            </span>
                        </div>
                    </div>

                    <!-- Target Group -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">Target Group <span class="text-danger">*</span></label>
                        <div class="col-md-8">
                            <select class="form-control" name="group_filter">
                                <option value="all"            <?php if (!$_smarty_tpl->tpl_vars['campaign']->value || $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'all') {?>selected<?php }?>>All Customers</option>
                                <option value="new"            <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'new') {?>selected<?php }?>>New Customers (last 30 days)</option>
                                <option value="expired"        <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'expired') {?>selected<?php }?>>Expired Customers</option>
                                <option value="active"         <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'active') {?>selected<?php }?>>Active Customers</option>
                                <option value="active_pppoe"   <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'active_pppoe') {?>selected<?php }?>>Active PPPOE</option>
                                <option value="expired_pppoe"  <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'expired_pppoe') {?>selected<?php }?>>Expired PPPOE</option>
                                <option value="all_pppoe"      <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'all_pppoe') {?>selected<?php }?>>All PPPOE</option>
                                <option value="active_hotspot" <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'active_hotspot') {?>selected<?php }?>>Active Hotspot</option>
                                <option value="expired_hotspot"<?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'expired_hotspot') {?>selected<?php }?>>Expired Hotspot</option>
                                <option value="all_hotspot"    <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['group_filter'] == 'all_hotspot') {?>selected<?php }?>>All Hotspot</option>
                            </select>
                        </div>
                    </div>

                    <!-- Router Filter -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">Router <span class="text-muted">(optional)</span></label>
                        <div class="col-md-8">
                            <select class="form-control" name="router_filter">
                                <option value="">All Routers</option>
                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['routers']->value, 'router');
$_smarty_tpl->tpl_vars['router']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['router']->value) {
$_smarty_tpl->tpl_vars['router']->do_else = false;
?>
                                    <option value="<?php echo $_smarty_tpl->tpl_vars['router']->value['name'];?>
"
                                        <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['router_filter'] == $_smarty_tpl->tpl_vars['router']->value['name']) {?>selected<?php }?>>
                                        <?php echo $_smarty_tpl->tpl_vars['router']->value['name'];?>

                                    </option>
                                <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            </select>
                        </div>
                    </div>

                    <!-- Send Via -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">Send Via <span class="text-danger">*</span></label>
                        <div class="col-md-8">
                            <select class="form-control" name="via">
                                <option value="sms"  <?php if (!$_smarty_tpl->tpl_vars['campaign']->value || $_smarty_tpl->tpl_vars['campaign']->value['via'] == 'sms') {?>selected<?php }?>>SMS</option>
                                <option value="wa"   <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['via'] == 'wa') {?>selected<?php }?>>WhatsApp</option>
                                <option value="both" <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['via'] == 'both') {?>selected<?php }?>>SMS and WhatsApp</option>
                            </select>
                        </div>
                    </div>

                    <!-- Batch Size -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">Batch Size</label>
                        <div class="col-md-8">
                            <select class="form-control" name="batch_size">
                                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, array(10,20,50,100,300,500,1000), 'bs');
$_smarty_tpl->tpl_vars['bs']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['bs']->value) {
$_smarty_tpl->tpl_vars['bs']->do_else = false;
?>
                                    <option value="<?php echo $_smarty_tpl->tpl_vars['bs']->value;?>
"
                                        <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['batch_size'] == $_smarty_tpl->tpl_vars['bs']->value) {?>selected
                                        <?php } elseif (!$_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['bs']->value == 50) {?>selected<?php }?>>
                                        <?php echo $_smarty_tpl->tpl_vars['bs']->value;?>
 messages per batch
                                    </option>
                                <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                            </select>
                        </div>
                    </div>

                    <!-- Delay Between Batches -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">Delay Between Batches</label>
                        <div class="col-md-8">
                            <select class="form-control" name="delay_seconds">
                                <option value="0"  <?php if (!$_smarty_tpl->tpl_vars['campaign']->value || $_smarty_tpl->tpl_vars['campaign']->value['delay_seconds'] == 0) {?>selected<?php }?>>No Delay</option>
                                <option value="3"  <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['delay_seconds'] == 3) {?>selected<?php }?>>3 Seconds</option>
                                <option value="5"  <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['delay_seconds'] == 5) {?>selected<?php }?>>5 Seconds</option>
                                <option value="10" <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['delay_seconds'] == 10) {?>selected<?php }?>>10 Seconds</option>
                                <option value="20" <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['delay_seconds'] == 20) {?>selected<?php }?>>20 Seconds</option>
                                <option value="30" <?php if ($_smarty_tpl->tpl_vars['campaign']->value && $_smarty_tpl->tpl_vars['campaign']->value['delay_seconds'] == 30) {?>selected<?php }?>>30 Seconds</option>
                            </select>
                            <span class="help-block">Pause between batches to avoid SMS/WhatsApp provider rate limits.</span>
                        </div>
                    </div>

                    <!-- Message -->
                    <div class="form-group">
                        <label class="col-md-3 control-label">Message <span class="text-danger">*</span></label>
                        <div class="col-md-8">
                            <textarea class="form-control" name="message" rows="6"
                                      placeholder="Type your promotional message here..." required><?php if ($_smarty_tpl->tpl_vars['campaign']->value) {
echo $_smarty_tpl->tpl_vars['campaign']->value['message'];
}?></textarea>
                            <div style="margin-top:8px;">
                                <small class="text-muted">
                                    <strong>Placeholders:</strong>
                                    <code>[[name]]</code> Customer Name &nbsp;&bull;&nbsp;
                                    <code>[[user_name]]</code> Username &nbsp;&bull;&nbsp;
                                    <code>[[phone]]</code> Phone &nbsp;&bull;&nbsp;
                                    <code>[[company_name]]</code> Company Name
                                </small>
                            </div>
                        </div>
                    </div>

                    <!-- Buttons -->
                    <div class="form-group">
                        <div class="col-md-8 col-md-offset-3">
                            <button type="submit" class="btn btn-primary">
                                <i class="fa fa-save"></i>
                                <?php if ($_smarty_tpl->tpl_vars['campaign']->value) {?>Update Campaign<?php } else { ?>Schedule Campaign<?php }?>
                            </button>
                            <a href="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
plugin/marketing_scheduler" class="btn btn-default">
                                <i class="fa fa-times"></i> Cancel
                            </a>
                        </div>
                    </div>

                </form>

            </div><!-- /panel-body -->
        </div><!-- /panel -->
    </div>
</div>

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