<?php
/* Smarty version 3.1.33-p1, created on 2020-09-16 20:54:33
  from '/home/tecnisat/public_html/central/admin/templates/v4/viewticket.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '3.1.33-p1',
  'unifunc' => 'content_5f627b89dec1e6_08163724',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '67775899e12d0a0365c48217f7d24638c0b5be5d' => 
    array (
      0 => '/home/tecnisat/public_html/central/admin/templates/v4/viewticket.tpl',
      1 => 1582944284,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_5f627b89dec1e6_08163724 (Smarty_Internal_Template $_smarty_tpl) {
echo $_smarty_tpl->tpl_vars['infobox']->value;?>


<h2>#<?php echo $_smarty_tpl->tpl_vars['tid']->value;?>
 - <?php echo $_smarty_tpl->tpl_vars['subject']->value;?>
 <select name="ticketstatus" id="ticketstatus" class="form-control select-inline" style="font-size:18px;">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['statuses']->value, 'statusitem');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['statusitem']->value) {
?>
<option<?php if ($_smarty_tpl->tpl_vars['statusitem']->value['title'] == $_smarty_tpl->tpl_vars['status']->value) {?> selected<?php }?> style="color:<?php echo $_smarty_tpl->tpl_vars['statusitem']->value['color'];?>
"><?php echo $_smarty_tpl->tpl_vars['statusitem']->value['title'];?>
</option>
<?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</select> <a href="#" onclick="$('#ticketstatus').val('Closed');$('#ticketstatus').trigger('change');return false"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['close'];?>
</a></h2>

<div class="ticketlastreply"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['lastreply'];?>
: <?php echo $_smarty_tpl->tpl_vars['lastreply']->value;?>
</div>
<input type="hidden" id="lastReplyId" value="<?php echo $_smarty_tpl->tpl_vars['lastReplyId']->value;?>
" />
<input type="hidden" id="currentSubject" value="<?php echo $_smarty_tpl->tpl_vars['subject']->value;?>
" />
<input type="hidden" id="currentCc" value="<?php echo $_smarty_tpl->tpl_vars['cc']->value;?>
" />
<input type="hidden" id="currentUserId" value="<?php echo $_smarty_tpl->tpl_vars['userid']->value;?>
" />
<input type="hidden" id="currentStatus" value="<?php echo $_smarty_tpl->tpl_vars['status']->value;?>
" />

<?php if ($_smarty_tpl->tpl_vars['clientnotes']->value) {?>
<div id="clientsimportantnotes">
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['clientnotes']->value, 'note');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['note']->value) {
?>
    <div class="panel panel-warning">
        <div class="panel-heading">
            <?php echo $_smarty_tpl->tpl_vars['note']->value['adminuser'];?>

            <div class="pull-right">
                <?php echo $_smarty_tpl->tpl_vars['note']->value['modified'];?>

            </div>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-11">
                    <?php echo $_smarty_tpl->tpl_vars['note']->value['note'];?>

                </div>
                <div class="col-md-1 pull-right text-right">
                    <a href="clientsnotes.php?userid=<?php echo $_smarty_tpl->tpl_vars['note']->value['userid'];?>
&action=edit&id=<?php echo $_smarty_tpl->tpl_vars['note']->value['id'];?>
">
                        <img src="images/edit.gif" width="16" height="16" align="absmiddle" />
                    </a>
                </div>
            </div>
        </div>
    </div>
<?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</div>
<?php }?>
<div class="pull-right">
    <?php if ($_smarty_tpl->tpl_vars['watchingTicket']->value) {?>
        <button class="btn btn-danger btn-xs" id="watch-ticket" type="button" data-admin-full-name="<?php echo $_smarty_tpl->tpl_vars['adminFullName']->value;?>
" data-admin-id="<?php echo $_smarty_tpl->tpl_vars['adminid']->value;?>
" data-ticket-id="<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;?>
" data-type="unwatch">
            <?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0], array( array('key'=>"support.unwatchTicket"),$_smarty_tpl ) );?>

        </button>
    <?php } else { ?>
        <button class="btn btn-info btn-xs" id="watch-ticket" type="button" data-admin-full-name="<?php echo $_smarty_tpl->tpl_vars['adminFullName']->value;?>
" data-admin-id="<?php echo $_smarty_tpl->tpl_vars['adminid']->value;?>
" data-ticket-id="<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;?>
" data-type="watch">
            <?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0], array( array('key'=>"support.watchTicket"),$_smarty_tpl ) );?>

        </button>
    <?php }?>
</div>

<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['addons_html']->value, 'addon_html');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['addon_html']->value) {
?>
<div style="margin-bottom:15px;"><?php echo $_smarty_tpl->tpl_vars['addon_html']->value;?>
</div>
<?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>

<div class="alert alert-info text-center<?php if (!$_smarty_tpl->tpl_vars['replyingadmin']->value) {?> hidden<?php }?>" role="alert" id="replyingAdminMsg">
    <?php echo $_smarty_tpl->tpl_vars['replyingadmin']->value['name'];?>
 <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['viewedandstarted'];?>
 @ <?php echo $_smarty_tpl->tpl_vars['replyingadmin']->value['time'];?>

</div>

<ul class="nav nav-tabs admin-tabs" role="tablist">
    <li class="active"><a href="#tab0" role="tab" data-toggle="tab"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['addreply'];?>
</a></li>
    <li><a href="#tab1" role="tab" data-toggle="tab"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['addnote'];?>
</a></li>
    <li><a href="#tab2" role="tab" data-toggle="tab" onclick="loadTab(2, 'customfields', 0)"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['setup']['customfields'];?>
</a></li>
    <li><a href="#tab3" role="tab" data-toggle="tab" onclick="loadTab(3, 'tickets', 0)"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['clienttickets'];?>
</a></li>
    <li><a href="#tab4" role="tab" data-toggle="tab" onclick="loadTab(4, 'clientlog', 0)"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['clientlog'];?>
</a></li>
    <li><a href="#tab5" role="tab" data-toggle="tab"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['options'];?>
</a></li>
    <li><a href="#tab6" role="tab" data-toggle="tab" onclick="loadTab(6, 'ticketlog', 0)"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['ticketlog'];?>
</a></li>
</ul>
<div class="tab-content admin-tabs">
  <div class="tab-pane active" id="tab0">

<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>
?action=viewticket&id=<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;?>
" enctype="multipart/form-data" name="replyfrm" id="frmAddTicketReply" data-no-clear="true">
<input type="hidden" name="postreply" value="1" />
<textarea name="message" id="replymessage" rows="14" class="form-control" style="margin:0 0 10px 0;"><?php if ($_smarty_tpl->tpl_vars['signature']->value) {?>



<?php echo $_smarty_tpl->tpl_vars['signature']->value;
}?></textarea>

<table class="form" width="100%" border="0" cellspacing="2" cellpadding="3">
    <tr>
        <td class="fieldlabel">
            <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['status'];?>

        </td>
        <td class="fieldarea">
            <select name="status" class="form-control select-inline">
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['statuses']->value, 'statusitem');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['statusitem']->value) {
?>
                    <option value="<?php echo $_smarty_tpl->tpl_vars['statusitem']->value['title'];?>
" style="color:<?php echo $_smarty_tpl->tpl_vars['statusitem']->value['color'];?>
"<?php if ($_smarty_tpl->tpl_vars['statusitem']->value['title'] == "Answered") {?> selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['statusitem']->value['title'];?>
</option>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
            </select>
        </td>
    </tr>
    <tr>
        <td class="fieldlabel">
            <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['priority'];?>

        </td>
        <td class="fieldarea">
            <select name="priority" class="form-control select-inline">
                <option value="nochange" selected><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['nochange'];?>
</option>
                <option value="High"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['status']['high'];?>
</option>
                <option value="Medium"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['status']['medium'];?>
</option>
                <option value="Low"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['status']['low'];?>
</option>
            </select>
        </td>
    </tr>
    <tr>
        <td width="15%" class="fieldlabel">
            <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['department'];?>

        </td>
        <td class="fieldarea">
            <select name="deptid" class="form-control select-inline">
                <option value="nochange" selected><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['nochange'];?>
</option>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['departments']->value, 'department');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['department']->value) {
?>
                    <option value="<?php echo $_smarty_tpl->tpl_vars['department']->value['id'];?>
"><?php echo $_smarty_tpl->tpl_vars['department']->value['name'];?>
</option>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
            </select>
        </td>
    </tr>
    <tr>
        <td class="fieldlabel">
            <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['flag'];?>

        </td>
        <td class="fieldarea">
            <select name="flagto" class="form-control select-inline">
                <option value="nochange" selected><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['nochange'];?>
</option>
                <option value="0"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['none'];?>
</option>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['staff']->value, 'staffmember');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['staffmember']->value) {
?>
                    <option value="<?php echo $_smarty_tpl->tpl_vars['staffmember']->value['id'];?>
"><?php echo $_smarty_tpl->tpl_vars['staffmember']->value['name'];?>
</option>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
            </select>
        </td>
    </tr>
    <tr>
        <td width="15%" class="fieldlabel">
            Tools
        </td>
        <td class="fieldarea">
            <input type="button" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['insertpredef'];?>
" class="btn btn-default" id="insertpredef" />
            <input type="button" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['insertkblink'];?>
" class="btn btn-default" onclick="window.open('supportticketskbarticle.php','kbartwnd','width=500,height=400,scrollbars=yes')" />

            <div id="prerepliescontainer">
                <div class="box">
                    <div style="float:right;"><input type="text" id="predefq" size="25" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['search'];?>
" onfocus="this.value=(this.value=='<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['search'];?>
') ? '' : this.value;" onblur="this.value=(this.value=='') ? '<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['search'];?>
' : this.value;" /></div>
                    <div id="prerepliescontent"><?php echo $_smarty_tpl->tpl_vars['predefinedreplies']->value;?>
</div>
                </div>
            </div>
        </td>
    </tr>
    <tr>
        <td class="fieldlabel">
            <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['attachments'];?>

        </td>
        <td class="fieldarea">
            <div class="row">
                <div class="col-sm-8">
                    <input type="file" name="attachments[]" class="form-control" />
                    <div id="fileuploads"></div>
                </div>
                <div class="col-sm-4 top-margin-5">
                    <a href="#" id="add-file-upload" class="btn btn-success btn-xs add-file-upload" data-more-id="fileuploads"><i class="fas fa-plus"></i> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['addmore'];?>
</a>
                </div>
            </div>
        </td>
    </tr>
    <?php if ($_smarty_tpl->tpl_vars['userid']->value) {?>
    <tr>
        <td class="fieldlabel">
            <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['addbilling'];?>

        </td>
        <td class="fieldarea">
            <input type="text" name="billingdescription" class="form-control input-250 input-inline" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['toinvoicedes'];?>
" onfocus="if(this.value=='<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['toinvoicedes'];?>
')this.value=''" /> @ <input type="text" name="billingamount" class="form-control input-100 input-inline" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['amount'];?>
" />
            <select name="billingaction" class="form-control select-inline">
                <option value="3" /> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['billableitems']['invoiceimmediately'];?>
</option>
                <option value="0" /> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['billableitems']['dontinvoicefornow'];?>
</option>
                <option value="1" /> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['billableitems']['invoicenextcronrun'];?>
</option>
                <option value="2" /> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['billableitems']['addnextinvoice'];?>
</option>
            </select>
        </td>
    </tr>
    <?php }?>
</table>

    <div class="btn-container">
        <input type="submit" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['addresponse'];?>
 &raquo;" name="postreply" class="btn btn-primary" id="postreplybutton" />
        <div style="display:inline-block;">
            <label class="checkbox-inline">
                &nbsp;
                <input type="checkbox" name="returntolist" value="1"<?php if ($_smarty_tpl->tpl_vars['returnToList']->value == true) {?> checked<?php }?> />
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['returnToTicketList'];?>

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

</form>

  </div>
  <div class="tab-pane" id="tab1">

<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>
?action=viewticket&id=<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;?>
" enctype="multipart/form-data" id="frmAddTicketNote" data-no-clear="false">
    <input type="hidden" name="postaction" value="note" />

<textarea name="message" id="replynote" rows="14" class="form-control"></textarea>

    <table class="form" width="100%" border="0" cellspacing="2" cellpadding="3">
        <tr>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['status'];?>

            </td>
            <td class="fieldarea">
                <select name="status" class="form-control select-inline">
                    <option value="nochange" selected><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['nochange'];?>
</option>
                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['statuses']->value, 'statusitem');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['statusitem']->value) {
?>
                        <option style="color:<?php echo $_smarty_tpl->tpl_vars['statusitem']->value['color'];?>
"><?php echo $_smarty_tpl->tpl_vars['statusitem']->value['title'];?>
</option>
                    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                </select>
            </td>
        <tr>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['priority'];?>

            </td>
            <td class="fieldarea">
                <select name="priority" class="form-control select-inline">
                    <option value="nochange" selected><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['nochange'];?>
</option>
                    <option value="High"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['status']['high'];?>
</option>
                    <option value="Medium"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['status']['medium'];?>
</option>
                    <option value="Low"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['status']['low'];?>
</option>
                </select>
            </td>
        </tr>
        <tr>
            <td width="15%" class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['department'];?>

            </td>
            <td class="fieldarea">
                <select name="deptid" class="form-control select-inline">
                    <option value="nochange" selected><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['nochange'];?>
</option>
                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['departments']->value, 'department');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['department']->value) {
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['department']->value['id'];?>
"><?php echo $_smarty_tpl->tpl_vars['department']->value['name'];?>
</option>
                    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                </select>
            </td>
        </tr>
        <tr>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['flag'];?>

            </td>
            <td class="fieldarea">
                <select name="flagto" class="form-control select-inline">
                    <option value="nochange" selected><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['nochange'];?>
</option>
                    <option value="0"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['none'];?>
</option>
                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['staff']->value, 'staffmember');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['staffmember']->value) {
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['staffmember']->value['id'];?>
"><?php echo $_smarty_tpl->tpl_vars['staffmember']->value['name'];?>
</option>
                    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                </select>
            </td>
        </tr>
        <tr>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['attachments'];?>

            </td>
            <td class="fieldarea">
                <div class="row">
                    <div class="col-sm-8">
                        <input type="file" name="attachments[]" class="form-control" />
                        <div id="note-file-uploads"></div>
                    </div>
                    <div class="col-sm-4 top-margin-5">
                        <a href="#" id="add-note-file-upload" class="btn btn-success btn-xs add-file-upload" data-more-id="note-file-uploads"><i class="fas fa-plus"></i> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['addmore'];?>
</a>
                    </div>
                </div>
            </td>
        </tr>
    </table>

    <div class="btn-container">
        <input type="submit" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['addnote'];?>
" class="btn btn-primary" name="postreply" />
        <div style="display:inline-block;">
            <label class="checkbox-inline">
                &nbsp;
                <input type="checkbox" name="returntolist" value="1"<?php if ($_smarty_tpl->tpl_vars['returnToList']->value == true) {?> checked<?php }?> />
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['returnToTicketList'];?>

            </label>
        </div>
    </div>
</form>

  </div>
  <div class="tab-pane" id="tab2">

<img src="images/loading.gif" align="top" /> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['loading'];?>


  </div>
  <div class="tab-pane" id="tab3">

<img src="images/loading.gif" align="top" /> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['loading'];?>


  </div>
  <div class="tab-pane" id="tab4">

<img src="images/loading.gif" align="top" /> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['loading'];?>


  </div>
  <div class="tab-pane" id="tab5">

<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>
?action=viewticket&id=<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;?>
" id="frmTicketOptions">
    <table class="form" width="100%" border="0" cellspacing="2" cellpadding="3">
        <tr>
            <td width="15%" class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['department'];?>

            </td>
            <td class="fieldarea">
                <select name="deptid" class="form-control select-inline">
                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['departments']->value, 'department');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['department']->value) {
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['department']->value['id'];?>
"<?php if ($_smarty_tpl->tpl_vars['department']->value['id'] == $_smarty_tpl->tpl_vars['deptid']->value) {?> selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['department']->value['name'];?>
</option>
                    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                </select>
            </td>
            <td width="15%" class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['clientname'];?>

            </td>
            <td class="fieldarea">
                <?php echo $_smarty_tpl->tpl_vars['userSearchDropdown']->value;?>

            </td>
        </tr>
        <tr>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['subject'];?>

            </td>
            <td class="fieldarea">
                <input type="text" name="subject" value="<?php echo $_smarty_tpl->tpl_vars['subject']->value;?>
" class="form-control input-300">
            </td>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['flag'];?>

            </td>
            <td class="fieldarea">
                <select name="flagto" class="form-control select-inline">
                    <option value="0"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['none'];?>
</option>
                    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['staff']->value, 'staffmember');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['staffmember']->value) {
?>
                        <option value="<?php echo $_smarty_tpl->tpl_vars['staffmember']->value['id'];?>
"<?php if ($_smarty_tpl->tpl_vars['staffmember']->value['id'] == $_smarty_tpl->tpl_vars['flag']->value) {?> selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['staffmember']->value['name'];?>
</option>
                    <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                </select>
            </td>
        </tr>
        <tr>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['status'];?>

            </td>
            <td class="fieldarea">
                <select name="status" class="form-control select-inline">
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['statuses']->value, 'statusitem');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['statusitem']->value) {
?>
                    <option<?php if ($_smarty_tpl->tpl_vars['statusitem']->value['title'] == $_smarty_tpl->tpl_vars['status']->value) {?> selected<?php }?> style="color:<?php echo $_smarty_tpl->tpl_vars['statusitem']->value['color'];?>
"><?php echo $_smarty_tpl->tpl_vars['statusitem']->value['title'];?>
</option>
                <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                </select>
            </td>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['priority'];?>

            </td>
            <td class="fieldarea">
                <select name="priority" class="form-control select-inline">
                    <option value="High"<?php if ($_smarty_tpl->tpl_vars['priority']->value == "High") {?> selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['status']['high'];?>
</option>
                    <option value="Medium"<?php if ($_smarty_tpl->tpl_vars['priority']->value == "Medium") {?> selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['status']['medium'];?>
</option>
                    <option value="Low"<?php if ($_smarty_tpl->tpl_vars['priority']->value == "Low") {?> selected<?php }?>><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['status']['low'];?>
</option>
                </select>
            </td>
        </tr>
        <tr>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['ccrecipients'];?>

            </td>
            <td class="fieldarea">
                <input type="text" id="inputTicketCc" name="cc" value="<?php echo $_smarty_tpl->tpl_vars['cc']->value;?>
" class="form-control selectize-ticketCc" placeholder="<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0], array( array('key'=>"global.none"),$_smarty_tpl ) );?>
">
            </td>
            <td class="fieldlabel">
                <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['mergeticket'];?>

            </td>
            <td class="fieldarea">
                <input type="text" name="mergetid" class="form-control input-150 input-inline"> (<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['notocombine'];?>
)
            </td>
        </tr>
    </table>
    <div class="btn-container">
        <button id="btnSaveChanges" type="submit" class="btn btn-primary" value="save">
            <i class="fas fa-save"></i>
            <?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0], array( array('key'=>'global.savechanges'),$_smarty_tpl ) );?>

        </button>
        <input type="reset" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['cancelchanges'];?>
" class="btn btn-default" />
    </div>
</form>

  </div>
  <div class="tab-pane" id="tab6">

<img src="images/loading.gif" align="top" /> <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['loading'];?>


  </div>
</div>

<?php if ($_smarty_tpl->tpl_vars['relatedservices']->value) {?>
<div class="tablebg">
<table class="datatable" id="relatedservicestbl" width="100%" border="0" cellspacing="1" cellpadding="3">
<tr><th><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['product'];?>
</th><th><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['amount'];?>
</th><th><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['billingcycle'];?>
</th><th><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['signupdate'];?>
</th><th><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['nextduedate'];?>
</th><th><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['status'];?>
</th></tr>
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['relatedservices']->value, 'relatedservice');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['relatedservice']->value) {
?>
<tr<?php if ($_smarty_tpl->tpl_vars['relatedservice']->value['selected']) {?> class="rowhighlight"<?php }?>><td><?php echo $_smarty_tpl->tpl_vars['relatedservice']->value['name'];?>
</td><td><?php echo $_smarty_tpl->tpl_vars['relatedservice']->value['amount'];?>
</td><td><?php echo $_smarty_tpl->tpl_vars['relatedservice']->value['billingcycle'];?>
</td><td><?php echo $_smarty_tpl->tpl_vars['relatedservice']->value['regdate'];?>
</td><td><?php echo $_smarty_tpl->tpl_vars['relatedservice']->value['nextduedate'];?>
</td><td><?php echo $_smarty_tpl->tpl_vars['relatedservice']->value['status'];?>
</td></tr>
<?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
</table>
</div>
<?php if ($_smarty_tpl->tpl_vars['relatedservicesexpand']->value) {?>
    <div id="relatedservicesexpand">
        <a href="#" onclick="expandRelServices();return false" class="btn btn-default btn-xs">
            <i class="fas fa-plus"></i>
            <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['expand'];?>

        </a>
    </div>
<?php }
}?>

<?php if (!$_smarty_tpl->tpl_vars['relatedservices']->value) {?><br /><?php }?>

<form method="post" action="supporttickets.php" id="ticketreplies">
<input type="hidden" name="id" value="<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;?>
" />
<input type="hidden" name="action" value="split" />

<div id="ticketreplies">

<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['replies']->value, 'reply');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['reply']->value) {
?>
<div class="reply<?php if ($_smarty_tpl->tpl_vars['reply']->value['note']) {?> note<?php } elseif ($_smarty_tpl->tpl_vars['reply']->value['admin']) {?> staff<?php }?>">

<div class="leftcol">

<div class="submitter">

<?php if ($_smarty_tpl->tpl_vars['reply']->value['admin']) {?>

<div class="name"><?php echo $_smarty_tpl->tpl_vars['reply']->value['admin'];?>
</div>
<div class="title"><?php if ($_smarty_tpl->tpl_vars['reply']->value['note']) {
echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['privateNote'];
} else {
echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['staff'];
}?></div>

<?php if ($_smarty_tpl->tpl_vars['reply']->value['rating']) {?>
<br /><?php echo $_smarty_tpl->tpl_vars['reply']->value['rating'];?>
<br /><br />
<?php }?>

<?php } else { ?>

<div class="name"><?php echo $_smarty_tpl->tpl_vars['reply']->value['clientname'];?>
</div>

<div class="title">
<?php if ($_smarty_tpl->tpl_vars['reply']->value['contactid']) {
echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['contact'];?>

<?php } elseif ($_smarty_tpl->tpl_vars['reply']->value['userid']) {
echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['fields']['client'];?>

<?php } else { ?>
<a href="mailto:<?php echo $_smarty_tpl->tpl_vars['reply']->value['clientemail'];?>
"><?php echo $_smarty_tpl->tpl_vars['reply']->value['clientemail'];?>
</a>
<?php }?>
</div>

<?php if (!$_smarty_tpl->tpl_vars['reply']->value['userid'] && !$_smarty_tpl->tpl_vars['reply']->value['contactid']) {?><input type="button" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['blocksender'];?>
" onclick="window.location='?action=viewticket&id=<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;?>
&blocksender=true&token=<?php echo $_smarty_tpl->tpl_vars['csrfToken']->value;?>
'" class="btn btn-xs btn-small" /><?php }?>

<?php }?>

</div>

<div class="tools">

<div class="editbtns<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {?>r<?php echo $_smarty_tpl->tpl_vars['reply']->value['id'];
} else { ?>t<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;
}?>">
<img src="../assets/img/spinner.gif" width="16" height="16" class="saveSpinner" style="display: none" />
<?php if (!$_smarty_tpl->tpl_vars['reply']->value['note']) {?><input type="button" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['edit'];?>
" onclick="editTicket('<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {?>r<?php echo $_smarty_tpl->tpl_vars['reply']->value['id'];
} else { ?>t<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;
}?>')" class="btn btn-xs btn-small btn-default" /><?php }
if ($_smarty_tpl->tpl_vars['deleteperm']->value) {?><input type="button" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['delete'];?>
" onclick="<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {
if ($_smarty_tpl->tpl_vars['reply']->value['note']) {?>doDeleteNote('<?php echo $_smarty_tpl->tpl_vars['reply']->value['id'];?>
');<?php } else { ?>doDeleteReply('<?php echo $_smarty_tpl->tpl_vars['reply']->value['id'];?>
');<?php }
} else { ?>doDeleteTicket();<?php }?>" class="btn btn-xs btn-small btn-danger" /><?php }?>
</div>
<div class="editbtns<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {?>r<?php echo $_smarty_tpl->tpl_vars['reply']->value['id'];
} else { ?>t<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;
}?>" style="display:none">
<img src="../assets/img/spinner.gif" width="16" height="16" class="saveSpinner" style="display: none" />
<input type="button" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['save'];?>
" onclick="editTicketSave('<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {?>r<?php echo $_smarty_tpl->tpl_vars['reply']->value['id'];
} else { ?>t<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;
}?>')" class="btn btn-xs btn-small btn-success" />
<input type="button" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['global']['cancel'];?>
" onclick="editTicketCancel('<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {?>r<?php echo $_smarty_tpl->tpl_vars['reply']->value['id'];
} else { ?>t<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;
}?>')" class="btn btn-xs btn-small btn-inverse" />
</div>

</div>

</div>
<div class="rightcol">
<?php if (!$_smarty_tpl->tpl_vars['reply']->value['note']) {?>
<div class="quoteicon"><a href="#" onClick="quoteTicket('<?php if (!$_smarty_tpl->tpl_vars['reply']->value['id']) {
echo $_smarty_tpl->tpl_vars['ticketid']->value;
}?>','<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {
echo $_smarty_tpl->tpl_vars['reply']->value['id'];
}?>'); return false;"><img src="images/icons/quote.png" border="0" /></a><?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {?> <input type="checkbox" name="rids[]" value="<?php echo $_smarty_tpl->tpl_vars['reply']->value['id'];?>
" /><?php }?></div>
<?php }?>
<div class="postedon"><?php if ($_smarty_tpl->tpl_vars['reply']->value['note']) {
echo $_smarty_tpl->tpl_vars['reply']->value['admin'];?>
 posted a note<?php } else { ?>Posted<?php }?> <?php if ($_smarty_tpl->tpl_vars['reply']->value['friendlydate']) {?>on <?php echo $_smarty_tpl->tpl_vars['reply']->value['friendlydate'];
} else { ?>today<?php }?> at <?php echo $_smarty_tpl->tpl_vars['reply']->value['friendlytime'];?>
</div>

<div class="msgwrap" id="content<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {?>r<?php echo $_smarty_tpl->tpl_vars['reply']->value['id'];
} else { ?>t<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;
}?>">

<div class="message markdown-content">
<?php echo $_smarty_tpl->tpl_vars['reply']->value['message'];?>

</div>

<?php if ($_smarty_tpl->tpl_vars['reply']->value['numattachments'] && !$_smarty_tpl->tpl_vars['reply']->value['attachments_removed']) {?>
<br />
<strong><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['attachments'];?>
</strong>
<br /><br />
<?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['reply']->value['attachments'], 'attachment', false, 'num');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['num']->value => $_smarty_tpl->tpl_vars['attachment']->value) {
if ($_smarty_tpl->tpl_vars['thumbnails']->value) {?>
<div class="ticketattachmentcontainer">
    <a href="../<?php echo $_smarty_tpl->tpl_vars['attachment']->value['dllink'];?>
"<?php if ($_smarty_tpl->tpl_vars['attachment']->value['isImage']) {?> data-lightbox="image-<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {
if ($_smarty_tpl->tpl_vars['reply']->value['note']) {?>n<?php } else { ?>r<?php }
echo $_smarty_tpl->tpl_vars['reply']->value['id'];
} else { ?>t<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;
}?>"<?php }?>>
        <span class="ticketattachmentthumbcontainer">
            <img src="../includes/thumbnail.php?<?php if ($_smarty_tpl->tpl_vars['reply']->value['id']) {
if ($_smarty_tpl->tpl_vars['reply']->value['note']) {?>nid=<?php } else { ?>rid=<?php }
echo $_smarty_tpl->tpl_vars['reply']->value['id'];
} else { ?>tid=<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;
}?>&i=<?php echo $_smarty_tpl->tpl_vars['num']->value;?>
" class="ticketattachmentthumb" />
        </span>
        <span class="ticketattachmentinfo">
            <img src="images/icons/attachment.png" align="top" />
            <?php echo $_smarty_tpl->tpl_vars['attachment']->value['filename'];?>

        </span>
    </a>
    <div class="ticketattachmentlinks">
        <small>
            <?php if ($_smarty_tpl->tpl_vars['attachment']->value['isImage']) {?><a href="../<?php echo $_smarty_tpl->tpl_vars['attachment']->value['dllink'];?>
"><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0], array( array('key'=>'support.download'),$_smarty_tpl ) );?>
</a> | <?php }?>
            <a href="<?php echo $_smarty_tpl->tpl_vars['attachment']->value['deletelink'];?>
" onclick="return confirm('<?php echo strtr($_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['delattachment'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
')" style="color:#cc0000"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['remove'];?>
</a>
        </small>
    </div>
</div>
<?php } else { ?>
<a href="../<?php echo $_smarty_tpl->tpl_vars['attachment']->value['dllink'];?>
"><img src="images/icons/attachment.png" align="absmiddle" /> <?php echo $_smarty_tpl->tpl_vars['attachment']->value['filename'];?>
</a> <small><?php if ($_smarty_tpl->tpl_vars['attachment']->value['isImage']) {?><a href="../<?php echo $_smarty_tpl->tpl_vars['attachment']->value['dllink'];?>
"><?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0], array( array('key'=>'support.download'),$_smarty_tpl ) );?>
</a> | <?php }?><a href="<?php echo $_smarty_tpl->tpl_vars['attachment']->value['deletelink'];?>
" onclick="return confirm('<?php echo strtr($_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['delattachment'], array("\\" => "\\\\", "'" => "\\'", "\"" => "\\\"", "\r" => "\\r", "\n" => "\\n", "</" => "<\/" ));?>
')" style="color:#cc0000"><?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['remove'];?>
</a></small><br />
<?php }
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
<div class="clear"></div>
<?php } elseif ($_smarty_tpl->tpl_vars['reply']->value['numattachments'] && $_smarty_tpl->tpl_vars['reply']->value['attachments_removed']) {?>
    <br />
    <strong>
        <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['attachments'];?>

    </strong>
    (<?php echo call_user_func_array( $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['lang'][0], array( array('key'=>'support.attachmentsRemoved'),$_smarty_tpl ) );?>
)
    <br /><br />
    <div class="ticketattachmentcontainer">
        <ul>
            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['reply']->value['attachments'], 'attachment', false, 'num');
if ($_from !== null) {
foreach ($_from as $_smarty_tpl->tpl_vars['num']->value => $_smarty_tpl->tpl_vars['attachment']->value) {
?>
                <li>
                    <?php echo $_smarty_tpl->tpl_vars['attachment']->value['filename'];?>

                </li>
            <?php
}
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
        </ul>
    </div>
    <div class="clear"></div>
<?php }?>

</div>

</div>

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

</div>

<a href="supportticketsprint.php?id=<?php echo $_smarty_tpl->tpl_vars['ticketid']->value;?>
" target="_blank" class="btn btn-default btn-xs">
    <i class="fas fa-print"></i>
    <?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['viewprintable'];?>

</a>
<?php if ($_smarty_tpl->tpl_vars['repliescount']->value > 1) {?>
    <span style="float:right;">
        <input type="button" value="<?php echo $_smarty_tpl->tpl_vars['_ADMINLANG']->value['support']['splitticketdialogbutton'];?>
" onclick="$('#modalsplitTicket').modal('show')" class="btn btn-default btn-xs" />
    </span>
<?php }?>

<?php echo $_smarty_tpl->tpl_vars['splitticketdialog']->value;?>

<input type="hidden" name="splitdeptid" id="splitdeptid" />
<input type="hidden" name="splitsubject" id="splitsubject" />
<input type="hidden" name="splitpriority" id="splitpriority" />
<input type="hidden" name="splitnotifyclient" id="splitnotifyclient" />
</form>

<?php echo '<script'; ?>
 src="../assets/js/lightbox.js"><?php echo '</script'; ?>
>
<?php }
}
