myvesta/web/templates/user/list_search.html
2021-09-04 01:23:24 +02:00

216 lines
9.9 KiB
HTML

<div class="l-center">
<div class="l-sort clearfix noselect">
<ul class="context-menu sort-order" style="display:none;">
<li entity="sort-date" sort_as_int="1"><span class="name active"><?=__('Date')?></span><span class="up">&nbsp;</span></li>
<li entity="sort-name"><span class="name"><?=__('Name')?></span><span class="up">&nbsp;</span></li>
<li entity="sort-star" sort_as_int="1"><span class="name"><?=__('Starred')?></span><span class="up">&nbsp;</span></li>
</ul>
<div class="l-sort-toolbar clearfix width-100p">
<span class="title edit display-inline-block float-left"><b><?=__('Search Results')?></b></span>
<table class="float-right">
<tr>
<td class="l-sort-toolbar__search-box">
<form action="/search/" method="get">
<input type="hidden" name="token" value="<?=$_SESSION['token']?>" />
<input type="text" name="q" class="search-input" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" />
<input type="submit" value="" class="l-sort-toolbar__search" onClick="return doSearch('/search/')" />
</form>
</td>
<td class="sort-by">
<?=__('sort by');?>: <span><b><?=__('Date')?></b></span> <i class="l-icon-down-arrow media-top"></i>
</td>
</tr>
</table>
</div>
</div>
<!-- /.l-sort -->
</div>
<div class="l-separator"></div>
<!-- /.l-separator -->
<div class="l-center units">
<?
foreach ($data as $key => $value) {
++$i;
if ($value['SUSPENDED'] == 'yes') {
$status = 'suspended';
$spnd_action = 'unsuspend' ;
} else {
$status = 'active';
$spnd_action = 'suspend';
}
if ($value['TYPE'] == 'db') {
$object = 'database';
} else {
$object = strtolower($value['TYPE']." ".$value['KEY']);
}
$uniq_id = $value['TYPE'].'-';
if($value['KEY'] == 'ACCOUNT'){
$uniq_id .= 'acc-';
}
$uniq_id .= sha1($value['RESULT']);
?>
<div class="l-unit <? if($status == 'suspended') echo 'l-unit--suspended'; if($_COOKIE[$uniq_id] == 1) echo ' l-unit--starred';?>" id="web-unit-<?=$i?>" uniq-id="<?=$uniq_id?>" sort-date="<?=strtotime($value['DATE'].' '.$value['TIME'])?>" sort-name="<?=$value['RESULT']?>">
<div class="l-unit-toolbar clearfix">
<!--div class="l-unit-toolbar__col l-unit-toolbar__col--left">
<input id="check<?=$i?>" class="ch-toggle" type="checkbox" name="check" value="check<?=$i?>">
<label for="check<?=$i?>" class="check-label"></label>
</div -->
<!-- l-unit-toolbar__col -->
<div class="l-unit-toolbar__col l-unit-toolbar__col--right noselect">
<div class="actions-panel clearfix">
<?
if ($value['USER'] != $user && $value['KEY'] == 'ACCOUNT') {
if ($key == $user) {
?>
<div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/logout/?token=<?=$_SESSION['token']?>"><?=__('logout')?> <i></i></a><span class="shortcut">&nbsp;L</span></div>
<?php
} else {
?>
<div class="actions-panel__col actions-panel__loginas shortcut-l" key-action="href"><a href="/login/?loginas=<?=$data[$key]['USER']?>&token=<?=$_SESSION['token']?>"><?=__('login as')?> <i></i></a><span class="shortcut">&nbsp;L</span></div>
<? }
}
?>
<?
if ($value['KEY'] == 'RECORD') {
$edit_lnk = '/edit/'.$value['TYPE'].'/?domain='.$value['PARENT'].'&record_id='.$value['LINK'].'&user='.$value['USER'];
}
if ($value['KEY'] == 'ACCOUNT') {
$edit_lnk = '/edit/'.$value['TYPE'].'/?domain='.$value['PARENT'].'&account='.$value['LINK'].'&user='.$value['USER'];
}
if ($value['KEY'] == 'JOB') {
$edit_lnk = '/edit/'.$value['TYPE'].'/?job='.$value['LINK'].'&user='.$value['USER'];
}
if ($value['KEY'] == 'DATABASE') {
$edit_lnk = '/edit/'.$value['TYPE'].'/?database='.$value['RESULT'].'&user='.$value['USER'];
}
if (($value['KEY'] != 'RECORD') && ($value['KEY'] != 'ACCOUNT') && ($value['KEY'] != 'JOB') && ($value['KEY'] != 'DATABASE') ) {
$edit_lnk = '/edit/'.$value['TYPE'].'/?'.strtolower($value['KEY']).'='.$value['RESULT'].'&user='.$value['USER'];
}
?>
<div class="actions-panel__col actions-panel__edit shortcut-enter" key-action="href"><a href="<?=$edit_lnk?>"><?=__('edit')?> <i></i></a><span class="shortcut enter">&nbsp;&#8629;</span></div>
<? if (!empty($value['STATS'])) { ?>
<div class="actions-panel__col actions-panel__logs shortcut-w" key-action="href"><a href="http://<?=$value['RESULT']?>/vstats/" target="_blank"><?=__('open webstats')?> <i></i></a><span class="shortcut">&nbsp;W</span></div>
<? } ?>
<?
if ($value['KEY'] == 'RECORD') {
$delete_lnk = '/delete/'.$value['TYPE'].'/?domain='.$value['PARENT'].'&record_id='.$value['LINK'].'&user='.$value['USER'];
$cnfrm = 'DELETE_RECORD_CONFIRMATION';
}
if ($value['KEY'] == 'ACCOUNT') {
$delete_lnk = '/delete/'.$value['TYPE'].'/?domain='.$value['PARENT'].'&account='.$value['LINK'].'&user='.$value['USER'];
$cnfrm = 'DELETE_USER_CONFIRMATION';
}
if ($value['KEY'] == 'JOB') {
$delete_lnk = '/delete/'.$value['TYPE'].'/?job='.$value['LINK'].'&user='.$value['USER'];
$cnfrm = 'DELETE_CRON_CONFIRMATION';
}
if ($value['KEY'] == 'DATABASE') {
$delete_lnk = '/delete/'.$value['TYPE'].'/?database='.$value['RESULT'].'&user='.$value['USER'];
$cnfrm = 'DELETE_DATABASE_CONFIRMATION';
}
if (($value['KEY'] != 'RECORD') && ($value['KEY'] != 'ACCOUNT') && ($value['KEY'] != 'JOB') && ($value['KEY'] != 'DATABASE') ) {
$delete_lnk = '/delete/'.$value['TYPE'].'/?'.strtolower($value['KEY']).'='.$value['RESULT'].'&user='.$value['USER'];
$cnfrm = 'DELETE_DOMAIN_CONFIRMATION';
}
?>
<div class="actions-panel__col actions-panel__delete shortcut-delete" key-action="js">
<a id="delete_link_<?=$i?>" class="data-controls do_delete">
<?=__('delete')?> <i class="do_delete"></i>
<input type="hidden" name="delete_url" value="<?=$delete_lnk?>&token=<?=$_SESSION['token']?>" />
<div id="delete_dialog_<?=$i?>" class="confirmation-text-delete hidden" title="<?=__('Confirmation')?>">
<p class="confirmation"><?=__($cnfrm, $value['RESULT'])?></p>
</div>
</a>
<span class="shortcut delete">&nbsp;Del</span>
</div>
</div>
<!-- /.actiona-panel -->
</div>
<!-- l-unit-toolbar__col -->
</div>
<!-- /.l-unit-toolbar -->
<div class="l-unit__col l-unit__col--left clearfix">
<div class="l-unit__date" u_date="<?=strtotime($value['DATE'])?>">
<?=translate_date($value['DATE'])?>
</div>
<div class="l-unit__suspended"><?__('suspended')?></div>
<div class="text-center">
<i class="l-icon-star" title="<?=__('save to favorites')?>"></i>
</div>
</div>
<!-- /.l-unit__col -->
<div class="l-unit__col l-unit__col--right">
<div class="l-unit__name separate" u_name="<?=$value['RESULT']?>">
<?=$value['RESULT']?> <span><?=str_replace(',', ', ', $value['ALIAS'])?></span>
</div>
<!-- /.l-unit__name -->
<div class="l-unit__stats">
<table>
<tr>
<td>
<div class="l-unit__stat-cols clearfix">
<div class="l-unit__stat-col l-unit__stat-col--left uppercase"><?=__($object)?></div>
</div>
</td>
<td>
<div class="l-unit__stat-cols clearfix">
<div class="l-unit__stat-col l-unit__stat-col--left"><?=__('Owner')?>:</div>
<div class="l-unit__stat-col l-unit__stat-col--right">
<b><?=$value['USER']?></b>
</div>
</div>
</td>
<td>
<div class="l-unit__stat-cols clearfix last">
<div class="l-unit__stat-col l-unit__stat-col--left"><?=__('Status')?>:</div>
<div class="l-unit__stat-col l-unit__stat-col--right">
<b><?=__($status)?></b>
</div>
</div>
</td>
</tr>
</table>
</div>
<!-- /.l-unit__stats -->
</div>
<!-- /.l-unit__col -->
</div>
<!-- /.l-unit -->
<!--div class="l-separator"></div-->
<!-- /.l-separator -->
<?}?>
</div>
<div id="vstobjects">
<div class="l-separator"></div>
<div class="l-center">
<div class="l-unit-ft">
<table class='data'></table>
<div class="l-unit__col l-unit__col--left clearfix"></div>
<div class="data-count l-unit__col l-unit__col--right clearfix">
<?php
if ( $i == 1) {
echo __('1 object');
} else {
echo __('%s objects',$i);
}
?>
</div>
</div>
</div>
</div>