/**
	 * prepare backend users render
	 *
	 * @param moscomprofilerUser $user
	 * @param object $plugin
	 */
	private function showUsers( $user, $plugin ) {
		$paging								=	new cbgjPaging( 'users' );

		$limit								=	$paging->getlimit( 30 );
		$limitstart							=	$paging->getLimistart();
		$search								=	$paging->getFilter( 'search' );
		$category							=	$paging->getFilter( 'category' );
		$group								=	$paging->getFilter( 'group' );
		$status								=	$paging->getFilter( 'status' );
		$id									=	$paging->getFilter( 'id' );
		$where								=	array();

		if ( isset( $search ) && ( $search != '' ) ) {
			$where[]						=	array( 'd.id', '=', (int) $search, array( 'd.username', 'CONTAINS', $search ), array( 'd.name', 'CONTAINS', $search ) );
		}

		if ( isset( $category ) && ( $category != '' ) ) {
			$where[]						=	array( 'c.id', '=', (int) $category );
		}

		if ( isset( $group ) && ( $group != '' ) ) {
			$where[]						=	array( 'group', '=', (int) $group );
		}

		if ( isset( $status ) && ( $status != '' ) ) {
			$where[]						=	array( 'status', '=', (int) $status );
		}

		if ( isset( $id ) && ( $id != '' ) ) {
			$where[]						=	array( 'id', '=', (int) $id );
		}

		$searching							=	( count( $where ) ? true : false );

		$total								=	count( cbgjData::getUsers( null, $where ) );

		if ( $total <= $limitstart ) {
			$limitstart						=	0;
		}

		$pageNav							=	$paging->getPageNav( $total, $limitstart, $limit );

		$rows								=	array_values( cbgjData::getUsers( null, $where, null, array( $pageNav->limitstart, $pageNav->limit ) ) );

		$input								=	array();

		$categories							=	cbgjData::getCategories();
		$listCategories						=	cbgjData::listArray( $categories );

		if ( $listCategories ) {
			array_unshift( $listCategories, moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select Category -' ) ) );

			$input['category']				=	$paging->getInputSelect( 'adminForm', 'category', $listCategories, $category );

			$listGroups						=	array();

			foreach ( $categories as $cat ) {
				$groups						=	cbgjData::listArray( cbgjData::getGroups( null, array( 'category', '=', (int) $cat->get( 'id' ) ) ) );

				if ( $groups ) {
					$listGroups[]			=	moscomprofilerHTML::makeOptGroup( $cat->get( 'name' ) );

					foreach ( $groups as $grp ) {
						$listGroups[]		=	moscomprofilerHTML::makeOption( $grp->value, $grp->text );
					}
				}
			}

			array_unshift( $listGroups, moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select Group -' ) ) );

			$input['batch_group']			=	moscomprofilerHTML::selectList( $listGroups, 'batch_group', null, 'value', 'text', null, 1, false, false );

			if ( $category ) {
				$listGroups					=	cbgjData::listArray( cbgjData::getGroups( null, array( 'category', '=', (int) $category ) ) );

				array_unshift( $listGroups, moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select Group -' ) ) );
			}

			$input['group']					=	$paging->getInputSelect( 'adminForm', 'group', $listGroups, $group );
		} else {
			$input['category']				=	'-';
			$input['group']					=	'-';
			$input['batch_group']			=	'-';
		}

		$listStatus							=	array();
		$listStatus[]						=	moscomprofilerHTML::makeOption( '', CBTxt::T( '- Select Status -' ) );
		$listStatus[]						=	moscomprofilerHTML::makeOption( '-1', CBTxt::T( 'Banned' ) );
		$listStatus[]						=	moscomprofilerHTML::makeOption( '0', CBTxt::T( 'Inactive' ) );
		$listStatus[]						=	moscomprofilerHTML::makeOption( '1', CBTxt::T( 'Active' ) );
		$listStatus[]						=	moscomprofilerHTML::makeOption( '2', CBTxt::T( 'Moderator' ) );
		$listStatus[]						=	moscomprofilerHTML::makeOption( '3', CBTxt::T( 'Admin' ) );
		$listStatus[]						=	moscomprofilerHTML::makeOption( '4', CBTxt::T( 'Owner' ) );
		$input['status']					=	$paging->getInputSelect( 'adminForm', 'status', $listStatus, $status );
		$input['batch_status']				=	moscomprofilerHTML::selectList( $listStatus, 'batch_status', null, 'value', 'text', null, 1, false, false );

		$input['search']					=	$paging->getInputText( 'adminForm', 'search', $search, '30' );
		$input['id']						=	$paging->getInputText( 'adminForm', 'id', $id, '6' );

		$pageNav->searching					=	$searching;

		HTML_cbgjAdmin::showUsers( $rows, $pageNav, $input, $user, $plugin );
	}