<div class="main-menu">
<ul>

<?PHP
$i = 1;
while($row = $this->menus->Assoc()){


		echo '<li'.($i == $this->menus->Numrows ? ' class="last-row"' : '').'><a href="'._RootUrl.'/admin/?model='.$row['model'].'&page='.$row['page'].'" '.($row['class'] ? 'class="'.$row['class'].'"' : '').'>'.ucfirst($this->Language($row['name'])).'</a>';


	if($this->parent_menus->Numrows > 0){

		echo '<ul class="child-menu step-1">';

		while($row2 = $this->parent_menus->Assoc()){

			echo '<li '.($this->parent_menus_2->Numrows > 0 ? 'class="expand"' : '').'><a href="'._RootUrl.'/admin/?model='.$row2['model'].'&page='.$row2['page'].'" '.($row2['class'] ? 'class="'.$row2['class'].'"' : '').'>'.ucfirst($this->Language($row2['name'])).'</a>';

			if($this->parent_menus_2->Numrows > 0){

				echo '<ul class="child-menu step-2">';

				while($row3 = $this->parent_menus_2->Assoc()){

					echo '<li><a href="'._RootUrl.'/admin/?model='.$row3['model'].'&page='.$row3['page'].'" '.($row3['class'] ? 'class="'.$row3['class'].'"' : '').'>'.ucfirst($this->Language($row3['name'])).'</a>';

					echo '</li>';
				}
				echo '</ul>';
			}

			echo '</li>';
		}
		echo '</ul>';
	}

	echo '</li>';
	$i++;
}

?>
</ul>
</div>