<?php
/* Smarty version 4.3.2, created on 2024-04-08 18:34:43
  from '/var/www/html/public/legacy/lib/Search/UI/templates/search.results.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.3.2',
  'unifunc' => 'content_661438c384c155_68889443',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    '2023b88b5cb34d4f27d6f4ed0e6e1a95152e06b8' => 
    array (
      0 => '/var/www/html/public/legacy/lib/Search/UI/templates/search.results.tpl',
      1 => 1709743133,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
  ),
),false)) {
function content_661438c384c155_68889443 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_checkPlugins(array(0=>array('file'=>'/var/www/html/public/legacy/include/Smarty/plugins/function.cycle.php','function'=>'smarty_function_cycle',),));
?>
<h2 class="moduleTitle"><?php echo $_smarty_tpl->tpl_vars['APP']->value['LBL_SEARCH_REAULTS_TITLE'];?>
</h2>
<?php if (!empty($_smarty_tpl->tpl_vars['total']->value)) {
echo $_smarty_tpl->tpl_vars['APP']->value['LBL_SEARCH_TOTAL'];
echo $_smarty_tpl->tpl_vars['total']->value;
}
if (!empty($_smarty_tpl->tpl_vars['error']->value)) {?>
    <p class="error"><?php echo $_smarty_tpl->tpl_vars['APP']->value['ERR_SEARCH_INVALID_QUERY'];?>
</p>
<?php } else { ?>

    <?php if ($_smarty_tpl->tpl_vars['pagination']->value) {?>
        <ul class="nav nav-tabs">
            <li class="tab-inline-pagination">
                <table border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tbody>
                        <tr>
                            <td nowrap class="paginationWrapper">
                                <span class="pagination">
                                    <button type="button" class="button btn-pagination" title="<?php echo $_smarty_tpl->tpl_vars['APP']->value['LBL_SEARCH_PREV'];?>
"<?php if (!$_smarty_tpl->tpl_vars['pagination']->value['prev']) {?>disabled="true"<?php } else { ?>onclick="pagination.onClick('prev');"<?php }?>>
                                        <span class="suitepicon suitepicon-action-left"> </span><span class="pagination-label"><?php echo $_smarty_tpl->tpl_vars['APP']->value['LBL_SEARCH_PREV'];?>
</span>
                                    </button>
                                    &nbsp;&nbsp;
                                    <span class="pagination-range-label"><?php echo $_smarty_tpl->tpl_vars['APP']->value['LBL_SEARCH_PAGE'];
echo $_smarty_tpl->tpl_vars['pagination']->value['page'];
echo $_smarty_tpl->tpl_vars['APP']->value['LBL_SEARCH_OF'];
echo $_smarty_tpl->tpl_vars['pagination']->value['last'];?>
</span>
                                    &nbsp;&nbsp;
                                    <button type="button" class="button btn-pagination" title="<?php echo $_smarty_tpl->tpl_vars['APP']->value['LBL_SEARCH_NEXT'];?>
"<?php if (!$_smarty_tpl->tpl_vars['pagination']->value['next']) {?>disabled="true"<?php } else { ?>onclick="pagination.onClick('next');"<?php }?>>
                                        <span class="pagination-label"><?php echo $_smarty_tpl->tpl_vars['APP']->value['LBL_SEARCH_NEXT'];?>
</span><span class="suitepicon suitepicon-action-right"> </span>
                                    </button>
                                </span>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </li>
        </ul>
        <?php echo '<script'; ?>
>
            
            var pagination = {
                onClick: function(dir) {
                    var from = <?php echo $_smarty_tpl->tpl_vars['pagination']->value['from'];?>
;
                    var size = <?php echo $_smarty_tpl->tpl_vars['pagination']->value['size'];?>
;
                    var string = "<?php echo $_smarty_tpl->tpl_vars['pagination']->value['string'];?>
";
                    if (dir === 'prev') {
                        from -= size;
                    } else if (dir === 'next') {
                        from += size;
                    } else {
                        throw 'Invalid direction';
                    }
                    // keep search form values
                    $('input[name="search-query-from"]').val(from);
                    $('select[name="search-query-size"]').val(size);
                    $('input[name="search-query-string"').val(string);
                    $('#search-wrapper-form').submit();
                }
            };
            
        <?php echo '</script'; ?>
>
    <?php }?>

    <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['resultsAsBean']->value, 'beans', false, 'module');
$_smarty_tpl->tpl_vars['beans']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['module']->value => $_smarty_tpl->tpl_vars['beans']->value) {
$_smarty_tpl->tpl_vars['beans']->do_else = false;
?>
    <h3><?php echo $_smarty_tpl->tpl_vars['module']->value;?>
</h3>
    <table class="list view">
        <thead>
            <tr>
                <th></th>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['headers']->value[$_smarty_tpl->tpl_vars['module']->value], 'header');
$_smarty_tpl->tpl_vars['header']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['header']->value) {
$_smarty_tpl->tpl_vars['header']->do_else = false;
?>
                <th title="<?php echo $_smarty_tpl->tpl_vars['header']->value['comment'];?>
"><?php echo $_smarty_tpl->tpl_vars['header']->value['label'];?>
</th>
                <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
            </tr>
        </thead>
        <tbody>
            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['beans']->value, 'bean');
$_smarty_tpl->tpl_vars['bean']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['bean']->value) {
$_smarty_tpl->tpl_vars['bean']->do_else = false;
?>
            <tr class="<?php echo smarty_function_cycle(array('values'=>"oddListRowS1,evenListRowS1"),$_smarty_tpl);?>
">
                <td><a href="<?php echo $_smarty_tpl->tpl_vars['APP_CONFIG']->value['site_url'];?>
/index.php?action=EditView&module=<?php echo $_smarty_tpl->tpl_vars['module']->value;?>
&record=<?php echo $_smarty_tpl->tpl_vars['bean']->value->id;?>
&offset=1"><span class="suitepicon suitepicon-action-edit"></span></a></td>
                <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['headers']->value[$_smarty_tpl->tpl_vars['module']->value], 'header');
$_smarty_tpl->tpl_vars['header']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['header']->value) {
$_smarty_tpl->tpl_vars['header']->do_else = false;
?>
                <?php $_smarty_tpl->_assignInScope('headerField', (($tmp = $_smarty_tpl->tpl_vars['header']->value['field'] ?? null)===null||$tmp==='' ? '' ?? null : $tmp));?>
                <td><?php echo $_smarty_tpl->tpl_vars['bean']->value->{$_smarty_tpl->tpl_vars['headerField']->value};?>

                </td>
                <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
            </tr>
            <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
        </tbody>
        </thead>
    </table>
    <?php
}
if ($_smarty_tpl->tpl_vars['beans']->do_else) {
?>
    <p class="error"><?php echo $_smarty_tpl->tpl_vars['APP']->value['ERR_SEARCH_NO_RESULTS'];?>
</p>
    <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>

    <?php if (!empty($_smarty_tpl->tpl_vars['results']->value->getSearchTime())) {?>
        <p class="text-muted text-right" id="search-time">
            <?php echo $_smarty_tpl->tpl_vars['APP']->value['LBL_SEARCH_PERFORMED_IN'];?>
 <?php echo $_smarty_tpl->tpl_vars['results']->value->getSearchTime()*sprintf("%.2f",1000);?>
 ms
        </p>
    <?php }
}
}
}
