Index: /pro-violet-viettel/sourcecode/application/language/message/messages_lang.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/language/message/messages_lang.php	(revision 720)
+++ /pro-violet-viettel/sourcecode/application/language/message/messages_lang.php	(revision 721)
@@ -15,4 +15,5 @@
 $lang['_SBG_REGISTER_VIP_FULLNAME_REQUIRED_MSG'] = 'Vui lÃ²ng nháº­p há» tÃªn Äáº§y Äá»§ tiáº¿ng Viá»t';
 $lang['_SBG_REGISTER_VIP_SCHOOL_REQUIRED_MSG'] = 'TÃªn ÄÆ¡n vá» khÃŽng ÄÆ°á»£c Äá» trá»ng';
+$lang['_SBG_PROVINCE_REQUIRED_MSG'] = 'Tá»nh/TP khÃŽng ÄÆ°á»£c Äá» trá»ng';
 
 // admin
@@ -149,6 +150,6 @@
 						'TrÃ  Vinh',
 						'TuyÃªn Quang',
+						'YÃªn BÃ¡i',
 						'VÄ©nh Long',
-						'VÄ©nh PhÃºc',
-						'YÃªn BÃ¡i'
+						'VÄ©nh PhÃºc'
 						);
Index: /pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 720)
+++ /pro-violet-viettel/sourcecode/application/modules/frontend/controllers/user.php	(revision 721)
@@ -145,5 +145,4 @@
         $user['expire_date'] = date('Y-m-d', strtotime("+" . $package['p_period'] . " ".$package['p_unit'], strtotime($currentExpireDate))); 
         $user['p_id'] = $package['p_id'];
-		//$user['district'] = $input['district'];
 		$user['province'] = $input['province'];
         $this->user_model->updateUser($us_id, $user);
@@ -252,8 +251,9 @@
                     $result['errors'][] = array("content"=>lang('_SBG_REGISTER_VIP_SCHOOL_REQUIRED_MSG'),"field"=>"school");
                 }
-
+				if (strlen($input['province']) == 0) {
+                    $result['errors'][] = array("content"=>lang('_SBG_PROVINCE_REQUIRED_MSG'),"field"=>"province");
+                }
                 $input['password'] = '';
                 $input['oldpass'] = '';
-                //$input['province'] = '';
                 $this->load->model('user_model');
                 if (!isset($result['errors'])) {
Index: /pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php	(revision 720)
+++ /pro-violet-viettel/sourcecode/application/modules/frontend/views/lecture_editor.php	(revision 721)
@@ -72,6 +72,6 @@
                             <div class="col-sm-8">
                                 <input name="school"  type="text" value="<?php echo $school; ?>" placeholder="ÄÆ¡n vá»" id="form-field-first" class="input-large">
-                            <label class="block clearfix has-error">
-                                <div id="school" class="help-block error"></div>
+								<label class="block clearfix has-error">
+									<div id="school" class="help-block error"></div>
                                 </label> 
                             </div>
@@ -86,4 +86,7 @@
 								<?php endforeach;?>
 								</select>
+								<label class="block clearfix has-error">
+									<div id="province" class="help-block error"></div>
+                                </label> 
 							</div>
 						</div>
Index: /pro-violet-viettel/sourcecode/application/modules/services/controllers/sync.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/controllers/sync.php	(revision 720)
+++ /pro-violet-viettel/sourcecode/application/modules/services/controllers/sync.php	(revision 721)
@@ -12,24 +12,15 @@
 		if($this->input->is_cli_request()){
 			error_reporting(E_ALL);
-
 			$this->load->model('Services_model');
-			
-			//$totalpage = 10213;
-			
-			// get total page
 			$totalpage = 1;
 			
-			$default = $this->Services_model->getCollaborator(2,1,100);
-			//var_dump($default);
+			$default = $this->Services_model->getCollaborator(2,1,5000);
 			$data = mb_convert_encoding($default, 'UTF-8', 'ISO-8859-1');
 			if($data){
 				$xml = simplexml_load_string($data);
-				$xml->registerXPathNamespace("S", "http://schemas.xmlsoap.org/soap/envelope/");
-				
+				$xml->registerXPathNamespace("S", "http://schemas.xmlsoap.org/soap/envelope/");	
 				$xml = $xml->xpath('//S:Body');
 				$xml = $xml[0];
-
 				$xml->registerXPathNamespace("ns2", "http://process.wsim.viettel.com/");
-				
 				$totalpage = $xml->xpath('//return//totalpage');
 				$totalpage = (int)$totalpage[0];
@@ -37,5 +28,5 @@
 			
 			for ($i=1; $i<=$totalpage; $i++){
-				$result = $this->Services_model->getCollaborator(2,$i,100);
+				$result = $this->Services_model->getCollaborator(2,$i,500);
 				$data = mb_convert_encoding($result, 'UTF-8', 'ISO-8859-1');
 				if($data && $data != -1){
@@ -72,5 +63,73 @@
 				}
 			}
+		}else{
+			show_404();
 		}
 	}
+	
+	public function deleteCollaborator () 
+	{
+		
+		if($this->input->is_cli_request()){
+			error_reporting(E_ALL);
+			$this->load->model('Services_model');
+			$totalpage = 1;
+	
+			$default = $this->Services_model->getCollaborator(2,1,5000);
+			$data = mb_convert_encoding($default, 'UTF-8', 'ISO-8859-1');
+			if($data){
+				$xml = simplexml_load_string($data);
+				$xml->registerXPathNamespace("S", "http://schemas.xmlsoap.org/soap/envelope/");		
+				$xml = $xml->xpath('//S:Body');
+				$xml = $xml[0];
+				$xml->registerXPathNamespace("ns2", "http://process.wsim.viettel.com/");	
+				$totalpage = $xml->xpath('//return//totalpage');
+				$totalpage = (int)$totalpage[0];
+			}
+
+			$collaboratorIds = array();
+			
+			$logMsg = "Start XML Process: " . date('Y-m-d H:i:s') . "\n";
+			write_file('./log/delete_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
+			
+			for ($i=1; $i<$totalpage; $i++){
+				$result = $this->Services_model->getCollaborator(2,$i,5000);
+				$data = mb_convert_encoding($result, 'UTF-8', 'ISO-8859-1');
+				if($data && $data != -1){
+					$xml = simplexml_load_string($data);
+					$xml->registerXPathNamespace("S", "http://schemas.xmlsoap.org/soap/envelope/");
+					$xml = $xml->xpath('//S:Body');
+					$xml = $xml[0];
+					$xml->registerXPathNamespace("ns2", "http://process.wsim.viettel.com/");
+					$lst = $xml->xpath('//return//lst');
+					foreach($lst as $item){
+						$item = (array)$item;
+						if ((string)$item['phone']){
+							array_push($collaboratorIds, (int)$item['id']);
+						}
+					}
+				}else{
+					$logMsg = date('Y-m-d H:i:s') . " Result is null \n";
+					write_file('./log/delete_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
+				}
+			}
+			
+			$logMsg = "Finish XML Process: " . date('Y-m-d H:i:s') . "\n";
+			write_file('./log/delete_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
+			
+			$collaboratorIdsSync = $this->Services_model->getAllCollaboratorID();
+			
+			if ($collaboratorIdsSync){
+				foreach($collaboratorIdsSync as $collaborator){
+					$id = (int)$collaborator->id;
+					if (in_array($id, $collaboratorIds) == false){
+						$this->Services_model->deleteCollaborator($id);
+					}
+				}
+			}
+		}else{
+			show_404();
+		}
+
+	}
 }
Index: /pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 720)
+++ /pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php	(revision 721)
@@ -486,8 +486,8 @@
 		$this->db->query($sql);
 		if ($this->db->affected_rows()){
-			$logMsg = date('Y-m-d H:i:s') . " Collaborator ID: ".$id.". Delete success! !\n";
+			$logMsg = date('Y-m-d H:i:s') . " Collaborator ID: ".$id.". Delete success!\n";
 			write_file('./log/delete_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
 		}else{
-			$logMsg = date('Y-m-d H:i:s') . " Collaborator ID: ".$id.". Delete fail! !. Sql = ".$sql."\n";
+			$logMsg = date('Y-m-d H:i:s') . " Collaborator ID: ".$id.". Delete fail!. Sql = ".$sql."\n";
 			write_file('./log/delete_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
 		}
