Putting Username, Date and Time on Menu Bar in DHTMLX

Good day, i was wondering is it possible to put name of the employee, date and time on the menu bar. The scenario is this, on the login page as you can see below types the employee id number and it’s password and ofcourse of what branch he/she is assigned to. When successfully logged in, he/she will be redirected to the homepage where you can see the dashboards. And i wanted to put the employee name, date and time of the server inside the menu bar in dhtmlx. What i am referring to is the photo attached below this post. I also have the code for the website which was made by my partner (PHP) and i wanted to convert it to dhtmlx way.

This is the code from my partner PHP. I wanted to put this on my menubar in dhtmlx and it’s correct syntax.

<div class="navbar-default navbar-bottom" role="navigation"><span style="padding-right:10px;border-right:1px solid #fff;">User: <?php echo $row_users->employee_name?></span><span style="padding-left:10px;">Branch Name: <?php echo $row_branch->branch_area?></span><span id="realdatetime" style="float:right;"><script> document.getElementById("realdatetime").innerHTML = moment().format('LL | h:mm:ss a'); var chat = setInterval(function(){var date = new Date(); document.getElementById("realdatetime").innerHTML = moment().format('LL | h:mm:ss a');;},1000); </script></span></div>

My index page

var menu_1 = layout.attachMenu(); menu_1.setSkin("dhx_skyblue"); menu_1.setIconsPath('icons/'); menu_1.loadStruct('data/dhxmenu.xml'); menu_1.attachEvent("onClick", function(id, zoneId, cas) { some if statements... } {

This is the dhxmenu.xml file. This is how i call my menu and i wanted to put the employers name, time and date on the menu bar with just a text connected to the database. I wanted to put this next to “Reports” link.

[code]<?xml version="1.0"?>

<item id="sep_top_5" type="separator"/>
<item id="sep_top_35" type="separator"/>
	<item id="inventory" text="Inventory">
	<item id="productsReceiving" text="Products Receiving">
		<item id="productSuppliers" text="Suppliers" img="" imgdis="about_dis.gif"/>
		<item id="productBranches" text="Branches" img="" imgdis="about_dis.gif"/>
	<item id="sep_top_6" type="separator"/>
	<item id="sparepartsReceiving" text="Spareparts Receiving">
		<item id="spareSuppliers" text="Suppliers" img="" imgdis="about_dis.gif"/>
		<item id="spareBranches" text="Branches" img="" imgdis="about_dis.gif"/>
	<item id="sep_top_7" type="separator"/>
		<item id="beginning" text="Beginning" img="" imgdis="about_dis.gif"/>
		<item id="requestForm" text="Request Form" img="" imgdis="about_dis.gif"/>
		<item id="requestStockDelivery" text="Request Stock Delivery" img="" imgdis="about_dis.gif"/>
		<item id="merchandiseTransfer" text="Merchandise Transfer" img="" imgdis="about_dis.gif"/>
	<item id="sep_top_8" type="separator"/>
	<item id="reorderPoint" text="Reorder Point">
		<item id="overstock" text="Overstock" img="" imgdis="about_dis.gif"/>
		<item id="understock" text="Understock" img="" imgdis="about_dis.gif"/>

<item id="sep_top_9" type="separator"/>
<item id="sep_top_39" type="separator"/>
	<item id="accounting" text="Accounting">
		<item id="journalVoucher" text="Journal Voucher" img="" imgdis="new_dis.gif"/>
<item id="sep_top_10" type="separator"/>
<item id="sep_top_40" type="separator"/>
	<item id="setup" text="Setup">
		<item id="bank" text="Bank" img="" imgdis="new_dis.gif"/>
		<item id="areas" text="Areas" img="" imgdis="new_dis.gif"/>
		<item id="agents" text="Agents" img="" imgdis="new_dis.gif"/>
		<item id="branches" text="Branches" img="" imgdis="new_dis.gif"/>
		<item id="suppliers" text="Suppliers" img="" imgdis="new_dis.gif"/>
		<item id="customers" text="Customers" img="" imgdis="new_dis.gif"/>
		<item id="employees" text="Employees" img="" imgdis="new_dis.gif"/>
		<item id="positions" text="Positions" img="" imgdis="new_dis.gif"/>
		<item id="warehouses" text="Warehouses" img="" imgdis="new_dis.gif"/>
	<item id="sep_top_11" type="separator"/>
		<item id="brand" text="Brand" img="" imgdis="new_dis.gif"/>
		<item id="setupProducts" text="Products" img="" imgdis="new_dis.gif"/>
		<item id="spareparts" text="Spareparts" img="" imgdis="new_dis.gif"/>
		<item id="categories" text="Categories" img="" imgdis="new_dis.gif"/>
		<item id="subcategories" text="Subcategories" img="" imgdis="new_dis.gif"/>
	<item id="sep_top_12" type="separator"/>	
		<item id="terms" text="Terms" img="" imgdis="new_dis.gif"/>
		<item id="roles" text="Roles" img="" imgdis="new_dis.gif"/>
		<item id="permissions" text="Permissions" img="" imgdis="new_dis.gif"/>
		<item id="chartOfAccounts" text="Chart of Accounts" img="" imgdis="new_dis.gif"/>
		<item id="viewLogs" text="View Logs" img="" imgdis="new_dis.gif"/>
		<item id="password" text="Edit Password" img="" imgdis="new_dis.gif"/>
	<item id="sep_top_13" type="separator"/>
	<item id="sep_top_41" type="separator"/>
		<item id="databank" text="Databank">
			<item id="creditApplication" text="Credit Application" img="" imgdis="new_dis.gif"/>
			<item id="creditInvestigationReports" text="Credit Investigation Reports" img="" imgdis="new_dis.gif"/>
			<item id="newApplication" text="New Applicant" img="" imgdis="new_dis.gif"/>
			<item id="newApproved" text="New Approved" img="" imgdis="new_dis.gif"/>
	<item id="sep_top_14" type="separator"/>
	<item id="sep_top_42" type="separator"/>
		<item id="loyaltyReward" text="Loyalty Reward" img="" imgdis="new_dis.gif"/>
	<item id="sep_top_15" type="separator"/>
	<item id="sep_top_43" type="separator"/>
		<item id="reports" text="Reports">
			<item id="journalTrialBalance" text="Journal Trial Balance" img="" imgdis="new_dis.gif"/>

You can use setTopText API


Thank you stan! Works like a miracle!