<?php

namespace OfficeBrain\CustomBundle\UserBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use OfficeBrain\Bundle\CoreBundle\CustomeHandler as FormErrorManager;
use Symfony\Component\HttpFoundation\JsonResponse;
use OfficeBrain\Bundle\UserBundle\Entity\User;
use OfficeBrain\Bundle\UserBundle\Form\UserType;
use OfficeBrain\Bundle\UserBundle\Form\AssignServiceGroupType;
use OfficeBrain\Bundle\UserBundle\Form\ResetPasswordType;
use Symfony\Component\DependencyInjection\ContainerInterface;
use OfficeBrain\Bundle\UserBundle\Controller\AdminUserController as BaseAdminUserController;

class AdminUserController extends BaseAdminUserController
{
    /**
     * @author Employee Id: 4493
     * set default value
     * @return NULL
     */

    public function __construct(ContainerInterface $container=null)
    {
        parent::__construct();

    }

    /**
     * @author Employee Id: 4493
     * To unset value
     * @return NULL
     */

    public function __destruct()
    {
    	parent::__destruct();
    }


    /**
     * @author Employee Id: 4493
     * Create objects which use this class
     * @return NULL
     */

    public function initAction()
    {
    	parent::initAction();
    }




    /**
     * @author Employee Id: 4493
     * OB eCommerce Product -  Admin User List
     *
     * @Route("admin/{_locale}/user/view",
     * 	name="office_brain_userbundle_adminuser_viewadminuser",
     *  options={"expose"=true}
     * )
     * @Method({"GET"})
     * @Template("OfficeBrainCustomBundleUserBundle:AdminUser:viewAdminUser.html.twig")
     */

    public function viewAdminUserAction()
    {
       $this->initAction();
       $this->getUserCountByTypeAction();
       $this->responseArray['record_set'] = $this->userManager->getAdminAllUsers($this->userId,$this->requestUserStatusTab,$this->page, $this->recordsPerPage,$this->searchParameterArray,$this->requestUserType,$this->requestStatus);

       if ($this->searchFlag == '1') {
	      $this->responseArray['html'] = $this->renderView('OfficeBrainCustomBundleUserBundle:AdminUser:viewAdminUser.html.twig', $this->responseArray);
	      return new JsonResponse($this->responseArray);
       }

       return $this->responseArray;
    }


 

}
