Index: pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php
===================================================================
--- pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 883)
+++ pro-violet-viettel/sourcecode/application/modules/admin/controllers/user.php	(revision 906)
@@ -81,4 +81,6 @@
 			$daterange [0] = str_replace ( '/', '-', $daterange [0] );
 			$daterange [1] = str_replace ( '/', '-', $daterange [1] );
+			$data['date_start'] = $daterange [0];
+			$data['date_end'] = $daterange [1];
 			$data ['daterange_start'] = date ( 'Y-m-d H:i:s', strtotime ( $daterange [0] ) );
 			$data ['daterange_end'] = date ( 'Y-m-d H:is:s', strtotime ( $daterange [1] . ' + 1 day' ) );
@@ -208,67 +210,37 @@
 		);
 		$data ['status'] = $this->uri->segment (7, 0);
-		/*
-		if ($this->input->post ( 'status' )) {
-			$data ['status'] = ( int ) $this->input->post ( 'status' );
-		}
-		*/
+		
 		$data['provinces'] = $provinces;
 		$data['province'] = $this->uri->segment (8);
+		
 		if ($data['province'] == 'default') $data['province'] = null;
-		if ($this->input->post ( 'province' )) {
-			$data ['province'] = $this->input->post ( 'province' );
-		}
 		if ($data['province'])
 			$data['districts'] = $this->user_model->getDistrictByProvince($data ['province']);
-		if ($this->input->post ( 'district' )) {
-			$data['district'] = $this->input->post ( 'district' );
-		}
-		
+
 		$data['district'] = $this->uri->segment (9);
 		if ($data['district'] == 'default') $data['district'] = null;
 		$data ['keyword'] = $this->uri->segment (6);
 		if ($data['keyword'] == 'default') $data['keyword'] = null;
+		
 		$data ['sorting_order'] = "sorting_desc";
 		$data ['sorting_field'] = "created_time";
-		$data ['sorting_order'] = $this->uri->segment (11);
-		$data ['sorting_field'] = $this->uri->segment (12);
-		
-		if ($this->input->post ( 'sorting_order' )) {
-			if ($this->input->post ( 'sorting_order' ) != "sorting") {
-				$data ['sorting_order'] = $this->input->post ( 'sorting_order' );
-				$data ['sorting_field'] = $this->input->post ( 'sorting_field' );
-			}
-		}
-		
-		if ($this->input->post ( 'items' )) {
-			$data ['perpage'] = $this->input->post ( 'items' );
-		}
-		
-		if ($this->input->post ( 'keyword' )) {
-			$data ['keyword'] = $this->input->post ( 'keyword' );
-		}
-		
-		$data ['daterange_start'] = "";
-		$data ['daterange_end'] = "";
-		$daterange = $this->uri->segment (10);
-		if ($daterange == 'default') $daterange = null;
-		if($daterange){
-			$daterange = explode ( " - ", $daterange );
-			$daterange [0] = str_replace ( '/', '-', $daterange [0] );
-			$daterange [1] = str_replace ( '/', '-', $daterange [1] );
-			$data ['daterange_start'] = date ( 'Y-m-d H:i:s', strtotime ( $daterange [0] ) );
-			$data ['daterange_end'] = date ( 'Y-m-d H:is:s', strtotime ( $daterange [1] . ' + 1 day' ) );
-		}
-		if ($this->input->post ( 'daterange' )) {
-			$daterange = explode ( " - ", $this->input->post ( 'daterange' ) );
-			$daterange [0] = str_replace ( '/', '-', $daterange [0] );
-			$daterange [1] = str_replace ( '/', '-', $daterange [1] );
-			$data ['daterange_start'] = date ( 'Y-m-d H:i:s', strtotime ( $daterange [0] ) );
-			$data ['daterange_end'] = date ( 'Y-m-d H:is:s', strtotime ( $daterange [1] . ' + 1 day' ) );
-		}
+		$data ['sorting_order'] = $this->uri->segment (12);
+		$data ['sorting_field'] = $this->uri->segment (13);
+
+		$data ['daterange_start'] = $this->uri->segment (10);
+		$data ['daterange_end'] = $this->uri->segment (11);
+		if ($data['daterange_start'] == 'default') $data['daterange_start'] = null;
+		if ($data['daterange_end'] == 'default') $data['daterange_end'] = null;
+		if ($data['daterange_start'])
+			$data['daterange_start'] = date ( 'Y-m-d H:i:s', strtotime ( $data ['daterange_start'] ) );
+		if ($data['daterange_end'])
+			$data['daterange_end'] = date ( 'Y-m-d H:i:s', strtotime ( $data['daterange_end'] . ' + 1 day' ) );
+
 		$data ['start'] = ($data ['current_page'] - 1) * $data ['perpage'];
+		//echo json_encode($data);
 		$data ['total'] = $this->user_model->get_total_users ( $data );
 		$us = $this->user_model->get_list_users ( $data );
 		$users = array ();
+		
 		
 		foreach ( $us as $u ) {
@@ -295,5 +267,5 @@
 			array_push ( $users, $u );
 		}
-	
+		
 		$data ['users'] = $users;
 		$data ['paging_url'] = base_url () . "admin/nguoi_dung/trang/";
