Thanks but i dont seem to understand very well your concept. Im not a coding person and the complete code would help like what Sentq provided in hist last post.
This is the code i have
<?php
add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar)
{
$client = Menu::context('client');
if (!is_null($client)) {
$SupportPIN = generatePinCode($_SESSION['uid'], 8);
$primarySidebar->addChild('Support-Pin', array(
'label' => "Support Pin",
'uri' => '#',
'order' => '1',
'icon' => 'fa-ticket'
));
$primarySidebar->getChild('Support-Pin')->setBodyHtml($SupportPIN);
});
add_hook('AdminAreaClientSummaryPage', 1, function($vars) {
return 'Support Pin: ' . generatePinCode($vars['userid'], 8);
});
function generatePinCode($clientid = 0, $length = 6){
$clientid = intval($clientid);
preg_match_all('!\d+!', md5(date("y" . $clientid)), $matches);
$numbers = join("", $matches[0]);
return substr($numbers, 0, $length);
}