62 lines
2.6 KiB
PHP
62 lines
2.6 KiB
PHP
|
|
<?php
|
||
|
|
require_once($_SERVER['DOCUMENT_ROOT']."/config.php");
|
||
|
|
if(!$_SESSION['superadmin']) {header("location:/index.php"); die("Доступ запрещён!");}
|
||
|
|
|
||
|
|
if($_GET['get_managers'])
|
||
|
|
{
|
||
|
|
$managers = User::getAllManagers($_GET['get_managers']);
|
||
|
|
if($managers)
|
||
|
|
{
|
||
|
|
foreach ($managers as $i => $mngr) {
|
||
|
|
$online = mysql_fetch_assoc(mysql_query("SELECT DATE_FORMAT(entry,'%d.%m.%Y %H:%i') AS entry FROM online WHERE id_user=$mngr[id]"));
|
||
|
|
if($online) $onl = "<div class='status green' title='Время захода'><i>$online[entry]</i></div>"; else $onl="<div class='status red' title='последняя авторизация'><i>$mngr[last_auth]</i></div>";
|
||
|
|
?>
|
||
|
|
<div class="one-user user_row row_line">
|
||
|
|
<div class="col">
|
||
|
|
<p><b class="big"><?php echo trim($mngr['last_name'] . ' ' . $mngr['first_name'] . ' ' . $mngr['middle_name']); ?></b></p>
|
||
|
|
</div>
|
||
|
|
<div class="col">
|
||
|
|
<p><b class="big"><?php echo $mngr['phone']; ?></b></p>
|
||
|
|
</div>
|
||
|
|
<div class="col">
|
||
|
|
<p><b class="big"><?php echo $mngr['email']; ?></b></p>
|
||
|
|
</div>
|
||
|
|
<div class="col">
|
||
|
|
<?php echo $onl; ?>
|
||
|
|
</div>
|
||
|
|
<div class="clear"></div>
|
||
|
|
</div>
|
||
|
|
<?php
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
if($_GET['get_agents'])
|
||
|
|
{
|
||
|
|
$agents = User::getAllAgents($_GET['get_agents']);
|
||
|
|
if($agents)
|
||
|
|
{
|
||
|
|
foreach ($agents as $i => $agent) {
|
||
|
|
$online = mysql_fetch_assoc(mysql_query("SELECT DATE_FORMAT(entry,'%d.%m.%Y %H:%i') AS entry FROM online WHERE id_user=$agent[id]"));
|
||
|
|
if($online) $onl = "<div class='status green' title='Время захода'><i>$online[entry]</i></div>"; else $onl="<div class='status red' title='последняя авторизация'><i>$agent[last_auth]</i></div>";
|
||
|
|
?>
|
||
|
|
<div class="one-user user_row row_line">
|
||
|
|
<div class="col">
|
||
|
|
<p><b class="big"><?php echo trim($agent['last_name'] . ' ' . $agent['first_name'] . ' ' . $agent['middle_name']); ?></b></p>
|
||
|
|
</div>
|
||
|
|
<div class="col">
|
||
|
|
<p><b class="big"><?php echo $agent['phone']; ?></b></p>
|
||
|
|
</div>
|
||
|
|
<div class="col">
|
||
|
|
<p><b class="big"><?php echo $agent['email']; ?></b></p>
|
||
|
|
</div>
|
||
|
|
<div class="col">
|
||
|
|
<?php echo $onl; ?>
|
||
|
|
</div>
|
||
|
|
<div class="clear"></div>
|
||
|
|
</div>
|
||
|
|
<?php
|
||
|
|
}
|
||
|
|
echo "</table>";
|
||
|
|
}
|
||
|
|
}
|