mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Added a function to get the agent alias
This commit is contained in:
parent
545dad643c
commit
c49df7c60d
@ -1325,6 +1325,28 @@ function agents_get_name ($id_agent, $case = "none") {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get alias of an agent.
|
||||||
|
*
|
||||||
|
* @param int $id_agent Agent id.
|
||||||
|
* @param string $case Case (upper, lower, none)
|
||||||
|
*
|
||||||
|
* @return string Alias of the given agent.
|
||||||
|
*/
|
||||||
|
function agents_get_alias ($id_agent, $case = 'none') {
|
||||||
|
$alias = (string) db_get_value ('alias', 'tagente', 'id_agente', (int) $id_agent);
|
||||||
|
|
||||||
|
switch ($case) {
|
||||||
|
case 'upper':
|
||||||
|
return mb_strtoupper($alias, 'UTF-8');
|
||||||
|
case 'lower':
|
||||||
|
return mb_strtolower($alias, 'UTF-8');
|
||||||
|
case 'none':
|
||||||
|
default:
|
||||||
|
return ($alias);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the number of pandora data packets in the database.
|
* Get the number of pandora data packets in the database.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user