From d0f6e764d3b82e52eefa95e7e423bf4dcdfef178 Mon Sep 17 00:00:00 2001
From: centiva1 <centiva1@centiva-desktop1.Home>
Date: Fri, 20 Jun 2014 13:25:15 +0530
Subject: [PATCH] Smradius code updated dated : 20 june

---
 .../Controller/ClientAttributesController.php |  20 +-
 .../app/Controller/ClientRealmsController.php |  35 +-
 htdocs/app/Controller/ClientsController.php   |  11 +-
 .../Controller/GroupAttributesController.php  |  33 +-
 .../app/Controller/GroupMemberController.php  |   9 +-
 htdocs/app/Controller/GroupsController.php    |  20 +-
 .../Controller/RealmAttributesController.php  |  18 +-
 .../app/Controller/RealmMembersController.php |  16 +-
 htdocs/app/Controller/RealmsController.php    |  20 +-
 .../Controller/UserAttributesController.php   |  32 +-
 .../app/Controller/UserGroupsController.php   |  17 +-
 htdocs/app/Controller/UserLogsController.php  |  12 +-
 .../app/Controller/UserTopupsController.php   |  24 +-
 htdocs/app/Controller/UsersController.php     |  46 +-
 .../WispLocationMembersController.php         |  15 +-
 .../Controller/WispLocationsController.php    |  30 +-
 .../app/Controller/WispUserLogsController.php |  12 +-
 htdocs/app/Controller/WispUsersController.php | 392 ++++-----
 .../Controller/WispUsersTopupsController.php  |  27 +-
 htdocs/app/Model/Accounting.php               |   5 +
 htdocs/app/Model/AccountingSummary.php        |   5 +
 htdocs/app/Model/Client.php                   |   6 +
 htdocs/app/Model/ClientAttribute.php          |   6 +
 htdocs/app/Model/ClientRealm.php              |  13 +-
 htdocs/app/Model/Group.php                    |   5 +
 htdocs/app/Model/GroupAttribute.php           |  11 +
 htdocs/app/Model/GroupMember.php              |   6 +
 htdocs/app/Model/Realm.php                    |   6 +
 htdocs/app/Model/RealmAttribute.php           |   6 +
 htdocs/app/Model/RealmMember.php              |   8 +-
 htdocs/app/Model/User.php                     |  14 +-
 htdocs/app/Model/UserAttribute.php            |  12 +-
 htdocs/app/Model/UserGroup.php                |  10 +-
 htdocs/app/Model/UserLog.php                  |  11 +-
 htdocs/app/Model/UserTopup.php                |  43 +-
 htdocs/app/Model/WispLocation.php             |   6 +
 htdocs/app/Model/WispLocationMember.php       |   8 +-
 htdocs/app/Model/WispUser.php                 |  53 +-
 htdocs/app/Model/WispUserLog.php              |  15 +-
 htdocs/app/Model/WispUsersTopup.php           |  14 +-
 htdocs/app/View/ClientAttributes/add.ctp      |  17 +-
 htdocs/app/View/ClientAttributes/edit.ctp     |  25 +-
 htdocs/app/View/ClientAttributes/index.ctp    |  94 ++-
 htdocs/app/View/ClientRealms/add.ctp          |  15 +-
 htdocs/app/View/ClientRealms/index.ctp        |  84 +-
 htdocs/app/View/Clients/add.ctp               |  19 +-
 htdocs/app/View/Clients/edit.ctp              |  15 +-
 htdocs/app/View/Clients/index.ctp             |  87 +-
 htdocs/app/View/Elements/flash_failure.ctp    |   4 +-
 htdocs/app/View/Elements/flash_success.ctp    |   4 +-
 htdocs/app/View/Elements/footer.ctp           |   7 +-
 htdocs/app/View/Elements/header.ctp           |  33 +-
 htdocs/app/View/Elements/left_panel.ctp       |  74 +-
 htdocs/app/View/Elements/wisp_left_panel.ctp  |  14 +-
 htdocs/app/View/Errors/error400.ctp           |  62 +-
 htdocs/app/View/Errors/error500.ctp           |  56 +-
 htdocs/app/View/GroupAttributes/add.ctp       |  80 +-
 htdocs/app/View/GroupAttributes/edit.ctp      |  56 +-
 htdocs/app/View/GroupAttributes/index.ctp     | 123 ++-
 htdocs/app/View/GroupMember/index.ctp         |  79 +-
 htdocs/app/View/Groups/add.ctp                |  13 +-
 htdocs/app/View/Groups/edit.ctp               |  39 +-
 htdocs/app/View/Groups/index.ctp              | 103 +--
 htdocs/app/View/Radius/index.ctp              |  21 +-
 htdocs/app/View/RealmAttributes/add.ctp       |  79 +-
 htdocs/app/View/RealmAttributes/edit.ctp      |  92 +--
 htdocs/app/View/RealmAttributes/index.ctp     | 105 ++-
 htdocs/app/View/RealmMembers/index.ctp        |  74 +-
 htdocs/app/View/Realms/add.ctp                |  39 +-
 htdocs/app/View/Realms/edit.ctp               |  39 +-
 htdocs/app/View/Realms/index.ctp              |  90 +--
 htdocs/app/View/UserAttributes/add.ctp        |  81 +-
 htdocs/app/View/UserAttributes/edit.ctp       |  95 +--
 htdocs/app/View/UserAttributes/index.ctp      | 117 ++-
 htdocs/app/View/UserGroups/add.ctp            |  11 +-
 htdocs/app/View/UserGroups/index.ctp          |  81 +-
 htdocs/app/View/UserLogs/index.ctp            | 136 ++--
 htdocs/app/View/UserTopups/add.ctp            | 137 ++--
 htdocs/app/View/UserTopups/edit.ctp           |  85 +-
 htdocs/app/View/UserTopups/index.ctp          |  96 ++-
 htdocs/app/View/Users/add.ctp                 |  53 +-
 htdocs/app/View/Users/edit.ctp                |  52 +-
 htdocs/app/View/Users/index.ctp               | 104 ++-
 htdocs/app/View/WispLocationMembers/index.ctp |  87 +-
 htdocs/app/View/WispLocations/add.ctp         |  38 +-
 htdocs/app/View/WispLocations/edit.ctp        |  37 +-
 htdocs/app/View/WispLocations/index.ctp       |  91 +--
 htdocs/app/View/WispUserLogs/index.ctp        | 152 ++--
 htdocs/app/View/WispUsers/add.ctp             | 340 ++++----
 htdocs/app/View/WispUsers/edit.ctp            | 742 +++++++++---------
 htdocs/app/View/WispUsers/index.ctp           |  39 +-
 htdocs/app/View/WispUsersTopups/add.ctp       |  84 +-
 htdocs/app/View/WispUsersTopups/edit.ctp      |  82 +-
 htdocs/app/View/WispUsersTopups/index.ctp     | 100 ++-
 htdocs/db/smradius_webgui_20_06_2014.sql      | 420 ++++++++++
 95 files changed, 3099 insertions(+), 2855 deletions(-)
 create mode 100644 htdocs/app/Model/GroupAttribute.php
 create mode 100644 htdocs/db/smradius_webgui_20_06_2014.sql

diff --git a/htdocs/app/Controller/ClientAttributesController.php b/htdocs/app/Controller/ClientAttributesController.php
index 298f4973..2ced45bb 100644
--- a/htdocs/app/Controller/ClientAttributesController.php
+++ b/htdocs/app/Controller/ClientAttributesController.php
@@ -8,13 +8,15 @@ class ClientAttributesController extends AppController {
 
 	/* index function 
 	 * @param $clientID
+	 * Functon loads list of client attributes with pagination
+	 *
 	 */
 		public function index($clientID){
-			if (isset($clientID)){			
+			if (isset($clientID)){		
+				// Fetching records with pagination
 				$this->paginate = array(
 				'limit' => PAGINATION_LIMIT,
-				'conditions' => array('ClientAttribute.ClientID' => $clientID)
-				);
+				'conditions' => array('ClientAttribute.ClientID' => $clientID));
 				$clientAttributes = $this->paginate();
 				
 				$this->set('clientAttributes', $clientAttributes);
@@ -26,15 +28,18 @@ class ClientAttributesController extends AppController {
 	
 	/* add function 
 	 * @param $clientID
+	 * Function used to add client attributes.
+	 *
 	 */
-	 
 		public function add($clientID){
 			$this->set('clientID', $clientID);
 			if ($this->request->is('post')){
 				$this->request->data['ClientAttribute']['Disabled'] = intval($this->request->data['ClientAttribute']['Disabled']);
 				$this->request->data['ClientAttribute']['ClientID'] = intval($this->request->params['pass'][0]);
 				$this->ClientAttribute->set($this->request->data);
+				// Validating user inputs.
 				if ($this->ClientAttribute->validates()) {
+					//Saving data to table.
 					$this->ClientAttribute->save($this->request->data);
 					$this->Session->setFlash(__('Client attribute is saved succefully!', true), 'flash_success');
 				} else {
@@ -45,6 +50,8 @@ class ClientAttributesController extends AppController {
 	
 	/* edit function 
 	 * @param $id , $clientID
+	 * Function used to edit client attributes.
+	 *
 	 */
 		public function edit($id, $clientID){
 			$clientAttribute = $this->ClientAttribute->findById($id);
@@ -62,11 +69,14 @@ class ClientAttributesController extends AppController {
 			}
 		}
 	
-	/* delete function 
+	/* remove function 
 	 * @param $id , $clientID
+	 * Function used to delete client attributes when clientID and id is matched.
+	 *
 	 */
 		public function remove($id, $clientID){
 			if (isset($id)){
+				// Deleting then redirecting to index
 				if($this->ClientAttribute->delete($id)){
 					$this->redirect('/client_attributes/index/'.$clientID);
 					$this->Session->setFlash(__('Client attribute is removed succefully!', true), 'flash_success');
diff --git a/htdocs/app/Controller/ClientRealmsController.php b/htdocs/app/Controller/ClientRealmsController.php
index aeaf5b7c..0218720c 100644
--- a/htdocs/app/Controller/ClientRealmsController.php
+++ b/htdocs/app/Controller/ClientRealmsController.php
@@ -5,8 +5,15 @@
  */
  
 class ClientRealmsController extends AppController {
+	
+	/* index function 
+	 * @param $clientID
+	 * Functon loads client realms list with pagination
+	 *
+	 */
 	public function index($clientID){
-		if (isset($clientID)){			
+		if (isset($clientID)){
+			// Fetching records with  pagination.			
 			$this->paginate = array(
 			'limit' => PAGINATION_LIMIT,
 			'conditions' => array('ClientID' => $clientID)
@@ -16,10 +23,11 @@ class ClientRealmsController extends AppController {
 			
 			foreach($clientRealm as $clientRealms)
 			{
-				$groupData= $this->ClientRealm->getGroupById($clientRealms['ClientRealm']['RealmID']);
-				if(isset($groupData[0]['realms']['Name']))
+				// Get realms name via realms id.
+				$realmsData= $this->ClientRealm->getRealmsById($clientRealms['ClientRealm']['RealmID']);
+				if(isset($realmsData[0]['realms']['Name']))
 				{
-				$clientRealms['ClientRealm']['realmName'] = $groupData[0]['realms']['Name'];
+				$clientRealms['ClientRealm']['realmName'] = $realmsData[0]['realms']['Name'];
 				}
 				$clientRealmsData[] = $clientRealms;
 			}
@@ -32,17 +40,24 @@ class ClientRealmsController extends AppController {
 		}			
 	}	
 	
+	/* add function 
+	 * @param $clientID
+	 * Function used to add client realms.
+	 *
+	 */
 	public function add($clientID){
 		if (isset($clientID))
 		{
 			$this->set('clientID', $clientID);
-			$clientRealms = $this->ClientRealm->selectGroup();
+			// Fetch realms for select box controler.
+			$clientRealms = $this->ClientRealm->selectRealms();
+			// Adding realms name to final array.
 			foreach($clientRealms as $val)
 			{
 				$arr[$val['realms']['ID']] = $val['realms']['Name'];
 			}
-			
 			$this->set('arr', $arr);
+			// run only when submit button clicked.
 			if ($this->request->is('post'))
 			{
 				$this->ClientRealm->set($this->request->data);
@@ -50,7 +65,6 @@ class ClientRealmsController extends AppController {
 				{
 					$this->ClientRealm->InsertRec($clientID,$this->request->data);
 					$this->Session->setFlash(__('Client member is saved succefully!', true), 'flash_success');
-				
 				} 
 				else 
 				{
@@ -58,11 +72,16 @@ class ClientRealmsController extends AppController {
 				}
 			}
 		}
-	
 	}
 	
+	/* remove function 
+	 * @param $id , $clientID
+	 * Function used to delete client realms when clientID and id is matched.
+	 *
+	 */
 	public function remove($id, $clientID){
 		if (isset($id)){
+			// Deleting then redirected to index function.
 			if($this->ClientRealm->delete($id)){
 				$this->redirect('/client_realms/index/'.$clientID);
 				$this->Session->setFlash(__('Client realm is removed succefully!', true), 'flash_success');
diff --git a/htdocs/app/Controller/ClientsController.php b/htdocs/app/Controller/ClientsController.php
index 73f56ee5..58ebecc1 100644
--- a/htdocs/app/Controller/ClientsController.php
+++ b/htdocs/app/Controller/ClientsController.php
@@ -5,7 +5,8 @@
 class ClientsController extends AppController
 {
 	/* index function 
-	 * 
+	 * Functon loads list of clients with pagination
+	 *
 	 */
 	public function index()
 	{
@@ -16,6 +17,7 @@ class ClientsController extends AppController
 	}
 	
 	/* add function 
+	 * Functon used to add clients.
 	 * 
 	 */
 	public function add(){
@@ -32,8 +34,11 @@ class ClientsController extends AppController
 	
 	/* edit function 
 	 * @param $id 
+	 * Function used to edit clients.
+	 *
 	 */
 	public function edit($id){
+		// Assigning client data to var.
 		$client = $this->Client->findById($id);
 		$this->set('client', $client);
 		if ($this->request->is('post')){
@@ -48,8 +53,10 @@ class ClientsController extends AppController
 		}
 	}
 	
-	/* delete function 
+	/* remoce function 
 	 * @param $id
+	 * Function used to delete clients.
+	 * 
 	 */
 	public function remove($id){
 		if($this->Client->delete($id)){
diff --git a/htdocs/app/Controller/GroupAttributesController.php b/htdocs/app/Controller/GroupAttributesController.php
index 90627807..b70598fc 100644
--- a/htdocs/app/Controller/GroupAttributesController.php
+++ b/htdocs/app/Controller/GroupAttributesController.php
@@ -6,9 +6,12 @@ class  GroupAttributesController extends AppController {
 
 	/* index function 
 	 * @param  $groupId
+	 * Functon loads list of group attributes with pagination
+	 *
 	 */
 	public function index($groupId){
-		if (isset($groupId)){			
+		if (isset($groupId)){
+			// Fetching data with pagination.			
 			$this->paginate = array(
 			'limit' => PAGINATION_LIMIT,
 			'conditions' => array('GroupAttribute.GroupID' => $groupId)
@@ -24,6 +27,8 @@ class  GroupAttributesController extends AppController {
 	
 	/* add function 
 	 * @param $groupId
+	 * Function used to add group attributes.	 
+	 *
 	 */
 	public function add($groupId){
 		$this->set('groupId', $groupId);
@@ -31,7 +36,9 @@ class  GroupAttributesController extends AppController {
 			$this->request->data['GroupAttribute']['Disabled'] = intval($this->request->data['GroupAttribute']['Disabled']);
 			$this->request->data['GroupAttribute']['GroupID'] = intval($this->request->params['pass'][0]);
 			$this->GroupAttribute->set($this->request->data);
+			// Validating entered data.
 			if ($this->GroupAttribute->validates()) {
+				// Saving data to table.
 				$this->GroupAttribute->save($this->request->data);
 				$this->Session->setFlash(__('Group attribute is saved succefully!', true), 'flash_success');
 			} else {
@@ -42,8 +49,11 @@ class  GroupAttributesController extends AppController {
 	
 	/* edit function 
 	 * @param $id, $groupId
+	 * Function used to edit group attributes.	 
+	 *
 	 */
 	public function edit($id, $groupId){
+		// Assigning group attribues values find by id to var.
 		$groupAttribute = $this->GroupAttribute->findById($id);
 		$this->set('groupAttribute', $groupAttribute);
 		if ($this->request->is('post')){
@@ -51,6 +61,7 @@ class  GroupAttributesController extends AppController {
 			$this->GroupAttribute->set($this->request->data);
 			if ($this->GroupAttribute->validates()) {
 				$this->GroupAttribute->id = $id;
+				//Saving data to the table.
 				$this->GroupAttribute->save($this->request->data);
 				$this->Session->setFlash(__('Attribute is saved succefully!', true), 'flash_success');
 			} else {
@@ -59,11 +70,14 @@ class  GroupAttributesController extends AppController {
 		}
 	}
 	
-	/* delete function 
+	/* remove function 
 	 * @param $id, $groupId
+	 * Function used to delete group attributes. 
+	 *	 
 	 */
 	public function remove($id, $groupId){
 		if (isset($id)){
+			// Deleting then redirecting to index function.
 			if($this->GroupAttribute->delete($id)){
 				$this->redirect('/group_attributes/index/'.$groupId);
 				$this->Session->setFlash(__('Attribute is removed succefully!', true), 'flash_success');
@@ -75,19 +89,4 @@ class  GroupAttributesController extends AppController {
 		}
 	}
 	
-	/* read attributes function 
-	 * @param $id
-	 */
-	public function attribute($id){
-		if ($this->request->is('post')){			
-			$this->request->data['UserAttribute'] = $this->request->data['User'];
-			$this->UserAttribute->set($this->request->data);
-			if ($this->UserAttribute->validates()) {
-				$this->UserAttribute->save($this->request->data);
-				$this->Session->setFlash(__('User attribute is saved succefully!', true), 'flash_success');
-			} else {
-				$this->Session->setFlash(__('User attribute is not saved succefully!', true), 'flash_failure');
-			}
-		}
-	}
 }
\ No newline at end of file
diff --git a/htdocs/app/Controller/GroupMemberController.php b/htdocs/app/Controller/GroupMemberController.php
index 642122fb..1411bf7a 100644
--- a/htdocs/app/Controller/GroupMemberController.php
+++ b/htdocs/app/Controller/GroupMemberController.php
@@ -5,13 +5,15 @@
  */
 class GroupMemberController extends AppController
 {
-	/* included table users
+	/* included users table 
 	 * 
 	 */
 	public $use = array('Users');
 	
 	/* index function 
 	 * @param $groupID
+	 * Functon loads list of group members with pagination
+	 *
 	 */
 	public function index($groupID)
 	{
@@ -26,6 +28,7 @@ class GroupMemberController extends AppController
 			$GroupMember = $this->paginate();
 			$UserNameData =array();
 			
+			// Preparing final array.
 			foreach($GroupMember as $groupMember)
 			{
 				$userName = $this->GroupMember->getUserNameById($groupMember['GroupMember']['UserID']);
@@ -42,8 +45,10 @@ class GroupMemberController extends AppController
 		}
 	}
 	
-	/* delete function 
+	/* remove function 
 	 * @param $id, $groupID
+	 * Function used to delete group member.
+
 	 */
 	public function remove($id, $groupID){
 		if (isset($id)){
diff --git a/htdocs/app/Controller/GroupsController.php b/htdocs/app/Controller/GroupsController.php
index 3950939b..6dd5ff53 100644
--- a/htdocs/app/Controller/GroupsController.php
+++ b/htdocs/app/Controller/GroupsController.php
@@ -5,23 +5,26 @@
 class GroupsController extends AppController {
 	
 	/* index function 
-	 *
+	 * Function used for Showing group list with pagination
+	 * 
 	 */
 	public function index(){
 		$this->Group->recursive = -1;
-		//$groups = $this->Group->find('all');
 		$this->paginate = array('limit' => PAGINATION_LIMIT );
 		$groups = $this->paginate();
 		$this->set('groups', $groups);
 	}
 	
 	/* add function 
-	 * 
+	 * Function used to add groups.
+	 *
 	 */
 	public function add(){
 		if ($this->request->is('post')){
 			$this->Group->set($this->request->data);
+			// Validating entered data.
 			if ($this->Group->validates()) {
+				// Saving data.
 			    $this->Group->save($this->request->data);
 				$this->Session->setFlash(__('Group is saved succefully!', true), 'flash_success');
 			} else {
@@ -32,16 +35,21 @@ class GroupsController extends AppController {
 	
 	/* edit function 
 	 * @param $id
+	 * Function used to edit groups.
+	 * 
 	 */
 	public function edit($id){
 		$group = $this->Group->findById($id);
 		$this->set('group', $group);
+		// Checking submit button is clicked or not 
 		if ($this->request->is('post')){
 			$this->Group->set($this->request->data);
+			// Validating submitted data.
 			if ($this->Group->validates()) {
 				$this->Group->id = $id;
 				$this->Group->save($this->request->data);
 				$this->Session->setFlash(__('Group is edited succefully!', true), 'flash_success');
+				
 				// For reload page to reflect change in data
 				$group = $this->Group->findById($id);
 				$this->set('group', $group);
@@ -51,11 +59,15 @@ class GroupsController extends AppController {
 		}
 	}
 	
-	/* delete function 
+	/* remove function 
 	 * @param $id
+	 * Function used to delete group.
+	 *
 	 */
 	public function remove($id){
+		// Deleting
 		if($this->Group->delete($id)){
+			// Redirected to index function.
 			$this->redirect('/groups/index');
 			$this->Session->setFlash(__('Group is removed succefully!', true), 'flash_success');
 		} else {
diff --git a/htdocs/app/Controller/RealmAttributesController.php b/htdocs/app/Controller/RealmAttributesController.php
index 8d8f95e6..8a76ac8c 100644
--- a/htdocs/app/Controller/RealmAttributesController.php
+++ b/htdocs/app/Controller/RealmAttributesController.php
@@ -7,6 +7,8 @@
 class RealmAttributesController extends AppController {
 	/* index function 
 	 * @param $realmId
+	 * Functon used for showing realms attribures with pagination
+	 * 
 	 */
 	public function index($realmId){
 		if (isset($realmId)){			
@@ -25,6 +27,8 @@ class RealmAttributesController extends AppController {
 	
 	/* edit function 
 	 * @param $realmId
+	 * Function used to add realms attributes
+	 *
 	 */
 	public function add($realmId){
 		$this->set('realmId', $realmId);
@@ -42,13 +46,17 @@ class RealmAttributesController extends AppController {
 	}
 	
 	/* edit function 
-	 * @param $id , $realmId
+	 * @param $id 
+	 * Function used to edit realms attributes.
+	 * 
 	 */
-	public function edit($id, $realmId){
+	public function edit($id){
 		$realmAttribute = $this->RealmAttribute->findById($id);
 		$this->set('realmAttribute', $realmAttribute);
+		// Checking submitted or not.
 		if ($this->request->is('post')){
 			$this->request->data['RealmAttribute']['Disabled'] = intval($this->request->data['RealmAttribute']['Disabled']);
+			// Setting submitted data.
 			$this->RealmAttribute->set($this->request->data);
 			if ($this->RealmAttribute->validates()) {
 				$this->RealmAttribute->id = $id;
@@ -60,12 +68,16 @@ class RealmAttributesController extends AppController {
 		}
 	}
 	
-	/* delete function 
+	/* remove function 
 	 * @param $id, $realmId
+	 * Function to delete realms attribute
+	 * 
 	 */
 	public function remove($id, $realmId){
 		if (isset($id)){
+			// Deleting & checking successful or not.
 			if($this->RealmAttribute->delete($id)){
+				// Redirecting to realms attribute index function.
 				$this->redirect('/realm_attributes/index/'.$realmId);
 				$this->Session->setFlash(__('Realm attribute is removed succefully!', true), 'flash_success');
 			} else {
diff --git a/htdocs/app/Controller/RealmMembersController.php b/htdocs/app/Controller/RealmMembersController.php
index 152fbadc..97ffde1a 100644
--- a/htdocs/app/Controller/RealmMembersController.php
+++ b/htdocs/app/Controller/RealmMembersController.php
@@ -7,19 +7,23 @@
 class RealmMembersController extends AppController {
 	/* index function 
 	 * @param $realmId
+	 * Function to show reamls members list with pagination 
+	 * 
 	 */
 	public function index($realmID){
-		if (isset($realmID)){			
+		if (isset($realmID)){	
+			// Getting list with pagination.		
 			$this->paginate = array(
                 'limit' => PAGINATION_LIMIT,
 				'conditions' => array('RealmID' => $realmID)
 			);
 			$realmMembers = $this->paginate();
 			$realmMembersData =array();
-
+			
+			// Generating final array.
 			foreach($realmMembers as $realmMember)
 			{
-				$clientData = $this->RealmMember->getGroupById($realmMember['RealmMember']['ClientID']);
+				$clientData = $this->RealmMember->getClientNameById($realmMember['RealmMember']['ClientID']);
 				if(isset($clientData[0]['clients']['Name']))
 				{
 					$realmMember['RealmMember']['clientName'] = $clientData[0]['clients']['Name'];
@@ -27,7 +31,7 @@ class RealmMembersController extends AppController {
 				$realmMembersData[] = $realmMember;
 			}
 			$realmMember = $realmMembersData;
-
+			// Send to view page.
 			$this->set('realmMember', $realmMember);
 			$this->set('realmID', $realmID);
 		} else {
@@ -35,8 +39,10 @@ class RealmMembersController extends AppController {
 		}			
 	}	
 
-	/* delete function 
+	/* remove function 
 	 * @param $id, $realmId
+	 * Function used to remove realms members.
+	 * 
 	 */
 	public function remove($id, $realmID){
 		if (isset($id)){
diff --git a/htdocs/app/Controller/RealmsController.php b/htdocs/app/Controller/RealmsController.php
index e86a12a0..f4f67fcc 100644
--- a/htdocs/app/Controller/RealmsController.php
+++ b/htdocs/app/Controller/RealmsController.php
@@ -6,7 +6,8 @@
 class RealmsController extends AppController
 {
 	/* index function 
-	 * 
+	 * Function used to show realms list with pagination. 
+	 *
 	 */
 	public function index()
 	{
@@ -17,11 +18,13 @@ class RealmsController extends AppController
 	}
 	
 	/* add function 
-	 * 
+	 * Used to add realms. 
+	 *
 	 */
 	public function add(){
 		if ($this->request->is('post')){
 			$this->Realm->set($this->request->data);
+			// Validating enterd data.
 			if ($this->Realm->validates()) {
 			    $this->Realm->save($this->request->data);
 				$this->Session->setFlash(__('Realm is saved succefully!', true), 'flash_success');
@@ -33,14 +36,21 @@ class RealmsController extends AppController
 	
 	/* edit function 
 	 * @param $id
+	 * Function used to edit realms.
+	 *
 	 */
 	public function edit($id){
+		// Fetch record and set to variable.
 		$realm = $this->Realm->findById($id);
 		$this->set('realm', $realm);
+		// Checking submission.
 		if ($this->request->is('post')){
+			// Setting submitted data.
 			$this->Realm->set($this->request->data);
+			// Validating submitted data.
 			if ($this->Realm->validates()) {
 				$this->Realm->id = $id;
+				// Saving
 			    $this->Realm->save($this->request->data);
 				$this->Session->setFlash(__('Realm is edited succefully!', true), 'flash_success');
 			} else {
@@ -49,11 +59,15 @@ class RealmsController extends AppController
 		}
 	}
 	
-	/* delete function 
+	/* remove function 
 	 * @param $id
+	 * Function usedto delete realms.
+	 *
 	 */
 	public function remove($id){
+		// Deleting & check done or not.
 		if($this->Realm->delete($id)){
+			// Redirecting to index.
 			$this->redirect('/realms/index');
 			$this->Session->setFlash(__('Realm is removed succefully!', true), 'flash_success');
 		} else {
diff --git a/htdocs/app/Controller/UserAttributesController.php b/htdocs/app/Controller/UserAttributesController.php
index 19cda458..cd366526 100644
--- a/htdocs/app/Controller/UserAttributesController.php
+++ b/htdocs/app/Controller/UserAttributesController.php
@@ -7,6 +7,8 @@ class UserAttributesController extends AppController {
 	
 	/* index function 
 	 * @param $userId
+	 * Function to show list of user attributes with pagination.
+	 *
 	 */		
 	public function index($userId){
 		if (isset($userId)){
@@ -32,17 +34,21 @@ class UserAttributesController extends AppController {
 				$this->request->data['UserAttribute']['Disabled'] = intval($this->request->data['UserAttribute']['Disabled']);
 				$this->request->data['UserAttribute']['UserID'] = intval($this->request->params['pass'][0]);
 				$this->UserAttribute->set($this->request->data);
+				// Validating	
 				if ($this->UserAttribute->validates()) {
-			  	  $this->UserAttribute->save($this->request->data);
+					// Saving
+					$this->UserAttribute->save($this->request->data);
 					$this->Session->setFlash(__('User attribute is saved succefully!', true), 'flash_success');
 				} else {
-			  	  $this->Session->setFlash(__('User attribute is not saved succefully!', true), 'flash_failure');
+					$this->Session->setFlash(__('User attribute is not saved succefully!', true), 'flash_failure');
 				}
 		}	
 	}
 	
 	/* edit function 
 	 * @param $id, $userId
+	 * Function used to edit users attributes.
+	 *
 	 */		
 	public function edit($id, $userId){
 		$userAttribute = $this->UserAttribute->findById($id);
@@ -59,12 +65,16 @@ class UserAttributesController extends AppController {
 			}
 		}
 	}
-	/* delete function 
+	/* remove function 
 	 * @param $id, $userId
+	 * Function used to delete users attributes.
+	 * 
 	 */		
 	public function remove($id, $userId){
 		if (isset($id)){
+			// Deleting and checking.
 			if($this->UserAttribute->delete($id)){
+				// Redirecting to index.
 				$this->redirect('/user_attributes/index/'.$userId);
 				$this->Session->setFlash(__('User is removed succefully!', true), 'flash_success');
 			} else {
@@ -74,20 +84,4 @@ class UserAttributesController extends AppController {
 			$this->redirect('/user_attributes/index'.$userId);
 		}
 	}
-	
-	/* attribute function 
-	 * @param $id
-	 */		
-	public function attribute($id){
-		if ($this->request->is('post')){			
-			$this->request->data['UserAttribute'] = $this->request->data['User'];
-			$this->UserAttribute->set($this->request->data);
-			if ($this->UserAttribute->validates()) {
-			    $this->UserAttribute->save($this->request->data);
-				$this->Session->setFlash(__('User attribute is saved succefully!', true), 'flash_success');
-			} else {
-			    $this->Session->setFlash(__('User attribute is not saved succefully!', true), 'flash_failure');
-			}
-		}
-	}
 }
\ No newline at end of file
diff --git a/htdocs/app/Controller/UserGroupsController.php b/htdocs/app/Controller/UserGroupsController.php
index 1b4b4a21..c567d657 100644
--- a/htdocs/app/Controller/UserGroupsController.php
+++ b/htdocs/app/Controller/UserGroupsController.php
@@ -9,6 +9,8 @@ class UserGroupsController extends AppController {
 	
 	/* index function 
 	 * @param $userId
+	 * Showing used group list with pagination.
+	 *
 	 */	
 	public function index($userId)
 	{
@@ -19,10 +21,10 @@ class UserGroupsController extends AppController {
                 'limit' => PAGINATION_LIMIT,
 				'conditions' => array('UserID' => $userId)
 			);
-			 
+			// Contains data with pagination. 
 			$UserGroups  = $this->paginate();
 			$UserGroupData =array();
-
+			// Adding group name to array.
 			foreach($UserGroups as $userGroup)
 			{
 				$groupData= $this->UserGroup->getGroupById($userGroup['UserGroup']['GroupID']);
@@ -41,26 +43,32 @@ class UserGroupsController extends AppController {
 	
 	/* add function 
 	 * @param $userId
+	 * Function to add user groups.
 	 */	
 	public function add($userId)
 	{
 		if (isset($userId))
 		{
 			$this->set('userId', $userId);
+			//Fetching  all groups.
+			$arr = array();
 			$groupItems = $this->UserGroup->selectGroup();
 			foreach($groupItems as $val)
 			{
 				$arr[$val['groups']['ID']] = $val['groups']['Name'];
 			}
 			
-			
 			$this->set('arr', $arr);
+			// Checking submission.
 			if ($this->request->is('post'))
 			{
 				$this->UserGroup->set($this->request->data);
+				// Validating submitted data.
 				if ($this->UserGroup->validates()) 
 				{
+					// Saving user groups.
 			    	$this->UserGroup->InsertRec($userId,$this->request->data);
+					// Sending message to screen.
 					$this->Session->setFlash(__('User Group is saved succefully!', true), 'flash_success');
 					
 				} 
@@ -78,10 +86,13 @@ class UserGroupsController extends AppController {
 	
 	/* remove function 
 	 * @param $id, $userId
+	 * Used to delete user groups
 	 */	
 	public function remove($id, $userId){
 		if (isset($id)){
+			// Deleting
 			if($this->UserGroup->delete($id)){
+				// Redirecting to index.
 				$this->redirect('/user_groups/index/'.$userId);
 				$this->Session->setFlash(__('User group is removed succefully!', true), 'flash_success');
 			} else {
diff --git a/htdocs/app/Controller/UserLogsController.php b/htdocs/app/Controller/UserLogsController.php
index 1bd753ed..dc717eee 100644
--- a/htdocs/app/Controller/UserLogsController.php
+++ b/htdocs/app/Controller/UserLogsController.php
@@ -7,28 +7,34 @@ class UserLogsController extends AppController
 {
 	/* index function 
 	 * @param $userId
+	 * Used to show user logs list with pagination.
+	 *
 	 */	
 	public function index($userId)
 	{
 		if (isset($userId))
 		{
-			// -- fetch data form topups table --
+			// Creating current month & year date.
 			$current = date('Y-m').'-01';
+			// Fetched data form topups table.
 			$userLog = $this->UserLog->SelectRec($userId,$current);
 			$this->set('userLog', $userLog);
 			$this->set('userId', $userId);
 			
-			// -- for searching --
+			// For searching topups month and year wise.
 			if ($this->request->is('post'))
 			{
+				// Reading submitted data to variable.
 				$data = $this->request->data;
+				// Setting data to model.
 				$this->UserLog->set($data);
 				$logDate = $data['UserLog']['yearData']."-".$data['UserLog']['dayData']."-01";
+				// Selected user log record from paramete logdate.
 			    $userLog = $this->UserLog->SelectRec($userId,$logDate);
 				$this->set('userLog', $userLog);
 			}
 			
-			// -- fetch data form accounting table --
+			// Fetch data form accounting table.
 			$username = $this->UserLog->SelectAcc($userId); 
 			$userName = $username[0]['users']['Username'];
 			
diff --git a/htdocs/app/Controller/UserTopupsController.php b/htdocs/app/Controller/UserTopupsController.php
index 5342cb36..d070ee5f 100644
--- a/htdocs/app/Controller/UserTopupsController.php
+++ b/htdocs/app/Controller/UserTopupsController.php
@@ -8,6 +8,8 @@ class UserTopupsController extends AppController {
 	public $use = array('Users');
 	/* index function 
 	 * @param $userId
+	 * Used to show user topups list with pagination.
+	 *
 	 */	
 	public function index($userId)
 	{
@@ -25,20 +27,24 @@ class UserTopupsController extends AppController {
 	
 	/* add function 
 	 * @param $userId
+	 * Used to add user topups
+	 *
 	 */	
 	public function add($userId)
 	{
 		if (isset($userId))
 		{
 			$this->set('userId', $userId);
+			// Checking button submission.
 			if ($this->request->is('post'))
 			{
 				$this->UserTopup->set($this->request->data);
+				// Validating input.
 				if ($this->UserTopup->validates()) 
 				{
+					// Saving data.
 			    	$this->UserTopup->InsertRec($userId,$this->request->data);
 					$this->Session->setFlash(__('User topup is saved succefully!', true), 'flash_success');
-					
 				} 
 				else 
 				{
@@ -54,20 +60,25 @@ class UserTopupsController extends AppController {
 	
 	/* edit function 
 	 * @param $id, $userId
+	 * Used to edit user topups
+	 *
 	 */	
 	public function edit($id, $userId){
+		// Loading topup data from user Id.
 		$topups = $this->UserTopup->findById($id);
 		$this->set('topup', $topups);
 		$this->set('userId', $userId);
+		// Checking submission.
 		if ($this->request->is('post')){
-			
+			// Setting data to model.
 			$this->UserTopup->set($this->request->data);
+			// Validating data.
 			if ($this->UserTopup->validates()) {
-
+				// Saving edited data.
 				$this->UserTopup->editRec($id, $this->request->data);
 				$this->Session->setFlash(__('User topup is saved succefully!', true), 'flash_success');
 
-				// For page reload to reflect data.
+				// For page reload to reflect new data.
 				$topups = $this->UserTopup->findById($id);
 				$this->set('topup', $topups);
 			} else {
@@ -76,11 +87,14 @@ class UserTopupsController extends AppController {
 		}
 	}
 	
-	/* delete function 
+	/* remove function 
 	 * @param $id, $userId
+	 * Used to delete user topups.
+	 *
 	 */	
 	public function remove($id, $userId){
 		if (isset($id)){
+			// Deleting
 			if($this->UserTopup->delete($id)){
 				$this->redirect('/user_topups/index/'.$userId);
 				$this->Session->setFlash(__('User topup is removed succefully!', true), 'flash_success');
diff --git a/htdocs/app/Controller/UsersController.php b/htdocs/app/Controller/UsersController.php
index ba644a36..ff8568de 100644
--- a/htdocs/app/Controller/UsersController.php
+++ b/htdocs/app/Controller/UsersController.php
@@ -4,18 +4,19 @@ class UsersController extends AppController {
 	public $use = array('UserAttribute');
 
 	/* index function 
-	 * 
+	 * Showing users list with pagination.
+	 *
 	 */			
 	public function index(){
-		//
 		$this->User->recursive = -1;
 		$this->paginate = array('limit' => PAGINATION_LIMIT );
 		$users = $this->paginate();
 		$this->set('users', $users);
-		}	
+	}	
 	
 	/* add function 
-	 * 
+	 * Adding users data.
+	 *
 	 */	
 	 	
 	public function add(){
@@ -33,18 +34,23 @@ class UsersController extends AppController {
 	
 	/* edit function 
 	 * @param $id
+	 * Editing users data.
 	 */		
 	public function edit($id){
+		// Finding users data and assigning to var $user.
 		$user = $this->User->findById($id);
 		$this->set('user', $user);
+		// Checking button is clicked or not.
 		if ($this->request->is('post')){
 			$this->request->data['User']['Disabled'] = intval($this->request->data['User']['Disabled']);
 			$this->User->set($this->request->data);
+			// Validating submitted data.
 			if ($this->User->validates()) {
 				$this->User->id = $id;
-			   $this->User->save($this->request->data);
+				// Save to database.				
+				$this->User->save($this->request->data);
 				$this->Session->setFlash(__('User is edited succefully!', true), 'flash_success');
-				// Code to update text field with new data.		
+				// To load page with new data saved above.
 				$user = $this->User->findById($id);
 				$this->set('user', $user);
 			} else {
@@ -53,35 +59,21 @@ class UsersController extends AppController {
 		}
 	}
 	
-	
-	/* delete function 
+	/* remove function 
 	 * @param $id
+	 * Function used to delete users data.
+	 *
 	 */	
 	public function remove($id){
+		// Deleting & checking done or not.
 		if($this->User->delete($id)){
-			$this->User->deleteGroup($id);
+			// Deleting user reference data from other db tables.
+			$this->User->deleteUserRef($id);
+			// Redirecting users to index function.
 			$this->redirect('/users/index');
 			$this->Session->setFlash(__('User is removed succefully!', true), 'flash_success');
 		} else {
 			$this->Session->setFlash(__('User is not removed succefully!', true), 'flash_failure');
 		}
 	}
-	
-	/* attribute function 
-	 * @param $id
-	 */	
-	public function attribute($id){
-		if ($this->request->is('post')){			
-			$this->request->data['UserAttribute'] = $this->request->data['User'];
-			$this->UserAttribute->set($this->request->data);
-			if ($this->UserAttribute->validates()) {
-			    $this->UserAttribute->save($this->request->data);
-				$this->Session->setFlash(__('User attribute is saved succefully!', true), 'flash_success');
-			} else {
-			    $this->Session->setFlash(__('User attribute is not saved succefully!', true), 'flash_failure');
-			}
-		}
-	}
-	
-	
 }
\ No newline at end of file
diff --git a/htdocs/app/Controller/WispLocationMembersController.php b/htdocs/app/Controller/WispLocationMembersController.php
index 468e2c68..106f35dd 100644
--- a/htdocs/app/Controller/WispLocationMembersController.php
+++ b/htdocs/app/Controller/WispLocationMembersController.php
@@ -6,16 +6,18 @@ class WispLocationMembersController extends AppController
 {
 	/* index function 
 	 * @param $LocationID
+	 * Used to show members location with pagination.
+	 *
 	 */	
 	public function index($LocationID)
 	{
-		//echo "<pre>";print_r($LocationID);exit;
 		$this->WispLocationMember->recursive = -1;
-		$this->paginate = array('limit' => PAGINATION_LIMIT,
-								'conditions' => array('LocationID' => $LocationID));
+		$this->paginate = array('limit' => PAGINATION_LIMIT,'conditions' => array('LocationID' => $LocationID));
+		// Assigning fetched data to variable.
 		$wispLocationMember = $this->paginate();
 		$memberData = array();
 		
+		// Generating final array.
 		foreach($wispLocationMember as $wMember)
 		{
 			$userNameData= $this->WispLocationMember->selectUsername($wMember['WispLocationMember']['UserID']);
@@ -32,12 +34,17 @@ class WispLocationMembersController extends AppController
 		$this->set('wispLocationMember', $wispLocationMember);
 		$this->set('LocationID', $LocationID);
 	}
-	/* delete function 
+	
+	/* remove function 
 	 * @param $id, $LocationID
+	 * used to delete members locations.
+	 *
 	 */		
 	public function remove($id, $LocationID)
 	{
+		// Deleting 
 		$deleteMember = $this->WispLocationMember->deleteMembers($id);
+		// Redirecting to index.
 		$this->redirect('/WispLocation_Members/index/'.$LocationID);
 		$this->Session->setFlash(__('Wisp locations member is removed succefully!', true), 'flash_success');
 	}
diff --git a/htdocs/app/Controller/WispLocationsController.php b/htdocs/app/Controller/WispLocationsController.php
index 4b49dc9e..454aed90 100644
--- a/htdocs/app/Controller/WispLocationsController.php
+++ b/htdocs/app/Controller/WispLocationsController.php
@@ -1,28 +1,35 @@
 <?php
-	/*
-	 * wisp location
-	 */	
+/*
+ * wisp location
+ */	
 class WispLocationsController extends AppController
 {
 	/* index function 
-	 * 
+	 * @param $LocationID
+	 * Used to show all location with pagination.
+	 *
 	 */	
 	public function index()
 	{
 		$this->WispLocation->recursive = -1;
 		$this->paginate = array('limit' => PAGINATION_LIMIT );
+		// Fetching and assigning to variable.
 		$wispLocation = $this->paginate();
 		$this->set('wispLocation', $wispLocation);
 	}
 	
 	/* add function 
+	 * Used to add locations.
 	 * 
 	 */	
 	public function add()
 	{
+		// Checking submission.
 		if ($this->request->is('post'))
-		{
+		{	
+			// Setting data to model.
 			$this->WispLocation->set($this->request->data);
+			// Validating submitted data.
 			if ($this->WispLocation->validates()) {
 			    $this->WispLocation->save($this->request->data);
 				$this->Session->setFlash(__('Wisp Location is saved succefully!', true), 'flash_success');
@@ -34,14 +41,21 @@ class WispLocationsController extends AppController
 	
 	/* edit function 
 	 * @param $id
+	 * Used to edit locations
+	 *
 	 */	
 	public function edit($id){
+		// Finding location from id and assigning to variable.
 		$location = $this->WispLocation->findById($id);
 		$this->set('location', $location);
+		// Checking submission.
 		if ($this->request->is('post')){
+			// Setting submitted data.
 			$this->WispLocation->set($this->request->data);
+			// Validating submitted data.
 			if ($this->WispLocation->validates()) {
 				$this->WispLocation->id = $id;
+				// Saving data.
 			    $this->WispLocation->save($this->request->data);
 				$this->Session->setFlash(__('Wisp Location is edited succefully!', true), 'flash_success');
 			} else {
@@ -50,11 +64,15 @@ class WispLocationsController extends AppController
 		}
 	}
 	
-	/* delete function 
+	/* remove function 
 	 * @param $id
+	 * used to delete locations.
+	 *
 	 */	
 	public function remove($id){
+		// Deleting
 		if($this->WispLocation->delete($id)){
+			// Redirecting to index.
 			$this->redirect('/WispLocations/index');
 			$this->Session->setFlash(__('Wisp Locations is removed succefully!', true), 'flash_success');
 		} else {
diff --git a/htdocs/app/Controller/WispUserLogsController.php b/htdocs/app/Controller/WispUserLogsController.php
index b6d182b9..dde07195 100644
--- a/htdocs/app/Controller/WispUserLogsController.php
+++ b/htdocs/app/Controller/WispUserLogsController.php
@@ -7,29 +7,33 @@ class WispUserLogsController extends AppController
 {
 	/* index function 
 	 * @param $userId
+	 * Used to load user logs data list. 
 	 */	
 	public function index($userId)
 	{
-		
 		if (isset($userId))
 		{
-			// -- fetch data form topups table --
+			// Creating current month & year date.
 			$current = date('Y-m').'-01';
+			// Fetched data form topups table.
 			$userLog = $this->WispUserLog->SelectRec($userId,$current);
 			$this->set('userLog', $userLog);
 			$this->set('userId', $userId);
 			
-			// -- for searching --
+			// For searching topups month and year wise.
 			if ($this->request->is('post'))
 			{
+				// Reading submitted data to variable.
 				$data = $this->request->data;
+				// Setting data to model.
 				$this->WispUserLog->set($data);
 				$logDate = $data['WispUserLog']['yearData']."-".$data['WispUserLog']['dayData']."-01";
+				// Selected user log record from paramete logdate.
 			    $userLog = $this->WispUserLog->SelectRec($userId,$logDate);
 				$this->set('userLog', $userLog);
 			}
 			
-			// -- fetch data form accounting table --
+			// Fetch data form accounting table.
 			$username = $this->WispUserLog->SelectAcc($userId); 
 			$userName = $username[0]['users']['Username'];
 			
diff --git a/htdocs/app/Controller/WispUsersController.php b/htdocs/app/Controller/WispUsersController.php
index 3be62964..cf035c40 100644
--- a/htdocs/app/Controller/WispUsersController.php
+++ b/htdocs/app/Controller/WispUsersController.php
@@ -2,43 +2,51 @@
 /* 
  * Wisp Users
  */
+ 
 class WispUsersController extends AppController
 {
 	/* index function 
-	 * 
+	 * Showing users list with pagination.  
+	 *
 	 */
 	public function index()
 	{
 		$this->WispUser->recursive = -1;
 		$this->paginate = array('limit' => PAGINATION_LIMIT );
+		// Assigning paginated data to var.
 		$wispUser = $this->paginate();
 		$wispUserData = array();
 
+		// Adding username and disabled to above array and generating final array.
 		foreach($wispUser as $wUsers)
 		{
 			$userData = $this->WispUser->selectById($wUsers['WispUser']['UserID']);
+			
 			$wUsers['WispUser']['Username'] = $userData[0]['users']['Username'];
 			$wUsers['WispUser']['Disabled'] = $userData[0]['users']['Disabled'];
 			$wispUserData[] = $wUsers;
 		}
+		
 		$wispUser = $wispUserData;
+		// setting data to use it on view page.
 		$this->set('wispUser', $wispUser);
 	}
 	
 	/* add function 
-	 * 
+	 * Used to add users to database
+	 *
 	 */
 	public function add()
 	{
-		// -- for fetching group from table --
+		// Fetching groups from table.
 		$groupItems = $this->WispUser->selectGroup();
+		$grouparr = $location = array();
 		foreach($groupItems as $val)
 		{
 			$grouparr[$val['groups']['ID']] = $val['groups']['Name'];
 		}
 		$this->set('grouparr', $grouparr);
-		
-		// -- for fetching location from table --
+		// Fetching locations from table
 		$locationData = $this->WispUser->selectLocation();
 		
 		foreach($locationData as $loc)
@@ -48,26 +56,26 @@ class WispUsersController extends AppController
 		$this->set('location', $location);
 		
 		$userData[] = array();
+		// Checking submission.
 		if ($this->request->is('post'))
 		{
 			$requestData = $this->WispUser->set($this->request->data);
-			//echo "<pre>";print_r($requestData);exit;
-			
+			// Checking wisp number field is set or not 
 			if(!$requestData['WispUser']['Number'])
 			{
+				// Validationg submitted data.
 				if($this->WispUser->validates())
 				{
 					$addUser = $this->WispUser->insertUsername($requestData['WispUser']['Username']);
-
 					foreach($addUser as $userId)
 					{
 						$requestData['WispUser']['UserId'] = $userId[0]['id'];
 					}
 					
-					// -- password is add in user_attributes table --
-					$insertValue = $this->WispUser->addValue($requestData['WispUser']['UserId'],'User-Password', '2', $requestData['WispUser']['Password']);
+					// Password attribute is inserted to table.
+					$insertValue = $this->WispUser->addValue($requestData['WispUser']['UserId'],'User-Password', '2', $requestData['WispUser']['Password'],'');
 					
-					// -- add group --
+					// Inserting groups
 					if(isset($requestData['groupId']))
 					{
 						foreach($requestData['groupId'] as $groupID)
@@ -75,9 +83,9 @@ class WispUsersController extends AppController
 							$addUserGroup = $this->WispUser->insertUserGroup($requestData['WispUser']['UserId'], $groupID);
 						}
 					}
-					// -- end of add group --
+					//end of group insertion.
 					
-					// -- add attribute --
+					// Inserting attributes.
 					$count1 = '';
 					if(isset($requestData['attributeName']))
 					{
@@ -95,44 +103,40 @@ class WispUsersController extends AppController
 								else
 								{
 									$attrValue = $this->switchModifier($requestData['attributeModifier'][$i],$attrValues);
-
-								}
+								}  
 							}
 
 							$addattribute = $this->WispUser->addValue($requestData['WispUser']['UserId'], $requestData['attributeName'][$i], $requestData['attributeoperator'][$i], $attrValue,$requestData['attributeModifier'][$i]);
 						}
 					}
-					//exit;
-					// -- end of add attribute --
+					// end of attribute insertion
 					
-					// -- add records in wisp_userdata table --
+					// Inserting data in wisp_userdata table
 					$this->WispUser->insertRec($requestData);
 					$this->Session->setFlash(__('Wisp user is saved succefully!', true), 'flash_success');
 					} else {
 			  			$this->Session->setFlash(__('Wisp user is not saved!', true), 'flash_failure');
 					}
 				}
+				// This sectiopn work,if number fields is inserted from add many tab option.
 				else
 				{
-					// for random generat user name.
-					//echo "<pre>";print_r($requestData);exit;
-					
-					// -- loop for number of choosen number --
 					$numberCount = $requestData['WispUser']['Number'];
 					$prefix = $requestData['WispUser']['Prefix'];
+					// loop to add $numberCount number of users to system.
 					for($abc=0;$abc<$numberCount;$abc++)
 					{
+						// generating random username and password
 						list($user,$pass) = $this->randomUserName($prefix);
 						$requestData['WispUser']['Username'] = $user;
 						$requestData['WispUser']['Password'] = $pass;
-						
+						// Saving username 	
 						$addUser = $this->WispUser->insertUsername($requestData['WispUser']['Username']);
-					//	print_r($addUser); 
 						foreach($addUser as $userId)
 						{
 							$requestData['WispUser']['UserId'] = $userId[0]['id'];
 						}
-					// -- add group --
+						//Inserting groups
 						if(isset($requestData['groupId']))
 						{
 							foreach($requestData['groupId'] as $groupID)
@@ -140,10 +144,12 @@ class WispUsersController extends AppController
 								$addUserGroup = $this->WispUser->insertUserGroup($requestData['WispUser']['UserId'], $groupID);
 							}
 						}
-						// -- end of add group --
-						// -- password is add in user_attributes table --
+						// End of group insertion
+						
+						// Inserting password to user_attributes table.
 						$insertValue = $this->WispUser->addValue($requestData['WispUser']['UserId'],'User-Password', '2', $requestData['WispUser']['Password'],'');
-						// -- add attribute --
+
+					// Inserting attributes
 					$count1 = '';
 					if(isset($requestData['attributeName']))
 					{
@@ -160,23 +166,21 @@ class WispUsersController extends AppController
 								}
 								else
 								{
+									// calling switch modifier function and getting attribute value after processing.
 									$attrValue = $this->switchModifier($requestData['attributeModifier'][$i],$attrValues);
-
 								}
 							}
-						//	echo "<pre>amit ===> "; print_r($requestData); echo "<hr>";
-						$addattribute = $this->WispUser->addValue($requestData['WispUser']['UserId'], $requestData['attributeName'][$i], $requestData['attributeoperator'][$i], $attrValue,$requestData['attributeModifier'][$i]);
+							// Saving attribute value to database.
+							$addattribute = $this->WispUser->addValue($requestData['WispUser']['UserId'], $requestData['attributeName'][$i], $requestData['attributeoperator'][$i], $attrValue,$requestData['attributeModifier'][$i]);
 						}
 					}
+					// Saving user data to db.
 					$this->WispUser->insertRec($requestData);
 					
-						//$newDataArr[] = $requestData;
 					} // end of for loop
 					$this->Session->setFlash(__('Wisp user is saved succefully!', true), 'flash_success');
 
-				} // -- end of else
-				
-			//exit;
+				} // end of else
 		}	
 	}
 	
@@ -220,96 +224,90 @@ class WispUsersController extends AppController
 	}
 	
 	/* randomUserName function 
-	 * function user to generate random username and password
 	 * @param $prefix
+	 * Function user to generate random username and password
 	 */
 	private function randomUserName($prefix)
 	{
+		$characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
+		$usernameReserved = 1 ;
 		
-			$characters = 'abcdefghijklmnopqrstuvwxyz0123456789';
-			$usernameReserved = 1 ;
-				// Generate random username
-				$string = '';
-				for ($c = 0; $c < 7; $c++)
-				{
-					$string .= $characters[rand(0, strlen($characters) - 1)];
-					//$string.= $characters[rand(0,strlen($characters))];
-				}
-				//echo "<pre>";print_r($string);
-				$thisUsername = $string;
-				// Add prefix to string
+		// Generate random username
+		$string = '';
+		for ($c = 0; $c < 7; $c++)
+		{
+			$string .= $characters[rand(0, strlen($characters) - 1)];
+		}
+		$thisUsername = $string;
 				
-				if ($prefix!='')
-				{
-					$thisUsername = $prefix.$string;
-				}
-				//$requestData['WispUser']['thisUsername'] = $thisUsername;
-				//$thisUsername = "madhavi";
-				// Check if username used
-				$userName = $this->WispUser->getUserName($thisUsername);
-				//echo "<pre>";print_r($userName);
+		// Add prefix to string
+		if ($prefix!='')
+		{
+			$thisUsername = $prefix.$string;
+		}
 				
-				if ($userName == 0)
-				{
-					$usernameReserved = 0;
-					$string = $thisUsername;
-					// Generate random password
-					$stringPass = '';
-					for ($c = 0; $c < 7; $c++)
-					{
-						$stringPass .= $characters[rand(0, strlen($characters) - 1)];
-					}
-					// Add username and password onto array
-					//$wispUser[$thisUsername] = $string;
-				}
-				if($usernameReserved == 0)
-				{
-					return array($string,$stringPass);
-				}	
-				else
-				{
-					return array('','');
-				}
+		// Check if username used
+		$userName = $this->WispUser->getUserName($thisUsername);
+				
+		if ($userName == 0)
+		{
+			$usernameReserved = 0;
+			$string = $thisUsername;
 		
-					
+			// Generate random password
+			$stringPass = '';
+			for ($c = 0; $c < 7; $c++)
+			{
+				$stringPass .= $characters[rand(0, strlen($characters) - 1)];
+			}
+		
+			// Add username and password onto array
+		}
+		if($usernameReserved == 0)
+		{
+			return array($string,$stringPass);
+		}	
+		else
+		{
+			return array('','');
+		}
 	}
 		
 	/* edit function 
 	 * @param $id
+	 * used to edit users data , group, attributes etc.
+	 *
 	 */	
 	public function edit($id)
 	{
-			// -- select all records form wisp_userdata table --
+		// Select all records form wisp_userdata table --
 		$user = $this->WispUser->findById($id);
-		//print_r($user);
-		// -- fetch userNmae --
+		// Fetch username
 		$username = $this->WispUser->selectById($user['WispUser']['UserID']);
 		$user['WispUser']['Username'] = $username[0]['users']['Username'];
-		// -- fetch Value as password --
+		// Fetch Value as password.
 		$getvalue = $this->WispUser->getValue($user['WispUser']['UserID']);
 		$user['WispUser']['Password'] = $getvalue[0]['user_attributes']['Value'];
 		$this->set('user', $user);
-		// fetch user groups
+		// Fetch user groups
 		$userGroups = $this->WispUser->selectUserGroups($user['WispUser']['UserID']);
-		//print_r($userGroups);
 		$this->set('userGroups', $userGroups);
-				
-		// fetcing user attribute
+		// Fetcing user attribute
 		$userAttrib = $this->WispUser->selectUserAttributes($user['WispUser']['UserID']);
 		
 		$this->set('userAttrib', $userAttrib);
 		
-		
-		// -- for fetching location from table --
+		// Fetching locations
+		$location = $grouparr = array();
 		$locationData = $this->WispUser->selectLocation();
-		
+
 		foreach($locationData as $loc)
 		{
 			$location[$loc['wisp_locations']['ID']] = $loc['wisp_locations']['Name'];
 		}
 		$this->set('location', $location);
 		
-		// -- for fetching groups --
+		// Fetching all groups to fill select control.
 		$groupItems = $this->WispUser->selectGroup();
 		foreach($groupItems as $val)
 		{
@@ -317,152 +315,90 @@ class WispUsersController extends AppController
 		}
 		$this->set('grouparr', $grouparr);
 		
-		// -- update records --
+		// Update records
 		$userData[] = array();
 		
+		// Checking submission.
 		if ($this->request->is('post'))
 		{
 			$requestData = $this->WispUser->set($this->request->data);
-			if(!$requestData['WispUser']['Number'])
+			// Condition to check username on submission or not.	
+			if($requestData['hiddenUserName'] ==$requestData['WispUser']['Username'])
 			{
-			
-				if($requestData['hiddenUserName'] ==$requestData['WispUser']['Username'])
+				$editUser = $this->WispUser->updateUsername($user['WispUser']['UserID'],$requestData['WispUser']['Username']);
+				
+				// Update password
+				$editValue = $this->WispUser->updateValue($user['WispUser']['UserID'],$requestData['WispUser']['Password']);
+				$this->WispUser->updateRec($requestData, $user['WispUser']['UserID']);
+				
+				// Update group 
+				$delGroup = $this->WispUser->deleteUserGroup($user['WispUser']['UserID']);
+
+				if(isset($requestData['groupId']))
 				{
-						
-					$editUser = $this->WispUser->updateUsername($user['WispUser']['UserID'],$requestData['WispUser']['Username']);
-					
-					// -- update password --
-					$editValue = $this->WispUser->updateValue($user['WispUser']['UserID'],$requestData['WispUser']['Password']);
-					$this->WispUser->updateRec($requestData, $user['WispUser']['UserID']);
-					
-				// -- update group --	
-					$delGroup = $this->WispUser->deleteUserGroup($user['WispUser']['UserID']);
-	
-					if(isset($requestData['groupId']))
+					foreach($requestData['groupId'] as $groupID)
 					{
-						foreach($requestData['groupId'] as $groupID)
-						{
-							$addUserGroup = $this->WispUser->insertUserGroup($user['WispUser']['UserID'], $groupID);	
-						}
+						$addUserGroup = $this->WispUser->insertUserGroup($user['WispUser']['UserID'], $groupID);
 					}
-					// -- end of update group --
-						
-							// -- update attribute --
-						$delAttribute = $this->WispUser->deleteUserAttibute($user['WispUser']['UserID']);
-						$count1 = '';
-						if(isset($requestData['attributeName']))
+				}
+				// end of group updation.
+					
+				// Update attribute 
+				$delAttribute = $this->WispUser->deleteUserAttibute($user['WispUser']['UserID']);
+				$count1 = '';
+				if(isset($requestData['attributeName']))
+				{
+					$i = 0;
+					$count1 = count($requestData['attributeName']);
+					for($i=0;$i<$count1;$i++)
+					{
+						if(isset($requestData['attributeModifier']))
 						{
-							$i = 0;
-							$count1 = count($requestData['attributeName']);
-							for($i=0;$i<$count1;$i++)
+							$attrValues = $requestData['attributeValues'][$i];
+							if($requestData['attributeModifier'][$i] == '')
 							{
-								if(isset($requestData['attributeModifier']))
-								{
-									$attrValues = $requestData['attributeValues'][$i];
-									if($requestData['attributeModifier'][$i] == '')
-									{
-										$attrValue = $attrValues;
-									}
-									else
-									{
-										$attrValue = $this->switchModifier($requestData['attributeModifier'][$i],$attrValues);
-									}
-								}
-								$addattribute = $this->WispUser->addValue($user['WispUser']['UserID'], $requestData['attributeName'][$i], $requestData['attributeoperator'][$i], $attrValue,$requestData['attributeModifier'][$i]);
+								$attrValue = $attrValues;
+							}
+							else
+							{
+								$attrValue = $this->switchModifier($requestData['attributeModifier'][$i],$attrValues);
 							}
 						}
-					
-					$this->Session->setFlash(__('Wisp user is updated succefully!', true), 'flash_success');
+						$addattribute = $this->WispUser->addValue($user['WispUser']['UserID'], $requestData['attributeName'][$i], $requestData['attributeoperator'][$i], $attrValue,$requestData['attributeModifier'][$i]);
+					}
 				}
-				else
+				$this->Session->setFlash(__('Wisp user is updated succefully!', true), 'flash_success');
+			}
+			else
+			{
+				if($this->WispUser->validates($user['WispUser']['UserID']))
 				{
-				   if($this->WispUser->validates($user['WispUser']['UserID']))
-					{
-						// -- update username --
-						
+					// Update username
 					$editUser = $this->WispUser->updateUsername($user['WispUser']['UserID'],$requestData['WispUser']['Username']);
-					
-					// -- update password --
+				
+					// Update password 
 					$editValue = $this->WispUser->updateValue($user['WispUser']['UserID'],$requestData['WispUser']['Password']);
-					// -- update other records --
+					// Update other records
 					$this->WispUser->updateRec($requestData, $user['WispUser']['UserID']);
-					
-					// -- update group --	
+				
+					// update groups
 					$delGroup = $this->WispUser->deleteUserGroup($user['WispUser']['UserID']);
-	
+
 					if(isset($requestData['groupId']))
 					{
 						foreach($requestData['groupId'] as $groupID)
 						{
-							$addUserGroup = $this->WispUser->insertUserGroup($user['WispUser']['UserID'], $groupID);	
+							$addUserGroup = $this->WispUser->insertUserGroup($user['WispUser']['UserID'], $groupID);
 						}
 					}
-					// -- end of update group --
-						
-							// -- update attribute --
-						$delAttribute = $this->WispUser->deleteUserAttibute($user['WispUser']['UserID']);
-						$count1 = '';
-						if(isset($requestData['attributeName']))
-						{
-							$i = 0;
-							$count1 = count($requestData['attributeName']);
-							for($i=0;$i<$count1;$i++)
-							{
-								if(isset($requestData['attributeModifier']))
-								{
-									$attrValues = $requestData['attributeValues'][$i];
-									if($requestData['attributeModifier'][$i] == '')
-									{
-										$attrValue = $attrValues;
-									}
-									else
-									{
-										$attrValue = $this->switchModifier($requestData['attributeModifier'][$i],$attrValues);
-									}
-								}
-								$addattribute = $this->WispUser->addValue($user['WispUser']['UserID'], $requestData['attributeName'][$i], $requestData['attributeoperator'][$i], $attrValue,$requestData['attributeModifier'][$i]);
-							}
-						}
-						
-					$this->Session->setFlash(__('Wisp user is updated succefully!', true), 'flash_success');
-					} else {
-					  $this->Session->setFlash(__('Wisp user is not saved!', true), 'flash_failure');
-					}
-				}	
-			}
-			else
-			{
-					// for random generat user name.
-					// -- loop for number of choosen number --
-					$numberCount = $requestData['WispUser']['Number'];
-					$prefix = $requestData['WispUser']['Prefix'];
-					for($abc=0;$abc<$numberCount;$abc++)
-					{
-						list($user,$pass) = $this->randomUserName($prefix);
-						$requestData['WispUser']['Username'] = $user;
-						$requestData['WispUser']['Password'] = $pass;
-						
-						$addUser = $this->WispUser->insertUsername($requestData['WispUser']['Username']);
-						foreach($addUser as $userId)
-						{
-							$requestData['WispUser']['UserId'] = $userId[0]['id'];
-						}
-					// -- add group --
-						if(isset($requestData['groupId']))
-						{
-							foreach($requestData['groupId'] as $groupID)
-							{
-								$addUserGroup = $this->WispUser->insertUserGroup($requestData['WispUser']['UserId'], $groupID);
-							}
-						}
-						// -- end of add group --
-						// -- password is add in user_attributes table --
-						$insertValue = $this->WispUser->addValue($requestData['WispUser']['UserId'],'User-Password', '2', $requestData['WispUser']['Password']);
-						// -- add attribute --
+					// end of group updation
+					
+					// Update attribute
+					$delAttribute = $this->WispUser->deleteUserAttibute($user['WispUser']['UserID']);
 					$count1 = '';
 					if(isset($requestData['attributeName']))
 					{
-						$i = $abc;
+						$i = 0;
 						$count1 = count($requestData['attributeName']);
 						for($i=0;$i<$count1;$i++)
 						{
@@ -475,41 +411,38 @@ class WispUsersController extends AppController
 								}
 								else
 								{
-									$attrValue = $this->switchModifier($requestData['attributeModifier'][$i]);
-
+									$attrValue = $this->switchModifier($requestData['attributeModifier'][$i],$attrValues);
 								}
 							}
-						$addattribute = $this->WispUser->addValue($requestData['WispUser']['UserId'], $requestData['attributeName'][$i], $requestData['attributeoperator'][$i], $attrValue);
+							$addattribute = $this->WispUser->addValue($user['WispUser']['UserID'], $requestData['attributeName'][$i], $requestData['attributeoperator'][$i], $attrValue,$requestData['attributeModifier'][$i]);
 						}
 					}
-					$this->WispUser->insertRec($requestData);
 					
-						//$newDataArr[] = $requestData;
-					} // end of for loop
-					$this->Session->setFlash(__('Wisp user is saved succefully!', true), 'flash_success');
-			}	
+					$this->Session->setFlash(__('Wisp user is updated succefully!', true), 'flash_success');
+				} else {
+					$this->Session->setFlash(__('Wisp user is not saved!', true), 'flash_failure');
+				}
+			}
 		}
 		
-		// -- select all records form wisp_userdata table --
+		//Fetching records form wisp_userdata table
 		$user = $this->WispUser->findById($id);
-		// -- fetch userNmae --
+		// Fetch userName
 		$username = $this->WispUser->selectById($user['WispUser']['UserID']);
 		$user['WispUser']['Username'] = $username[0]['users']['Username'];
-		// -- fetch Value as password --
+		// Fetch password 
 		$getvalue = $this->WispUser->getValue($user['WispUser']['UserID']);
 		$user['WispUser']['Password'] = $getvalue[0]['user_attributes']['Value'];
 		$this->set('user', $user);
-		// fetch user groups
+		// Fetch user groups data
 		$userGroups = $this->WispUser->selectUserGroups($user['WispUser']['UserID']);
 		$this->set('userGroups', $userGroups);
-				
-		// fetcing user attribute
+		// Fetcing user attribute data.
 		$userAttrib = $this->WispUser->selectUserAttributes($user['WispUser']['UserID']);
 		
 		$this->set('userAttrib', $userAttrib);
 		
-		
-		// -- for fetching location from table --
+		// Fetching all location to fill select control.
 		$locationData = $this->WispUser->selectLocation();
 		
 		foreach($locationData as $loc)
@@ -518,18 +451,22 @@ class WispUsersController extends AppController
 		}
 		$this->set('location', $location);
 		
-		// -- update records --
 		$userData[] = array();
 	}
 	
 	/* delete function 
 	 * @param $id
+	 * used to delete record from all table referencing user.
+	 *
 	 */	
 	public function remove($id)
 	{
+		// Fetching user data and assigning to var.
 		$userId = $this->WispUser->fetchUserId($id);
-		//echo "<pre>";print_r($userId[0]['wisp_userdata']['UserID']);exit;
+		
+		// Deleting user attributes.
 		$UserAttributes = $this->WispUser->deleteUserAttributes($userId[0]['wisp_userdata']['UserID']);
+		// Deleting record from topup, users and group table.
 		$Users = $this->WispUser->deleteUsers($userId[0]['wisp_userdata']['UserID']);
 		if($this->WispUser->delete($id))
 		{
@@ -539,5 +476,4 @@ class WispUsersController extends AppController
 			$this->Session->setFlash(__('Wisp user is not removed!', true), 'flash_failure');
 		}
 	}
-	
 }
\ No newline at end of file
diff --git a/htdocs/app/Controller/WispUsersTopupsController.php b/htdocs/app/Controller/WispUsersTopupsController.php
index 09786334..0dcaaf4f 100644
--- a/htdocs/app/Controller/WispUsersTopupsController.php
+++ b/htdocs/app/Controller/WispUsersTopupsController.php
@@ -7,6 +7,8 @@ class WispUsersTopupsController extends AppController
 {
 	/* index function 
 	 * @param $userId
+	 * Used to show user topups with pagination.
+	 * 
 	 */	
 	public function index($userId)
 	{
@@ -17,8 +19,8 @@ class WispUsersTopupsController extends AppController
                 'limit' => PAGINATION_LIMIT,
 				'conditions' => array('UserID' => $userId)
 			);
+			
 			$wtopups  = $this->paginate();
-			//echo "<pre>";print_r($wtopups);exit;
 			$this->set('wtopups', $wtopups);
 			$this->set('userId', $userId);
 		}
@@ -26,20 +28,24 @@ class WispUsersTopupsController extends AppController
 	
 	/* add function 
 	 * @param $userId
+	 * Used to add user topups
+	 *
 	 */	
 	public function add($userId)
 	{
 		if (isset($userId))
 		{
 			$this->set('userId', $userId);
+			// Checking button submission.
 			if ($this->request->is('post'))
 			{
 				$this->WispUsersTopup->set($this->request->data);
+				// Validating input.
 				if ($this->WispUsersTopup->validates()) 
 				{
+					// Saving data.
 			    	$this->WispUsersTopup->InsertRec($userId,$this->request->data);
 					$this->Session->setFlash(__('Wisp user topup is saved succefully!', true), 'flash_success');
-					
 				} 
 				else 
 				{
@@ -52,19 +58,23 @@ class WispUsersTopupsController extends AppController
 			
 		}
 	}
-	
 	/* edit function 
 	 * @param $id, $userId
+	 * Used to edit user topups
+	 *
 	 */	
 	public function edit($id, $userId){
+		// Loading topup data from user Id.
 		$topups = $this->WispUsersTopup->findById($id);
 		$this->set('topup', $topups);
 		$this->set('userId', $userId);
+		// Checking submission.
 		if ($this->request->is('post')){
-			
+			// Setting data to model.			
 			$this->WispUsersTopup->set($this->request->data);
+			// Validating data.
 			if ($this->WispUsersTopup->validates()) {
-
+				// Saving edited data.
 				$this->WispUsersTopup->editRec($id, $this->request->data);
 				$this->Session->setFlash(__('Wisp user topup is edit succefully!', true), 'flash_success');
 
@@ -76,13 +86,16 @@ class WispUsersTopupsController extends AppController
 			}
 		}
 	}
-	
-	/* delete function 
+	/* remove function 
 	 * @param $id, $userId
+	 * Used to delete user topups.
+	 *
 	 */	
 	public function remove($id, $userId){
 		if (isset($id)){
+			// Deleting
 			if($this->WispUsersTopup->delete($id)){
+				// Redecting to index function.
 				$this->redirect('/wispUsers_topups/index/'.$userId);
 				$this->Session->setFlash(__('User topup is removed succefully!', true), 'flash_success');
 			} else {
diff --git a/htdocs/app/Model/Accounting.php b/htdocs/app/Model/Accounting.php
index c07f4ed9..29326066 100644
--- a/htdocs/app/Model/Accounting.php
+++ b/htdocs/app/Model/Accounting.php
@@ -1,3 +1,8 @@
 <?php
+/**
+ * Accounting Model
+ *
+ */
+ 
 class Accounting extends AppModel {
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/AccountingSummary.php b/htdocs/app/Model/AccountingSummary.php
index 93ff5372..8a29b695 100644
--- a/htdocs/app/Model/AccountingSummary.php
+++ b/htdocs/app/Model/AccountingSummary.php
@@ -1,4 +1,9 @@
 <?php
+/**
+ * Accounting Summary Model
+ *
+ */
+ 
 class AccountingSummary extends AppModel {
 	
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/Client.php b/htdocs/app/Model/Client.php
index 518425ac..5a9853d7 100644
--- a/htdocs/app/Model/Client.php
+++ b/htdocs/app/Model/Client.php
@@ -1,7 +1,13 @@
 <?php
+/**
+ * Client Model
+ *
+ */
+ 
 class Client extends AppModel
 {
 	public $useTable = 'clients';
 	
+	//Validating form controllers.
 	public $validate = array('Name' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value.')),'AccessList' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value.')));
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/ClientAttribute.php b/htdocs/app/Model/ClientAttribute.php
index 9f611fe9..b5ef4ebb 100644
--- a/htdocs/app/Model/ClientAttribute.php
+++ b/htdocs/app/Model/ClientAttribute.php
@@ -1,7 +1,13 @@
 <?php
+/**
+ * Client Attribute Model
+ *
+ */
+ 
 class ClientAttribute extends AppModel
 {
 	public $useTable = 'client_attributes';
 	
+	//Validating form controllers.
 	public $validate = array('Name' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value')), 'Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value')));
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/ClientRealm.php b/htdocs/app/Model/ClientRealm.php
index f23d7683..76541304 100644
--- a/htdocs/app/Model/ClientRealm.php
+++ b/htdocs/app/Model/ClientRealm.php
@@ -1,21 +1,30 @@
 <?php
+/**
+ * Client Realm Model
+ *
+ */
+
 class ClientRealm extends AppModel
 {
 	public $useTable = 'clients_to_realms';
 	
+	//Validating form controller.
 	public $validate = array('Type' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please select value')));
 	
-	public function selectGroup()
+	// Fetch realms for select box controler.
+	public function selectRealms()
 	{
 		return $res = $this->query("select ID,Name from realms");
 	}
 	
+	// Insert record in table.
 	public function insertRec($clientID, $data)
 	{
 		$res = $this->query("INSERT INTO clients_to_realms (ClientID,RealmID) VALUES ('".$clientID."','".$data['ClientRealm']['Type']."')");
 	}
 	
-	public function getGroupById($realmID)
+	// Get realms name via realms id.
+	public function getRealmsById($realmID)
 	{
 		return $res = $this->query("select Name from realms where ID = ".$realmID);
 	}
diff --git a/htdocs/app/Model/Group.php b/htdocs/app/Model/Group.php
index 9fa626b2..ceabf168 100644
--- a/htdocs/app/Model/Group.php
+++ b/htdocs/app/Model/Group.php
@@ -1,3 +1,8 @@
 <?php
+/**
+ * Group Model
+ *
+ */
+ 
 class Group extends AppModel {
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/GroupAttribute.php b/htdocs/app/Model/GroupAttribute.php
new file mode 100644
index 00000000..9132be6c
--- /dev/null
+++ b/htdocs/app/Model/GroupAttribute.php
@@ -0,0 +1,11 @@
+<?php
+/**
+ * Group Attribute Model
+ *
+ */
+ 
+class GroupAttribute extends AppModel
+{	
+	//Validating form controller.
+	public $validate = array('Name' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter name')), 'Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value')));
+}
\ No newline at end of file
diff --git a/htdocs/app/Model/GroupMember.php b/htdocs/app/Model/GroupMember.php
index 3232165e..9e52a0a1 100644
--- a/htdocs/app/Model/GroupMember.php
+++ b/htdocs/app/Model/GroupMember.php
@@ -1,8 +1,14 @@
 <?php
+/**
+ * Group Member Model
+ *
+ */
+ 
 class GroupMember extends AppModel
 {
 	public $useTable = 'users_to_groups';
 	
+	// Fetch usernname via its id.
 	public function getUserNameById($userId)
 	{
 		return $res = $this->query("select Username from users where ID = ".$userId);
diff --git a/htdocs/app/Model/Realm.php b/htdocs/app/Model/Realm.php
index 892e2a06..8ffcc0ab 100644
--- a/htdocs/app/Model/Realm.php
+++ b/htdocs/app/Model/Realm.php
@@ -1,7 +1,13 @@
 <?php
+/**
+ * Realm Model
+ *
+ */
+ 
 class Realm extends AppModel
 {
 	public $useTable = 'realms';
 	
+	//Validating form controller.
 	public $validate = array('Name' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value')));
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/RealmAttribute.php b/htdocs/app/Model/RealmAttribute.php
index 55c3f963..8ef99152 100644
--- a/htdocs/app/Model/RealmAttribute.php
+++ b/htdocs/app/Model/RealmAttribute.php
@@ -1,7 +1,13 @@
 <?php
+/**
+ * Realm Attribute Model
+ *
+ */
+ 
 class RealmAttribute extends AppModel
 {
 	public $useTable = 'realm_attributes';
 	
+	//Validating form controllers.
 	public $validate = array('Name' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value')), 'Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value')));
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/RealmMember.php b/htdocs/app/Model/RealmMember.php
index 66223f57..45859038 100644
--- a/htdocs/app/Model/RealmMember.php
+++ b/htdocs/app/Model/RealmMember.php
@@ -1,9 +1,15 @@
 <?php
+/**
+ * Realm Member Model
+ *
+ */
+ 
 class RealmMember extends AppModel
 {
 	public $useTable = 'clients_to_realms';
 	
-	public function getGroupById($clientID)
+	// Fetch client name via its id.
+	public function getClientNameById($clientID)
 	{
 		return $res = $this->query("select Name from clients where ID = ".$clientID);
 	}
diff --git a/htdocs/app/Model/User.php b/htdocs/app/Model/User.php
index 95d3f7f7..d1ee470a 100644
--- a/htdocs/app/Model/User.php
+++ b/htdocs/app/Model/User.php
@@ -1,10 +1,20 @@
 <?php
+/**
+ * User Model
+ *
+ */
+ 
 class User extends AppModel
 {
+	//Validating form controller.
 	public $validate = array('Username' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please choose a username'), 'unique' => array('rule' => 'isUnique', 'message' => 'The username you have chosen has already been registered')));
 	
-	public function deleteGroup($userId)
+	// Delete user records form different tables.
+	public function deleteUserRef($userId)
 	{
-		return $res = $this->query("DELETE FROM users_to_groups where UserID = ".$userId);
+		 $res = $this->query("delete from wisp_userdata where UserID = ".$userId);
+		$res = $this->query("delete from user_attributes where UserID = '".$userId."'");
+		$res = $this->query("delete from users_to_groups where UserID = '".$userId."'");
+		$res = $this->query("delete from topups where UserID = '".$userId."'");
 	}
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/UserAttribute.php b/htdocs/app/Model/UserAttribute.php
index 4f513ca2..d2274692 100644
--- a/htdocs/app/Model/UserAttribute.php
+++ b/htdocs/app/Model/UserAttribute.php
@@ -1,5 +1,11 @@
 <?php
-class UserAttribute extends AppModel {
-	
-	var $belongTo = array('User');
+/**
+ * User Attribute Model
+ *
+ */
+ 
+class UserAttribute extends AppModel
+{	
+	//Validating form controller.
+	public $validate = array('Name' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter name')), 'Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value')));
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/UserGroup.php b/htdocs/app/Model/UserGroup.php
index 2ae69ab0..c146821d 100644
--- a/htdocs/app/Model/UserGroup.php
+++ b/htdocs/app/Model/UserGroup.php
@@ -1,23 +1,31 @@
 <?php
+/**
+ * User Group Model
+ *
+ */
+ 
 class UserGroup extends AppModel
 {
 	public $useTable = 'users_to_groups';
 	
+	//Validating form controllers.
 	public $validate = array('Type' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value')));
 	
+	//Fetching  all groups for select box controller.
 	public function selectGroup()
 	{
 		return $res = $this->query("select ID, Name from groups");
 	}
 	
+	//Fetching group name via its id.
 	public function getGroupById($groupId)
 	{
 		return $res = $this->query("select ID,Name from groups where ID = ".$groupId);
 	}
 	
+	// Saving user groups.
 	public function insertRec($userId, $data)
 	{
-		//echo "INSERT INTO users_to_groups (UserID,GroupID) VALUES ('".$userId."','".$data['UserGroup']['Type']."')";
 		$res = $this->query("INSERT INTO users_to_groups (UserID,GroupID) VALUES ('".$userId."','".$data['UserGroup']['Type']."')");
 	}
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/UserLog.php b/htdocs/app/Model/UserLog.php
index 4cb99289..a2bca635 100644
--- a/htdocs/app/Model/UserLog.php
+++ b/htdocs/app/Model/UserLog.php
@@ -1,14 +1,23 @@
 <?php
-class UserLog extends AppModel {
+/**
+ * User Log Model
+ *
+ */
+ 
+class UserLog extends AppModel
+{
+	//Validating form controllers.
 	public $validate = array('Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value'),'numeric' => array('rule'     => 'naturalNumber','required' => true,'message'=> 'numbers only')));
 															   
 	public $useTable = 'accounting';
 
+	//Fetch records form table.
 	public function SelectRec($userId, $data)
 	{
 		return $userLog = $this->query("select * from topups where ValidFrom = '".$data."' and UserID = '".$userId."'");
 	}
 	
+	//Fetch username.
 	public function SelectAcc($userId)
 	{
 		return $userLog = $this->query("select Username from users where ID = '".$userId."'");
diff --git a/htdocs/app/Model/UserTopup.php b/htdocs/app/Model/UserTopup.php
index 7618347a..782b22d4 100644
--- a/htdocs/app/Model/UserTopup.php
+++ b/htdocs/app/Model/UserTopup.php
@@ -1,43 +1,24 @@
 <?php
-class UserTopup extends AppModel {
-	public $validate = array('Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value'),'numeric' => array('rule'     => 'naturalNumber','required' => true,'message'=> 'numbers only')));
+/**
+ * User Topup Model
+ *
+ */
+ 
+class UserTopup extends AppModel
+{
+	//Validating form controllers.
+	public $validate = array('Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value'),'numeric' => array('rule' => 'naturalNumber','required' => true,'message'=> 'numbers only')));
 															   
 	public $useTable = 'topups';
-	/*	public function getAllResults($userId)
-	{
-		$res = $this->query("SELECT
-					accounting.ID,
-					accounting.EventTimestamp,
-					accounting.AcctStatusType,
-					accounting.ServiceType,
-					accounting.FramedProtocol,
-					accounting.NASPortType,
-					accounting.NASPortID,
-					accounting.CallingStationID,
-					accounting.CalledStationID,
-					accounting.AcctSessionID,
-					accounting.FramedIPAddress,
-					accounting.AcctInputOctets / 1024 / 1024 +
-					accounting.AcctInputGigawords * 4096 AS AcctInput,
-					accounting.AcctOutputOctets / 1024 / 1024 +
-					accounting.AcctOutputGigawords * 4096 AS AcctOutput,
-					accounting.AcctTerminateCause,
-					accounting.AcctSessionTime / 60 AS AcctSessionTime
-				FROM
-					accounting, users
-				WHERE
-					users.Username = accounting.Username
-				AND
-					users.ID = ".$userId);
-		return $res;
-	  }	 */
-
+	
+	//Insert record in topups table.
 	public function insertRec($userId, $data)
 	{
 		$timestamp = date("Y-m-d H:i:s");
 		$res = $this->query("INSERT INTO topups (UserID,Timestamp,Type,Value,ValidFrom,ValidTo) VALUES (?,?,?,?,?,?)",array($userId,$timestamp,$data['UserTopup']['Type'],$data['UserTopup']['Value'],$data['UserTopup']['valid_from'], $data['UserTopup']['valid_to']));
 	}
 	
+	//Update topups table.
 	public function editRec($id, $data)
 	{
 		$res = $this->query("UPDATE topups SET `Type` = '".$data['UserTopup']['Type']."',`Value` = '".$data['UserTopup']['Value']."',`ValidFrom` = '".$data['UserTopup']['valid_from']."',`ValidTo` = '".$data['UserTopup']['valid_to']."' where `ID` = ".$id);
diff --git a/htdocs/app/Model/WispLocation.php b/htdocs/app/Model/WispLocation.php
index 8581c677..c83f8e20 100644
--- a/htdocs/app/Model/WispLocation.php
+++ b/htdocs/app/Model/WispLocation.php
@@ -1,7 +1,13 @@
 <?php
+/**
+ * Wisp Location Model
+ *
+ */
+ 
 class WispLocation extends AppModel
 {
 	public $useTable = 'wisp_locations';
 	
+	//Validating form controller.
 	public $validate = array('Name' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter name.')));
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/WispLocationMember.php b/htdocs/app/Model/WispLocationMember.php
index 118a375b..8f69cb3c 100644
--- a/htdocs/app/Model/WispLocationMember.php
+++ b/htdocs/app/Model/WispLocationMember.php
@@ -1,16 +1,22 @@
 <?php
+/**
+ * Wisp Location Member Model
+ *
+ */
+ 
 class WispLocationMember extends AppModel
 {
 	public $useTable = 'wisp_userdata';
 	
+	//Fetching username.
 	public function selectUsername($userName)
 	{
 		return $res = $this->query("select Username from users where ID = '".$userName."'");
 	}
 	
+	//Deleting record.
 	public function deleteMembers($id)
 	{
-		//echo "update wisp_userdata set LocationID = '0' where ID = '".$id."'";exit;
 		$res = $this->query("update wisp_userdata set LocationID = '0' where ID = '".$id."'");
 	}
 }
\ No newline at end of file
diff --git a/htdocs/app/Model/WispUser.php b/htdocs/app/Model/WispUser.php
index 278cce21..4c18f2fb 100644
--- a/htdocs/app/Model/WispUser.php
+++ b/htdocs/app/Model/WispUser.php
@@ -1,18 +1,18 @@
 <?php
+/**
+ * Wisp User Model
+ *
+ */
+ 
 class WispUser extends AppModel
 {
 	public $useTable = 'wisp_userdata';
 	
+	//Validating form controllers.
+	public $validate = array('Username' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please choose a username'), 'unique' => array('rule' => array('uniqueCheck'), 'message' => 'The username you have chosen has already been registered')));
 	
-	public $validate = array('Username' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please choose a username'), 'unique' => array('rule' => array('uniqueCheck'), 'message' => 'The username you have chosen has already been registered'))/*,
-	'Password' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please choose a username')),
-	'FirstName' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please choose a username')),
-	'LastName' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please choose a username')),
-	'Phone' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please choose a username')),
-	'Email' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please choose a username')),
-	'Location' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please choose a username'))*/);
-	
-	public function uniqueCheck($Username, $UserID)
+	//Check username is exist or not in table.
+	public function uniqueCheck($Username)
 	{
 		$res = $this->query("select count(ID) from users where Username = '".$Username['Username']."'");
 		
@@ -26,63 +26,75 @@ class WispUser extends AppModel
     	}
 	}
 	
+	//Fetching record from users table.
 	public function selectById($userId)
 	{
 		return $res = $this->query("select Username, Disabled from users where ID = ".$userId,false);
 	}
 	
+	//Fetching all locations for select box controller.
 	public function selectLocation()
 	{
 		 return $res = $this->query("select * from wisp_locations");
 	}
 	
+	//Inser username in table and get its id.
 	public function insertUsername($userName)
 	{
-		 $res = $this->query("insert into users (Username) values ('".$userName."')",false);
+		$res = $this->query("insert into users (Username) values ('".$userName."')",false);
 		return $userId = $this->query('select max(ID) as id FROM `users`',false);
 		 
 	}
+	
+	//Inser data in wisp_userdata table.
 	public function insertRec($data)
 	{
 		 $res = $this->query("insert into wisp_userdata (UserID, LocationID, FirstName, LastName, Email, Phone) values ('".$data['WispUser']['UserId']."' , '".$data['WispUser']['Location']."', '".$data['WispUser']['FirstName']."', '".$data['WispUser']['LastName']."', '".$data['WispUser']['Email']."', '".$data['WispUser']['Phone']."')");
 	}
 	
+	//Update wisp_userdata table.
 	public function updateRec($data, $userId)
 	{
 		$res = $this->query("update wisp_userdata set LocationID = '".$data['WispUser']['Location']."', FirstName = '".$data['WispUser']['FirstName']."', LastName = '".$data['WispUser']['LastName']."', Email = '".$data['WispUser']['Email']."', Phone = '".$data['WispUser']['Phone']."' where UserID = '".$userId."'");
 	}
 	
-	public function addValue($userId, $attName, $attoperator, $password,$modifier)
+	//Insert attribute data in table.
+	public function addValue($userId, $attName, $attoperator, $password, $modifier = '')
 	{
-		//echo $userId.', '.$attName.', '.$attoperator.', '.$password; exit;
 		 $res = $this->query("insert into user_attributes (UserID, Name, Operator, Value, Disabled, modifier) values ('".$userId."' , '".$attName."', '".$attoperator."', '".$password."', '0','".$modifier."')");
 	}
 	
+	//Fetching value from table.
 	public function getValue($userId)
 	{
 		 return $res = $this->query("select Value from user_attributes where UserID = ".$userId);
 	}
 	
+	//Update username.
 	public function updateUsername($userId, $userName)
 	{
 		$res = $this->query("update users set Username = '".$userName."' where ID = '".$userId."'");
 	}
 	
+	//Update value.
 	public function updateValue($userId, $userValue)
 	{
 		$res = $this->query("update user_attributes set Value = '".$userValue."' where UserID = '".$userId."'");
 	}
 	
+	//Fetching user id for delete record.
 	public function fetchUserId($id)
 	{
 		return $res = $this->query("select UserID from wisp_userdata where ID = '".$id."'");
 	}
 	
+	//Deleting attribute.
 	public function deleteUserAttributes($userId)
 	{
 		$res = $this->query("delete from user_attributes where UserID = '".$userId."'");
 	}
 	
+	//Delete user record from all related tables.
 	public function deleteUsers($userId)
 	{
 		$res = $this->query("delete from users where ID = '".$userId."'");
@@ -91,15 +103,14 @@ class WispUser extends AppModel
 		$res = $this->query("delete from topups where UserID = '".$userId."'");
 	}
 	
+	// Check if username used
 	public function getUserName($userName)
 	{
 		$res = $this->query("select Username from users where Username = '".$userName."'");
-		
-//		print_r($res);
 		return count($res);
-		
 	}
 	
+	// Fetching all groups to fill select control.
 	public function selectGroup()
 	{
 		return $res = $this->query("select ID, Name from groups");
@@ -111,29 +122,25 @@ class WispUser extends AppModel
 		return  $res = $this->query("SELECT *,g.name FROM users_to_groups as utg , groups as g WHERE UserID = ".$userId." AND g.ID = utg.GroupID",false);
 	}
 	
-
-	
-	// Select user attributes from user id 
+	//Select user attributes.
 	public function selectUserAttributes($userId)
 	{
 		return  $res = $this->query("SELECT * FROM user_attributes WHERE UserID = ".$userId,false);
 	}
 	
-	// -- add group --
+	//Add group
 	public function insertUserGroup($userId, $groupId)
 	{
-		//echo $userId.", ".$groupId;exit;
-		//echo "insert into users_to_groups (UserID, GroupID, Disabled, Comment) values ('".$userId."' , '".$groupId."', '0', '')";exit;
 		 $res = $this->query("insert into users_to_groups (UserID, GroupID, Disabled, Comment) values ('".$userId."' , '".$groupId."', '0', '')");
 	}
 	
-	// -- delete group --
+	//Delete group.
 	public function deleteUserGroup($userId)
 	{
 		 $res = $this->query("delete from users_to_groups where UserID =".$userId);
 	}
 	
-	// -- delete attributes --
+	//Delete attributes.
 	public function deleteUserAttibute($userId)
 	{
 		$res = $this->query("delete from user_attributes where UserID = ".$userId." AND Name!='User-Password'");
diff --git a/htdocs/app/Model/WispUserLog.php b/htdocs/app/Model/WispUserLog.php
index 16281ccd..b68e4f89 100644
--- a/htdocs/app/Model/WispUserLog.php
+++ b/htdocs/app/Model/WispUserLog.php
@@ -1,14 +1,23 @@
 <?php
-class WispUserLog extends AppModel {
-	public $validate = array('Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value'),'numeric' => array('rule'     => 'naturalNumber','required' => true,'message'=> 'numbers only')));
+/**
+ * Wisp User Log Model
+ *
+ */
+ 
+class WispUserLog extends AppModel
+{
+	//Validating form controllers.
+	public $validate = array('Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value'),'numeric' => array('rule' => 'naturalNumber','required' => true,'message'=> 'numbers only')));
 															   
 	public $useTable = 'accounting';
-
+	
+	//Fetching records form table.
 	public function SelectRec($userId, $data)
 	{
 		return $userLog = $this->query("select * from topups where ValidFrom = '".$data."' and UserID = '".$userId."'");
 	}
 	
+	//Fetching username.
 	public function SelectAcc($userId)
 	{
 		return $userLog = $this->query("select Username from users where ID = '".$userId."'");
diff --git a/htdocs/app/Model/WispUsersTopup.php b/htdocs/app/Model/WispUsersTopup.php
index 6830f15e..f951ff69 100644
--- a/htdocs/app/Model/WispUsersTopup.php
+++ b/htdocs/app/Model/WispUsersTopup.php
@@ -1,20 +1,26 @@
 <?php
+/**
+ * Wisp Users Topup Model
+ *
+ */
+ 
 class WispUsersTopup extends AppModel 
 {
 	public $useTable = 'topups';
-	
+
+	//Validating form controllers.
 	public $validate = array('Value' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please enter value'),'numeric' => array('rule' => 'naturalNumber','required' => true,'message'=> 'numbers only')), 'Type' => array('required' => array('rule' => array('notEmpty'),'message' => 'Please select value')));
-															   
+	
+	//Insert record in topups table.														   
 	public function insertRec($userId, $data)
 	{
-		//echo "<pre>";print_r($data);exit;
 		$timestamp = date("Y-m-d H:i:s");
 		$res = $this->query("INSERT INTO topups (UserID,Timestamp,Type,Value,ValidFrom,ValidTo) VALUES (?,?,?,?,?,?)",array($userId,$timestamp,$data['WispUsersTopup']['Type'],$data['WispUsersTopup']['Value'],$data['WispUsersTopup']['valid_from'], $data['WispUsersTopup']['valid_to']));
 	}
 	
+	//Update topups table.
 	public function editRec($id, $data)
 	{
-		//echo "<pre>";print_r($data.$id);exit;
 		$res = $this->query("UPDATE topups SET `Type` = '".$data['WispUsersTopup']['Type']."',`Value` = '".$data['WispUsersTopup']['Value']."',`ValidFrom` = '".$data['WispUsersTopup']['valid_from']."',`ValidTo` = '".$data['WispUsersTopup']['valid_to']."' where `ID` = ".$id);
 	}
 }
\ No newline at end of file
diff --git a/htdocs/app/View/ClientAttributes/add.ctp b/htdocs/app/View/ClientAttributes/add.ctp
index 05e8f9a3..9f22ed6d 100644
--- a/htdocs/app/View/ClientAttributes/add.ctp
+++ b/htdocs/app/View/ClientAttributes/add.ctp
@@ -6,9 +6,8 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Add Client Attribute')?></legend>
-		<?php echo $this->Form->create()?>
+		<div class="col-md-10"><legend><?php echo __('Add Client Attribute')?></legend>
+			<?php echo $this->Form->create()?>
 			<div class="form-group">
 				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
 				<div class="row">
@@ -46,15 +45,7 @@ body {
 				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
 				<?php echo $this->Html->link('Cancel', array('action' => 'index', $clientID), array('class' => 'btn btn-default'))?>							
 			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/ClientAttributes/edit.ctp b/htdocs/app/View/ClientAttributes/edit.ctp
index bf862a9a..30930a94 100644
--- a/htdocs/app/View/ClientAttributes/edit.ctp
+++ b/htdocs/app/View/ClientAttributes/edit.ctp
@@ -6,15 +6,13 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Edit Client Attribute')?></legend>
-		<?php echo $this->Form->create()?>
+		<div class="col-md-10"><legend><?php echo __('Edit Client Attribute')?></legend>
+			<?php echo $this->Form->create()?>
 			<div class="form-group">
 				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
 				<div class="row">
 					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 
-										'placeholder' => 'Name', 'value' => $clientAttribute['ClientAttribute']['Name']));?>
+						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name', 'value' => $clientAttribute['ClientAttribute']['Name']));?>
 					</div>					
 				</div>
 			</div>
@@ -38,8 +36,9 @@ body {
 				<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
 				<div class="row">
 					<div class="col-md-3">
-						<?php if($clientAttribute['ClientAttribute']['Disabled'] == 1) {
-								 $isCheck = true;
+						<?php 
+							if($clientAttribute['ClientAttribute']['Disabled'] == 1) {
+								$isCheck = true;
 							} else {
 								$isCheck = false;
 							}
@@ -54,15 +53,7 @@ body {
 				<button type="submit" class="btn btn-primary"><?php echo __('Save', true)?></button>
 				<?php echo $this->Html->link(__('Cancel', true), array('action' => 'index', $clientAttribute['ClientAttribute']['ClientID']), array('class' => 'btn btn-default'))?>							
 			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/ClientAttributes/index.ctp b/htdocs/app/View/ClientAttributes/index.ctp
index dd1226e0..1ea631c3 100644
--- a/htdocs/app/View/ClientAttributes/index.ctp
+++ b/htdocs/app/View/ClientAttributes/index.ctp
@@ -1,70 +1,64 @@
 <style type="text/css">
 body {
-	padding-top: 50px;
+padding-top: 50px;
 }
 </style>
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Client Attributes List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID', true);?></a></th>
-					<th><a><?php echo __('Name', true);?></a></th>
-					<th><a><?php echo __('Operator', true);?></a></th>
-					<th><a><?php echo __('Value', true);?></a></th>
-					<th><a><?php echo __('Disabled', true);?></a></th>					
-					<th><a><?php echo __('Actions', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				<?php 
-				$options=array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||==');
-				foreach ($clientAttributes as $clientAttributes): ?>
-				<tr>
-					<td><? echo __($clientAttributes['ClientAttribute']['ID'])?></td>
-					<td><? echo __($clientAttributes['ClientAttribute']['Name'])?></td>
-					<td><? echo __($options[$clientAttributes['ClientAttribute']['Operator']])?></td>
-					<td><? echo __($clientAttributes['ClientAttribute']['Value'])?></td>
-					<td><? echo __( ($clientAttributes['ClientAttribute']['Disabled'] == 1) ? 'true' : 'false')?></td>					
-					<td>
+		<div class="col-md-10"><legend>Client Attributes List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID', true);?></a></th>
+						<th><a><?php echo __('Name', true);?></a></th>
+						<th><a><?php echo __('Operator', true);?></a></th>
+						<th><a><?php echo __('Value', true);?></a></th>
+						<th><a><?php echo __('Disabled', true);?></a></th>					
+						<th><a><?php echo __('Actions', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php 
+					$options=array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||==');
+					foreach ($clientAttributes as $clientAttributes): ?>
+					<tr>
+						<td><? echo $clientAttributes['ClientAttribute']['ID'];?></td>
+						<td><? echo $clientAttributes['ClientAttribute']['Name'];?></td>
+						<td><? echo $options[$clientAttributes['ClientAttribute']['Operator']];?></td>
+						<td><? echo $clientAttributes['ClientAttribute']['Value'];?></td>
+						<td><? echo ($clientAttributes['ClientAttribute']['Disabled'] == 1) ? 'true' : 'false';?></td>					
+						<td>
 						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'client_attributes',  'action' => 'edit', $clientAttributes['ClientAttribute']['ID'], $clientID), array('escape' => false, 'title' => 'Edit attribute'));?>												
 						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'client_attributes','action' => 'remove', $clientAttributes['ClientAttribute']['ID'], $clientID), array('escape' => false, 'title' => 'Remove attribute'), 'Are you sure you want to remove this attribute?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				<tr>
-					<td align="center" colspan="10" >
+						</td>
+					</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
 						<?php
 							$total = $this->Paginator->counter(array(
-    							'format' => '%pages%'));
+								'format' => '%pages%'));
 							if($total >1)
 							{		
 								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
 						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
+						<?php echo $this->Paginator->numbers(); ?>
+						<!-- Shows the next and previous links -->
+						<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+						<!-- prints X of Y, where X is current page and Y is number of pages -->
 						<?php
-							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-							}
+						echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+						}
 						?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-		<div class="form-group">			
-			<?php echo $this->Html->link(__('Add'), array('action' => 'add', $clientID), array('class' => 'btn btn-primary'))?>			
-			<?php echo $this->Html->link(__('Cancel'), array('controller' => 'clients', 'action' => 'index'), array('class' => 'btn btn-default'))?>
-		</div>
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+						</td>
+					</tr>
+				</tbody>
+			</table>
+			<div class="form-group">			
+				<?php echo $this->Html->link(__('Add'), array('action' => 'add', $clientID), array('class' => 'btn btn-primary'))?>			
+				<?php echo $this->Html->link(__('Cancel'), array('controller' => 'clients', 'action' => 'index'), array('class' => 'btn btn-default'))?>
+			</div>
 		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/ClientRealms/add.ctp b/htdocs/app/View/ClientRealms/add.ctp
index d4fbd75a..e6a1aeef 100644
--- a/htdocs/app/View/ClientRealms/add.ctp
+++ b/htdocs/app/View/ClientRealms/add.ctp
@@ -6,9 +6,8 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Add Client Realm')?></legend>
-		<?php echo $this->Form->create()?>
+		<div class="col-md-10"><legend><?php echo __('Add Client Realm')?></legend>
+			<?php echo $this->Form->create()?>
 			<div class="form-group">
 				<?php echo $this->Form->label('Group', 'Group', array('class'=>'col-md-2 control-label'));?>								
 				<div class="row">
@@ -22,14 +21,6 @@ body {
 				<?php echo $this->Html->link('Cancel', array('action' => 'index', $clientID), array('class' => 'btn btn-default'))?>							
 			</div>
 		<?php echo $this->Form->end(); ?>
-		
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/ClientRealms/index.ctp b/htdocs/app/View/ClientRealms/index.ctp
index 10b37d71..6940aa06 100644
--- a/htdocs/app/View/ClientRealms/index.ctp
+++ b/htdocs/app/View/ClientRealms/index.ctp
@@ -6,56 +6,50 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Client Realms List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID', true);?></a></th>
-					<th><a><?php echo __('Name', true);?></a></th>
-					<th><a><?php echo __('Action', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				<?php foreach ($clientRealms as $clientRealms): ?>
-				<tr>
-					<td><? echo __($clientRealms['ClientRealm']['ID'])?></td>
-					<td><? echo __($clientRealms['ClientRealm']['realmName'])?></td>
-					<td>											
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'client_realms','action' => 'remove', $clientRealms['ClientRealm']['ID'], $clientID), array('escape' => false, 'title' => 'Remove realm'), 'Are you sure you want to remove this realm?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				<tr>
-					<td align="center" colspan="10" >
-						<?php
+		<div class="col-md-10"><legend>Client Realms List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID', true);?></a></th>
+						<th><a><?php echo __('Name', true);?></a></th>
+						<th><a><?php echo __('Action', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php foreach ($clientRealms as $clientRealms): ?>
+					<tr>
+						<td><? echo $clientRealms['ClientRealm']['ID'];?></td>
+						<td><? echo $clientRealms['ClientRealm']['realmName'];?></td>
+						<td>											
+							<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'client_realms','action' => 'remove', $clientRealms['ClientRealm']['ID'], $clientID), array('escape' => false, 'title' => 'Remove realm'), 'Are you sure you want to remove this realm?');?>
+						</td>
+					</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
 							$total = $this->Paginator->counter(array(
     							'format' => '%pages%'));
 							if($total >1)
 							{		
-								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
-						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
-						<?php
-							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
+							?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+								echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
 							}
-						?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-		<div class="form-group">			
-			<?php echo $this->Html->link(__('Add'), array('action' => 'add', $clientID), array('class' => 'btn btn-primary'))?>			
-			<?php echo $this->Html->link(__('Cancel'), array('controller' => 'clients', 'action' => 'index'), array('class' => 'btn btn-default'))?>
-		</div>
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+			<div class="form-group">			
+				<?php echo $this->Html->link(__('Add'), array('action' => 'add', $clientID), array('class' => 'btn btn-primary'))?>			
+				<?php echo $this->Html->link(__('Cancel'), array('controller' => 'clients', 'action' => 'index'), array('class' => 'btn btn-default'))?>
+			</div>
 		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/Clients/add.ctp b/htdocs/app/View/Clients/add.ctp
index d5386d08..71088130 100644
--- a/htdocs/app/View/Clients/add.ctp
+++ b/htdocs/app/View/Clients/add.ctp
@@ -6,9 +6,8 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Add Client</legend>
-		<?php echo $this->Form->create()?>			
+		<div class="col-md-10"><legend>Add Client</legend>
+			<?php echo $this->Form->create()?>			
 			<div class="form-group">
 				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
 				<div class="row">
@@ -25,21 +24,11 @@ body {
 					</div>
 				</div>
 			</div>		
-			
 			<div class="form-group">
 				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
-				<!--<a class="btn btn-default" href="/realms/index" role="button"><?php echo __('Cancel')?></a>-->
 				<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
 			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Clients/edit.ctp b/htdocs/app/View/Clients/edit.ctp
index 8355a10b..80b43dcf 100644
--- a/htdocs/app/View/Clients/edit.ctp
+++ b/htdocs/app/View/Clients/edit.ctp
@@ -6,9 +6,8 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Edit Client</legend>
-		<?php echo $this->Form->create()?>			
+		<div class="col-md-10"><legend>Edit Client</legend>
+			<?php echo $this->Form->create()?>			
 			<div class="form-group">
 				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
 				<div class="row">
@@ -25,19 +24,11 @@ body {
 					</div>
 				</div>
 			</div>		
-			
 			<div class="form-group">
 				<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
-				<!--<a class="btn btn-default" href="/groups/index" role="button"><?php echo __('Cancel')?></a>-->
 				<?php echo $this->Html->link('Cancel', array('controller' => 'clients', 'action' => 'index'), array('class' => 'btn btn-default'))?>
 			</div>
-		<?php echo $this->Form->end(); ?>
-	<!--	
-	 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/Clients/index.ctp b/htdocs/app/View/Clients/index.ctp
index f07981f5..a38300ec 100644
--- a/htdocs/app/View/Clients/index.ctp
+++ b/htdocs/app/View/Clients/index.ctp
@@ -6,58 +6,51 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Clients List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID');?></a></th>
-					<th><a><?php echo __('Name');?></a></th>				
-					<th><a><?php echo __('AccessList');?></a></th>
-					<th><a><?php echo __('Actions');?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php foreach ($client as $client): ?>
-				<tr>
-					<td><? echo __($client['Client']['ID'])?></td>
-					<td><? echo __($client['Client']['Name'])?></td>
-					<td><? echo __($client['Client']['AccessList'])?></td>
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group_edit.png"></img>',array('action' => 'edit', $client['Client']['ID']), array('escape' => false, 'title' => 'Edit client'));?>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'clients','action' => 'remove', $client['Client']['ID']), array('escape' => false, 'title' => 'Remove client'), 'Are you sure you want to remove this client?');?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table.png"></img>',array('controller' => 'client_attributes', 'action' => 'index', $client['Client']['ID']), array('escape' => false, 'title' => 'Client Attributes'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/world.png"></img>',array('controller' => 'client_realms', 'action' => 'index', $client['Client']['ID']), array('escape' => false, 'title' => 'Client Realms'));?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				<tr>
-					<td align="center" colspan="10" >
-						<?php
+		<div class="col-md-10"><legend>Clients List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID');?></a></th>
+						<th><a><?php echo __('Name');?></a></th>				
+						<th><a><?php echo __('AccessList');?></a></th>
+						<th><a><?php echo __('Actions');?></a></th>
+					</tr>
+				</thead>
+				<tbody>			
+					<?php foreach ($client as $client): ?>
+					<tr>
+						<td><? echo $client['Client']['ID'];?></td>
+						<td><? echo $client['Client']['Name'];?></td>
+						<td><? echo $client['Client']['AccessList'];?></td>
+						<td>
+							<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group_edit.png"></img>',array('action' => 'edit', $client['Client']['ID']), array('escape' => false, 'title' => 'Edit client'));?>												
+							<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'clients','action' => 'remove', $client['Client']['ID']), array('escape' => false, 'title' => 'Remove client'), 'Are you sure you want to remove this client?');?>
+							<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table.png"></img>',array('controller' => 'client_attributes', 'action' => 'index', $client['Client']['ID']), array('escape' => false, 'title' => 'Client Attributes'));?>
+							<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/world.png"></img>',array('controller' => 'client_realms', 'action' => 'index', $client['Client']['ID']), array('escape' => false, 'title' => 'Client Realms'));?>
+						</td>
+					</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
 							$total = $this->Paginator->counter(array(
     							'format' => '%pages%'));
 							if($total >1)
 							{		
-								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
-						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
-						<?php
-							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled'));
+							?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+								echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
 							}
-						?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
 		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/Elements/flash_failure.ctp b/htdocs/app/View/Elements/flash_failure.ctp
index 4d0f3942..5c26c311 100644
--- a/htdocs/app/View/Elements/flash_failure.ctp
+++ b/htdocs/app/View/Elements/flash_failure.ctp
@@ -1,4 +1,4 @@
 <div class="alert alert-danger alert-dismissable">
-    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
-    <p><?=$message?></p>
+	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+	<p><?=$message?></p>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/Elements/flash_success.ctp b/htdocs/app/View/Elements/flash_success.ctp
index 882a4847..e891f388 100644
--- a/htdocs/app/View/Elements/flash_success.ctp
+++ b/htdocs/app/View/Elements/flash_success.ctp
@@ -1,4 +1,4 @@
 <div class="alert alert-success alert-dismissable">
-    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
-    <p><?=$message?></p>
+	<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
+	<p><?=$message?></p>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/Elements/footer.ctp b/htdocs/app/View/Elements/footer.ctp
index fcc89815..14a7d44f 100644
--- a/htdocs/app/View/Elements/footer.ctp
+++ b/htdocs/app/View/Elements/footer.ctp
@@ -1,5 +1,6 @@
 <div style="padding: 0 15px">
 	<hr />
-<footer>
-	<p class="muted">v0.1.1 - Copyright &copy; 2014-2015, <a href="http://www.allworldit.com">AllWorldIT</a></p>
-</footer></div>
+	<footer>
+		<p class="muted">v0.1.1 - Copyright &copy; 2014-2015, <a href="http://www.allworldit.com">AllWorldIT</a></p>
+	</footer>
+</div>
diff --git a/htdocs/app/View/Elements/header.ctp b/htdocs/app/View/Elements/header.ctp
index d88db6e8..25850d31 100644
--- a/htdocs/app/View/Elements/header.ctp
+++ b/htdocs/app/View/Elements/header.ctp
@@ -1,18 +1,17 @@
 <div class="navbar navbar-inverse navbar-fixed-top">
-			<a class="navbar-brand" href="#">					
-			</a>
-			<div class="container">
-				<div class="navbar-header">
-					<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
-						<span class="icon-bar"></span>
-						<span class="icon-bar"></span>
-						<span class="icon-bar"></span>
-					</button>
-				</div>
-				<div class="collapse navbar-collapse">
-					<ul class="nav navbar-nav">
-						<li><a href="<?php echo BASE_URL; ?>/users/index"><?php echo __('Radius Control Panel')?></a></li>
-						<li><a href="<?php echo BASE_URL; ?>/wispUsers/index"><?php echo __('WiSP Control Panel')?></a></li>
-					</ul>
-				</div>
-			</div>
+	<a class="navbar-brand" href="#"></a>
+	<div class="container">
+	<div class="navbar-header">
+		<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
+			<span class="icon-bar"></span>
+			<span class="icon-bar"></span>
+			<span class="icon-bar"></span>
+		</button>
+	</div>
+	<div class="collapse navbar-collapse">
+		<ul class="nav navbar-nav">
+			<li><a href="<?php echo BASE_URL; ?>/users/index"><?php echo __('Radius Control Panel')?></a></li>
+			<li><a href="<?php echo BASE_URL; ?>/wispUsers/index"><?php echo __('WiSP Control Panel')?></a></li>
+		</ul>
+	</div>
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Elements/left_panel.ctp b/htdocs/app/View/Elements/left_panel.ctp
index da28f905..a795d1b2 100644
--- a/htdocs/app/View/Elements/left_panel.ctp
+++ b/htdocs/app/View/Elements/left_panel.ctp
@@ -3,9 +3,8 @@
 		<div class="panel-group" id="accordion">
 			<div class="panel panel-primary">
 				<div class="panel-heading">
-					<p class="panel-title text-center"><a class="accordion-toggle"
-						data-toggle="collapse" data-parent="#accordion" href="#collapseUsers"><img
-						src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/user.png"></img><? echo __('Users')?></a>
+					<p class="panel-title text-center">
+						<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseUsers"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/user.png"></img><? echo __('Users')?></a>
 					</p>
 				</div>
 				<div id="collapseUsers" class="panel-collapse collapse in">
@@ -28,10 +27,9 @@
 		<div class="panel-group">
 			<div class="panel panel-primary">
 				<div class="panel-heading">
-				<p class="panel-title text-center"><a class="accordion-toggle"
-					data-toggle="collapse" data-parent="#accordion" href="#collapseGroups"><img
-					src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/group.png"></img><?=__('Groups')?></a>
-				</p>
+					<p class="panel-title text-center">
+						<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseGroups"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/group.png"></img><?=__('Groups')?></a>
+					</p>
 				</div>
 				<div id="collapseGroups" class="panel-collapse collapse in">
 					<div class="panel-body">
@@ -53,53 +51,45 @@
 		<div class="panel-group">
 			<div class="panel panel-primary">
 				<div class="panel-heading">
-				<p class="panel-title text-center"><a class="accordion-toggle"
-					data-toggle="collapse" data-parent="#accordion1"
-					href="#collapseWorlds"><img
-					src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/world.png"></img><?=__('Realms')?></a>
-				</p>
+					<p class="panel-title text-center">
+						<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#collapseWorlds"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/world.png"></img><?=__('Realms')?></a>
+					</p>
 				</div>
-			<div id="collapseWorlds" class="panel-collapse collapse in">
-				<div class="panel-body">
-					<div class="col-md-12">
-						<div class="form-group">
-							<ul class="nav nav-pills nav-stacked">
-								<li><a href="<?php echo BASE_URL;?>/realms/index"><img
-									src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/world.png"></img><?=__('List Realms')?></a></li>
-								<li><a href="<?php echo BASE_URL;?>/realms/add"><img
-									src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/world_add.png"></img><?=__('Add Realms')?></a></li>																
-							</ul>
+				<div id="collapseWorlds" class="panel-collapse collapse in">
+					<div class="panel-body">
+						<div class="col-md-12">
+							<div class="form-group">
+								<ul class="nav nav-pills nav-stacked">
+									<li><a href="<?php echo BASE_URL;?>/realms/index"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/world.png"></img><?=__('List Realms')?></a></li>
+									<li><a href="<?php echo BASE_URL;?>/realms/add"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/world_add.png"></img><?=__('Add Realms')?></a></li>																
+								</ul>
+							</div>
 						</div>
 					</div>
 				</div>
 			</div>
-			</div>
 		</div>
 	
 		<div class="panel-group">
 			<div class="panel panel-primary">
-			<div class="panel-heading">
-			<p class="panel-title text-center"><a class="accordion-toggle"
-				data-toggle="collapse" data-parent="#accordion"
-				href="#collapseServers"><img
-				src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/server.png"></img><?=__('Clients')?></a>
-			</p>
-			</div>
-			<div id="collapseServers" class="panel-collapse collapse in">
-				<div class="panel-body">
-					<div class="col-md-12">
-						<div class="form-group">
-							<ul class="nav nav-pills nav-stacked">
-								<li><a href="<?php echo BASE_URL;?>/clients/index"><img
-									src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/server_edit.png"></img><?=__('List Clients')?></a></li>
-								<li><a href="<?php echo BASE_URL;?>/clients/add"><img
-									src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/server_add.png"></img><?=__('Add Clients')?></a></li>																
-							</ul>
+				<div class="panel-heading">
+					<p class="panel-title text-center">
+						<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseServers"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/server.png"></img><?=__('Clients')?></a>
+					</p>
+				</div>
+				<div id="collapseServers" class="panel-collapse collapse in">
+					<div class="panel-body">
+						<div class="col-md-12">
+							<div class="form-group">
+								<ul class="nav nav-pills nav-stacked">
+									<li><a href="<?php echo BASE_URL;?>/clients/index"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/server_edit.png"></img><?=__('List Clients')?></a></li>
+									<li><a href="<?php echo BASE_URL;?>/clients/add"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/server_add.png"></img><?=__('Add Clients')?></a></li>																
+								</ul>
+							</div>
 						</div>
 					</div>
 				</div>
 			</div>
-			</div>
 		</div>
 	</ul>
-</div>
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Elements/wisp_left_panel.ctp b/htdocs/app/View/Elements/wisp_left_panel.ctp
index 8d82cc46..229affab 100644
--- a/htdocs/app/View/Elements/wisp_left_panel.ctp
+++ b/htdocs/app/View/Elements/wisp_left_panel.ctp
@@ -3,9 +3,8 @@
 		<div class="panel-group" id="accordion">
 			<div class="panel panel-primary">
 				<div class="panel-heading">
-					<p class="panel-title text-center"><a class="accordion-toggle"
-						data-toggle="collapse" data-parent="#accordion" href="#collapseUsers"><img
-						src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/user.png"></img> <? echo __('Users')?></a>
+					<p class="panel-title text-center">
+						<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseUsers"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/user.png"></img><? echo __('Users')?></a>
 					</p>
 				</div>
 				<div id="collapseUsers" class="panel-collapse collapse in">
@@ -27,10 +26,9 @@
 		<div class="panel-group">
 			<div class="panel panel-primary">
 				<div class="panel-heading">
-				<p class="panel-title text-center"><a class="accordion-toggle"
-					data-toggle="collapse" data-parent="#accordion" href="#collapseGroups"><img
-					src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/map.png"></img> <?=__('Locations')?></a>
-				</p>
+					<p class="panel-title text-center">
+						<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion" href="#collapseGroups"><img src="<?php echo BASE_URL;?>/resources/custom/images/silk/icons/map.png"></img> <?=__('Locations')?></a>
+					</p>
 				</div>
 				<div id="collapseGroups" class="panel-collapse collapse in">
 					<div class="panel-body">
@@ -47,4 +45,4 @@
 			</div>
 		</div>
 	</ul>
-</div>
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Errors/error400.ctp b/htdocs/app/View/Errors/error400.ctp
index 81bc61bc..6cb5ca43 100644
--- a/htdocs/app/View/Errors/error400.ctp
+++ b/htdocs/app/View/Errors/error400.ctp
@@ -1,31 +1,31 @@
-<?php
-/**
- *
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * For full copyright and license information, please see the LICENSE.txt
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link          http://cakephp.org CakePHP(tm) Project
- * @package       app.View.Errors
- * @since         CakePHP(tm) v 0.10.0.1076
- * @license       http://www.opensource.org/licenses/mit-license.php MIT License
- */
-?>
-<h2><?php echo $name; ?></h2>
-<p class="error">
-	<strong><?php echo __d('cake', 'Error'); ?>: </strong>
-	<?php printf(
-		__d('cake', 'The requested address %s was not found on this server.'),
-		"<strong>'{$url}'</strong>"
-	); ?>
-</p>
-<?php
-if (Configure::read('debug') > 0):
-	echo $this->element('exception_stack_trace');
-endif;
-?>
+<?php
+/**
+ *
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * For full copyright and license information, please see the LICENSE.txt
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link          http://cakephp.org CakePHP(tm) Project
+ * @package       app.View.Errors
+ * @since         CakePHP(tm) v 0.10.0.1076
+ * @license       http://www.opensource.org/licenses/mit-license.php MIT License
+ */
+?>
+<h2><?php echo $name; ?></h2>
+<p class="error">
+	<strong><?php echo __d('cake', 'Error'); ?>: </strong>
+	<?php printf(
+		__d('cake', 'The requested address %s was not found on this server.'),
+		"<strong>'{$url}'</strong>"
+	); ?>
+</p>
+<?php
+	if (Configure::read('debug') > 0):
+		echo $this->element('exception_stack_trace');
+	endif;
+?>
\ No newline at end of file
diff --git a/htdocs/app/View/Errors/error500.ctp b/htdocs/app/View/Errors/error500.ctp
index aba5e37d..7f3ade4c 100644
--- a/htdocs/app/View/Errors/error500.ctp
+++ b/htdocs/app/View/Errors/error500.ctp
@@ -1,28 +1,28 @@
-<?php
-/**
- *
- *
- * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
- * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- *
- * Licensed under The MIT License
- * For full copyright and license information, please see the LICENSE.txt
- * Redistributions of files must retain the above copyright notice.
- *
- * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
- * @link          http://cakephp.org CakePHP(tm) Project
- * @package       app.View.Errors
- * @since         CakePHP(tm) v 0.10.0.1076
- * @license       http://www.opensource.org/licenses/mit-license.php MIT License
- */
-?>
-<h2><?php echo $name; ?></h2>
-<p class="error">
-	<strong><?php echo __d('cake', 'Error'); ?>: </strong>
-	<?php echo __d('cake', 'An Internal Error Has Occurred.'); ?>
-</p>
-<?php
-if (Configure::read('debug') > 0):
-	echo $this->element('exception_stack_trace');
-endif;
-?>
+<?php
+/**
+ *
+ *
+ * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
+ * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
+ *
+ * Licensed under The MIT License
+ * For full copyright and license information, please see the LICENSE.txt
+ * Redistributions of files must retain the above copyright notice.
+ *
+ * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
+ * @link          http://cakephp.org CakePHP(tm) Project
+ * @package       app.View.Errors
+ * @since         CakePHP(tm) v 0.10.0.1076
+ * @license       http://www.opensource.org/licenses/mit-license.php MIT License
+ */
+?>
+<h2><?php echo $name; ?></h2>
+<p class="error">
+	<strong><?php echo __d('cake', 'Error'); ?>: </strong>
+	<?php echo __d('cake', 'An Internal Error Has Occurred.'); ?>
+</p>
+<?php
+	if (Configure::read('debug') > 0):
+		echo $this->element('exception_stack_trace');
+	endif;
+?>
\ No newline at end of file
diff --git a/htdocs/app/View/GroupAttributes/add.ctp b/htdocs/app/View/GroupAttributes/add.ctp
index 3366589d..544a7109 100644
--- a/htdocs/app/View/GroupAttributes/add.ctp
+++ b/htdocs/app/View/GroupAttributes/add.ctp
@@ -6,58 +6,46 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Add Group Attribute')?></legend>
-		<?php echo $this->Form->create()?>
-			<div class="form-group">
-				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name'));?>
-					</div>					
+		<div class="col-md-10"><legend><?php echo __('Add Group Attribute')?></legend>
+			<?php echo $this->Form->create()?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name'));?>
+						</div>					
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control',
-							 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=',
-																	'=~', '!~', '=*', '!*', '||==')));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=', '=~', '!~', '=*', '!*', '||==')));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value'));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value'));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-3">
-						<?php echo $this->Form->checkbox('Disabled');?>						
-						<?php echo __('Disabled')?>					
+				<div class="form-group">
+					<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-3">
+							<?php echo $this->Form->checkbox('Disabled');?>						
+							<?php echo __('Disabled')?>					
+						</div>
 					</div>
 				</div>
-			</div>
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
-				<?php echo $this->Html->link('Cancel', array('action' => 'index', $groupId), array('class' => 'btn btn-default'))?>							
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index', $groupId), array('class' => 'btn btn-default'))?>							
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/GroupAttributes/edit.ctp b/htdocs/app/View/GroupAttributes/edit.ctp
index ad395943..eb926c67 100644
--- a/htdocs/app/View/GroupAttributes/edit.ctp
+++ b/htdocs/app/View/GroupAttributes/edit.ctp
@@ -6,32 +6,29 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Edit Group Attribute')?></legend>
-		<?php echo $this->Form->create()?>
-			<div class="form-group">
-				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 
-										'placeholder' => 'Name', 'value' => $groupAttribute['GroupAttribute']['Name']));?>
-					</div>					
+		<div class="col-md-10"><legend><?php echo __('Edit Group Attribute')?></legend>
+			<?php echo $this->Form->create()?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name', 'value' => $groupAttribute['GroupAttribute']['Name']));?>
+						</div>					
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=', '=~', '!~', '=*', '!*', '||=='), 'value' => $groupAttribute['GroupAttribute']['Operator']));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=', '=~', '!~', '=*', '!*', '||=='), 'value' => $groupAttribute['GroupAttribute']['Operator']));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 
-								'placeholder' => 'Value', 'value' => $groupAttribute['GroupAttribute']['Value']));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value', 'value' => $groupAttribute['GroupAttribute']['Value']));?>
 					</div>
 				</div>
 			</div>
@@ -50,20 +47,11 @@ body {
 					</div>
 				</div>
 			</div>
-			
 			<div class="form-group">
 				<button type="submit" class="btn btn-primary"><?php echo __('Save', true)?></button>
 				<?php echo $this->Html->link(__('Cancel', true), array('action' => 'index', $groupAttribute['GroupAttribute']['GroupID']), array('class' => 'btn btn-default'))?>							
 			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/GroupAttributes/index.ctp b/htdocs/app/View/GroupAttributes/index.ctp
index 5752d22f..077bf3e4 100644
--- a/htdocs/app/View/GroupAttributes/index.ctp
+++ b/htdocs/app/View/GroupAttributes/index.ctp
@@ -6,85 +6,58 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Group Attribute List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID', true);?></a></th>
-					<th><a><?php echo __('Name', true);?></a></th>
-					<th><a><?php echo __('Operator', true);?></a></th>
-					<th><a><?php echo __('Value', true);?></a></th>
-					<th><a><?php echo __('Disabled', true);?></a></th>					
-					<th><a><?php echo __('Actions', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php 
-				$options=array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||==');
-				foreach ($groupAttributes as $groupAttribute): ?>
-				<tr>
-					<td><? echo __($groupAttribute['GroupAttribute']['ID'])?></td>
-					<td><? echo __($groupAttribute['GroupAttribute']['Name'])?></td>
-					<td><? echo __($options[$groupAttribute['GroupAttribute']['Operator']])?></td>
-					<!--<td><? echo __($groupAttribute['GroupAttribute']['Operator'])?></td>-->
-					<td><? echo __($groupAttribute['GroupAttribute']['Value'])?></td>
-					<td><? echo __( ($groupAttribute['GroupAttribute']['Disabled'] == 1) ? 'true' : 'false')?></td>					
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'group_attributes',  'action' => 'edit', $groupAttribute['GroupAttribute']['ID'], $groupId), array('escape' => false, 'title' => 'Edit attribute'));?>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'group_attributes','action' => 'remove', $groupAttribute['GroupAttribute']['ID'], $groupId), array('escape' => false, 'title' => 'Remove attribute'), 'Are you sure you want to remove this group?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				
-				<!--<tr>
-					<td align="center" colspan="10">
-
-						<ul class="pagination">
-							<li><a href="limits.html#">&laquo;</a></li>
-							<li class="active"><a href="limits.html#">1</a></li>
-							<li><a href="limits.html#">2</a></li>
-							<li><a href="limits.html#">3</a></li>
-							<li><a href="limits.html#">4</a></li>
-							<li><a href="limits.html#">5</a></li>
-							<li><a href="limits.html#">&raquo;</a></li>
-						</ul>
-
-					</td>
-				</tr>-->
-				<tr>
-					<td align="center" colspan="10" >
-						<?php
+		<div class="col-md-10"><legend>Group Attribute List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID', true);?></a></th>
+						<th><a><?php echo __('Name', true);?></a></th>
+						<th><a><?php echo __('Operator', true);?></a></th>
+						<th><a><?php echo __('Value', true);?></a></th>
+						<th><a><?php echo __('Disabled', true);?></a></th>					
+						<th><a><?php echo __('Actions', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php 
+					$options=array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||==');
+					foreach ($groupAttributes as $groupAttribute): ?>
+					<tr>
+						<td><? echo $groupAttribute['GroupAttribute']['ID'];?></td>
+						<td><? echo $groupAttribute['GroupAttribute']['Name'];?></td>
+						<td><? echo $options[$groupAttribute['GroupAttribute']['Operator']];?></td>
+						<td><? echo $groupAttribute['GroupAttribute']['Value'];?></td>
+						<td><? echo ($groupAttribute['GroupAttribute']['Disabled'] == 1) ? 'true' : 'false';?></td>					
+						<td>
+							<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'group_attributes',  'action' => 'edit', $groupAttribute['GroupAttribute']['ID'], $groupId), array('escape' => false, 'title' => 'Edit attribute'));?>												
+							<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'group_attributes','action' => 'remove', $groupAttribute['GroupAttribute']['ID'], $groupId), array('escape' => false, 'title' => 'Remove attribute'), 'Are you sure you want to remove this group?');?>
+						</td>
+					</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
 							$total = $this->Paginator->counter(array(
     							'format' => '%pages%'));
 							if($total >1)
 							{		
-								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
-						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
-						<?php
-							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled'));
+							?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled'));?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
 							}
-						?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-		<div class="form-group">			
-			<?php echo $this->Html->link(__('Add'), array('action' => 'add', $groupId), array('class' => 'btn btn-primary'))?>			
-			<?php echo $this->Html->link(__('Cancel'), array('controller' => 'groups', 'action' => 'index', $groupId), array('class' => 'btn btn-default'))?>
-		</div>
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+			<div class="form-group">			
+				<?php echo $this->Html->link(__('Add'), array('action' => 'add', $groupId), array('class' => 'btn btn-primary'))?>			
+				<?php echo $this->Html->link(__('Cancel'), array('controller' => 'groups', 'action' => 'index', $groupId), array('class' => 'btn btn-default'))?>
+			</div>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/GroupMember/index.ctp b/htdocs/app/View/GroupMember/index.ctp
index a00ae7f6..ee5097d1 100644
--- a/htdocs/app/View/GroupMember/index.ctp
+++ b/htdocs/app/View/GroupMember/index.ctp
@@ -8,53 +8,46 @@ body {
 	<div class="row"><?php echo $this->element('left_panel');?>
 		<div class="col-md-10"><legend>Group Members List</legend>
 			<table class="table">
-			<thead>
-			 
-				<tr>
-					<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
-					<th><?php echo $this->Paginator->sort('Username', 'Username'); ?></th>
-					<th><?php echo $this->Paginator->sort('Disabled', 'Disabled'); ?></th>
-					<th><a><?php echo __('Actions', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php foreach ($GroupMember as $GroupMember): ?>
-				<tr>
-					<td><? echo __($GroupMember['GroupMember']['ID'])?></td>
-					<td><? echo __($GroupMember['GroupMember']['UserName'])?></td>
-					<td><? echo __(($GroupMember['GroupMember']['Disabled'] == 1) ? 'true' : 'false')?></td>
-					<td>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'group_member','action' => 'remove', $GroupMember['GroupMember']['ID'], $groupID), array('escape' => false, 'title' => 'Remove Group'), 'Are you sure you want to remove this group member?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				<tr>
-					<td align="center" colspan="10" >
-						<?php
+				<thead>
+					<tr>
+						<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
+						<th><?php echo $this->Paginator->sort('Username', 'Username'); ?></th>
+						<th><?php echo $this->Paginator->sort('Disabled', 'Disabled'); ?></th>
+						<th><a><?php echo __('Actions', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php foreach ($GroupMember as $GroupMember): ?>
+						<tr>
+							<td><? echo $GroupMember['GroupMember']['ID'];?></td>
+							<td><? echo $GroupMember['GroupMember']['UserName'];?></td>
+							<td><? echo ($GroupMember['GroupMember']['Disabled'] == 1) ? 'true' : 'false';?></td>
+							<td>												
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'group_member','action' => 'remove', $GroupMember['GroupMember']['ID'], $groupID), array('escape' => false, 'title' => 'Remove Group'), 'Are you sure you want to remove this group member?');?>
+							</td>
+						</tr>
+						<? endforeach; ?>
+						<tr>
+						<td align="center" colspan="10" >
+							<?php
 							$total = $this->Paginator->counter(array(
     							'format' => '%pages%'));
 							if($total >1)
 							{		
-								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
-						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
-						<?php
+							echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
+							?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
 							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
 							}
-						?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-	<!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
-</div>
-</div>
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+		</div>
+	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/Groups/add.ctp b/htdocs/app/View/Groups/add.ctp
index f78e262e..3b6dbb46 100644
--- a/htdocs/app/View/Groups/add.ctp
+++ b/htdocs/app/View/Groups/add.ctp
@@ -6,7 +6,6 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
 	<div class="col-md-10"><legend>Add Group</legend>
 		<?php echo $this->Form->create()?>			
 			<div class="form-group">
@@ -17,21 +16,11 @@ body {
 					</div>
 				</div>
 			</div>			
-			
 			<div class="form-group">
 				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
-				<!--<a class="btn btn-default" href="/groups/index" role="button"><?php echo __('Cancel')?></a>-->
 				<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
 			</div>
 		<?php echo $this->Form->end(); ?>
-		
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Groups/edit.ctp b/htdocs/app/View/Groups/edit.ctp
index d872449a..d32c16fa 100644
--- a/htdocs/app/View/Groups/edit.ctp
+++ b/htdocs/app/View/Groups/edit.ctp
@@ -6,32 +6,21 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Edit Group</legend>
-		<?php echo $this->Form->create()?>			
-			<div class="form-group">
-				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name', 'value' => $group['Group']['Name']));?>
+		<div class="col-md-10"><legend>Edit Group</legend>
+			<?php echo $this->Form->create()?>			
+				<div class="form-group">
+					<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name', 'value' => $group['Group']['Name']));?>
+						</div>
 					</div>
+				</div>			
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
 				</div>
-			</div>			
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
-				<!--<a class="btn btn-default" href="/groups/index" role="button"><?php echo __('Cancel')?></a>-->
-				<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
-			</div>
-		<?php echo $this->Form->end(); ?>
-		<!--
-	 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Groups/index.ctp b/htdocs/app/View/Groups/index.ctp
index a77da227..48909f8f 100644
--- a/htdocs/app/View/Groups/index.ctp
+++ b/htdocs/app/View/Groups/index.ctp
@@ -6,80 +6,55 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Groups List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID');?></a></th>
-					<th><a><?php echo __('Name');?></a></th>
-					<th><a><?php echo __('Priority');?></a></th>					
-					<th><a><?php echo __('Disabled');?></a></th>
-					<th><a><?php echo __('Comment');?></a></th>
-					<th><a><?php echo __('Actions');?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php foreach ($groups as $group): ?>
-				<tr>
-					<td><? echo __($group['Group']['ID'])?></td>
-					<td><? echo __($group['Group']['Name'])?></td>
-					<td><? echo __($group['Group']['Priority'])?></td>
-					<td><? echo __(($group['Group']['Disabled'] == 1) ? 'true' : 'false')?></td>
-					<td><? echo __($group['Group']['Comment'])?></td>
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group_edit.png"></img>',array('action' => 'edit', $group['Group']['ID']), array('escape' => false, 'title' => 'Edit group'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group_delete.png"></img>',array('action' => 'remove', $group['Group']['ID']), array('escape' => false, 'title' => 'Remove group'), 'Are you sure you want to remove this group?');?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table.png"></img>',array('controller' => 'group_attributes', 'action' => 'index', $group['Group']['ID']), array('escape' => false, 'title' => 'Group attributes'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group.png"></img>',array('controller' => 'group_member', 'action' => 'index', $group['Group']['ID']), array('escape' => false, 'title' => 'Group member'));?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				
-				<!--<tr>
-					<td align="center" colspan="10">
-
-						<ul class="pagination">
-							<li><a href="limits.html#">&laquo;</a></li>
-							<li class="active"><a href="limits.html#">1</a></li>
-							<li><a href="limits.html#">2</a></li>
-							<li><a href="limits.html#">3</a></li>
-							<li><a href="limits.html#">4</a></li>
-							<li><a href="limits.html#">5</a></li>
-							<li><a href="limits.html#">&raquo;</a></li>
-						</ul>
-
-					</td>
-				</tr>-->
+		<div class="col-md-10"><legend>Groups List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID');?></a></th>
+						<th><a><?php echo __('Name');?></a></th>
+						<th><a><?php echo __('Priority');?></a></th>					
+						<th><a><?php echo __('Disabled');?></a></th>
+						<th><a><?php echo __('Comment');?></a></th>
+						<th><a><?php echo __('Actions');?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php foreach ($groups as $group): ?>
+						<tr>
+							<td><? echo $group['Group']['ID'];?></td>
+							<td><? echo $group['Group']['Name'];?></td>
+							<td><? echo $group['Group']['Priority'];?></td>
+							<td><? echo ($group['Group']['Disabled'] == 1) ? 'true' : 'false';?></td>
+							<td><? echo $group['Group']['Comment'];?></td>
+							<td>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group_edit.png"></img>',array('action' => 'edit', $group['Group']['ID']), array('escape' => false, 'title' => 'Edit group'));?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group_delete.png"></img>',array('action' => 'remove', $group['Group']['ID']), array('escape' => false, 'title' => 'Remove group'), 'Are you sure you want to remove this group?');?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table.png"></img>',array('controller' => 'group_attributes', 'action' => 'index', $group['Group']['ID']), array('escape' => false, 'title' => 'Group attributes'));?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group.png"></img>',array('controller' => 'group_member', 'action' => 'index', $group['Group']['ID']), array('escape' => false, 'title' => 'Group member'));?>
+							</td>
+						</tr>
+					<? endforeach; ?>
 				<tr>
 					<td align="center" colspan="10" >
 						<?php
-							$total = $this->Paginator->counter(array(
-    							'format' => '%pages%'));
-							if($total >1)
-							{		
-								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
+						$total = $this->Paginator->counter(array(
+    						'format' => '%pages%'));
+						if($total >1)
+						{		
+							echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled'));
 						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
+						<?php echo $this->Paginator->numbers(); ?>
+						<!-- Shows the next and previous links -->
+						<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+						<!-- prints X of Y, where X is current page and Y is number of pages -->
 						<?php
 							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-							}
+						}
 						?>
 					</td>
 				</tr>
 			</tbody>
 		</table>
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Radius/index.ctp b/htdocs/app/View/Radius/index.ctp
index 663d1122..58736b8a 100644
--- a/htdocs/app/View/Radius/index.ctp
+++ b/htdocs/app/View/Radius/index.ctp
@@ -5,14 +5,17 @@ body {
 </style>
 
 <div style="padding: 15px 15px">
-<div class="row"><?php echo $this->element('left_panel');?>
-
-<div class="col-md-10"><legend>Radius Control Panel</legend> <span
-	class="glyphicon glyphicon-time" /> - Processing, <span
-	class="glyphicon glyphicon-edit" /> - Override, <span
-	class="glyphicon glyphicon-import" /> - Being Added, <span
-	class="glyphicon glyphicon-trash" /> - Being Removed, <span
-	class="glyphicon glyphicon-random" /> - Conflicts</div>
-</div>
+	<div class="row">
+		<?php echo $this->element('left_panel');?>
+	
+		<div class="col-md-10"><legend>Radius Control Panel</legend> 
+			<span
+			class="glyphicon glyphicon-time" /> - Processing, <span
+			class="glyphicon glyphicon-edit" /> - Override, <span
+			class="glyphicon glyphicon-import" /> - Being Added, <span
+			class="glyphicon glyphicon-trash" /> - Being Removed, <span
+			class="glyphicon glyphicon-random" /> - Conflicts
+			</div>
+	</div>
 </div>
 
diff --git a/htdocs/app/View/RealmAttributes/add.ctp b/htdocs/app/View/RealmAttributes/add.ctp
index 9573d5b4..76aaa6e8 100644
--- a/htdocs/app/View/RealmAttributes/add.ctp
+++ b/htdocs/app/View/RealmAttributes/add.ctp
@@ -6,57 +6,46 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Add Realm Attribute')?></legend>
-		<?php echo $this->Form->create()?>
-			<div class="form-group">
-				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name'));?>
-					</div>					
+		<div class="col-md-10"><legend><?php echo __('Add Realm Attribute')?></legend>
+			<?php echo $this->Form->create()?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name'));?>
+						</div>					
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control',
-							 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=',
-																	'=~', '!~', '=*', '!*', '||==')));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=', '=~', '!~', '=*', '!*', '||==')));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value'));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value'));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-3">
-						<?php echo $this->Form->checkbox('Disabled');?>						
-						<?php echo __('Disabled')?>					
+				<div class="form-group">
+					<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-3">
+							<?php echo $this->Form->checkbox('Disabled');?>						
+							<?php echo __('Disabled')?>					
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
-				<?php echo $this->Html->link('Cancel', array('action' => 'index', $realmId), array('class' => 'btn btn-default'))?>							
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index', $realmId), array('class' => 'btn btn-default'))?>							
+				</div>
+				<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/RealmAttributes/edit.ctp b/htdocs/app/View/RealmAttributes/edit.ctp
index 95713f7e..1d7913c6 100644
--- a/htdocs/app/View/RealmAttributes/edit.ctp
+++ b/htdocs/app/View/RealmAttributes/edit.ctp
@@ -6,64 +6,52 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Edit Realm Attribute')?></legend>
-		<?php echo $this->Form->create()?>
-			<div class="form-group">
-				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 
-										'placeholder' => 'Name', 'value' => $realmAttribute['RealmAttribute']['Name']));?>
-					</div>					
+		<div class="col-md-10"><legend><?php echo __('Edit Realm Attribute')?></legend>
+			<?php echo $this->Form->create()?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name', 'value' => $realmAttribute['RealmAttribute']['Name']));?>
+						</div>					
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=', '=~', '!~', '=*', '!*', '||=='), 'value' => $realmAttribute['RealmAttribute']['Operator']));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=', '=~', '!~', '=*', '!*', '||=='), 'value' => $realmAttribute['RealmAttribute']['Operator']));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 
-								'placeholder' => 'Value', 'value' => $realmAttribute['RealmAttribute']['Value']));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value', 'value' => $realmAttribute['RealmAttribute']['Value']));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-3">
-						<?php if($realmAttribute['RealmAttribute']['Disabled'] == 1) {
-								 $isCheck = true;
-							} else {
-								$isCheck = false;
-							}
-						?>
-						<?php echo $this->Form->checkbox('Disabled', array('checked' => $isCheck));?>						
-						<?php echo __('Disabled')?>					
+				<div class="form-group">
+					<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-3">
+							<?php if($realmAttribute['RealmAttribute']['Disabled'] == 1) {
+								 	$isCheck = true;
+								  } else {
+									$isCheck = false;
+								  }
+							?>
+							<?php echo $this->Form->checkbox('Disabled', array('checked' => $isCheck));?>						
+							<?php echo __('Disabled')?>					
+						</div>
 					</div>
 				</div>
-			</div>
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Save', true)?></button>
-				<?php echo $this->Html->link(__('Cancel', true), array('action' => 'index', $realmAttribute['RealmAttribute']['RealmID']), array('class' => 'btn btn-default'))?>							
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Save', true)?></button>
+					<?php echo $this->Html->link(__('Cancel', true), array('action' => 'index', $realmAttribute['RealmAttribute']['RealmID']), array('class' => 'btn btn-default'))?>							
+				</div>
+				<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/RealmAttributes/index.ctp b/htdocs/app/View/RealmAttributes/index.ctp
index c888b07f..3ae4044f 100644
--- a/htdocs/app/View/RealmAttributes/index.ctp
+++ b/htdocs/app/View/RealmAttributes/index.ctp
@@ -6,68 +6,59 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Realm Attribute List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID', true);?></a></th>
-					<th><a><?php echo __('Name', true);?></a></th>
-					<th><a><?php echo __('Operator', true);?></a></th>
-					<th><a><?php echo __('Value', true);?></a></th>
-					<th><a><?php echo __('Disabled', true);?></a></th>					
-					<th><a><?php echo __('Actions', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				<?php 
-				$options=array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||==');
-				foreach ($realmAttributes as $realmAttributes): ?>
-				<tr>
-					<td><? echo __($realmAttributes['RealmAttribute']['ID'])?></td>
-					<td><? echo __($realmAttributes['RealmAttribute']['Name'])?></td>
-					<td><? echo __($options[$realmAttributes['RealmAttribute']['Operator']])?></td>
-					<!--<td><? echo __($realmAttributes['RealmAttribute']['Operator'])?></td>-->
-					<td><? echo __($realmAttributes['RealmAttribute']['Value'])?></td>
-					<td><? echo __( ($realmAttributes['RealmAttribute']['Disabled'] == 1) ? 'true' : 'false')?></td>					
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'realm_attributes',  'action' => 'edit', $realmAttributes['RealmAttribute']['ID'], $realmId), array('escape' => false, 'title' => 'Edit attribute'));?>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'realm_attributes','action' => 'remove', $realmAttributes['RealmAttribute']['ID'], $realmId), array('escape' => false, 'title' => 'Remove attribute'), 'Are you sure you want to remove this attribute?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				<tr>
-					<td align="center" colspan="10" >
-						<?php
+		<div class="col-md-10"><legend>Realm Attribute List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID', true);?></a></th>
+						<th><a><?php echo __('Name', true);?></a></th>
+						<th><a><?php echo __('Operator', true);?></a></th>
+						<th><a><?php echo __('Value', true);?></a></th>
+						<th><a><?php echo __('Disabled', true);?></a></th>					
+						<th><a><?php echo __('Actions', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php 
+					$options=array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||==');
+					foreach ($realmAttributes as $realmAttributes): ?>
+					<tr>
+						<td><? echo $realmAttributes['RealmAttribute']['ID'];?></td>
+						<td><? echo $realmAttributes['RealmAttribute']['Name'];?></td>
+						<td><? echo $options[$realmAttributes['RealmAttribute']['Operator']];?></td>
+						<td><? echo $realmAttributes['RealmAttribute']['Value'];?></td>
+						<td><? echo ($realmAttributes['RealmAttribute']['Disabled'] == 1) ? 'true' : 'false';?></td>					
+						<td>
+							<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'realm_attributes',  'action' => 'edit', $realmAttributes['RealmAttribute']['ID'], $realmId), array('escape' => false, 'title' => 'Edit attribute'));?>												
+							<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'realm_attributes','action' => 'remove', $realmAttributes['RealmAttribute']['ID'], $realmId), array('escape' => false, 'title' => 'Remove attribute'), 'Are you sure you want to remove this attribute?');?>
+						</td>
+					</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
 							$total = $this->Paginator->counter(array(
     							'format' => '%pages%'));
 							if($total >1)
 							{		
 								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
-						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
-						<?php
-							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+								echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
 							}
-						?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-		<div class="form-group">			
-			<?php echo $this->Html->link(__('Add'), array('action' => 'add', $realmId), array('class' => 'btn btn-primary'))?>			
-			<?php echo $this->Html->link(__('Cancel'), array('controller' => 'realms', 'action' => 'index'), array('class' => 'btn btn-default'))?>
-		</div>
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+			<div class="form-group">			
+				<?php echo $this->Html->link(__('Add'), array('action' => 'add', $realmId), array('class' => 'btn btn-primary'))?>			
+				<?php echo $this->Html->link(__('Cancel'), array('controller' => 'realms', 'action' => 'index'), array('class' => 'btn btn-default'))?>
+			</div>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/RealmMembers/index.ctp b/htdocs/app/View/RealmMembers/index.ctp
index a814472a..8d0aa690 100644
--- a/htdocs/app/View/RealmMembers/index.ctp
+++ b/htdocs/app/View/RealmMembers/index.ctp
@@ -6,52 +6,46 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Realm Members List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID', true);?></a></th>
-					<th><a><?php echo __('Name', true);?></a></th>
-					<th><a><?php echo __('Action', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				<?php foreach ($realmMember as $realmMember): ?>
-				<tr>
-					<td><? echo __($realmMember['RealmMember']['ID'])?></td>
-					<td><? echo __($realmMember['RealmMember']['clientName'])?></td>
-					<td>											
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'realm_members','action' => 'remove', $realmMember['RealmMember']['ID'], $realmID), array('escape' => false, 'title' => 'Remove member'), 'Are you sure you want to remove this member?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				<tr>
-					<td align="center" colspan="10" >
-						<?php
+		<div class="col-md-10"><legend>Realm Members List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID', true);?></a></th>
+						<th><a><?php echo __('Name', true);?></a></th>
+						<th><a><?php echo __('Action', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php foreach ($realmMember as $realmMember): ?>
+						<tr>
+							<td><? echo $realmMember['RealmMember']['ID'];?></td>
+							<td><? echo $realmMember['RealmMember']['clientName'];?></td>
+							<td>											
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'realm_members','action' => 'remove', $realmMember['RealmMember']['ID'], $realmID), array('escape' => false, 'title' => 'Remove member'), 'Are you sure you want to remove this member?');?>
+						</td>
+					</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
 							$total = $this->Paginator->counter(array(
     							'format' => '%pages%'));
 							if($total >1)
 							{		
 								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
-						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
-						<?php
-							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+								echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
 							}
-						?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
 		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/Realms/add.ctp b/htdocs/app/View/Realms/add.ctp
index b6d94d73..6934e796 100644
--- a/htdocs/app/View/Realms/add.ctp
+++ b/htdocs/app/View/Realms/add.ctp
@@ -6,32 +6,21 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Add Realm</legend>
-		<?php echo $this->Form->create()?>			
-			<div class="form-group">
-				<?php echo $this->Form->label('Realm', 'Realm', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Realm'));?>
+		<div class="col-md-10"><legend>Add Realm</legend>
+			<?php echo $this->Form->create()?>			
+				<div class="form-group">
+					<?php echo $this->Form->label('Realm', 'Realm', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Realm'));?>
+						</div>
 					</div>
 				</div>
-			</div>			
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
-				<!--<a class="btn btn-default" href="/realms/index" role="button"><?php echo __('Cancel')?></a>-->
-				<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Realms/edit.ctp b/htdocs/app/View/Realms/edit.ctp
index 408882bc..3a5bcef9 100644
--- a/htdocs/app/View/Realms/edit.ctp
+++ b/htdocs/app/View/Realms/edit.ctp
@@ -6,32 +6,21 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Edit Realm</legend>
-		<?php echo $this->Form->create()?>			
-			<div class="form-group">
-				<?php echo $this->Form->label('Realm', 'Realm', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Realm', 'value' => $realm['Realm']['Name']));?>
+		<div class="col-md-10"><legend>Edit Realm</legend>
+			<?php echo $this->Form->create()?>			
+				<div class="form-group">
+					<?php echo $this->Form->label('Realm', 'Realm', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Realm', 'value' => $realm['Realm']['Name']));?>
+						</div>
 					</div>
 				</div>
-			</div>			
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
-				<!--<a class="btn btn-default" href="/groups/index" role="button"><?php echo __('Cancel')?></a>-->
-				<?php echo $this->Html->link('Cancel', array('controller' => 'realms', 'action' => 'index'), array('class' => 'btn btn-default'))?>
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
+					<?php echo $this->Html->link('Cancel', array('controller' => 'realms', 'action' => 'index'), array('class' => 'btn btn-default'))?>
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Realms/index.ctp b/htdocs/app/View/Realms/index.ctp
index 7518a23f..d0259537 100644
--- a/htdocs/app/View/Realms/index.ctp
+++ b/htdocs/app/View/Realms/index.ctp
@@ -6,61 +6,51 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Realms List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID');?></a></th>
-					<th><a><?php echo __('Name');?></a></th>				
-					<th><a><?php echo __('Disabled');?></a></th>
-					<th><a><?php echo __('Actions');?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php foreach ($realm as $realm): ?>
-				<tr>
-				<?php //print_r($realm['Realm']['Disabled']); ?>
-					<td><? echo __($realm['Realm']['ID'])?></td>
-					<td><? echo __($realm['Realm']['Name'])?></td>
-					<td><? echo __(($realm['Realm']['Disabled'] == 1) ? 'true' : 'false')?></td>
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group_edit.png"></img>',array('action' => 'edit', $realm['Realm']['ID']), array('escape' => false, 'title' => 'Edit realm'));?>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'realms','action' => 'remove', $realm['Realm']['ID']), array('escape' => false, 'title' => 'Remove realm'), 'Are you sure you want to remove this realm?');?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table.png"></img>',array('controller' => 'realm_attributes', 'action' => 'index', $realm['Realm']['ID']), array('escape' => false, 'title' => 'Realm Attributes'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group.png"></img>',array('controller' => 'realm_members', 'action' => 'index', $realm['Realm']['ID']), array('escape' => false, 'title' => 'Realm Member'));?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				<tr>
-					<td align="center" colspan="10" >
-						<?php
+		<div class="col-md-10"><legend>Realms List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID');?></a></th>
+						<th><a><?php echo __('Name');?></a></th>				
+						<th><a><?php echo __('Disabled');?></a></th>
+						<th><a><?php echo __('Actions');?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php foreach ($realm as $realm): ?>
+						<tr>
+							<td><? echo $realm['Realm']['ID'];?></td>
+							<td><? echo $realm['Realm']['Name'];?></td>
+							<td><? echo ($realm['Realm']['Disabled'] == 1) ? 'true' : 'false';?></td>
+							<td>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group_edit.png"></img>',array('action' => 'edit', $realm['Realm']['ID']), array('escape' => false, 'title' => 'Edit realm'));?>												
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'realms','action' => 'remove', $realm['Realm']['ID']), array('escape' => false, 'title' => 'Remove realm'), 'Are you sure you want to remove this realm?');?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table.png"></img>',array('controller' => 'realm_attributes', 'action' => 'index', $realm['Realm']['ID']), array('escape' => false, 'title' => 'Realm Attributes'));?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group.png"></img>',array('controller' => 'realm_members', 'action' => 'index', $realm['Realm']['ID']), array('escape' => false, 'title' => 'Realm Member'));?>
+							</td>
+						</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
 							$total = $this->Paginator->counter(array(
     							'format' => '%pages%'));
 							if($total >1)
 							{		
 								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
-						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
-						<?php
-							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+								echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
 							}
-						?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-	<!-- 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/UserAttributes/add.ctp b/htdocs/app/View/UserAttributes/add.ctp
index 97eac941..a09cb56c 100644
--- a/htdocs/app/View/UserAttributes/add.ctp
+++ b/htdocs/app/View/UserAttributes/add.ctp
@@ -6,57 +6,46 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Add User Attribute')?></legend>
-		<?php echo $this->Form->create()?>
-			<div class="form-group">
-				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name'));?>
-					</div>					
+		<div class="col-md-10"><legend><?php echo __('Add User Attribute')?></legend>
+			<?php echo $this->Form->create()?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name'));?>
+						</div>
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||==')));
-						?>
-</div>
+				<div class="form-group">
+					<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||=='))); ?>
+						</div>
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value'));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value'));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-3">
-						<?php echo $this->Form->checkbox('Disabled');?>						
-						<?php echo __('Disabled')?>					
+				<div class="form-group">
+					<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-3">
+							<?php echo $this->Form->checkbox('Disabled');?>						
+							<?php echo __('Disabled')?>					
+						</div>
 					</div>
 				</div>
-			</div>
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
-				<?php echo $this->Html->link('Cancel', array('action' => 'index', $userId), array('class' => 'btn btn-default'))?>							
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index', $userId), array('class' => 'btn btn-default'))?>							
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/UserAttributes/edit.ctp b/htdocs/app/View/UserAttributes/edit.ctp
index bdf47acb..46d47f5a 100644
--- a/htdocs/app/View/UserAttributes/edit.ctp
+++ b/htdocs/app/View/UserAttributes/edit.ctp
@@ -6,66 +6,53 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Edit User Attribute')?></legend>
-		<?php echo $this->Form->create()?>
-			<div class="form-group">
-				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 
-										'placeholder' => 'Name', 'value' => $userAttribute['UserAttribute']['Name']));?>
-					</div>					
+		<div class="col-md-10"><legend><?php echo __('Edit User Attribute')?></legend>
+			<?php echo $this->Form->create()?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name', 'value' => $userAttribute['UserAttribute']['Name']));?>
+						</div>					
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control',
-							 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=',
-																	'=~', '!~', '=*', '!*', '||=='), 'value' => $userAttribute['UserAttribute']['Operator']));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=', '=~', '!~', '=*', '!*', '||=='), 'value' => $userAttribute['UserAttribute']['Operator']));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 
-								'placeholder' => 'Value', 'value' => $userAttribute['UserAttribute']['Value']));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value', 'value' => $userAttribute['UserAttribute']['Value']));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-3">
-						<?php if($userAttribute['UserAttribute']['Disabled'] == 1) {
-								 $isCheck = true;
-							} else {
-								$isCheck = false;
-							}
-						?>
-						<?php echo $this->Form->checkbox('Disabled', array('checked' => $isCheck));?>						
-						<?php echo __('Disabled')?>					
+				<div class="form-group">
+					<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-3">
+							<?php 
+								if($userAttribute['UserAttribute']['Disabled'] == 1) {
+								 	$isCheck = true;
+								} else {
+									$isCheck = false;
+								}
+							?>
+							<?php echo $this->Form->checkbox('Disabled', array('checked' => $isCheck));?>						
+							<?php echo __('Disabled')?>					
+						</div>
 					</div>
 				</div>
-			</div>
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Save', true)?></button>
-				<?php echo $this->Html->link(__('Cancel', true), array('action' => 'index', $userAttribute['UserAttribute']['UserID']), array('class' => 'btn btn-default'))?>							
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Save', true)?></button>
+					<?php echo $this->Html->link(__('Cancel', true), array('action' => 'index', $userAttribute['UserAttribute']['UserID']), array('class' => 'btn btn-default'))?>							
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/UserAttributes/index.ctp b/htdocs/app/View/UserAttributes/index.ctp
index f5302e2f..1eded182 100644
--- a/htdocs/app/View/UserAttributes/index.ctp
+++ b/htdocs/app/View/UserAttributes/index.ctp
@@ -6,72 +6,57 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>User Attribute List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID', true);?></a></th>
-					<th><a><?php echo __('Name', true);?></a></th>
-					<th><a><?php echo __('Operator', true);?></a></th>
-					<th><a><?php echo __('Value', true);?></a></th>
-					<th><a><?php echo __('Disabled', true);?></a></th>
-					<th><a><?php echo __('Actions', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php 
-				$options=array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||==');
-				foreach ($userAttributes as $userAttribute): ?>
-				<tr>
-					<td><? echo __($userAttribute['UserAttribute']['ID'])?></td>
-					<td><? echo __($userAttribute['UserAttribute']['Name'])?></td>
-					<td><? 
-					echo __($options[$userAttribute['UserAttribute']['Operator']])?></td>
-					<td><? echo __($userAttribute['UserAttribute']['Value'])?></td>
-					<td><? echo __( ($userAttribute['UserAttribute']['Disabled'] == 1) ? 'true' : 'false')?></td>
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'user_attributes',  'action' => 'edit', $userAttribute['UserAttribute']['ID'], $userId), array('escape' => false, 'title' => 'Edit attribute'));?>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'user_attributes','action' => 'remove', $userAttribute['UserAttribute']['ID'], $userId), array('escape' => false, 'title' => 'Remove attribute'), 'Are you sure you want to remove this attribute?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				
-				<tr>
-					<td align="center" colspan="10">
-
-	<?php 
-	$total = $this->Paginator->counter(array(
-    'format' => '%pages%'));
-			if($total >1) {		
- 
-		echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
-
+		<div class="col-md-10"><legend>User Attribute List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID', true);?></a></th>
+						<th><a><?php echo __('Name', true);?></a></th>
+						<th><a><?php echo __('Operator', true);?></a></th>
+						<th><a><?php echo __('Value', true);?></a></th>
+						<th><a><?php echo __('Disabled', true);?></a></th>
+						<th><a><?php echo __('Actions', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>
 					<?php 
-					echo $this->Paginator->numbers(); ?>
-<!-- Shows the next and previous links -->
-<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-<!-- prints X of Y, where X is current page and Y is number of pages -->
-<?php
-echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-}
-?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-		<div class="form-group">			
-			<?php echo $this->Html->link(__('Add'), array('action' => 'add', $userId), array('class' => 'btn btn-primary'))?>			
-			<?php echo $this->Html->link(__('Cancel'), array('controller' => 'users', 'action' => 'index', $userId), array('class' => 'btn btn-default'))?>
-		</div>
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+					$options=array('=', ':=', '==', '+=', '!=', '<', '>', '<=', '>=','=~', '!~', '=*', '!*', '||==');
+					foreach ($userAttributes as $userAttribute): ?>
+						<tr>
+							<td><? echo $userAttribute['UserAttribute']['ID'];?></td>
+							<td><? echo $userAttribute['UserAttribute']['Name'];?></td>
+							<td><? echo $options[$userAttribute['UserAttribute']['Operator']];?></td>
+							<td><? echo $userAttribute['UserAttribute']['Value'];?></td>
+							<td><? echo ($userAttribute['UserAttribute']['Disabled'] == 1) ? 'true' : 'false';?></td>
+							<td>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'user_attributes',  'action' => 'edit', $userAttribute['UserAttribute']['ID'], $userId), array('escape' => false, 'title' => 'Edit attribute'));?>												
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'user_attributes','action' => 'remove', $userAttribute['UserAttribute']['ID'], $userId), array('escape' => false, 'title' => 'Remove attribute'), 'Are you sure you want to remove this attribute?');?>
+							</td>
+						</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10">
+							<?php 
+							$total = $this->Paginator->counter(array(
+							    'format' => '%pages%'));
+							if($total >1) {		
+								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+								echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							}
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
+			<div class="form-group">			
+				<?php echo $this->Html->link(__('Add'), array('action' => 'add', $userId), array('class' => 'btn btn-primary'))?>			
+				<?php echo $this->Html->link(__('Cancel'), array('controller' => 'users', 'action' => 'index', $userId), array('class' => 'btn btn-default'))?>
+			</div>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/UserGroups/add.ctp b/htdocs/app/View/UserGroups/add.ctp
index f44bfa5a..c7f22dc7 100644
--- a/htdocs/app/View/UserGroups/add.ctp
+++ b/htdocs/app/View/UserGroups/add.ctp
@@ -14,7 +14,6 @@ $(document).ready(function(){
 			$('#save').prop('disabled', false);
 	});  
 });
-alert(selID);
 </script>
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
@@ -34,14 +33,6 @@ alert(selID);
 				<?php echo $this->Html->link('Cancel', array('action' => 'index', $userId), array('class' => 'btn btn-default'))?>							
 			</div>
 		<?php echo $this->Form->end(); ?>
-		
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/UserGroups/index.ctp b/htdocs/app/View/UserGroups/index.ctp
index d42fc429..3c066729 100644
--- a/htdocs/app/View/UserGroups/index.ctp
+++ b/htdocs/app/View/UserGroups/index.ctp
@@ -8,53 +8,46 @@ body {
 	<div class="row"><?php echo $this->element('left_panel');?>
 		<div class="col-md-10"><legend>User Group List</legend>
 			<table class="table">
-			<thead>
-			 
-				<tr>
-					<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
-					<th><?php echo $this->Paginator->sort('Name', 'Name'); ?></th>
-					<th>Action</th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php foreach ($UserGroup as $UserGroup): ?>
-				<tr>
-					<td><? echo __($UserGroup['UserGroup']['ID'])?></td>
-					<td><? echo __($UserGroup['UserGroup']['group'])?></td>
-					<td>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'user_groups','action' => 'remove', $UserGroup['UserGroup']['ID'], $userId), array('escape' => false, 'title' => 'Remove Group'), 'Are you sure you want to remove this Group?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-			<tr>
-					<td align="center" colspan="10" >
-				<?php
-$total = $this->Paginator->counter(array(
-    'format' => '%pages%'));
-			if($total >1) {		
-					echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
-
-					<?php echo $this->Paginator->numbers(); ?>
-<!-- Shows the next and previous links -->
-<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-<!-- prints X of Y, where X is current page and Y is number of pages -->
-<?php
-echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-}
-?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-			
+				<thead>
+					<tr>
+						<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
+						<th><?php echo $this->Paginator->sort('Name', 'Name'); ?></th>
+						<th>Action</th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php foreach ($UserGroup as $UserGroup): ?>
+						<tr>
+							<td><? echo $UserGroup['UserGroup']['ID'];?></td>
+							<td><? echo $UserGroup['UserGroup']['group'];?></td>
+							<td>												
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'user_groups','action' => 'remove', $UserGroup['UserGroup']['ID'], $userId), array('escape' => false, 'title' => 'Remove Group'), 'Are you sure you want to remove this Group?');?>
+							</td>
+						</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
+							$total = $this->Paginator->counter(array(
+							    'format' => '%pages%'));
+							if($total >1) {		
+								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+								echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							}
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>		
 		</div>
 		<div class="form-group">			
 			<?php echo $this->Html->link(__('Add Group'), array('action' => 'add', $userId), array('class' => 'btn btn-primary'))?>			
 			<?php echo $this->Html->link(__('Cancel'), array('controller'=>'users','action' => 'index', $userId), array('class' => 'btn btn-default'))?>
 		</div>
-
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/UserLogs/index.ctp b/htdocs/app/View/UserLogs/index.ctp
index 6d69c7d7..4b5cedcc 100644
--- a/htdocs/app/View/UserLogs/index.ctp
+++ b/htdocs/app/View/UserLogs/index.ctp
@@ -3,22 +3,20 @@ body {
 	padding-top: 50px;
 }
 #main{
-//background-color:red;
-border:1px #DFE8F6 solid;
+	border:1px #DFE8F6 solid;
 }
 #search{
-background-color:#DFE8F6;
-width:400px;
-float:left;
-border:1px #C8D1D4 solid;
-height:180px;
+	background-color:#DFE8F6;
+	width:400px;
+	float:left;
+	border:1px #C8D1D4 solid;
+	height:180px;
 }
 #topuploags{
-//background-color:pink;
-overflow-y: scroll;
-height:180px;
-padding-left:5px;
-border:1px #DFE8F6 solid;
+	overflow-y: scroll;
+	height:180px;
+	padding-left:5px;
+	border:1px #DFE8F6 solid;
 }
 </style>
 <div style="padding: 15px 15px">
@@ -46,7 +44,6 @@ border:1px #DFE8F6 solid;
 									?>
 								</div>					
 							</div>
-							
 							<div class="row">
 								<div class="col-md-4 input-group" style="float:left;width:100px;margin-right:0px;margin-left: 18px;">
 									<?php
@@ -60,12 +57,10 @@ border:1px #DFE8F6 solid;
 										$dayData[$number] = $number;
 									}
 									}
-									
 									echo $this->Form->input('dayData', array('label' => false, 'class' => 'form-control', 'type' => 'select', "options" =>$dayData,'selected' => $month));
 									?>
 								</div>					
 							</div>
-							
 						</div>
 						<div class="form-group">
 							<button type="submit" class="btn btn-primary" style="margin-left:100px"><?php echo __('Search')?></button>							
@@ -73,23 +68,46 @@ border:1px #DFE8F6 solid;
 					<?php echo $this->Form->end(); ?>
 				</div>
 				<div id="topuploags">
-				<?php $userLog1 = array_values($userLog);
-				$totalvalue1 = '';
-				$totalvalue2 = ''; ?>
-					<?php foreach ($userLog as $userLog){
-						if($userLog['topups']['Type'] == '1') {
-							$totalvalue1[] = $userLog['topups']['Value'].",";
-						} else { $totalvalue1[] = ''; }
-						if($userLog['topups']['Type'] == '2'){
-							$totalvalue2[] = $userLog['topups']['Value'].",";
-						} else { $totalvalue2[] = ''; }
-					}
-					if($totalvalue1 != ''){
-						$tValue = array_sum($totalvalue1);
-					} else { $tValue = 0; }
-					if($totalvalue2 != ''){
-						$uValue = array_sum($totalvalue2);
-					} else { $uValue = 0; }
+					<?php 
+						$userLog1 = array_values($userLog);
+						$totalvalue1 = '';
+						$totalvalue2 = '';
+						
+						foreach ($userLog as $userLog)
+						{
+							if($userLog['topups']['Type'] == '1')
+							{
+								$totalvalue1[] = $userLog['topups']['Value'].",";
+							}
+							else
+							{
+								$totalvalue1[] = '';
+							}
+							if($userLog['topups']['Type'] == '2')
+							{
+								$totalvalue2[] = $userLog['topups']['Value'].",";
+							}
+							else
+							{
+								$totalvalue2[] = '';
+							}
+						}
+						if($totalvalue1 != '')
+						{
+							$tValue = array_sum($totalvalue1);
+						}
+						else
+						{
+							$tValue = 0;
+						}
+						if($totalvalue2 != '')
+						{
+							$uValue = array_sum($totalvalue2);
+						}
+						else
+						{
+							$uValue = 0;
+						}
 					?>
 					<div>Traffic:</div>
 					<div>Cap: Prepaid</div>
@@ -147,38 +165,38 @@ border:1px #DFE8F6 solid;
 								$outputMbyte = $AcctOutputOctets + $AcctOutputGigawords;
 							?>
 							<tr>
-								<td><? echo __($acc['UserLog']['EventTimestamp'])?></td>
-								<td><? echo __($acc['UserLog']['ServiceType'])?></td>
-								<td><? echo __($acc['UserLog']['FramedProtocol'])?></td>
-								<td><? echo __($acc['UserLog']['CallingStationID'])?></td>
-								<td><? echo __($inputMbyte)?></td>
-								<td><? echo __($outputMbyte)?></td>
-								<td><? echo __($acc['UserLog']['AcctSessionTime']/60)?></td>
-								<td><? echo __($acc['UserLog']['AcctTerminateCause'])?></td>
+								<td><? echo $acc['UserLog']['EventTimestamp'];?></td>
+								<td><? echo $acc['UserLog']['ServiceType'];?></td>
+								<td><? echo $acc['UserLog']['FramedProtocol'];?></td>
+								<td><? echo $acc['UserLog']['CallingStationID'];?></td>
+								<td><? echo $inputMbyte;?></td>
+								<td><? echo $outputMbyte;?></td>
+								<td><? echo ($acc['UserLog']['AcctSessionTime']/60)?></td>
+								<td><? echo $acc['UserLog']['AcctTerminateCause'];?></td>
 							</tr>
 							<? endforeach; ?>
 							<tr>
-					<td align="center" colspan="10" >
-						<?php
-							$total = $this->Paginator->counter(array(
-    							'format' => '%pages%'));
-							if($total >1)
-							{		
-								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
-						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
-						<?php
-							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-							}
-						?>
-					</td>
-				</tr>
+								<td align="center" colspan="10" >
+									<?php
+									$total = $this->Paginator->counter(array(
+	    								'format' => '%pages%'));
+									if($total >1)
+									{		
+										echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
+									?>
+									<?php echo $this->Paginator->numbers(); ?>
+									<!-- Shows the next and previous links -->
+									<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+									<!-- prints X of Y, where X is current page and Y is number of pages -->
+									<?php
+										echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+									}
+									?>
+								</td>
+							</tr>
 						</tbody>
 					</table>
 				</div>
-			</div>
+		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/UserTopups/add.ctp b/htdocs/app/View/UserTopups/add.ctp
index 2a52e5a2..26ca6f58 100644
--- a/htdocs/app/View/UserTopups/add.ctp
+++ b/htdocs/app/View/UserTopups/add.ctp
@@ -3,95 +3,82 @@ body {
 	padding-top: 50px;
 }
 </style>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
+<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
 <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
 <link rel="stylesheet" href="/resources/demos/style.css">
- <script>
+<script>
 $(function() {
-var date = new Date(), y = date.getFullYear(), m = date.getMonth();
-var firstDay = new Date(y, m, 1);
-var lastDay = new Date(y, m + 1, 1);
-
-$('#datepickerFrom').datepicker({
-	defaultDate:firstDay,
-	dateFormat:'yy-mm-dd',
-    beforeShowDay: function (date) {
-      //getDate() returns the day (0-31)
-       if (date.getDate() == 1) {
-           return [true, ''];
-       }
-       return [false, ''];
-
-    }
-});
-$('#datepickerTo').datepicker({
-	minDate: lastDay,
-	dateFormat:'yy-mm-dd',
-	 beforeShowDay: function (date) {
-      //getDate() returns the day (0-31)
-       if (date.getDate() == 1) {
-           return [true, ''];
-       }
-       return [false, ''];
-
-    }
-});
+	var date = new Date(), y = date.getFullYear(), m = date.getMonth();
+	var firstDay = new Date(y, m, 1);
+	var lastDay = new Date(y, m + 1, 1);
+	
+	$('#datepickerFrom').datepicker({
+		defaultDate:firstDay,
+		dateFormat:'yy-mm-dd',
+		beforeShowDay: function (date) {
+		  //getDate() returns the day (0-31)
+		   if (date.getDate() == 1) {
+			   return [true, ''];
+		   }
+		   return [false, ''];
+		}
+	});
+	$('#datepickerTo').datepicker({
+		minDate: lastDay,
+		dateFormat:'yy-mm-dd',
+		 beforeShowDay: function (date) {
+		  //getDate() returns the day (0-31)
+		   if (date.getDate() == 1) {
+			   return [true, ''];
+		   }
+		   return [false, ''];
+		}
+	});
 });
-
 </script>
+
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Add User Topup')?></legend>
-		<?php echo $this->Form->create()?>
-			<div class="form-group">
-				<?php echo $this->Form->label('Type', 'Type', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Type', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('1'=>'Traffic', '2'=>'Uptime')));?>
-					</div>					
+		<div class="col-md-10"><legend><?php echo __('Add User Topup')?></legend>
+			<?php echo $this->Form->create()?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Type', 'Type', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Type', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('1'=>'Traffic', '2'=>'Uptime')));?>
+						</div>
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
+				<div class="form-group">
+					<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
 							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value', 'type' => 'text'));?>
-</div>
+						</div>
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Valid From', 'Valid From', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-					<?php echo $this->Form->input('valid_from', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerFrom', 'readonly'=>'readonly','value' => date("Y-m-01")));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Valid From', 'Valid From', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('valid_from', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerFrom', 'readonly'=>'readonly','value' => date("Y-m-01")));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Valid To', 'Valid To', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-										<?php echo $this->Form->input('valid_to', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerTo', 'readonly'=>'readonly','value' => date("Y-m-01", strtotime('+1 month'))));?>
-
+				<div class="form-group">
+					<?php echo $this->Form->label('Valid To', 'Valid To', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('valid_to', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerTo', 'readonly'=>'readonly','value' => date("Y-m-01", strtotime('+1 month'))));?>
+						</div>
 					</div>
+				</div>	
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index', $userId), array('class' => 'btn btn-default'))?>							
 				</div>
-			</div>
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
-				<?php echo $this->Html->link('Cancel', array('action' => 'index', $userId), array('class' => 'btn btn-default'))?>							
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/UserTopups/edit.ctp b/htdocs/app/View/UserTopups/edit.ctp
index 5cc2edc1..fbae9f4b 100644
--- a/htdocs/app/View/UserTopups/edit.ctp
+++ b/htdocs/app/View/UserTopups/edit.ctp
@@ -3,11 +3,11 @@ body {
 	padding-top: 50px;
 }
 </style>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
+<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
 <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
 <link rel="stylesheet" href="/resources/demos/style.css">
- <script>
+<script>
 $(function() {
 var date = new Date(), y = date.getFullYear(), m = date.getMonth();
 var firstDay = new Date(y, m, 1);
@@ -22,7 +22,6 @@ $('#datepickerFrom').datepicker({
            return [true, ''];
        }
        return [false, ''];
-
     }
 });
 $('#datepickerTo').datepicker({
@@ -34,64 +33,52 @@ $('#datepickerTo').datepicker({
            return [true, ''];
        }
        return [false, ''];
-
     }
 });
 });
-
 </script>
+
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Edit User Topup')?></legend>
-		<?php echo $this->Form->create()?>
-			<div class="form-group">
-				<?php echo $this->Form->label('Type', 'Type', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Type', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('1'=>'Traffic', '2'=>'Uptime'),'value' => $topup['UserTopup']['Type']));?>
-					</div>					
+		<div class="col-md-10"><legend><?php echo __('Edit User Topup')?></legend>
+			<?php echo $this->Form->create()?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Type', 'Type', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Type', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => array('1'=>'Traffic', '2'=>'Uptime'),'value' => $topup['UserTopup']['Type']));?>
+						</div>					
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
+				<div class="form-group">
+					<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
 							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value','value' => $topup['UserTopup']['Value'], 'type' => 'text'));?>
-</div>
+						</div>
+					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Valid From', 'Valid From', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-					<?php echo $this->Form->input('valid_from', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerFrom', 'readonly'=>'readonly','value' => date("Y-m-d",strtotime($topup['UserTopup']['ValidFrom']))));?>
+				<div class="form-group">
+					<?php echo $this->Form->label('Valid From', 'Valid From', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('valid_from', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerFrom', 'readonly'=>'readonly','value' => date("Y-m-d",strtotime($topup['UserTopup']['ValidFrom']))));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Valid To', 'Valid To', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-4 input-group">
-										<?php echo $this->Form->input('valid_to', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerTo', 'readonly'=>'readonly','value' => date("Y-m-d",strtotime($topup['UserTopup']['ValidTo']))));?>
-
+				<div class="form-group">
+					<?php echo $this->Form->label('Valid To', 'Valid To', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('valid_to', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerTo', 'readonly'=>'readonly','value' => date("Y-m-d",strtotime($topup['UserTopup']['ValidTo']))));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
-				<?php echo $this->Html->link('Cancel', array('action' => 'index', $userId), array('class' => 'btn btn-default'))?>							
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index', $userId), array('class' => 'btn btn-default'))?>							
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/UserTopups/index.ctp b/htdocs/app/View/UserTopups/index.ctp
index 457e3b00..08303d39 100644
--- a/htdocs/app/View/UserTopups/index.ctp
+++ b/htdocs/app/View/UserTopups/index.ctp
@@ -8,61 +8,53 @@ body {
 	<div class="row"><?php echo $this->element('left_panel');?>
 		<div class="col-md-10"><legend>User Topups List</legend>
 			<table class="table">
-			<thead>
-			 
-				<tr>
-					<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
-					<th><?php echo $this->Paginator->sort('Type', 'Type'); ?></th>
-					<th><?php echo $this->Paginator->sort('Value', 'Value'); ?></th>
-					<th><a><?php echo __('Valid From'); ?></a></th>
-					<th><a><?php echo __('Valid To'); ?></a></th>
-					<th><a><?php echo __('Action'); ?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php foreach ($topups as $topup): ?>
-				<tr>
-					<td><? echo __($topup['UserTopup']['ID'])?></td>
-					<td><? echo __($topup['UserTopup']['Type'])?></td>
-					<td><? echo __($topup['UserTopup']['Value'])?></td>
-					<td><? echo __(date("Y-m-d", strtotime($topup['UserTopup']['ValidFrom']))); ?></td>
-					<td><? echo __(date("Y-m-d", strtotime($topup['UserTopup']['ValidTo']))) ; ?></td>
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'user_topups',  'action' => 'edit', $topup['UserTopup']['ID'], $userId), array('escape' => false, 'title' => 'Edit attribute'));?>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'user_topups','action' => 'remove', $topup['UserTopup']['ID'], $userId), array('escape' => false, 'title' => 'Remove attribute'), 'Are you sure you want to remove this attribute?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				
-				<tr>
-					<td align="center" colspan="10" >
-				<?php
-$total = $this->Paginator->counter(array(
-    'format' => '%pages%'));
-			if($total >1) {		
-					echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
-
-					<?php echo $this->Paginator->numbers(); ?>
-<!-- Shows the next and previous links -->
-<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-<!-- prints X of Y, where X is current page and Y is number of pages -->
-<?php
-echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-}
-?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-			
+				<thead>
+					<tr>
+						<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
+						<th><?php echo $this->Paginator->sort('Type', 'Type'); ?></th>
+						<th><?php echo $this->Paginator->sort('Value', 'Value'); ?></th>
+						<th><a><?php echo __('Valid From'); ?></a></th>
+						<th><a><?php echo __('Valid To'); ?></a></th>
+						<th><a><?php echo __('Action'); ?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php foreach ($topups as $topup): ?>
+						<tr>
+							<td><? echo $topup['UserTopup']['ID'];?></td>
+							<td><? echo ($topup['UserTopup']['Type'] == 1) ? 'Traffic' : 'Uptime';?></td>
+							<td><? echo $topup['UserTopup']['Value'];?></td>
+							<td><? echo date("Y-m-d", strtotime($topup['UserTopup']['ValidFrom'])); ?></td>
+							<td><? echo date("Y-m-d", strtotime($topup['UserTopup']['ValidTo'])); ?></td>
+							<td>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'user_topups',  'action' => 'edit', $topup['UserTopup']['ID'], $userId), array('escape' => false, 'title' => 'Edit topup'));?>												
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'user_topups','action' => 'remove', $topup['UserTopup']['ID'], $userId), array('escape' => false, 'title' => 'Remove topup'), 'Are you sure you want to remove this topup?');?>
+							</td>
+						</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
+							$total = $this->Paginator->counter(array(
+							    'format' => '%pages%'));
+							if($total >1) {		
+								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							}
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
 		</div>
 		<div class="form-group">			
 			<?php echo $this->Html->link(__('Add Topups'), array('action' => 'add', $userId), array('class' => 'btn btn-primary'))?>			
 			<?php echo $this->Html->link(__('Cancel'), array('controller'=>'users','action' => 'index', $userId), array('class' => 'btn btn-default'))?>
 		</div>
-
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Users/add.ctp b/htdocs/app/View/Users/add.ctp
index 18e500af..1f3efdfb 100644
--- a/htdocs/app/View/Users/add.ctp
+++ b/htdocs/app/View/Users/add.ctp
@@ -6,41 +6,30 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>Add User</legend>
-		<?php echo $this->Form->create()?>			
-			<div class="form-group">
-				<?php echo $this->Form->label('Username', 'Username', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Username', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Username'));?>
+		<div class="col-md-10"><legend>Add User</legend>
+			<?php echo $this->Form->create()?>			
+				<div class="form-group">
+					<?php echo $this->Form->label('Username', 'Username', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Username', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Username'));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-3">
-						<?php echo $this->Form->checkbox('Disabled');?>						
-						<?php echo __('Disabled')?>					
+				<div class="form-group">
+					<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-3">
+							<?php echo $this->Form->checkbox('Disabled');?>						
+							<?php echo __('Disabled')?>					
+						</div>
 					</div>
 				</div>
-			</div>
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
-				<!--<a class="btn btn-default" href="/users/index" role="button"><?php echo __('Cancel')?></a>-->
-				<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Users/edit.ctp b/htdocs/app/View/Users/edit.ctp
index bda98ff8..317f0039 100644
--- a/htdocs/app/View/Users/edit.ctp
+++ b/htdocs/app/View/Users/edit.ctp
@@ -6,40 +6,30 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Edit User')?></legend>
-		<?php echo $this->Form->create()?>			
-			<div class="form-group">
-				<?php echo $this->Form->label('Username', 'Username', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Username', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Username', 'value' => $user['User']['Username']));?>
+		<div class="col-md-10"><legend><?php echo __('Edit User')?></legend>
+			<?php echo $this->Form->create()?>			
+				<div class="form-group">
+					<?php echo $this->Form->label('Username', 'Username', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Username', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Username', 'value' => $user['User']['Username']));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
-				<div class="row">
-					<div class="col-md-3">
-						<?php echo $this->Form->checkbox('Disabled', array( 'checked' => (($user['User']['Disabled'] == '1') ? true : false)));?>						
-						<?php echo __('Disabled')?>					
+				<div class="form-group">
+					<?php echo $this->Form->label('Disabled', 'Disabled', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-3">
+							<?php echo $this->Form->checkbox('Disabled', array( 'checked' => (($user['User']['Disabled'] == '1') ? true : false)));?>						
+							<?php echo __('Disabled')?>					
+						</div>
 					</div>
 				</div>
-			</div>
-			
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
-				<a class="btn btn-default" href="<?php echo BASE_URL; ?>/users/index" role="button"><?php echo __('Cancel')?></a>				
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	<!-- 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
+					<a class="btn btn-default" href="<?php echo BASE_URL; ?>/users/index" role="button"><?php echo __('Cancel')?></a>				
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/Users/index.ctp b/htdocs/app/View/Users/index.ctp
index dabdb5aa..af27e66a 100644
--- a/htdocs/app/View/Users/index.ctp
+++ b/htdocs/app/View/Users/index.ctp
@@ -6,63 +6,51 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend>User List</legend>
-		<table class="table">
-			<thead>
-			 
-				<tr>
-					<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
-					<th><?php echo $this->Paginator->sort('Username', 'Username'); ?></th>
-					<th><a><?php echo __('Disabled', true);?></a></th>					
-					<th><a><?php echo __('Actions', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php foreach ($users as $user): ?>
-				<tr>
-					<td><? echo __($user['User']['ID'])?></td>
-					<td><? echo __($user['User']['Username'])?></td>
-					<td><? echo __( ($user['User']['Disabled'] == 1) ? 'true' : 'false')?></td>
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/user_edit.png"></img>',array('action' => 'edit', $user['User']['ID']), array('escape' => false, 'title' => 'Edit user'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/user_delete.png"></img>',array('action' => 'remove', $user['User']['ID']), array('escape' => false, 'title' => 'Remove user'), 'Are you sure you want to remove this user?');?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table.png"></img>',array('controller' => 'user_attributes', 'action' => 'index', $user['User']['ID']), array('escape' => false, 'title' => 'User attributes'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/page_white_text.png"></img>',array('controller' => 'user_logs', 'action' => 'index', $user['User']['ID']), array('escape' => false, 'title' => 'User logs'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group.png"></img>',array('controller' => 'user_groups', 'action' => 'index', $user['User']['ID']), array('escape' => false, 'title' => 'User groups'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/chart_bar.png"></img>',array('controller' => 'user_topups', 'action' => 'index', $user['User']['ID']), array('escape' => false, 'title' => 'User topups'));?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				
-				<tr>
-					<td align="center" colspan="10" >
-				<?php
-$total = $this->Paginator->counter(array(
-    'format' => '%pages%'));
-			if($total >1) {		
-					echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
-
-					<?php echo $this->Paginator->numbers(); ?>
-<!-- Shows the next and previous links -->
-<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-<!-- prints X of Y, where X is current page and Y is number of pages -->
-<?php
-echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-}
-?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-	 	<!--<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+		<div class="col-md-10"><legend>User List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
+						<th><?php echo $this->Paginator->sort('Username', 'Username'); ?></th>
+						<th><a><?php echo __('Disabled', true);?></a></th>					
+						<th><a><?php echo __('Actions', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php foreach ($users as $user): ?>
+						<tr>
+							<td><? echo $user['User']['ID'];?></td>
+							<td><? echo $user['User']['Username'];?></td>
+							<td><? echo ($user['User']['Disabled'] == 1) ? 'true' : 'false';?></td>
+							<td>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/user_edit.png"></img>',array('action' => 'edit', $user['User']['ID']), array('escape' => false, 'title' => 'Edit user'));?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/user_delete.png"></img>',array('action' => 'remove', $user['User']['ID']), array('escape' => false, 'title' => 'Remove user'), 'Are you sure you want to remove this user?');?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table.png"></img>',array('controller' => 'user_attributes', 'action' => 'index', $user['User']['ID']), array('escape' => false, 'title' => 'User attributes'));?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/page_white_text.png"></img>',array('controller' => 'user_logs', 'action' => 'index', $user['User']['ID']), array('escape' => false, 'title' => 'User logs'));?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group.png"></img>',array('controller' => 'user_groups', 'action' => 'index', $user['User']['ID']), array('escape' => false, 'title' => 'User groups'));?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/chart_bar.png"></img>',array('controller' => 'user_topups', 'action' => 'index', $user['User']['ID']), array('escape' => false, 'title' => 'User topups'));?>
+							</td>
+						</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
+							$total = $this->Paginator->counter(array(
+							    'format' => '%pages%'));
+							if($total >1) {		
+								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+								echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							}
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/WispLocationMembers/index.ctp b/htdocs/app/View/WispLocationMembers/index.ctp
index f55ec17e..c43fa2ef 100644
--- a/htdocs/app/View/WispLocationMembers/index.ctp
+++ b/htdocs/app/View/WispLocationMembers/index.ctp
@@ -6,55 +6,44 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('wisp_left_panel');?>
-	
-	<div class="col-md-10"><legend>Wisp Location Member List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID', true);?></a></th>
-					<th><a><?php echo __('UserName', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php foreach ($wispLocationMember as $wMember): ?>
-				<tr>
-					<td><? echo __($wMember['WispLocationMember']['ID'])?></td>
-					<td><? echo __($wMember['WispLocationMember']['userName'])?></td>
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'WispLocation_Members','action' => 'remove', $wMember['WispLocationMember']['ID'], $LocationID), array('escape' => false, 'title' => 'Remove member'), 'Are you sure you want to remove this member?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				
-				<tr>
-					<td align="center" colspan="10">
-
-	<?php 
-	$total = $this->Paginator->counter(array(
-    'format' => '%pages%'));
-			if($total >1) {		
- 
-		echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
-
-					<?php 
-					echo $this->Paginator->numbers(); ?>
-<!-- Shows the next and previous links -->
-<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-<!-- prints X of Y, where X is current page and Y is number of pages -->
-<?php
-echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-}
-?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-	 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts
+		<div class="col-md-10"><legend>Wisp Location Member List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID', true);?></a></th>
+						<th><a><?php echo __('UserName', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>	
+					<?php foreach ($wispLocationMember as $wMember): ?>
+						<tr>
+							<td><? echo $wMember['WispLocationMember']['ID'];?></td>
+							<td><? echo $wMember['WispLocationMember']['userName'];?></td>
+							<td>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'WispLocation_Members','action' => 'remove', $wMember['WispLocationMember']['ID'], $LocationID), array('escape' => false, 'title' => 'Remove member'), 'Are you sure you want to remove this member?');?>
+							</td>
+						</tr>
+					<? endforeach; ?>	
+					<tr>
+						<td align="center" colspan="10">
+							<?php 
+							$total = $this->Paginator->counter(array(
+								'format' => '%pages%'));
+							if($total >1) {
+								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
+							<?php 
+							echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							}
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
 		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/WispLocations/add.ctp b/htdocs/app/View/WispLocations/add.ctp
index 63a30cbb..41eae4eb 100644
--- a/htdocs/app/View/WispLocations/add.ctp
+++ b/htdocs/app/View/WispLocations/add.ctp
@@ -6,31 +6,21 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('wisp_left_panel');?>
-	
-	<div class="col-md-10"><legend>Add Wisp Location</legend>
-		<?php echo $this->Form->create()?>			
-			<div class="form-group">
-				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name'));?>
+		<div class="col-md-10"><legend>Add Wisp Location</legend>
+			<?php echo $this->Form->create()?>			
+				<div class="form-group">
+					<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Name'));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
-				<!--<a class="btn btn-default" href="/users/index" role="button"><?php echo __('Cancel')?></a>-->
-				<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	<!-- 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/WispLocations/edit.ctp b/htdocs/app/View/WispLocations/edit.ctp
index f53880b0..630919fb 100644
--- a/htdocs/app/View/WispLocations/edit.ctp
+++ b/htdocs/app/View/WispLocations/edit.ctp
@@ -6,30 +6,21 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('wisp_left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Edit Wisp Location')?></legend>
-		<?php echo $this->Form->create()?>			
-			<div class="form-group">
-				<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Username', 'value' => $location['WispLocation']['Name']));?>
+		<div class="col-md-10"><legend><?php echo __('Edit Wisp Location')?></legend>
+			<?php echo $this->Form->create()?>			
+				<div class="form-group">
+					<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label'));?>								
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Username', 'value' => $location['WispLocation']['Name']));?>
+						</div>
 					</div>
 				</div>
-			</div>
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
-				<a class="btn btn-default" href="<?php echo BASE_URL; ?>/WispLocations/index" role="button"><?php echo __('Cancel')?></a>				
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	<!-- 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
+					<a class="btn btn-default" href="<?php echo BASE_URL; ?>/WispLocations/index" role="button"><?php echo __('Cancel')?></a>				
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/WispLocations/index.ctp b/htdocs/app/View/WispLocations/index.ctp
index f59653e7..6f39f01d 100644
--- a/htdocs/app/View/WispLocations/index.ctp
+++ b/htdocs/app/View/WispLocations/index.ctp
@@ -6,57 +6,46 @@ body {
 
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('wisp_left_panel');?>
-	
-	<div class="col-md-10"><legend>Wisp Location List</legend>
-		<table class="table">
-			<thead>
-				<tr>
-					<th><a><?php echo __('ID', true);?></a></th>
-					<th><a><?php echo __('Name', true);?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php foreach ($wispLocation as $wLocation): ?>
-				<tr>
-					<td><? echo __($wLocation['WispLocation']['ID'])?></td>
-					<td><? echo __($wLocation['WispLocation']['Name'])?></td>
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'Wisp_Locations',  'action' => 'edit', $wLocation['WispLocation']['ID']), array('escape' => false, 'title' => 'Edit location'));?>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'Wisp_Locations','action' => 'remove', $wLocation['WispLocation']['ID']), array('escape' => false, 'title' => 'Remove location'), 'Are you sure you want to remove this locations?');?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/user.png"></img>',array('controller' => 'WispLocation_Members',  'action' => 'index', $wLocation['WispLocation']['ID']), array('escape' => false, 'title' => 'Location Member'));?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				
-				<tr>
-					<td align="center" colspan="10">
-
-	<?php 
-	$total = $this->Paginator->counter(array(
-    'format' => '%pages%'));
-			if($total >1) {		
- 
-		echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
-
-					<?php 
-					echo $this->Paginator->numbers(); ?>
-<!-- Shows the next and previous links -->
-<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-<!-- prints X of Y, where X is current page and Y is number of pages -->
-<?php
-echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-}
-?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-	<!-- 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+		<div class="col-md-10"><legend>Wisp Location List</legend>
+			<table class="table">
+				<thead>
+					<tr>
+						<th><a><?php echo __('ID', true);?></a></th>
+						<th><a><?php echo __('Name', true);?></a></th>
+					</tr>
+				</thead>
+				<tbody>	
+					<?php foreach ($wispLocation as $wLocation): ?>
+						<tr>
+							<td><? echo $wLocation['WispLocation']['ID'];?></td>
+							<td><? echo $wLocation['WispLocation']['Name'];?></td>
+							<td>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'Wisp_Locations',  'action' => 'edit', $wLocation['WispLocation']['ID']), array('escape' => false, 'title' => 'Edit location'));?>												
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'Wisp_Locations','action' => 'remove', $wLocation['WispLocation']['ID']), array('escape' => false, 'title' => 'Remove location'), 'Are you sure you want to remove this locations?');?>
+								<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/user.png"></img>',array('controller' => 'WispLocation_Members',  'action' => 'index', $wLocation['WispLocation']['ID']), array('escape' => false, 'title' => 'Location Member'));?>
+							</td>
+						</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10">
+							<?php 
+							$total = $this->Paginator->counter(array(
+							    'format' => '%pages%'));
+							if($total >1) {
+								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
+							<?php 
+							echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							}
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
 		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/WispUserLogs/index.ctp b/htdocs/app/View/WispUserLogs/index.ctp
index b9c2a99a..36f0f5d7 100644
--- a/htdocs/app/View/WispUserLogs/index.ctp
+++ b/htdocs/app/View/WispUserLogs/index.ctp
@@ -3,22 +3,20 @@ body {
 	padding-top: 50px;
 }
 #main{
-//background-color:red;
-border:1px #DFE8F6 solid;
+	border:1px #DFE8F6 solid;
 }
 #search{
-background-color:#DFE8F6;
-width:400px;
-float:left;
-border:1px #C8D1D4 solid;
-height:180px;
+	background-color:#DFE8F6;
+	width:400px;
+	float:left;
+	border:1px #C8D1D4 solid;
+	height:180px;
 }
 #topuploags{
-//background-color:pink;
-overflow-y: scroll;
-height:180px;
-padding-left:5px;
-border:1px #DFE8F6 solid;
+	overflow-y: scroll;
+	height:180px;
+	padding-left:5px;
+	border:1px #DFE8F6 solid;
 }
 </style>
 <div style="padding: 15px 15px">
@@ -46,7 +44,6 @@ border:1px #DFE8F6 solid;
 									?>
 								</div>					
 							</div>
-							
 							<div class="row">
 								<div class="col-md-4 input-group" style="float:left;width:100px;margin-right:0px;margin-left: 18px;">
 									<?php
@@ -55,17 +52,15 @@ border:1px #DFE8F6 solid;
 									$dayData = array();
 									foreach(range(1, 12) as $number){
 										if($number <= 9){
-    									$dayData['0'.$number] = '0'.$number;
-  									} else {
-										$dayData[$number] = $number;
-									}
-									}
-									
+    										$dayData['0'.$number] = '0'.$number;
+	  									} else {
+											$dayData[$number] = $number;
+										}
+									}						
 									echo $this->Form->input('dayData', array('label' => false, 'class' => 'form-control', 'type' => 'select', "options" =>$dayData,'selected' => $month));
 									?>
 								</div>					
 							</div>
-							
 						</div>
 						<div class="form-group">
 							<button type="submit" class="btn btn-primary" style="margin-left:100px"><?php echo __('Search')?></button>							
@@ -73,23 +68,46 @@ border:1px #DFE8F6 solid;
 					<?php echo $this->Form->end(); ?>
 				</div>
 				<div id="topuploags">
-				<?php $userLog1 = array_values($userLog);
-				$totalvalue1 = '';
-				$totalvalue2 = ''; ?>
-					<?php foreach ($userLog as $userLog){
-						if($userLog['topups']['Type'] == '1') {
-							$totalvalue1[] = $userLog['topups']['Value'].",";
-						} else { $totalvalue1[] = ''; }
-						if($userLog['topups']['Type'] == '2'){
-							$totalvalue2[] = $userLog['topups']['Value'].",";
-						} else { $totalvalue2[] = ''; }
-					}
-					if($totalvalue1 != ''){
-						$tValue = array_sum($totalvalue1);
-					} else { $tValue = 0; }
-					if($totalvalue2 != ''){
-						$uValue = array_sum($totalvalue2);
-					} else { $uValue = 0; }
+					<?php
+						$userLog1 = array_values($userLog);
+						$totalvalue1 = '';
+						$totalvalue2 = '';
+					
+						foreach ($userLog as $userLog)
+						{
+							if($userLog['topups']['Type'] == '1')
+							{
+								$totalvalue1[] = $userLog['topups']['Value'].",";
+							}
+							else
+							{
+								$totalvalue1[] = '';
+							}
+							if($userLog['topups']['Type'] == '2')
+							{
+								$totalvalue2[] = $userLog['topups']['Value'].",";
+							}
+							else
+							{
+								$totalvalue2[] = '';
+							}
+						}
+						if($totalvalue1 != '')
+						{
+							$tValue = array_sum($totalvalue1);
+						}
+						else
+						{
+							$tValue = 0;
+						}
+						if($totalvalue2 != '')
+						{
+							$uValue = array_sum($totalvalue2);
+						}
+						else
+						{
+							$uValue = 0;
+						}
 					?>
 					<div>Traffic:</div>
 					<div>Cap: Prepaid</div>
@@ -138,44 +156,44 @@ border:1px #DFE8F6 solid;
 						</thead>
 						<tbody>
 							<?php foreach ($userAcc as $acc): 
-								$AcctInputOctets = $acc['UserLog']['AcctInputOctets'] / 1024  /1024;
-								$AcctInputGigawords = $acc['UserLog']['AcctInputGigawords'] * 4096;
+								$AcctInputOctets = $acc['WispUserLog']['AcctInputOctets'] / 1024  /1024;
+								$AcctInputGigawords = $acc['WispUserLog']['AcctInputGigawords'] * 4096;
 								$inputMbyte = $AcctInputOctets + $AcctInputGigawords;
 								
-								$AcctOutputOctets = $acc['UserLog']['AcctOutputOctets'] / 1024  /1024;
-								$AcctOutputGigawords = $acc['UserLog']['AcctOutputGigawords'] * 4096;
+								$AcctOutputOctets = $acc['WispUserLog']['AcctOutputOctets'] / 1024  /1024;
+								$AcctOutputGigawords = $acc['WispUserLog']['AcctOutputGigawords'] * 4096;
 								$outputMbyte = $AcctOutputOctets + $AcctOutputGigawords;
 							?>
 							<tr>
-								<td><? echo __($acc['UserLog']['EventTimestamp'])?></td>
-								<td><? echo __($acc['UserLog']['ServiceType'])?></td>
-								<td><? echo __($acc['UserLog']['FramedProtocol'])?></td>
-								<td><? echo __($acc['UserLog']['CallingStationID'])?></td>
-								<td><? echo __($inputMbyte)?></td>
-								<td><? echo __($outputMbyte)?></td>
-								<td><? echo __($acc['UserLog']['AcctSessionTime']/60)?></td>
-								<td><? echo __($acc['UserLog']['AcctTerminateCause'])?></td>
+								<td><? echo $acc['WispUserLog']['EventTimestamp'];?></td>
+								<td><? echo $acc['WispUserLog']['ServiceType'];?></td>
+								<td><? echo $acc['WispUserLog']['FramedProtocol'];?></td>
+								<td><? echo $acc['WispUserLog']['CallingStationID'];?></td>
+								<td><? echo $inputMbyte;?></td>
+								<td><? echo $outputMbyte;?></td>
+								<td><? echo $acc['WispUserLog']['AcctSessionTime']/60;?></td>
+								<td><? echo $acc['WispUserLog']['AcctTerminateCause'];?></td>
 							</tr>
 							<? endforeach; ?>
 							<tr>
-					<td align="center" colspan="10" >
-						<?php
-							$total = $this->Paginator->counter(array(
-    							'format' => '%pages%'));
-							if($total >1)
-							{		
-								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
-						?>
-								<?php echo $this->Paginator->numbers(); ?>
-								<!-- Shows the next and previous links -->
-								<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-								<!-- prints X of Y, where X is current page and Y is number of pages -->
-						<?php
-							echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-							}
-						?>
-					</td>
-				</tr>
+								<td align="center" colspan="10" >
+									<?php
+									$total = $this->Paginator->counter(array(
+		    							'format' => '%pages%'));
+									if($total >1)
+									{		
+										echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); 
+									?>
+									<?php echo $this->Paginator->numbers(); ?>
+									<!-- Shows the next and previous links -->
+									<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+									<!-- prints X of Y, where X is current page and Y is number of pages -->
+									<?php
+									echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+									}
+									?>
+								</td>
+							</tr>
 						</tbody>
 					</table>
 				</div>
diff --git a/htdocs/app/View/WispUsers/add.ctp b/htdocs/app/View/WispUsers/add.ctp
index 75c232f9..e4eb3024 100644
--- a/htdocs/app/View/WispUsers/add.ctp
+++ b/htdocs/app/View/WispUsers/add.ctp
@@ -4,174 +4,200 @@ body {
 }
 #slides
 {
-padding:30px 5px 5px 5px;border:1px #428BCA solid; border-top:2px #428BCA solid;margin-bottom:9px; 
--webkit-border-radius: 8px;
--webkit-border-top-left-radius: 0;
--moz-border-radius: 8px;
--moz-border-radius-topleft: 0;
-border-radius: 8px;
-border-top-left-radius: 0;
+	padding:30px 5px 5px 5px;border:1px #428BCA solid; border-top:2px #428BCA solid;margin-bottom:9px; 
+	-webkit-border-radius: 8px;
+	-webkit-border-top-left-radius: 0;
+	-moz-border-radius: 8px;
+	-moz-border-radius-topleft: 0;
+	border-radius: 8px;
+	border-top-left-radius: 0;
+}
+ul#tabs
+{
+	list-style-type: none;
+	margin: 30px 0 0 0;
+	padding: 0 0 0.3em 0;
+}
+ul#tabs li
+{
+	display: inline;
+	background-color: #428BCA;
+	border: 1px solid #428BCA;
+	padding: 0.4em;
+	text-decoration: none;
+	color: #000;
+	-webkit-border-top-left-radius: 8px;
+	-webkit-border-top-right-radius: 8px;
+	-moz-border-radius-topleft: 8px;
+	-moz-border-radius-topright: 8px;
+	border-top-left-radius: 8px;
+	border-top-right-radius: 8px;
+}
+ul#tabs li a
+{
+	color: #fff;
+	text-decoration:none;
+}
+ul#tabs li:hover
+{
+	background-color: #72BBE0;
+	padding: 0.4em;
+}
+div.tabContent
+{
+	padding: 0.5em;
+	background-color: #428BCA;
+}
+div.tabContent.hide
+{
+	display: none;
+}
+#tabs li.selected
+{
+	background-color: #fff;
+	color: #000;
+	padding: 0.6em;
+	border: 1px solid #428BCA;
+	border-bottom:none;
+}
+#tabs li.selected:hover
+{
+	background-color: #fff;
+	padding: 0.6em;
+}
+#tabs li.selected a
+{
+	color: #000;
+	text-decoration:none;
 }
-ul#tabs { list-style-type: none; margin: 30px 0 0 0; padding: 0 0 0.3em 0; }
-ul#tabs li { display: inline; background-color: #428BCA; border: 1px solid #428BCA; padding: 0.4em; text-decoration: none; color: #000; -webkit-border-top-left-radius: 8px;
--webkit-border-top-right-radius: 8px;
--moz-border-radius-topleft: 8px;
--moz-border-radius-topright: 8px;
-border-top-left-radius: 8px;
-border-top-right-radius: 8px;  }
-ul#tabs li a {  color: #fff;  text-decoration:none; }
-ul#tabs li:hover { background-color: #72BBE0; padding: 0.4em; }
-
-div.tabContent {  padding: 0.5em; background-color: #428BCA; }
-div.tabContent.hide { display: none;}
-#tabs li.selected{background-color: #fff; color: #000; padding: 0.6em; border: 1px solid #428BCA;  border-bottom:none;}
-
-#tabs li.selected:hover {background-color: #fff; padding: 0.6em; }
-#tabs li.selected a {  color: #000;  text-decoration:none; }
-
-
 </style>
 
 <script>
 $(document).ready(function(){
- 
-//Set the initial state: highlight the first button...
-$('#tabs').find('li:eq(0)').addClass('selected');
- 
-//and hide all slides except the first one
-$('#slides').find('> div:eq(0)').nextAll().hide();
- 
-//actions that apply on click of any of the buttons
-$('#tabs li').click( function(event) {
- 
-//turn off the link so it doesn't try to jump down the page
-event.preventDefault();
- 
-//un-highlight the buttons
-$('#tabs li').removeClass();
- 
-//hide all the slides
-$('#slides > div').hide();
- 
-//highlight the current button
-$(this).addClass('selected');
- 
-//get the index of the current button...
-var index = $('#tabs li').index(this);
- 
-//and use that index to show the corresponding slide
-$('#slides > div:eq('+index+')').show();
- 
+	//Set the initial state: highlight the first button...
+	$('#tabs').find('li:eq(0)').addClass('selected');
+	 
+	//and hide all slides except the first one
+	$('#slides').find('> div:eq(0)').nextAll().hide();
+	 
+	//actions that apply on click of any of the buttons
+	$('#tabs li').click( function(event) {
+	 
+	//turn off the link so it doesn't try to jump down the page
+	event.preventDefault();
+	 
+	//un-highlight the buttons
+	$('#tabs li').removeClass();
+	 
+	//hide all the slides
+	$('#slides > div').hide();
+	 
+	//highlight the current button
+	$(this).addClass('selected');
+	 
+	//get the index of the current button...
+	var index = $('#tabs li').index(this);
+	 
+	//and use that index to show the corresponding slide
+	$('#slides > div:eq('+index+')').show();
 });
 
 $("#WispUserNumber").keyup(function() {
-if($("#WispUserNumber").val().length > 0 )
-{
-	$("#WispUserUsername").removeAttr( "required" );
-}
-else
-{
-	$("#WispUserUsername").attr( "required","required" );
-}	
-
+	if($("#WispUserNumber").val().length > 0 )
+	{
+		$("#WispUserUsername").removeAttr( "required" );
+	}
+	else
+	{
+		$("#WispUserUsername").attr( "required","required" );
+	}
 });
 
 /* -- for groups -- */
-	$("#btn").click(function()
-	{
-		 //var values = $("input[id='groups']").map(function(){return $(this).val();}).get();
-//alert(values);dffdfgdgdfdfg
-		$("#selectValid").css("display", "none");
-		
-		var groupText = $("#groups option:selected").text();
-		var groupValue = $("#groups option:selected").val();
+$("#btn").click(function()
+{
+	$("#selectValid").css("display", "none");
+	var groupText = $("#groups option:selected").text();
+	var groupValue = $("#groups option:selected").val();
 
-		if(groupText == 'please select')
+	if(groupText == 'Please select')
+	{
+		$("#selectValid").html("Please select group.");
+		$("#selectValid").css("display", "block");
+	}
+	else
+	{
+		if ($('#grp'+groupValue).length > 0)
 		{
-			$("#selectValid").html("Please select group.");
+			$("#selectValid").html("Already Added");
 			$("#selectValid").css("display", "block");
+			return false;
 		}
-		else
-		{
-			if ($('#grp'+groupValue).length > 0) { 
-				$("#selectValid").html("Already Added");
-				$("#selectValid").css("display", "block");
-				return false;
- 		   
-			}
-			//$("#selectValid").css("display", "none");
-			$("#selectGroup table").append("<tr id='grp"+groupValue+"'><td>"+groupText+"<input type='hidden' name='groupId[]' value='"+groupValue+"'></td><td align='right'><input type = 'button' value = 'Remove' onclick='deleteGroupRow("+groupValue+");' class='btn btn-primary'/></td></tr>");
-			$('select option:contains("please select")').prop('selected',true);
-		}
-		$("#groups").html(optionList).selectmenu('refresh', true);
-	});
-	/* -- for attributs -- */
-	
-	$("#attributeBtn").click(function()
+		$("#selectGroup table").append("<tr id='grp"+groupValue+"'><td>"+groupText+"<input type='hidden' name='groupId[]' value='"+groupValue+"'></td><td align='right'><input type = 'button' value = 'Remove' onclick='deleteGroupRow("+groupValue+");' class='btn btn-primary'/></td></tr>");
+		$('select option:contains("Please select")').prop('selected',true);
+	}
+	$("#groups").html(optionList).selectmenu('refresh', true);
+});
+
+/* -- for attributs -- */
+$("#attributeBtn").click(function()
+{
+	var nameText = $("#nameId option:selected").text();
+	var nameValue = $("#nameId option:selected").val();
+	var operatorText = $("#operatorId option:selected").text();
+	var operatorValue = $("#operatorId option:selected").val();
+	var attributeValue = $("#valueId").val();
+	var modifierText = $("#modifierId option:selected").text();
+
+	if(modifierText == 'Please select')
 	{
-		var nameText = $("#nameId option:selected").text();
-		var nameValue = $("#nameId option:selected").val();
-		
-		var operatorText = $("#operatorId option:selected").text();
-		var operatorValue = $("#operatorId option:selected").val();
-		
-		var attributeValue = $("#valueId").val();
-		
-		var modifierText = $("#modifierId option:selected").text();
-		
-		if(modifierText == 'please select')
-		{
-			modifierText = '';
-		}
-		
-		//alert(nameText);
-		//alert(nameText+operatorText+attributeValue+modifierText);
-		
-		var valid = 1;
-		if(nameText == 'please select')
-		{
-			$("#selectName").css("display", "block");
-			valid = 0;
-		}
-		else
-		{
-			$("#selectName").css("display", "none");
-		}
-		
-		if(operatorText == 'please select')
-		{
-			$("#selectoperator").css("display", "block");
-			valid = 0;
-		}
-		else
-		{
-			$("#selectoperator").css("display", "none");
-		}
-		
-		if(attributeValue == '')
-		{
-			$("#selectvalue").css("display", "block");
-			valid = 0;
-		}
-		else
-		{
-			$("#selectvalue").css("display", "none");
-		}
+		modifierText = '';
+	}
+	var valid = 1;
+
+	if(nameText == 'Please select')
+	{
+		$("#selectName").css("display", "block");
+		valid = 0;
+	}
+	else
+	{
+		$("#selectName").css("display", "none");
+	}
 		
-		if(valid == 1)
-		{
-			attrTemp = parseInt($("#attribGenerator").val());
+	if(operatorText == 'Please select')
+	{
+		$("#selectoperator").css("display", "block");
+		valid = 0;
+	}
+	else
+	{
+		$("#selectoperator").css("display", "none");
+	}
 
-			var row = "<tr id='attrib"+attrTemp+"'><td>"+nameText+"<input type='hidden' name='attributeName[]' value='"+nameValue+"'></td><td>"+operatorText+"<input type='hidden' name='attributeoperator[]' value='"+operatorValue+"'></td><td>"+attributeValue+"<input type='hidden' name='attributeValues[]' value='"+attributeValue+"'></td><td>"+modifierText+"<input type='hidden' name='attributeModifier[]' value='"+modifierText+"'></td><td align='right'><input type = 'button' value = 'Remove' onclick='deleteAttributeRow("+attrTemp+");' class='btn btn-primary'/></td></tr>";
-			$("#selectAttribute1").css("display","block");
-			$("#selectAttribute1 table").append(row);
-			
-			$("#attribGenerator").val(attrTemp+1);
-			$('select option:contains("please select")').prop('selected',true);
-			$("#valueId").val("");
-		}
-	});
+	if(attributeValue == '')
+	{
+		$("#selectvalue").css("display", "block");
+		valid = 0;
+	}
+	else
+	{
+		$("#selectvalue").css("display", "none");
+	}
+		
+	if(valid == 1)
+	{
+		attrTemp = parseInt($("#attribGenerator").val());
+		var row = "<tr id='attrib"+attrTemp+"'><td>"+nameText+"<input type='hidden' name='attributeName[]' value='"+nameValue+"'></td><td>"+operatorText+"<input type='hidden' name='attributeoperator[]' value='"+operatorValue+"'></td><td>"+attributeValue+"<input type='hidden' name='attributeValues[]' value='"+attributeValue+"'></td><td>"+modifierText+"<input type='hidden' name='attributeModifier[]' value='"+modifierText+"'></td><td align='right'><input type = 'button' value = 'Remove' onclick='deleteAttributeRow("+attrTemp+");' class='btn btn-primary'/></td></tr>";
+		$("#selectAttribute1").css("display","block");
+		$("#selectAttribute1 table").append(row);
+		$("#attribGenerator").val(attrTemp+1);
+		$('select option:contains("Please select")').prop('selected',true);
+		$("#valueId").val("");
+	}
+});
 });
+
 function deleteGroupRow(valData)
 {
 	$('#grp'+valData).remove();
@@ -213,7 +239,7 @@ function deleteAttributeRow(valData)
 			</div>
 			<!-- end tabs -->
 			<div id="slides" >
-				<!-- personal indo div -->
+				<!-- personal info div -->
 				<div id="pinfo">
 					<div class="form-group">
 						<?php echo $this->Form->label('FirstName', 'First Name', array('class'=>'col-md-2 control-label'));?>								
@@ -264,7 +290,7 @@ function deleteAttributeRow(valData)
 						<?php echo $this->Form->label('Group', 'Group', array('class'=>'col-md-2 control-label'));?>								
 						<div class="row">
 							<div class="col-md-4 input-group" style="float:left;">
-								<?php echo $this->Form->input('Type', array('empty' => array(0=>'please select'),'label' => false, 'class' => 'form-control', 'type' => 'select', "options" =>$grouparr, 'id' => 'groups'));?>
+								<?php echo $this->Form->input('Type', array('empty' => array(0=>'Please select'),'label' => false, 'class' => 'form-control', 'type' => 'select', "options" =>$grouparr, 'id' => 'groups'));?>
 								<span style="display:none;" id="selectValid"></span>
 							</div>
 							<div style = "padding-left:600px;"><input type = "button" value = "Add Group" id="btn" class="btn btn-primary"/></div>
@@ -292,7 +318,7 @@ function deleteAttributeRow(valData)
 						<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label','style'=>'width:60px;'));?>								
 						<div class="row">
 							<div class="col-md-4 input-group">
-								<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => $options, 'empty' => array(0=>'please select'), 'id' => 'nameId', 'style' => 'width:150px;'));?>
+								<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => $options, 'empty' => array(0=>'Please select'), 'id' => 'nameId', 'style' => 'width:150px;'));?>
 								<span style="display:none;" id="selectName">Please select name.</span>
 							</div>
 						</div>
@@ -301,7 +327,7 @@ function deleteAttributeRow(valData)
 						<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label', 'style'=>'margin-left:0px;width:80px;'));?>
 						<div class="row">
 							<div class="col-md-4 input-group">
-								<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => $operator, 'empty' => array(''=>'please select'), 'style'=>'width:180px;', 'id' => 'operatorId'));?>
+								<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => $operator, 'empty' => array(''=>'Please select'), 'style'=>'width:180px;', 'id' => 'operatorId'));?>
 								<span style="display:none;" id="selectoperator">Please select operator.</span>
 							</div>
 						</div>
@@ -319,7 +345,7 @@ function deleteAttributeRow(valData)
 						<?php echo $this->Form->label('Modifier', 'Modifier', array('class'=>'col-md-2 control-label', 'style'=>'width:80px;margin-left:0px;'));?>
 						<div class="row">
 							<div class="col-md-4 input-group">
-								<?php echo $this->Form->input('Modifier', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => $modifier, 'empty' => array(0=>'please select'), 'style'=>'width:90px;margin-left:0px;', 'id' => 'modifierId'));?>
+								<?php echo $this->Form->input('Modifier', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => $modifier, 'empty' => array(0=>'Please select'), 'style'=>'width:90px;margin-left:0px;', 'id' => 'modifierId'));?>
 								<span style="display:none;" id="selectmodifier">Please select modifier.</span>
 							</div>
 						</div>
@@ -371,12 +397,6 @@ function deleteAttributeRow(valData)
 				<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
 			</div>
 		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
 		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/WispUsers/edit.ctp b/htdocs/app/View/WispUsers/edit.ctp
index e209bb89..e6d5e10e 100644
--- a/htdocs/app/View/WispUsers/edit.ctp
+++ b/htdocs/app/View/WispUsers/edit.ctp
@@ -4,192 +4,207 @@ body {
 }
 #slides
 {
-padding:30px 5px 5px 5px;border:1px #428BCA solid; border-top:2px #428BCA solid;margin-bottom:9px; 
--webkit-border-radius: 8px;
--webkit-border-top-left-radius: 0;
--moz-border-radius: 8px;
--moz-border-radius-topleft: 0;
-border-radius: 8px;
-border-top-left-radius: 0;
+	padding:30px 5px 5px 5px;border:1px #428BCA solid; border-top:2px #428BCA solid;margin-bottom:9px; 
+	-webkit-border-radius: 8px;
+	-webkit-border-top-left-radius: 0;
+	-moz-border-radius: 8px;
+	-moz-border-radius-topleft: 0;
+	border-radius: 8px;
+	border-top-left-radius: 0;
+}
+ul#tabs
+{
+	list-style-type: none;
+	margin: 30px 0 0 0;
+	padding: 0 0 0.3em 0;
+}
+ul#tabs li
+{
+	display: inline;
+	background-color: #428BCA;
+	border: 1px solid #428BCA;
+	padding: 0.4em;
+	text-decoration: none;
+	color: #ffffff;
+	-webkit-border-top-left-radius: 8px;
+	-webkit-border-top-right-radius: 8px;
+	-moz-border-radius-topleft: 8px;
+	-moz-border-radius-topright: 8px;
+	border-top-left-radius: 8px;
+	border-top-right-radius: 8px;
+}
+ul#tabs li a
+{
+	color: #fff;
+	text-decoration:none;
+}
+ul#tabs li:hover
+{
+	background-color: #72BBE0;
+	padding: 0.4em;
+}
+div.tabContent
+{
+	padding: 0.5em;
+	background-color: #428BCA;
+}
+div.tabContent.hide
+{
+	display: none;
+}
+#tabs li.selected
+{
+	background-color: #fff;
+	color: #000;
+	padding: 0.6em;
+	border: 1px solid #428BCA;
+	border-bottom:none;
+}
+#tabs li.selected:hover
+{
+	background-color: #fff;
+	padding: 0.6em;
+}
+#tabs li.selected a
+{
+	color: #000;
+	text-decoration:none;
 }
-ul#tabs { list-style-type: none; margin: 30px 0 0 0; padding: 0 0 0.3em 0; }
-ul#tabs li { display: inline; background-color: #428BCA; border: 1px solid #428BCA; padding: 0.4em; text-decoration: none; color: #ffffff; -webkit-border-top-left-radius: 8px;
--webkit-border-top-right-radius: 8px;
--moz-border-radius-topleft: 8px;
--moz-border-radius-topright: 8px;
-border-top-left-radius: 8px;
-border-top-right-radius: 8px;  }
-ul#tabs li a {  color: #fff;  text-decoration:none; }
-ul#tabs li:hover { background-color: #72BBE0; padding: 0.4em; }
-
-div.tabContent {  padding: 0.5em; background-color: #428BCA; }
-div.tabContent.hide { display: none;}
-#tabs li.selected{background-color: #fff; color: #000; padding: 0.6em; border: 1px solid #428BCA;  border-bottom:none;}
-
-#tabs li.selected:hover {background-color: #fff; padding: 0.6em; }
-#tabs li.selected a {  color: #000;  text-decoration:none; }
-
-
 </style>
 
 <script>
-$(document).ready(function(){
- 
-//Set the initial state: highlight the first button...
-$('#tabs').find('li:eq(0)').addClass('selected');
- 
-//and hide all slides except the first one
-$('#slides').find('> div:eq(0)').nextAll().hide();
- 
-//actions that apply on click of any of the buttons
-$('#tabs li').click( function(event) {
- 
-//turn off the link so it doesn't try to jump down the page
-event.preventDefault();
- 
-//un-highlight the buttons
-$('#tabs li').removeClass();
- 
-//hide all the slides
-$('#slides > div').hide();
- 
-//highlight the current button
-$(this).addClass('selected');
- 
-//get the index of the current button...
-var index = $('#tabs li').index(this);
- 
-//and use that index to show the corresponding slide
-$('#slides > div:eq('+index+')').show();
- 
+$(document).ready(function()
+{
+	//Set the initial state: highlight the first button...
+	$('#tabs').find('li:eq(0)').addClass('selected');
+	 
+	//and hide all slides except the first one
+	$('#slides').find('> div:eq(0)').nextAll().hide();
+	 
+	//actions that apply on click of any of the buttons
+	$('#tabs li').click( function(event) {
+	 
+	//turn off the link so it doesn't try to jump down the page
+	event.preventDefault();
+	 
+	//un-highlight the buttons
+	$('#tabs li').removeClass();
+	 
+	//hide all the slides
+	$('#slides > div').hide();
+	 
+	//highlight the current button
+	$(this).addClass('selected');
+	 
+	//get the index of the current button...
+	var index = $('#tabs li').index(this);
+	 
+	//and use that index to show the corresponding slide
+	$('#slides > div:eq('+index+')').show();
 });
 
-$("#WispUserNumber").keyup(function() {
-if($("#WispUserNumber").val().length > 0 )
+$("#WispUserNumber").keyup(function()
 {
-	$("#WispUserUsername").removeAttr( "required" );
-}
-else
-{
-	$("#WispUserUsername").attr( "required","required" );
-}	
-
+	if($("#WispUserNumber").val().length > 0 )
+	{
+		$("#WispUserUsername").removeAttr( "required" );
+	}
+	else
+	{
+		$("#WispUserUsername").attr( "required","required" );
+	}
 });
 
 /* -- for groups -- */
-	$("#btn").click(function()
+$("#btn").click(function()
+{
+	$("#selectValid").css("display", "none");
+	var groupText = $("#groups option:selected").text();
+	var groupValue = $("#groups option:selected").val();
+	if(groupText == 'please select')
 	{
-		 //var values = $("input[id='groups']").map(function(){return $(this).val();}).get();
-//alert(values);dffdfgdgdfdfg
-		$("#selectValid").css("display", "none");
-		
-		var groupText = $("#groups option:selected").text();
-		var groupValue = $("#groups option:selected").val();
-
-		if(groupText == 'please select')
+		$("#selectValid").html("Please select group.");
+		$("#selectValid").css("display", "block");
+	}
+	else
+	{
+		if ($('#grp'+groupValue).length > 0)
 		{
-			$("#selectValid").html("Please select group.");
+			$("#selectValid").html("Already Added");
 			$("#selectValid").css("display", "block");
+			return false;   
 		}
-		else
-		{
-			if ($('#grp'+groupValue).length > 0) { 
-				$("#selectValid").html("Already Added");
-				$("#selectValid").css("display", "block");
-				return false;
- 		   
-			}
-			//$("#selectValid").css("display", "none");
-			$("#selectGroup table").append("<tr id='grp"+groupValue+"'><td>"+groupText+"<input type='hidden' name='groupId[]' value='"+groupValue+"'></td><td align='right'><input type = 'button' value = 'Remove' onclick='deleteGroupRow("+groupValue+");' class='btn btn-primary'/></td></tr>");
-			$('select option:contains("please select")').prop('selected',true);
-		}
-		$("#groups").html(optionList).selectmenu('refresh', true);
-	});
-	/* -- for attributs -- */
-	
-	$("#attributeBtn").click(function()
+		$("#selectGroup table").append("<tr id='grp"+groupValue+"'><td>"+groupText+"<input type='hidden' name='groupId[]' value='"+groupValue+"'></td><td align='right'><input type = 'button' value = 'Remove' onclick='deleteGroupRow("+groupValue+");' class='btn btn-primary'/></td></tr>");
+		$('select option:contains("please select")').prop('selected',true);
+	}
+	$("#groups").html(optionList).selectmenu('refresh', true);
+});
+
+/* -- for attributs -- */
+$("#attributeBtn").click(function()
+{
+	var nameText = $("#nameId option:selected").text();
+	var nameValue = $("#nameId option:selected").val();
+	var operatorText = $("#operatorId option:selected").text();
+	var operatorValue = $("#operatorId option:selected").val();
+	var attributeValue = $("#valueId").val();
+	var modifierText = $("#modifierId option:selected").text();
+	if(modifierText == 'please select')
 	{
-		
-		var nameText = $("#nameId option:selected").text();
-		var nameValue = $("#nameId option:selected").val();
-		
-		var operatorText = $("#operatorId option:selected").text();
-		var operatorValue = $("#operatorId option:selected").val();
-		
-		var attributeValue = $("#valueId").val();
-		
-		var modifierText = $("#modifierId option:selected").text();
-		
-		if(modifierText == 'please select')
-		{
-			modifierText = '';
-		}
-		
-		//alert(nameText);
-		//alert(nameText+operatorText+attributeValue+modifierText);
-		
-		var valid = 1;
-		if(nameText == 'please select')
-		{
-			$("#selectName").css("display", "block");
-			valid = 0;
-		}
-		else
-		{
-			$("#selectName").css("display", "none");
-		}
-		
-		if(operatorText == 'please select')
-		{
-			$("#selectoperator").css("display", "block");
-			valid = 0;
-		}
-		else
-		{
-			$("#selectoperator").css("display", "none");
-		}
-		
-		if(attributeValue == '')
+		modifierText = '';
+	}
+	var valid = 1;
+	if(nameText == 'please select')
+	{
+		$("#selectName").css("display", "block");
+		valid = 0;
+	}
+	else
+	{
+		$("#selectName").css("display", "none");
+	}
+	if(operatorText == 'please select')
+	{
+		$("#selectoperator").css("display", "block");
+		valid = 0;
+	}
+	else
+	{
+		$("#selectoperator").css("display", "none");
+	}
+	if(attributeValue == '')
+	{
+		$("#selectvalue").css("display", "block");
+		valid = 0;
+	}
+	else
+	{
+		$("#selectvalue").css("display", "none");
+	}
+	if(valid == 1)
+	{
+		if($(this).val()=='Update Group')
 		{
-			$("#selectvalue").css("display", "block");
-			valid = 0;
+			attrTemp = $("#editCheck").val();
+			var row = "<tr id='attrib"+attrTemp+"'><td>"+nameText+"<input type='hidden' name='attributeName[]' value='"+nameValue+"' id='attributeName"+attrTemp+"'></td><td>"+operatorText+"<input type='hidden' name='attributeoperator[]' id='attributeoperator"+attrTemp+"' value='"+operatorValue+"'></td><td>"+attributeValue+"<input type='hidden' name='attributeValues[]' id='attributeValues"+attrTemp+"' value='"+attributeValue+"'></td><td>"+modifierText+"<input type='hidden' id='attributeModifier"+attrTemp+"' name='attributeModifier[]' value='"+modifierText+"'></td><td align='right'><input type = 'button' value = 'Edit' onclick='editAttributeRow("+attrTemp+");' class='btn btn-primary'/> <input type = 'button' value = 'Remove' onclick='deleteAttributeRow("+attrTemp+");' class='btn btn-primary'/></td></tr>";
+			$("#attrib"+attrTemp).replaceWith(row);
+			$(this).val('Add Group');
+			$("#nameId").val(0);
+			$("#operatorId").val('');
+			$("#valueId").val('');
 		}
 		else
 		{
-			$("#selectvalue").css("display", "none");
-		}
-		
-		if(valid == 1)
-		{
-			if($(this).val()=='Update Group')
-			{
-				
-				attrTemp = $("#editCheck").val();
-				
-				var row = "<tr id='attrib"+attrTemp+"'><td>"+nameText+"<input type='hidden' name='attributeName[]' value='"+nameValue+"' id='attributeName"+attrTemp+"'></td><td>"+operatorText+"<input type='hidden' name='attributeoperator[]' id='attributeoperator"+attrTemp+"' value='"+operatorValue+"'></td><td>"+attributeValue+"<input type='hidden' name='attributeValues[]' id='attributeValues"+attrTemp+"' value='"+attributeValue+"'></td><td>"+modifierText+"<input type='hidden' id='attributeModifier"+attrTemp+"' name='attributeModifier[]' value='"+modifierText+"'></td><td align='right'><input type = 'button' value = 'Edit' onclick='editAttributeRow("+attrTemp+");' class='btn btn-primary'/> <input type = 'button' value = 'Remove' onclick='deleteAttributeRow("+attrTemp+");' class='btn btn-primary'/></td></tr>";
-				
-				$("#attrib"+attrTemp).replaceWith(row);
-				
-				$(this).val('Add Group');
-				$("#nameId").val(0);
-				$("#operatorId").val('');
-				$("#valueId").val('');
-	
-			}
-			else
-			{
-				attrTemp = parseInt($("#attribGenerator").val());
-	
-				var row = "<tr id='attrib"+attrTemp+"'><td>"+nameText+"<input type='hidden' name='attributeName[]' id='attributeName"+attrTemp+"' value='"+nameValue+"'></td><td>"+operatorText+"<input type='hidden' name='attributeoperator[]' id='attributeoperator"+attrTemp+"' value='"+operatorValue+"'></td><td>"+attributeValue+"<input type='hidden' name='attributeValues[]' id='attributeValues"+attrTemp+"' value='"+attributeValue+"'></td><td>"+modifierText+"<input type='hidden' id='attributeModifier"+attrTemp+"' name='attributeModifier[]' value='"+modifierText+"'></td><td align='right'><input type = 'button' value = 'Edit' onclick='editAttributeRow("+attrTemp+");' class='btn btn-primary'/> <input type = 'button' value = 'Remove' onclick='deleteAttributeRow("+attrTemp+");' class='btn btn-primary'/></td></tr>";
-				$("#selectAttribute1").css("display","block");
-				$("#selectAttribute1 table").append(row);
-				
-				$("#attribGenerator").val(attrTemp+1);
-				$('select option:contains("please select")').prop('selected',true);
-				$("#valueId").val("");
-			}	
-		}
-	});
+			attrTemp = parseInt($("#attribGenerator").val());
+			var row = "<tr id='attrib"+attrTemp+"'><td>"+nameText+"<input type='hidden' name='attributeName[]' id='attributeName"+attrTemp+"' value='"+nameValue+"'></td><td>"+operatorText+"<input type='hidden' name='attributeoperator[]' id='attributeoperator"+attrTemp+"' value='"+operatorValue+"'></td><td>"+attributeValue+"<input type='hidden' name='attributeValues[]' id='attributeValues"+attrTemp+"' value='"+attributeValue+"'></td><td>"+modifierText+"<input type='hidden' id='attributeModifier"+attrTemp+"' name='attributeModifier[]' value='"+modifierText+"'></td><td align='right'><input type = 'button' value = 'Edit' onclick='editAttributeRow("+attrTemp+");' class='btn btn-primary'/> <input type = 'button' value = 'Remove' onclick='deleteAttributeRow("+attrTemp+");' class='btn btn-primary'/></td></tr>";
+			$("#selectAttribute1").css("display","block");
+			$("#selectAttribute1 table").append(row);
+			$("#attribGenerator").val(attrTemp+1);
+			$('select option:contains("please select")').prop('selected',true);
+			$("#valueId").val("");
+		}	
+	}
+});
 });
 function deleteGroupRow(valData)
 {
@@ -201,230 +216,237 @@ function deleteAttributeRow(valData)
 }
 function editAttributeRow(valData)
 {
-
 	$('#attrib'+$("#editCheck").val()).css("background-color","#fff");
-	
 	$('#attrib'+valData).css("background-color","#F4F4F4");
 	$("#editCheck").val(valData);
-	
 	$("#attributeBtn").val('Update Group');
 	$("#nameId").val($('#attributeName'+valData).val());
 	$("#operatorId").val($('#attributeoperator'+valData).val());
 	$("#valueId").val($('#attributeValues'+valData).val());
 	$("#modifierId").val($('#attributeModifier'+valData).val());
 }		
-
 </script>
 
-
-<?php //echo "<pre>";print_r($user);exit; ?>
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('wisp_left_panel');?>
-	<div class="col-md-10"><legend>Edit Wisp User</legend>
-		<?php echo $this->Form->create()?>
-			<div class="form-group">
-				<?php echo $this->Form->label('Username', 'Username', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Username', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Username', 'value' => $user['WispUser']['Username']));?>
-						<input type='hidden' name='hiddenUserName' value='<?php echo $user['WispUser']['Username']; ?>' />
-						
-					</div>
-				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Password', 'Password', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Password', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Password', 'value' => $user['WispUser']['Password']));?>
-					</div>
-				</div>
-			</div>
-<!-- for tabs -->
-			<div id="tabs1">
-				<ul id="tabs">
-  					<li><a href="#pinfo">Personal</a></li>
-  					<li><a href="#groups">Groups</a></li>
-  					<li><a href="#attributes">Attributes</a></li>
-  					<li><a href="#addmany">Add Many</a></li>
-				</ul>
-			</div>
-			<!-- end tabs -->
-			<div id="slides" >
-			<!-- personal indo div -->
-			<div id="pinfo">			
+		<div class="col-md-10"><legend>Edit Wisp User</legend>
+			<?php echo $this->Form->create()?>
 				<div class="form-group">
-				<?php echo $this->Form->label('FirstName', 'First Name', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('FirstName', array('label' => false, 'class' => 'form-control', 'placeholder' => 'First Name', 'value' => $user['WispUser']['FirstName']));?>
-					</div>
-				</div>
-				</div>
-				
-			<div class="form-group">
-				<?php echo $this->Form->label('LastName', 'LastName', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('LastName', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Last Name', 'value' => $user['WispUser']['LastName']));?>
-					</div>
-				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Phone', 'Phone', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Phone', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Phone',  'type' => 'text', 'value' => $user['WispUser']['Phone']));?>
-					</div>
-				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Email', 'Email', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Email', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Email', 'value' => $user['WispUser']['Email']));?>
-					</div>
-				</div>
-			</div>
-			<div class="form-group">
-				<?php echo $this->Form->label('Location', 'Location', array('class'=>'col-md-2 control-label'));?>								
-				<div class="row">
-					<div class="col-md-4 input-group">
-						<?php echo $this->Form->input('Location', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => $location, 'empty' => false, 'options' => $location, 'value' => $user['WispUser']['LocationID'], 'empty' => true));?>
+					<?php echo $this->Form->label('Username', 'Username', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Username', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Username', 'value' => $user['WispUser']['Username']));?>
+							<input type='hidden' name='hiddenUserName' value='<?php echo $user['WispUser']['Username']; ?>' />
+						</div>
 					</div>
 				</div>
-			</div>
-		</div>
-		<!-- end personal info div -->
-		<!-- start group -->
-				<div id="groups" style="display:none;">
-					<div class="form-group">
-						<?php echo $this->Form->label('Group', 'Group', array('class'=>'col-md-2 control-label'));?>								
-						<div class="row">
-							<div class="col-md-4 input-group" style="float:left;">
-								<?php echo $this->Form->input('Type', array('empty' => array(0=>'please select'),'label' => false, 'class' => 'form-control', 'type' => 'select', "options" =>$grouparr, 'id' => 'groups'));?>
-								<span style="display:none;" id="selectValid"></span>
-							</div>
-							<div style = "padding-left:600px;"><input type = "button" value = "Add Group" id="btn" class="btn btn-primary"/></div>
+				<div class="form-group">
+					<?php echo $this->Form->label('Password', 'Password', array('class'=>'col-md-2 control-label'));?>
+					<div class="row">
+						<div class="col-md-4 input-group">
+							<?php echo $this->Form->input('Password', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Password', 'value' => $user['WispUser']['Password']));?>
 						</div>
 					</div>
-					<div id='selectGroup'>
-						<table class="table">
-							<thead>
-								<tr><th><a><?php echo __('Name', true);?></a></th></tr>
-							</thead>
-							<tbody>
-							<?php foreach($userGroups as $ug) {	?>
-							<tr id='grp<?php echo $ug['utg']['GroupID'];?>'><td><?php echo $ug['g']['Name'];?><input type='hidden' name='groupId[]' value='<?php echo $ug['utg']['GroupID'];?>'></td><td align='right'><input type = 'button' value = 'Remove' onclick='deleteGroupRow(<?php echo $ug['utg']['GroupID'];?>);' class='btn btn-primary'/></td></tr>
-							<?php } ?>
-							</tbody>
-						</table>
-					</div>
 				</div>
-				<!-- end group -->
 
-				<!-- start attributes -->
-				<div id="attributes" style="display:none;">
-					<?php $options = array('Traffic Limit' => 'Traffic Limit', 'Uptime Limit' => 'Uptime Limit', 'IP Address' => 'IP Address', 'MAC Address' => 'MAC Address');
-		$operator=array('Add as reply if unique', 'Set configuration value', 'Match value in request', 'Add reply and set configuration', 'Inverse match value in request', 'Match less-than value in request', 'Match greater-than value in request', 'Match less-than or equal value in request', 'Match greater-than or equal value in request','Match string containing regex in request', 'Match string not containing regex in request', 'Match if attribute is defined in request', 'Match if attribute is not defined in request', 'Match any of these values in request');
-		$modifier = array('Seconds' => 'Seconds', 'Minutes' => 'Minutes', 'Hours' => 'Hours', 'Days' => 'Days', 'Weeks' => 'Weeks', 'Months' => 'Months', 'MBytes' => 'MBytes', 'GBytes' => 'GBytes', 'TBytes' => 'TBytes');?>
-	
-					<div class="form-group" style="float:left;width:200px;">
-						<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label','style'=>'width:60px;'));?>								
-						<div class="row">
-							<div class="col-md-4 input-group">
-								<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => $options, 'empty' => array(0=>'please select'), 'id' => 'nameId', 'style' => 'width:150px;'));?>
-								<span style="display:none;" id="selectName">Please select name.</span>
+				<!-- for tabs -->
+				<div id="tabs1">
+					<ul id="tabs">
+  						<li><a href="#pinfo">Personal</a></li>
+  						<li><a href="#groups">Groups</a></li>
+  						<li><a href="#attributes">Attributes</a></li>
+					</ul>
+				</div>
+				<!-- end tabs -->
+
+				<div id="slides" >
+					<!-- personal info div -->
+						<div id="pinfo">
+							<div class="form-group">
+								<?php echo $this->Form->label('FirstName', 'First Name', array('class'=>'col-md-2 control-label'));?>
+								<div class="row">
+									<div class="col-md-4 input-group">
+										<?php echo $this->Form->input('FirstName', array('label' => false, 'class' => 'form-control', 'placeholder' => 'First Name', 'value' => $user['WispUser']['FirstName']));?>
+									</div>
+								</div>
 							</div>
-						</div>
-					</div>
-					<div class="form-group" style="float:left;width:250px;">
-						<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label', 'style'=>'margin-left:0px;width:80px;'));?>
-						<div class="row">
-							<div class="col-md-4 input-group">
-								<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => $operator, 'empty' => array(''=>'please select'), 'style'=>'width:180px;', 'id' => 'operatorId'));?>
-								<span style="display:none;" id="selectoperator">Please select operator.</span>
+							<div class="form-group">
+								<?php echo $this->Form->label('LastName', 'LastName', array('class'=>'col-md-2 control-label'));?>
+								<div class="row">
+									<div class="col-md-4 input-group">
+										<?php echo $this->Form->input('LastName', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Last Name', 'value' => $user['WispUser']['LastName']));?>
+									</div>
+								</div>
 							</div>
-						</div>
-					</div>
-					<div class="form-group" style="float:left;width:250px;">
-						<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label', 'style'=>'width:60px;margin-left:0px;'));?>
-						<div class="row">
-							<div class="col-md-4 input-group">
-								<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value', 'style'=>'width:180px;', 'id' => 'valueId'));?>
-								<span style="display:none;" id="selectvalue">Please enter value.</span>
+							<div class="form-group">
+								<?php echo $this->Form->label('Phone', 'Phone', array('class'=>'col-md-2 control-label'));?>
+								<div class="row">
+									<div class="col-md-4 input-group">
+										<?php echo $this->Form->input('Phone', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Phone',  'type' => 'text', 'value' => $user['WispUser']['Phone']));?>
+									</div>
+								</div>
 							</div>
-						</div>
-					</div>		
-					<div class="form-group" style="float:left;width:200px">
-						<?php echo $this->Form->label('Modifier', 'Modifier', array('class'=>'col-md-2 control-label', 'style'=>'width:80px;margin-left:0px;'));?>
-						<div class="row">
-							<div class="col-md-4 input-group">
-								<?php echo $this->Form->input('Modifier', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => $modifier, 'empty' => array(0=>'please select'), 'style'=>'width:90px;margin-left:0px;', 'id' => 'modifierId'));?>
-								<span style="display:none;" id="selectmodifier">Please select modifier.</span>
+							<div class="form-group">
+								<?php echo $this->Form->label('Email', 'Email', array('class'=>'col-md-2 control-label'));?>
+								<div class="row">
+									<div class="col-md-4 input-group">
+										<?php echo $this->Form->input('Email', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Email', 'value' => $user['WispUser']['Email']));?>
+									</div>
+								</div>
+							</div>
+							<div class="form-group">
+								<?php echo $this->Form->label('Location', 'Location', array('class'=>'col-md-2 control-label'));?>
+								<div class="row">
+									<div class="col-md-4 input-group">
+										<?php echo $this->Form->input('Location', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => $location, 'empty' => false, 'options' => $location, 'value' => $user['WispUser']['LocationID'], 'empty' => true));?>
+									</div>
+								</div>
 							</div>
 						</div>
-					</div>
-					<div style = "padding-left:0px;"><input type = "button" value = "Add Group" id="attributeBtn" class="btn btn-primary"/></div><br><br><br>
-					<div id='selectAttribute1' style="">
-					<input type='hidden' id='attribGenerator' value='<?php echo (sizeof($userAttrib) + 1) ; ?>' />
-					<input type='hidden' id='editCheck' value='0' />
-						<table class="table">
-							<thead>
-								<tr>
-									<th><a><?php echo __('Name', true);?></a></th>
-									<th><a><?php echo __('Operator', true);?></a></th>
-									<th><a><?php echo __('Value', true);?></a></th>
-									<th><a><?php echo __('Modifier', true);?></a></th>
-								</tr>
-							</thead>
-							<tbody>
-							<?php 
-							$arrOperator = array(0=>"=",1=>":=",2=>"==",3=>"+=",4=>"!=",5=>"<",6=>">",7=>"<=",8=>">=",9=>"=~",10=>"!~",11=>"=*",12=>"!*",13=>"||==");
-							$i=0; foreach($userAttrib as $ua) { $i++;
-							if($ua['user_attributes']['Name']=='User-Password') { continue; } ?>
-							<tr id='attrib<?php echo $i; ?>'><td><?php echo $ua['user_attributes']['Name']; ?><input type='hidden' name='attributeName[]' id='attributeName<?php echo $i; ?>' value='<?php echo $ua['user_attributes']['Name']; ?>'></td><td><?php echo $arrOperator[$ua['user_attributes']['Operator']]; ?><input type='hidden' name='attributeoperator[]' id='attributeoperator<?php echo $i; ?>' value='<?php echo $ua['user_attributes']['Operator']; ?>'></td><td><?php echo $ua['user_attributes']['Value']; ?><input type='hidden' name='attributeValues[]' value='<?php echo $ua['user_attributes']['Value']; ?>' id='attributeValues<?php echo $i; ?>' ></td><td><?php echo $ua['user_attributes']['modifier']; ?><input type='hidden' name='attributeModifier[]'id='attributeModifier<?php echo $i; ?>' value='<?php echo $ua['user_attributes']['modifier']; ?>'></td><td align='right'><input type = 'button' value = 'Edit' onclick='editAttributeRow(<?php echo $i; ?>);' class='btn btn-primary'/> <input type = 'button' value = 'Remove' onclick='deleteAttributeRow(<?php echo $i; ?>);' class='btn btn-primary'/></td></tr>
-							<?php } ?>
-							</tbody>
-						</table>
-					</div>
-				</div>	
-				<!-- end attributes -->
+						<!-- end personal info div -->
 
-				<!-- start add many -->
-				<div id="addmany" style="display:none;">
-					<div class="form-group">
-						<?php echo $this->Form->label('Prefix', 'Prefix', array('class'=>'col-md-2 control-label'));?>								
-						<div class="row">
-							<div class="col-md-4 input-group">
-								<?php echo $this->Form->input('Prefix', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Prefix', 'type' => 'text'));?>
+						<!-- start group -->
+						<div id="groups" style="display:none;">
+							<div class="form-group">
+								<?php echo $this->Form->label('Group', 'Group', array('class'=>'col-md-2 control-label'));?>
+								<div class="row">
+									<div class="col-md-4 input-group" style="float:left;">
+										<?php echo $this->Form->input('Type', array('empty' => array(0=>'please select'),'label' => false, 'class' => 'form-control', 'type' => 'select', "options" =>$grouparr, 'id' => 'groups'));?>
+										<span style="display:none;" id="selectValid"></span>
+									</div>
+									<div style = "padding-left:600px;"><input type = "button" value = "Add Group" id="btn" class="btn btn-primary"/></div>
+								</div>
+							</div>
+							<div id='selectGroup'>
+								<table class="table">
+									<thead>
+										<tr><th><a><?php echo __('Name', true);?></a></th></tr>
+									</thead>
+									<tbody>
+										<?php foreach($userGroups as $ug) {	?>
+											<tr id='grp<?php echo $ug['utg']['GroupID'];?>'><td><?php echo $ug['g']['Name'];?><input type='hidden' name='groupId[]' value='<?php echo $ug['utg']['GroupID'];?>'></td><td align='right'><input type = 'button' value = 'Remove' onclick='deleteGroupRow(<?php echo $ug['utg']['GroupID'];?>);' class='btn btn-primary'/></td></tr>
+										<?php } ?>
+									</tbody>
+								</table>
 							</div>
 						</div>
-					</div>
-					<div class="form-group">
-						<?php echo $this->Form->label('Number', 'Number', array('class'=>'col-md-2 control-label'));?>								
-						<div class="row">
-							<div class="col-md-4 input-group">
-								<?php echo $this->Form->input('Number', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Number', 'type' => 'text'));?>
+						<!-- end group -->
+
+						<!-- start attributes -->
+						<div id="attributes" style="display:none;">
+							<?php
+								$options = array('Traffic Limit' => 'Traffic Limit', 'Uptime Limit' => 'Uptime Limit', 'IP Address' => 'IP Address', 'MAC Address' => 'MAC Address');
+								$operator=array('Add as reply if unique', 'Set configuration value', 'Match value in request', 'Add reply and set configuration', 'Inverse match value in request', 'Match less-than value in request', 'Match greater-than value in request', 'Match less-than or equal value in request', 'Match greater-than or equal value in request','Match string containing regex in request', 'Match string not containing regex in request', 'Match if attribute is defined in request', 'Match if attribute is not defined in request', 'Match any of these values in request');
+								$modifier = array('Seconds' => 'Seconds', 'Minutes' => 'Minutes', 'Hours' => 'Hours', 'Days' => 'Days', 'Weeks' => 'Weeks', 'Months' => 'Months', 'MBytes' => 'MBytes', 'GBytes' => 'GBytes', 'TBytes' => 'TBytes');
+							?>
+							<div class="form-group" style="float:left;width:200px;">
+								<?php echo $this->Form->label('Name', 'Name', array('class'=>'col-md-2 control-label','style'=>'width:60px;'));?>
+								<div class="row">
+									<div class="col-md-4 input-group">
+										<?php echo $this->Form->input('Name', array('label' => false, 'class' => 'form-control', 'type' => 'select', 'options' => $options, 'empty' => array(0=>'please select'), 'id' => 'nameId', 'style' => 'width:150px;'));?>
+										<span style="display:none;" id="selectName">Please select name.</span>
+									</div>
+								</div>
+							</div>
+							<div class="form-group" style="float:left;width:250px;">
+								<?php echo $this->Form->label('Operator', 'Operator', array('class'=>'col-md-2 control-label', 'style'=>'margin-left:0px;width:80px;'));?>
+								<div class="row">
+									<div class="col-md-4 input-group">
+										<?php echo $this->Form->input('Operator', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => $operator, 'empty' => array(''=>'please select'), 'style'=>'width:180px;', 'id' => 'operatorId'));?>
+										<span style="display:none;" id="selectoperator">Please select operator.</span>
+									</div>
+								</div>
+							</div>
+							<div class="form-group" style="float:left;width:250px;">
+								<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label', 'style'=>'width:60px;margin-left:0px;'));?>
+								<div class="row">
+									<div class="col-md-4 input-group">
+										<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value', 'style'=>'width:180px;', 'id' => 'valueId'));?>
+										<span style="display:none;" id="selectvalue">Please enter value.</span>
+									</div>
+								</div>
 							</div>
+							<div class="form-group" style="float:left;width:200px">
+								<?php echo $this->Form->label('Modifier', 'Modifier', array('class'=>'col-md-2 control-label', 'style'=>'width:80px;margin-left:0px;'));?>
+								<div class="row">
+									<div class="col-md-4 input-group">
+										<?php echo $this->Form->input('Modifier', array('label' => false, 'class' => 'form-control','type' => 'select', 'options' => $modifier, 'empty' => array(0=>'please select'), 'style'=>'width:90px;margin-left:0px;', 'id' => 'modifierId'));?>
+										<span style="display:none;" id="selectmodifier">Please select modifier.</span>
+									</div>
+								</div>
+							</div>
+							<div style = "padding-left:0px;"><input type = "button" value = "Add Group" id="attributeBtn" class="btn btn-primary"/></div><br><br><br>
+						<div id='selectAttribute1' style="">
+							<input type='hidden' id='attribGenerator' value='<?php echo (sizeof($userAttrib) + 1) ; ?>' />
+							<input type='hidden' id='editCheck' value='0' />
+							<table class="table">
+								<thead>
+									<tr>
+										<th><a><?php echo __('Name', true);?></a></th>
+										<th><a><?php echo __('Operator', true);?></a></th>
+										<th><a><?php echo __('Value', true);?></a></th>
+										<th><a><?php echo __('Modifier', true);?></a></th>
+									</tr>
+								</thead>
+								<tbody>
+								<?php
+									$arrOperator = array(0=>"=",1=>":=",2=>"==",3=>"+=",4=>"!=",5=>"<",6=>">",7=>"<=",8=>">=",9=>"=~",10=>"!~",11=>"=*",12=>"!*",13=>"||==");
+									$i=0; foreach($userAttrib as $ua) { $i++;
+									if($ua['user_attributes']['Name']=='User-Password') { continue; }
+								?>
+								<tr id='attrib<?php echo $i; ?>'><td><?php echo $ua['user_attributes']['Name']; ?><input type='hidden' name='attributeName[]' id='attributeName<?php echo $i; ?>' value='<?php echo $ua['user_attributes']['Name']; ?>'></td><td><?php echo $arrOperator[$ua['user_attributes']['Operator']]; ?><input type='hidden' name='attributeoperator[]' id='attributeoperator<?php echo $i; ?>' value='<?php echo $ua['user_attributes']['Operator']; ?>'></td><td><?php echo reverceSwitchModifier($ua['user_attributes']['modifier'],$ua['user_attributes']['Value']); ?><input type='hidden' name='attributeValues[]' value='<?php echo reverceSwitchModifier($ua['user_attributes']['modifier'],$ua['user_attributes']['Value']); ?>' id='attributeValues<?php echo $i; ?>' ></td><td><?php echo $ua['user_attributes']['modifier']; ?><input type='hidden' name='attributeModifier[]'id='attributeModifier<?php echo $i; ?>' value='<?php echo $ua['user_attributes']['modifier']; ?>'></td><td align='right'><input type = 'button' value = 'Edit' onclick='editAttributeRow(<?php echo $i; ?>);' class='btn btn-primary'/> <input type = 'button' value = 'Remove' onclick='deleteAttributeRow(<?php echo $i; ?>);' class='btn btn-primary'/></td></tr>
+								<?php } ?>
+								</tbody>
+							</table>
 						</div>
 					</div>
-				</div>
-				<!-- end add many -->
-			</div>
+					<!-- end attributes -->
 
-			<div class="form-group">
-				<button type="submit" class="btn btn-primary"><?php echo __('Update')?></button>
-				<!--<a class="btn btn-default" href="/users/index" role="button"><?php echo __('Cancel')?></a>-->
-				<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
-			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
+				</div>
+				<div class="form-group">
+					<button type="submit" class="btn btn-primary"><?php echo __('Update')?></button>
+					<?php echo $this->Html->link('Cancel', array('action' => 'index'), array('class' => 'btn btn-default'))?>
+				</div>
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
\ No newline at end of file
+</div>
+<?php 
+function reverceSwitchModifier($val,$attrValues)
+	{
+		$av = '';
+
+		switch ($val)
+		{
+			case "Seconds":
+				$av = $attrValues * 60;
+				break;
+			case "Minutes":
+				$av = $attrValues;
+				break;
+			case "Hours":
+				$av = $attrValues / 60;
+				break;
+			case "Days":
+				$av = $attrValues / 1440;
+				break;
+			case "Weeks":
+				$av = $attrValues / 10080;
+				break;
+			case "Months":
+				$av = $attrValues / 44640; 
+				break;
+			case "MBytes":
+				$av = $attrValues;
+				break;
+			case "GBytes":
+				$av = $attrValues / 1000;
+				break;
+			case "TBytes":
+				$av = $attrValues / 1000000;
+				break;
+		}
+		return $av;
+		
+	}
+?>
\ No newline at end of file
diff --git a/htdocs/app/View/WispUsers/index.ctp b/htdocs/app/View/WispUsers/index.ctp
index 303b9d3b..cf1fe5ae 100644
--- a/htdocs/app/View/WispUsers/index.ctp
+++ b/htdocs/app/View/WispUsers/index.ctp
@@ -23,44 +23,39 @@ body {
 				<tbody>
 				<?php foreach ($wispUser as $wUser): ?>
 				<tr>
-					<td><? echo __($wUser['WispUser']['UserID'])?></td>
-					<td><? echo __($wUser['WispUser']['Username'])?></td>
-					<td><? echo __(($wUser['WispUser']['Disabled'] == 1) ? 'true' : 'false')?></td>
-					<td><? echo __($wUser['WispUser']['FirstName'])?></td>
-					<td><? echo __($wUser['WispUser']['LastName'])?></td>
-					<td><? echo __($wUser['WispUser']['Email'])?></td>
-					<td><? echo __($wUser['WispUser']['Phone'])?></td>
+					<td><? echo $wUser['WispUser']['UserID'];?></td>
+					<td><? echo $wUser['WispUser']['Username'];?></td>
+					<td><? echo ($wUser['WispUser']['Disabled'] == 1) ? 'true' : 'false';?></td>
+					<td><? echo $wUser['WispUser']['FirstName'];?></td>
+					<td><? echo $wUser['WispUser']['LastName'];?></td>
+					<td><? echo $wUser['WispUser']['Email'];?></td>
+					<td><? echo $wUser['WispUser']['Phone'];?></td>
 					<td>
 						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/user_edit.png"></img>',array('action' => 'edit', $wUser['WispUser']['ID']), array('escape' => false, 'title' => 'Edit user'));?>
 						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/user_delete.png"></img>',array('action' => 'remove', $wUser['WispUser']['ID']), array('escape' => false, 'title' => 'Remove user'), 'Are you sure you want to remove this user?');?>
 						<?php // echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table.png"></img>',array('controller' => 'wispUsers_attributes', 'action' => 'index', $wUser['WispUser']['ID']), array('escape' => false, 'title' => 'User attributes'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/page_white_text.png"></img>',array('controller' => 'wispUserLogs', 'action' => 'index', $wUser['WispUser']['ID']), array('escape' => false, 'title' => 'User logs'));?>
+						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/page_white_text.png"></img>',array('controller' => 'wispUserLogs', 'action' => 'index', $wUser['WispUser']['UserID']), array('escape' => false, 'title' => 'User logs'));?>
 						<?php // echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/group.png"></img>',array('controller' => 'wispUsers_groups', 'action' => 'index', $wUser['WispUser']['ID']), array('escape' => false, 'title' => 'User groups'));?>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/chart_bar.png"></img>',array('controller' => 'wispUsers_topups', 'action' => 'index', $wUser['WispUser']['ID']), array('escape' => false, 'title' => 'User topups'));?>
+						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/chart_bar.png"></img>',array('controller' => 'wispUsers_topups', 'action' => 'index', $wUser['WispUser']['UserID']), array('escape' => false, 'title' => 'User topups'));?>
 					</td>
 				</tr>
 				<? endforeach; ?>
 				<tr>
 					<td align="center" colspan="10" >
-					<?php $total = $this->Paginator->counter(array('format' => '%pages%'));
+						<?php $total = $this->Paginator->counter(array('format' => '%pages%'));
 						if($total >1) {		
-							echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
-							<?php echo $this->Paginator->numbers(); ?>
-							<!-- Shows the next and previous links -->
-							<?php echo $this->Paginator->next('>>', null, null, array('class'=>'disabled')); ?>
-							<!-- prints X of Y, where X is current page and Y is number of pages -->
-							<?php echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+						echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
+						<?php echo $this->Paginator->numbers(); ?>
+						<!-- Shows the next and previous links -->
+						<?php echo $this->Paginator->next('>>', null, null, array('class'=>'disabled')); ?>
+						<!-- prints X of Y, where X is current page and Y is number of pages -->
+						<?php echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
 						}
-					?>
+						?>
 					</td>
 				</tr>
 			</tbody>
 		</table>
-	 <!--	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts-->
 		</div>
 	</div>
 </div>
\ No newline at end of file
diff --git a/htdocs/app/View/WispUsersTopups/add.ctp b/htdocs/app/View/WispUsersTopups/add.ctp
index 9f7700aa..491d5831 100644
--- a/htdocs/app/View/WispUsersTopups/add.ctp
+++ b/htdocs/app/View/WispUsersTopups/add.ctp
@@ -3,48 +3,44 @@ body {
 	padding-top: 50px;
 }
 </style>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
+<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
 <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
 <link rel="stylesheet" href="/resources/demos/style.css">
- <script>
+<script>
 $(function() {
-var date = new Date(), y = date.getFullYear(), m = date.getMonth();
-var firstDay = new Date(y, m, 1);
-var lastDay = new Date(y, m + 1, 1);
-
-$('#datepickerFrom').datepicker({
-	defaultDate:firstDay,
-	dateFormat:'yy-mm-dd',
-    beforeShowDay: function (date) {
-      //getDate() returns the day (0-31)
-       if (date.getDate() == 1) {
-           return [true, ''];
-       }
-       return [false, ''];
-
-    }
-});
-$('#datepickerTo').datepicker({
-	minDate: lastDay,
-	dateFormat:'yy-mm-dd',
-	 beforeShowDay: function (date) {
-      //getDate() returns the day (0-31)
-       if (date.getDate() == 1) {
-           return [true, ''];
-       }
-       return [false, ''];
-
-    }
-});
+	var date = new Date(), y = date.getFullYear(), m = date.getMonth();
+	var firstDay = new Date(y, m, 1);
+	var lastDay = new Date(y, m + 1, 1);
+	$('#datepickerFrom').datepicker({
+		defaultDate:firstDay,
+		dateFormat:'yy-mm-dd',
+    	beforeShowDay: function (date) {
+	      //getDate() returns the day (0-31)
+    	   if (date.getDate() == 1) {
+        	   return [true, ''];
+	       }
+    	   return [false, ''];
+	    }
+	});
+	$('#datepickerTo').datepicker({
+		minDate: lastDay,
+		dateFormat:'yy-mm-dd',
+		 beforeShowDay: function (date) {
+			//getDate() returns the day (0-31)
+			if (date.getDate() == 1) {
+	           return [true, ''];
+    	   }
+	       return [false, ''];
+	    }
+	});
 });
-
 </script>
+
 <div style="padding: 15px 15px">
 	<div class="row"><?php echo $this->element('wisp_left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Add Wisp User Topup')?></legend>
-		<?php echo $this->Form->create()?>
+		<div class="col-md-10"><legend><?php echo __('Add Wisp User Topup')?></legend>
+			<?php echo $this->Form->create()?>
 			<div class="form-group">
 				<?php echo $this->Form->label('Type', 'Type', array('class'=>'col-md-2 control-label'));?>								
 				<div class="row">
@@ -57,8 +53,8 @@ $('#datepickerTo').datepicker({
 				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
 				<div class="row">
 					<div class="col-md-4 input-group">
-							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value', 'type' => 'text'));?>
-</div>
+						<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value', 'type' => 'text'));?>
+					</div>
 				</div>
 			</div>
 			<div class="form-group">
@@ -73,25 +69,15 @@ $('#datepickerTo').datepicker({
 				<?php echo $this->Form->label('Valid To', 'Valid To', array('class'=>'col-md-2 control-label'));?>
 				<div class="row">
 					<div class="col-md-4 input-group">
-										<?php echo $this->Form->input('valid_to', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerTo', 'readonly'=>'readonly','value' => date("Y-m-01", strtotime('+1 month'))));?>
-
+						<?php echo $this->Form->input('valid_to', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerTo', 'readonly'=>'readonly','value' => date("Y-m-01", strtotime('+1 month'))));?>
 					</div>
 				</div>
 			</div>
-			
 			<div class="form-group">
 				<button type="submit" class="btn btn-primary"><?php echo __('Add')?></button>
 				<?php echo $this->Html->link('Cancel', array('action' => 'index', $userId), array('class' => 'btn btn-default'))?>							
 			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/WispUsersTopups/edit.ctp b/htdocs/app/View/WispUsersTopups/edit.ctp
index 2b614f91..2c221a8d 100644
--- a/htdocs/app/View/WispUsersTopups/edit.ctp
+++ b/htdocs/app/View/WispUsersTopups/edit.ctp
@@ -3,48 +3,46 @@ body {
 	padding-top: 50px;
 }
 </style>
- <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
+<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
 <script src="//code.jquery.com/jquery-1.10.2.js"></script>
 <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
 <link rel="stylesheet" href="/resources/demos/style.css">
- <script>
-$(function() {
-var date = new Date(), y = date.getFullYear(), m = date.getMonth();
-var firstDay = new Date(y, m, 1);
-var lastDay = new Date(y, m + 1, 1);
+<script>
+$(function(){
+	var date = new Date(), y = date.getFullYear(), m = date.getMonth();
+	var firstDay = new Date(y, m, 1);
+	var lastDay = new Date(y, m + 1, 1);
 
-$('#datepickerFrom').datepicker({
-	defaultDate:firstDay,
-	dateFormat:'yy-mm-dd',
-    beforeShowDay: function (date) {
-      //getDate() returns the day (0-31)
-       if (date.getDate() == 1) {
-           return [true, ''];
-       }
-       return [false, ''];
+	$('#datepickerFrom').datepicker({
+		defaultDate:firstDay,
+		dateFormat:'yy-mm-dd',
+    	beforeShowDay: function (date) {
+	      //getDate() returns the day (0-31)
+	       if (date.getDate() == 1) {
+    	       return [true, ''];
+	       }
+    	   return [false, ''];
+	    }
+	});
 
-    }
-});
-$('#datepickerTo').datepicker({
+	$('#datepickerTo').datepicker({
 	minDate: lastDay,
-	dateFormat:'yy-mm-dd',
-	 beforeShowDay: function (date) {
-      //getDate() returns the day (0-31)
-       if (date.getDate() == 1) {
-           return [true, ''];
-       }
-       return [false, ''];
-
-    }
-});
+		dateFormat:'yy-mm-dd',
+		 beforeShowDay: function (date) {
+		 	//getDate() returns the day (0-31)
+	       if (date.getDate() == 1) {
+    	       return [true, ''];
+	       }
+    	   return [false, ''];
+	    }
+	});
 });
-
 </script>
+
 <div style="padding: 15px 15px">
-	<div class="row"><?php echo $this->element('left_panel');?>
-	
-	<div class="col-md-10"><legend><?php echo __('Edit User Topup')?></legend>
-		<?php echo $this->Form->create()?>
+	<div class="row"><?php echo $this->element('left_panel');?>	
+		<div class="col-md-10"><legend><?php echo __('Edit User Topup')?></legend>
+			<?php echo $this->Form->create()?>
 			<div class="form-group">
 				<?php echo $this->Form->label('Type', 'Type', array('class'=>'col-md-2 control-label'));?>								
 				<div class="row">
@@ -57,7 +55,7 @@ $('#datepickerTo').datepicker({
 				<?php echo $this->Form->label('Value', 'Value', array('class'=>'col-md-2 control-label'));?>
 				<div class="row">
 					<div class="col-md-4 input-group">
-							<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value','value' => $topup['WispUsersTopup']['Value'], 'type' => 'text'));?>
+						<?php echo $this->Form->input('Value', array('label' => false, 'class' => 'form-control', 'placeholder' => 'Value','value' => $topup['WispUsersTopup']['Value'], 'type' => 'text'));?>
 </div>
 				</div>
 			</div>
@@ -73,25 +71,15 @@ $('#datepickerTo').datepicker({
 				<?php echo $this->Form->label('Valid To', 'Valid To', array('class'=>'col-md-2 control-label'));?>
 				<div class="row">
 					<div class="col-md-4 input-group">
-										<?php echo $this->Form->input('valid_to', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerTo', 'readonly'=>'readonly','value' => date("Y-m-d",strtotime($topup['WispUsersTopup']['ValidTo']))));?>
-
+						<?php echo $this->Form->input('valid_to', array('label' => false, 'class' => 'form-control', 'id' => 'datepickerTo', 'readonly'=>'readonly','value' => date("Y-m-d",strtotime($topup['WispUsersTopup']['ValidTo']))));?>
 					</div>
 				</div>
 			</div>
-			
 			<div class="form-group">
 				<button type="submit" class="btn btn-primary"><?php echo __('Save')?></button>
 				<?php echo $this->Html->link('Cancel', array('action' => 'index', $userId), array('class' => 'btn btn-default'))?>							
 			</div>
-		<?php echo $this->Form->end(); ?>
-		
-	 	<span class="glyphicon glyphicon-time" /> - Processing,
-		<span class="glyphicon glyphicon-edit" /> - Override, 
-		<span class="glyphicon glyphicon-import" /> - Being Added,
-		<span class="glyphicon glyphicon-trash" /> - Being Removed,
-		<span class="glyphicon glyphicon-random" /> - Conflicts
+			<?php echo $this->Form->end(); ?>
 		</div>
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/app/View/WispUsersTopups/index.ctp b/htdocs/app/View/WispUsersTopups/index.ctp
index 3b026cf5..a4b259bc 100644
--- a/htdocs/app/View/WispUsersTopups/index.ctp
+++ b/htdocs/app/View/WispUsersTopups/index.ctp
@@ -8,63 +8,55 @@ body {
 	<div class="row"><?php echo $this->element('wisp_left_panel');?>
 		<div class="col-md-10"><legend>Wisp User Topups List</legend>
 			<table class="table">
-			<thead>
-			 
-				<tr>
-					<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
-					<th><?php echo $this->Paginator->sort('Type', 'Type'); ?></th>
-					<th><?php echo $this->Paginator->sort('Value', 'Value'); ?></th>
-					<th><a><?php echo __('Valid From'); ?></a></th>
-					<th><a><?php echo __('Valid To'); ?></a></th>
-					<th><a><?php echo __('Action'); ?></a></th>
-				</tr>
-			</thead>
-			<tbody>
-				
-				<?php 
-				$topUpTypeArr = array(1=>'Traffice' , 2=>'Uptime');
-				foreach ($wtopups as $wtopup): ?>
-				<tr>
-					<td><? echo __($wtopup['WispUsersTopup']['ID'])?></td>
-					<td><? echo __($topUpTypeArr[$wtopup['WispUsersTopup']['Type']])?></td>
-					<td><? echo __($wtopup['WispUsersTopup']['Value'])?></td>
-					<td><? echo __(date("Y-m-d", strtotime($wtopup['WispUsersTopup']['ValidFrom']))); ?></td>
-					<td><? echo __(date("Y-m-d", strtotime($wtopup['WispUsersTopup']['ValidTo']))) ; ?></td>
-					<td>
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'wispUsers_topups',  'action' => 'edit', $wtopup['WispUsersTopup']['ID'], $userId), array('escape' => false, 'title' => 'Edit attribute'));?>												
-						<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'wispUsers_topups','action' => 'remove', $wtopup['WispUsersTopup']['ID'], $userId), array('escape' => false, 'title' => 'Remove attribute'), 'Are you sure you want to remove this topus?');?>
-					</td>
-				</tr>
-				<? endforeach; ?>
-				
-				<tr>
-					<td align="center" colspan="10" >
-				<?php
-$total = $this->Paginator->counter(array(
-    'format' => '%pages%'));
-			if($total >1) {		
-					echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
-
-					<?php echo $this->Paginator->numbers(); ?>
-<!-- Shows the next and previous links -->
-<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
-<!-- prints X of Y, where X is current page and Y is number of pages -->
-<?php
-echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
-}
-?>
-					</td>
-				</tr>
-			</tbody>
-		</table>
-			
+				<thead>
+					<tr>
+						<th><?php echo $this->Paginator->sort('ID', 'ID'); ?></th>
+						<th><?php echo $this->Paginator->sort('Type', 'Type'); ?></th>
+						<th><?php echo $this->Paginator->sort('Value', 'Value'); ?></th>
+						<th><a><?php echo __('Valid From'); ?></a></th>
+						<th><a><?php echo __('Valid To'); ?></a></th>
+						<th><a><?php echo __('Action'); ?></a></th>
+					</tr>
+				</thead>
+				<tbody>
+					<?php 
+						$topUpTypeArr = array(1=>'Traffice' , 2=>'Uptime');
+						foreach ($wtopups as $wtopup): ?>
+							<tr>
+								<td><? echo $wtopup['WispUsersTopup']['ID'];?></td>
+								<td><? echo $topUpTypeArr[$wtopup['WispUsersTopup']['Type']];?></td>
+								<td><? echo $wtopup['WispUsersTopup']['Value'];?></td>
+								<td><? echo date("Y-m-d", strtotime($wtopup['WispUsersTopup']['ValidFrom'])); ?></td>
+								<td><? echo date("Y-m-d", strtotime($wtopup['WispUsersTopup']['ValidTo'])); ?></td>
+								<td>
+									<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_edit.png"></img>',array('controller' => 'wispUsers_topups',  'action' => 'edit', $wtopup['WispUsersTopup']['ID'], $userId), array('escape' => false, 'title' => 'Edit topup'));?>												
+									<?php echo $this->Html->link('<img src="'.BASE_URL.'/resources/custom/images/silk/icons/table_delete.png"></img>',array('controller' => 'wispUsers_topups','action' => 'remove', $wtopup['WispUsersTopup']['ID'], $userId), array('escape' => false, 'title' => 'Remove topup'), 'Are you sure you want to remove this topus?');?>
+								</td>
+							</tr>
+					<? endforeach; ?>
+					<tr>
+						<td align="center" colspan="10" >
+							<?php
+							$total = $this->Paginator->counter(array(
+							    'format' => '%pages%'));
+							if($total >1) {		
+								echo $this->Paginator->prev('<<', null, null, array('class' => 'disabled')); ?>
+							<?php echo $this->Paginator->numbers(); ?>
+							<!-- Shows the next and previous links -->
+							<?php echo $this->Paginator->next('>>', null, null, array('class' => 'disabled')); ?>
+							<!-- prints X of Y, where X is current page and Y is number of pages -->
+							<?php
+								echo "<span style='margin-left:20px;'>Page : ".$this->Paginator->counter()."</span>";
+							}
+							?>
+						</td>
+					</tr>
+				</tbody>
+			</table>
 		</div>
 		<div class="form-group">			
 			<?php echo $this->Html->link(__('Add Topups'), array('action' => 'add', $userId), array('class' => 'btn btn-primary'))?>			
 			<?php echo $this->Html->link(__('Cancel'), array('controller'=>'wispUsers','action' => 'index', $userId), array('class' => 'btn btn-default'))?>
 		</div>
-
 	</div>
-</div>
-
-
+</div>
\ No newline at end of file
diff --git a/htdocs/db/smradius_webgui_20_06_2014.sql b/htdocs/db/smradius_webgui_20_06_2014.sql
new file mode 100644
index 00000000..cda4c43c
--- /dev/null
+++ b/htdocs/db/smradius_webgui_20_06_2014.sql
@@ -0,0 +1,420 @@
+-- phpMyAdmin SQL Dump
+-- version 4.0.4.1
+-- http://www.phpmyadmin.net
+--
+-- Host: localhost
+-- Generation Time: Jun 20, 2014 at 09:53 AM
+-- Server version: 5.6.12
+-- PHP Version: 5.5.3
+
+SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
+SET time_zone = "+00:00";
+
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+
+--
+-- Database: `smradius_webgui`
+--
+CREATE DATABASE IF NOT EXISTS `smradius_webgui` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
+USE `smradius_webgui`;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `accounting`
+--
+
+CREATE TABLE IF NOT EXISTS `accounting` (
+  `ID` int(11) NOT NULL,
+  `Username` varchar(255) NOT NULL,
+  `ServiceType` int(11) NOT NULL,
+  `FramedProtocol` int(11) NOT NULL,
+  `NASPort` varchar(255) NOT NULL,
+  `NASPortType` int(11) NOT NULL,
+  `CallingStationID` varchar(255) NOT NULL,
+  `CalledStationID` varchar(255) NOT NULL,
+  `NASPortID` varchar(255) NOT NULL,
+  `AcctSessionID` varchar(255) NOT NULL,
+  `FramedIPAddress` varchar(16) NOT NULL,
+  `AcctAuthentic` int(11) NOT NULL,
+  `EventTimestamp` datetime NOT NULL,
+  `NASIdentifier` varchar(255) NOT NULL,
+  `NASIPAddress` varchar(16) NOT NULL,
+  `AcctDelayTime` int(11) NOT NULL,
+  `AcctSessionTime` int(11) NOT NULL,
+  `AcctInputOctets` int(11) NOT NULL,
+  `AcctInputGigawords` int(11) NOT NULL,
+  `AcctInputPackets` int(11) NOT NULL,
+  `AcctOutputOctets` int(11) NOT NULL,
+  `AcctOutputGigawords` int(11) NOT NULL,
+  `AcctOutputPackets` int(11) NOT NULL,
+  `AcctStatusType` int(11) NOT NULL,
+  `AcctTerminateCause` int(11) NOT NULL,
+  `PeriodKey` varchar(255) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+--
+-- Dumping data for table `accounting`
+--
+
+INSERT INTO `accounting` (`ID`, `Username`, `ServiceType`, `FramedProtocol`, `NASPort`, `NASPortType`, `CallingStationID`, `CalledStationID`, `NASPortID`, `AcctSessionID`, `FramedIPAddress`, `AcctAuthentic`, `EventTimestamp`, `NASIdentifier`, `NASIPAddress`, `AcctDelayTime`, `AcctSessionTime`, `AcctInputOctets`, `AcctInputGigawords`, `AcctInputPackets`, `AcctOutputOctets`, `AcctOutputGigawords`, `AcctOutputPackets`, `AcctStatusType`, `AcctTerminateCause`, `PeriodKey`) VALUES
+(1, 'madhavi2', 1, 111, '123qwe', 111, '111qqq', 'qqq111', '111www', 'www222', '222www', 222, '2014-06-01 00:00:00', '1111wwwww', 'www222', 222, 111, 123, 321, 221, 112, 332, 1123, 3321, 1234, '33');
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `accounting_summary`
+--
+
+CREATE TABLE IF NOT EXISTS `accounting_summary` (
+  `ID` int(11) NOT NULL,
+  `Username` varchar(255) NOT NULL,
+  `PeriodKey` varchar(255) NOT NULL,
+  `TotalSessionTime` int(11) NOT NULL,
+  `TotalInput` int(11) NOT NULL,
+  `TotalOutput` int(11) NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `clients`
+--
+
+CREATE TABLE IF NOT EXISTS `clients` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `Name` varchar(255) NOT NULL,
+  `AccessList` varchar(255) NOT NULL,
+  `Disabled` int(1) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`ID`),
+  UNIQUE KEY `Name` (`Name`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
+
+--
+-- Dumping data for table `clients`
+--
+
+INSERT INTO `clients` (`ID`, `Name`, `AccessList`, `Disabled`) VALUES
+(1, 'rrr1', '12', 0);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `clients_to_realms`
+--
+
+CREATE TABLE IF NOT EXISTS `clients_to_realms` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `ClientID` int(11) NOT NULL,
+  `RealmID` int(11) NOT NULL,
+  `Disabled` int(1) NOT NULL DEFAULT '0',
+  `Comment` varchar(1024) NOT NULL,
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
+
+--
+-- Dumping data for table `clients_to_realms`
+--
+
+INSERT INTO `clients_to_realms` (`ID`, `ClientID`, `RealmID`, `Disabled`, `Comment`) VALUES
+(1, 1, 1, 0, ''),
+(2, 1, 1, 0, ''),
+(3, 1, 1, 0, '');
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `client_attributes`
+--
+
+CREATE TABLE IF NOT EXISTS `client_attributes` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `ClientID` int(11) NOT NULL,
+  `Name` varchar(255) NOT NULL,
+  `Operator` varchar(4) NOT NULL,
+  `Value` varchar(255) NOT NULL,
+  `Disabled` int(1) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
+
+--
+-- Dumping data for table `client_attributes`
+--
+
+INSERT INTO `client_attributes` (`ID`, `ClientID`, `Name`, `Operator`, `Value`, `Disabled`) VALUES
+(1, 1, 'yui', '0', '123', 1);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `groups`
+--
+
+CREATE TABLE IF NOT EXISTS `groups` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `Name` varchar(255) NOT NULL,
+  `Priority` smallint(6) NOT NULL,
+  `Disabled` smallint(1) NOT NULL DEFAULT '0',
+  `Comment` varchar(1024) NOT NULL,
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
+
+--
+-- Dumping data for table `groups`
+--
+
+INSERT INTO `groups` (`ID`, `Name`, `Priority`, `Disabled`, `Comment`) VALUES
+(4, 'g1', 0, 0, '');
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `group_attributes`
+--
+
+CREATE TABLE IF NOT EXISTS `group_attributes` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `GroupID` int(11) NOT NULL,
+  `Name` varchar(255) NOT NULL,
+  `Operator` varchar(4) NOT NULL,
+  `Value` varchar(255) NOT NULL,
+  `Disabled` smallint(1) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
+
+--
+-- Dumping data for table `group_attributes`
+--
+
+INSERT INTO `group_attributes` (`ID`, `GroupID`, `Name`, `Operator`, `Value`, `Disabled`) VALUES
+(2, 1, 'qwqw', '6', 'qwqwqwqw', 1);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `realms`
+--
+
+CREATE TABLE IF NOT EXISTS `realms` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `Name` varchar(255) NOT NULL,
+  `Disabled` int(1) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
+
+--
+-- Dumping data for table `realms`
+--
+
+INSERT INTO `realms` (`ID`, `Name`, `Disabled`) VALUES
+(1, 'realm1', 0);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `realm_attributes`
+--
+
+CREATE TABLE IF NOT EXISTS `realm_attributes` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `RealmID` int(11) NOT NULL,
+  `Name` varchar(255) NOT NULL,
+  `Operator` varchar(4) NOT NULL,
+  `Value` varchar(255) NOT NULL,
+  `Disabled` int(1) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
+
+--
+-- Dumping data for table `realm_attributes`
+--
+
+INSERT INTO `realm_attributes` (`ID`, `RealmID`, `Name`, `Operator`, `Value`, `Disabled`) VALUES
+(1, 1, 'wewewe', '8', '1212', 0);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `topups`
+--
+
+CREATE TABLE IF NOT EXISTS `topups` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `UserID` int(11) NOT NULL,
+  `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
+  `Type` int(1) NOT NULL COMMENT '1 = traffic topup, 2 = uptime topup',
+  `Value` int(11) NOT NULL,
+  `ValidFrom` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `ValidTo` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
+  `Depleted` smallint(6) NOT NULL DEFAULT '0',
+  `SMAdminDepletedOn` datetime NOT NULL,
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
+
+--
+-- Dumping data for table `topups`
+--
+
+INSERT INTO `topups` (`ID`, `UserID`, `Timestamp`, `Type`, `Value`, `ValidFrom`, `ValidTo`, `Depleted`, `SMAdminDepletedOn`) VALUES
+(1, 1, '2014-06-20 05:29:53', 1, 123, '2014-06-30 18:30:00', '2014-07-31 18:30:00', 0, '0000-00-00 00:00:00'),
+(2, 1, '2014-06-20 01:59:25', 2, 333, '2014-05-31 18:30:00', '2014-06-30 18:30:00', 0, '0000-00-00 00:00:00'),
+(4, 2, '2014-06-20 02:33:29', 1, 345, '2014-06-30 18:30:00', '2014-07-31 18:30:00', 0, '0000-00-00 00:00:00'),
+(5, 5, '2014-06-20 04:04:58', 1, 123, '2014-05-31 18:30:00', '2014-06-30 18:30:00', 0, '0000-00-00 00:00:00');
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `topups_summary`
+--
+
+CREATE TABLE IF NOT EXISTS `topups_summary` (
+  `ID` int(11) NOT NULL,
+  `TopupID` int(11) NOT NULL,
+  `PeriodKey` varchar(255) NOT NULL,
+  `Balance` int(11) NOT NULL,
+  `Depleted` smallint(6) NOT NULL DEFAULT '0',
+  `SMAdminDepletedOn` datetime NOT NULL
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `users`
+--
+
+CREATE TABLE IF NOT EXISTS `users` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `Username` varchar(255) NOT NULL,
+  `Disabled` int(1) NOT NULL DEFAULT '0',
+  PRIMARY KEY (`ID`),
+  UNIQUE KEY `Username` (`Username`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
+
+--
+-- Dumping data for table `users`
+--
+
+INSERT INTO `users` (`ID`, `Username`, `Disabled`) VALUES
+(1, 'madhavi', 0),
+(2, 'add-63kvupt', 0),
+(4, 'madhavi1', 0),
+(5, 'madhavi2', 0);
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `users_data`
+--
+
+CREATE TABLE IF NOT EXISTS `users_data` (
+  `ID` int(11) NOT NULL,
+  `UserID` int(11) NOT NULL,
+  `LastUpdated` datetime NOT NULL,
+  `Name` varchar(255) NOT NULL,
+  `Value` varchar(255) NOT NULL,
+  UNIQUE KEY `UserID` (`UserID`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1;
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `users_to_groups`
+--
+
+CREATE TABLE IF NOT EXISTS `users_to_groups` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `UserID` int(11) NOT NULL,
+  `GroupID` int(11) NOT NULL,
+  `Disabled` int(1) NOT NULL DEFAULT '0',
+  `Comment` varchar(1024) NOT NULL,
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
+
+--
+-- Dumping data for table `users_to_groups`
+--
+
+INSERT INTO `users_to_groups` (`ID`, `UserID`, `GroupID`, `Disabled`, `Comment`) VALUES
+(4, 1, 4, 0, '');
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `user_attributes`
+--
+
+CREATE TABLE IF NOT EXISTS `user_attributes` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `UserID` int(11) NOT NULL,
+  `Name` varchar(255) NOT NULL,
+  `Operator` varchar(4) NOT NULL,
+  `Value` varchar(255) NOT NULL,
+  `Disabled` int(1) NOT NULL DEFAULT '0',
+  `modifier` varchar(250) NOT NULL,
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=8 ;
+
+--
+-- Dumping data for table `user_attributes`
+--
+
+INSERT INTO `user_attributes` (`ID`, `UserID`, `Name`, `Operator`, `Value`, `Disabled`, `modifier`) VALUES
+(1, 1, 'User-Password', '2', '123', 0, ''),
+(3, 2, 'User-Password', '2', 'somlnvc', 0, ''),
+(6, 1, 'Traffic Limit', '0', '0.2', 0, 'Seconds'),
+(7, 5, 'User-Password', '2', '123456', 0, '');
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `wisp_locations`
+--
+
+CREATE TABLE IF NOT EXISTS `wisp_locations` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `Name` varchar(255) NOT NULL,
+  PRIMARY KEY (`ID`),
+  UNIQUE KEY `Name` (`Name`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
+
+--
+-- Dumping data for table `wisp_locations`
+--
+
+INSERT INTO `wisp_locations` (`ID`, `Name`) VALUES
+(3, 'Indore'),
+(2, 'Ujjain');
+
+-- --------------------------------------------------------
+
+--
+-- Table structure for table `wisp_userdata`
+--
+
+CREATE TABLE IF NOT EXISTS `wisp_userdata` (
+  `ID` int(11) NOT NULL AUTO_INCREMENT,
+  `UserID` int(11) NOT NULL,
+  `LocationID` int(11) NOT NULL,
+  `FirstName` varchar(255) NOT NULL,
+  `LastName` varchar(255) NOT NULL,
+  `Email` varchar(255) NOT NULL,
+  `Phone` int(11) NOT NULL,
+  PRIMARY KEY (`ID`)
+) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
+
+--
+-- Dumping data for table `wisp_userdata`
+--
+
+INSERT INTO `wisp_userdata` (`ID`, `UserID`, `LocationID`, `FirstName`, `LastName`, `Email`, `Phone`) VALUES
+(1, 1, 3, 'madhavi', 'shah', 'madhavi@centiva.co', 1234567890),
+(2, 2, 0, '', '', '', 0),
+(4, 5, 0, '', '', '', 0);
+
+/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
+/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
+/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
-- 
GitLab