<?php
/* Smarty version 5.4.1, created on 2024-11-04 07:27:18
  from 'file:../default/contacts_group_email.tpl' */

/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
  'version' => '5.4.1',
  'unifunc' => 'content_6728bda66236f6_57870044',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '6e261f07c4ae5607d166d7201189f0e9fdf6c2fa' => 
    array (
      0 => '../default/contacts_group_email.tpl',
      1 => 1730635717,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
))) {
function content_6728bda66236f6_57870044 (\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = '/Users/razib/Herd/suite/ui/theme/default';
$_smarty_tpl->getInheritance()->init($_smarty_tpl, true);
?>


<?php 
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_3096079476728bda661c9b9_41321348', "content");
?>


<?php 
$_smarty_tpl->getInheritance()->instanceBlock($_smarty_tpl, 'Block_20105020596728bda66219b2_79150704', "script");
?>

<?php $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, ((string)$_smarty_tpl->getValue('layouts_admin')), $_smarty_current_dir);
}
/* {block "content"} */
class Block_3096079476728bda661c9b9_41321348 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = '/Users/razib/Herd/suite/ui/theme/default';
?>

    <div class="row">
        <div class="col-md-12">
            <div class="panel"  id="iform">
                <div class="panel-hdr">
                    <h5><?php echo $_smarty_tpl->getValue('_L')['Send Email'];?>
</h5>

                </div>
                <div class="panel-container">
                    <div class="panel-content">
                        <form id="mainForm" method="post">

                            <div class="mail-box">


                                <div class="mail-body">


                                    <div class="mb-3"><label for="emails"><?php echo $_smarty_tpl->getValue('_L')['To'];?>
:</label>

                                        <select class="form-select" name="emails[]" id="emails" multiple="multiple">

                                            <?php
$_from = $_smarty_tpl->getSmarty()->getRuntime('Foreach')->init($_smarty_tpl, $_smarty_tpl->getValue('ds'), 'd');
$foreach0DoElse = true;
foreach ($_from ?? [] as $_smarty_tpl->getVariable('d')->value) {
$foreach0DoElse = false;
?>
                                                <option value="<?php echo $_smarty_tpl->getValue('d')['email'];?>
" selected><?php echo $_smarty_tpl->getValue('d')['email'];?>
</option>
                                            <?php
}
$_smarty_tpl->getSmarty()->getRuntime('Foreach')->restore($_smarty_tpl, 1);?>

                                        </select>
                                    </div>
                                    <div class="mb-3">
                                        <label for="cc"><?php echo $_smarty_tpl->getValue('_L')['Cc'];?>
:</label>
                                        <input type="text" id="cc" name="cc" class="form-control" value="">
                                    </div>

                                    <div class="mb-3">
                                        <label for="bcc"><?php echo $_smarty_tpl->getValue('_L')['Bcc'];?>
:</label>
                                        <input type="text" id="bcc" name="bcc" class="form-control" value="">
                                    </div>

                                    <div class="mb-3">
                                        <label for="subject"><?php echo $_smarty_tpl->getValue('_L')['Subject'];?>
:</label>
                                        <input type="text" id="subject" name="subject" class="form-control mb-3" required value="">

                                        <textarea id="content"  class="form-control sysedit" name="message"></textarea>

                                    </div>




                                </div>


                                <div class="mail-body text-end">

                                    <button type="submit" id="send_email"  class="btn btn-sm btn-primary"><i class="fal fa-paper-plane-o"></i> <?php echo $_smarty_tpl->getValue('_L')['Send'];?>
</button>
                                </div>

                            </div>

                        </form>
                    </div>



                </div>
            </div>



        </div>



    </div>
<?php
}
}
/* {/block "content"} */
/* {block "script"} */
class Block_20105020596728bda66219b2_79150704 extends \Smarty\Runtime\Block
{
public function callBlock(\Smarty\Template $_smarty_tpl) {
$_smarty_current_dir = '/Users/razib/Herd/suite/ui/theme/default';
?>


    <?php echo '<script'; ?>
>
        $(function () {

            var form = document.getElementById("mainForm");


            $('#content').redactor(
                {
                    minHeight: 200, // pixels
                    plugins: ['fontcolor']
                }
            );

            $("#emails").select2({
                    language: {
                        noResults: function () {
                            return $("#_lan_no_results_found").val();
                        }
                    }
                }
            );


            const $send_email = $("#send_email");

            $("#mainForm").submit(function (e) {

                e.preventDefault();
                $send_email.prop('disabled', true);

                $.post('<?php ob_start();
echo $_smarty_tpl->getValue('base_url');
$_prefixVariable1 = ob_get_clean();
echo $_prefixVariable1;?>
contacts/group_email_post', $( "#mainForm" ).serialize())
                    .done(function (data) {
                        window.location = '<?php ob_start();
echo $_smarty_tpl->getValue('base_url');
$_prefixVariable2 = ob_get_clean();
echo $_prefixVariable2;?>
util/sent-emails';
                    }).fail(function(data) {
                    $('#clx_form_box').unblock();
                });

            });



        });

    <?php echo '</script'; ?>
>
<?php
}
}
/* {/block "script"} */
}
