<?php
/* Smarty version 5.4.2, created on 2025-01-07 17:33:08
  from 'file:../default/orders_view.tpl' */

/* @var \Smarty\Template $_smarty_tpl */
if ($_smarty_tpl->getCompiled()->isFresh($_smarty_tpl, array (
  'version' => '5.4.2',
  'unifunc' => 'content_677daba4ccd5a3_53277673',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'd4b2c8d2549de0b748518013167beb03a73c41df' => 
    array (
      0 => '../default/orders_view.tpl',
      1 => 1736289184,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
))) {
function content_677daba4ccd5a3_53277673 (\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_1490234873677daba4cb4fd1_98849434', "content");
?>


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

<?php $_smarty_tpl->getInheritance()->endChild($_smarty_tpl, ((string)$_smarty_tpl->getValue('layouts_admin')), $_smarty_current_dir);
}
/* {block "content"} */
class Block_1490234873677daba4cb4fd1_98849434 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">

                <div class="panel-container">
                    <div class="panel-content">
                        <h3 style="color: #2f96f3;"><?php echo $_smarty_tpl->getValue('_L')['Order'];?>
 # <?php echo $_smarty_tpl->getValue('order')->id;?>
</h3>
                        <hr>
                        <?php if ($_smarty_tpl->getSmarty()->getModifierCallback('has_access')($_smarty_tpl->getValue('user')->roleid,'orders','edit')) {?>
                            <a href="javascript:;" onclick="confirmThenGoToUrl(event,'orders/set/<?php echo $_smarty_tpl->getValue('order')->id;?>
/Active/');" class="btn btn-primary">  <?php echo $_smarty_tpl->getValue('_L')['Accept'];?>
 </a>
                            <a href="javascript:;" onclick="confirmThenGoToUrl(event,'orders/set/<?php echo $_smarty_tpl->getValue('order')->id;?>
/Pending/');"  class="btn btn-warning">  <?php echo $_smarty_tpl->getValue('_L')['Pending'];?>
 </a>
                            <a href="javascript:;" onclick="confirmThenGoToUrl(event,'orders/set/<?php echo $_smarty_tpl->getValue('order')->id;?>
/Cancelled/');" class="btn btn-info"> <?php echo $_smarty_tpl->getValue('_L')['Cancel'];?>
 </a>
                        <?php }?>


                        <?php if ($_smarty_tpl->getSmarty()->getModifierCallback('has_access')($_smarty_tpl->getValue('user')->roleid,'orders','delete')) {?>
                            <a href="javascript:;" onclick="confirmThenGoToUrl(event,'delete/order/<?php echo $_smarty_tpl->getValue('order')->id;?>
/');" class="btn btn-danger">  <?php echo $_smarty_tpl->getValue('_L')['Delete'];?>
 </a>
                        <?php }?>
                        <hr>
                        <h4><?php echo $_smarty_tpl->getValue('_L')['Available Module for this Order'];?>
</h4>

                        <a href="<?php echo $_smarty_tpl->getValue('_url');?>
orders/module/<?php echo $_smarty_tpl->getValue('order')->id;?>
/" onclick="confirmThenGoToUrl(event,'orders/set/<?php echo $_smarty_tpl->getValue('order')->id;?>
/Active/');" class="btn btn-info">  <?php echo $_smarty_tpl->getValue('_L')['Default'];?>
 </a>

                        <hr>




                        <div class="row">
                            <div class="col-md-4">
                                <div class="well">
                                    <h4><?php echo $_smarty_tpl->getValue('_L')['Order Number'];?>
 - <?php echo $_smarty_tpl->getValue('order')->ordernum;?>
</h4>
                                    <p><strong><?php echo $_smarty_tpl->getValue('_L')['Customer'];?>
: </strong> <?php echo $_smarty_tpl->getValue('order')->cname;?>
</p>
                                    <p><strong><?php echo $_smarty_tpl->getValue('_L')['Product_Service'];?>
: </strong> <?php echo $_smarty_tpl->getValue('order')->stitle;?>
</p>
                                    <p><strong><?php echo $_smarty_tpl->getValue('_L')['Amount'];?>
: </strong> <span class="amount"><?php echo $_smarty_tpl->getValue('order')->amount;?>
</span> </p>
                                    <p><strong><?php echo $_smarty_tpl->getValue('_L')['Date'];?>
: </strong><?php echo $_smarty_tpl->getSmarty()->getModifierCallback('date')($_smarty_tpl->getValue('config')['df'],$_smarty_tpl->getSmarty()->getModifierCallback('strtotime')($_smarty_tpl->getValue('order')->date_added));?>
</p>
                                    <p><strong><?php echo $_smarty_tpl->getValue('_L')['Status'];?>
: </strong>

                                        <?php if ($_smarty_tpl->getValue('order')->status == 'Active') {?>
                                            <span class="label label-success"><?php echo $_smarty_tpl->getSmarty()->getModifierCallback('ib_lan_get_line')($_smarty_tpl->getValue('_L')[$_smarty_tpl->getValue('order')->status]);?>
</span>
                                        <?php } else { ?>
                                            <span class="label label-danger"><?php echo $_smarty_tpl->getSmarty()->getModifierCallback('ib_lan_get_line')($_smarty_tpl->getValue('_L')[$_smarty_tpl->getValue('order')->status]);?>
</span>
                                        <?php }?>
                                    </p>
                                    <?php if ($_smarty_tpl->getValue('order')->iid != '0') {?>
                                        <p><strong><?php echo $_smarty_tpl->getValue('_L')['Invoice'];?>
: </strong> <a href="<?php echo $_smarty_tpl->getValue('_url');?>
invoices/view/<?php echo $_smarty_tpl->getValue('order')->iid;?>
/"><?php echo Invoice::getInvoiceNumberById($_smarty_tpl->getValue('order')->iid);?>
</a> </p>
                                    <?php }?>



                                </div>
                            </div>
                            <div class="col-md-8">

                                <h4><?php echo $_smarty_tpl->getValue('_L')['Activation Message'];?>
</h4>
                                <hr>
                                <form method="post" id="ib_form">
                                    <div class="mb-3">
                                        <label for="activation_subject"><?php echo $_smarty_tpl->getValue('_L')['Subject'];?>
</label>
                                        <input type="text" class="form-control" id="activation_subject" name="activation_subject" value="<?php echo $_smarty_tpl->getValue('order')->activation_subject;?>
">
                                    </div>
                                    <div class="mb-3">
                                        <label for="activation_message"><?php echo $_smarty_tpl->getValue('_L')['Message'];?>
</label>
                                        <textarea class="form-control" id="activation_message" name="activation_message" rows="3"><?php echo $_smarty_tpl->getValue('order')->activation_message;?>
</textarea>
                                    </div>

                                    <input type="hidden" name="oid" id="oid" value="<?php echo $_smarty_tpl->getValue('order')->id;?>
">

                                    <button type="submit" id="btn_activation_message_save" class="btn btn-primary"><i class="fal fa-check"></i> <?php echo $_smarty_tpl->getValue('_L')['Save'];?>
</button>
                                    <button type="submit" id="btn_activation_message_send" class="btn btn-danger"><i class="fal fa-send"></i> <?php echo $_smarty_tpl->getValue('_L')['Send'];?>
</button>

                                </form>


                            </div>
                        </div>

                    </div>



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



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

    <?php echo '<script'; ?>
 src="<?php echo APP_URL;?>
/ui/lib/tinymce/tinymce.min.js" referrerpolicy="origin"><?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
>
        var _url = base_url;


        tinymce.init({
            selector: '#activation_message',
            // language: ib_lang,
            relative_urls: false,
            remove_script_host: false,
            removed_menuitems: 'newdocument',
            forced_root_block : false,
            fontsize_formats: '8pt 10pt 12pt 14pt 18pt 24pt 36pt',
            setup: function(ed) {
                ed.on('init', function() {
                    this.getDoc().body.style.fontSize = '14px';
                });
            },
            table_default_styles: {
                width: '100%'
            },

            toolbar: 'code | styles | bold italic underline strikethrough fontsize | numlist bullist link image table | alignleft aligncenter alignright alignjustify | outdent indent',
            license_key: 'gpl',
            branding: false,
            promotion: false,
            menubar: false,
        });

        var $btn_activation_message_save = $("#btn_activation_message_save");
        var $btn_activation_message_send = $("#btn_activation_message_send");
        var $ib_form = $("#ib_form");

        $btn_activation_message_save.on('click', function(e) {
            e.preventDefault();

            $ib_form.block({ message: block_msg });
            $.post( _url + "orders/save_activation/", {

                oid: $('#oid').val(),
                activation_subject: $('#activation_subject').val(),
                activation_message: tinyMCE.activeEditor.getContent(),
                send_email: 'no'

            })
                .done(function( data ) {

                    $ib_form.unblock();

                    if ($.isNumeric(data)) {

                        toastr.success('<?php echo $_smarty_tpl->getSmarty()->getModifierCallback('__')('data_updated');?>
');

                    }

                    else {
                        toastr.error(data);
                    }

                });

        });



        $btn_activation_message_send.on('click', function(e) {
            e.preventDefault();

            $ib_form.block({ message: block_msg });
            $.post( _url + "orders/save_activation/", {

                oid: $('#oid').val(),
                activation_subject: $('#activation_subject').val(),
                activation_message: tinyMCE.activeEditor.getContent(),
                send_email: 'yes'

            })
                .done(function( data ) {

                    $ib_form.unblock();

                    if ($.isNumeric(data)) {

                        toastr.success(_L['email_sent']);

                    }

                    else {
                        toastr.error(data);
                    }

                });

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