Index: /pro-violet-viettel/sourcecode/application/cache/smarty/compiled/8b2d10c353cfdb015a96e339ea08ab72495dbf35.file.listview.php.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/cache/smarty/compiled/8b2d10c353cfdb015a96e339ea08ab72495dbf35.file.listview.php.php	(revision 359)
+++ /pro-violet-viettel/sourcecode/application/cache/smarty/compiled/8b2d10c353cfdb015a96e339ea08ab72495dbf35.file.listview.php.php	(revision 360)
@@ -1,3 +1,3 @@
-<?php /* Smarty version Smarty-3.1.7, created on 2014-10-30 15:14:35
+<?php /* Smarty version Smarty-3.1.7, created on 2014-10-30 16:16:52
          compiled from "application/modules/admin/views/collaborator/listview.php" */ ?>
 <?php /*%%SmartyHeaderCode:691235965451c611936948-25061103%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
@@ -8,5 +8,5 @@
     array (
       0 => 'application/modules/admin/views/collaborator/listview.php',
-      1 => 1414656631,
+      1 => 1414660609,
       2 => 'file',
     ),
@@ -31,8 +31,5 @@
 ),false); /*/%%SmartyHeaderCode%%*/?>
 <?php if ($_valid && !is_callable('content_5451c61194a0f')) {function content_5451c61194a0f($_smarty_tpl) {?><div id="breadcrumbs" class="breadcrumbs">
-    <script type="text/javascript">
-        try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
-    </script>
-
+   
     <ul class="breadcrumb">
         <li>
@@ -117,16 +114,19 @@
                     <table class="table table-striped table-bordered table-hover dataTable" id="sample-table-2" aria-describedby="sample-table-2_info">
                         <thead>
-                            <tr role="row"><th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label="">
+                            <tr role="row">
+                                <th class="center sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 44px;" aria-label="">
                                     <label>
                                         <input type="checkbox" class="ace">
                                         <span class="lbl"></span>
                                     </label>
-                                </th><th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Sá» Äiá»n thoáº¡i: activate to sort column ascending">Sá» Äiá»n thoáº¡i</th><th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 183px;" aria-label="Há» tÃªn: activate to sort column ascending">Há» tÃªn</th><th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 122px;" aria-label="Tiá»n: activate to sort column ascending">Tiá»n</th><th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="
-
-                                                                                                                                                                                                        NgÃ y ÄÄng kÃœ
-                                                                                                                                                                                                        : activate to sort column ascending">
+                                </th>
+                                <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 176px;" aria-label="Sá» Äiá»n thoáº¡i: activate to sort column ascending">Sá» Äiá»n thoáº¡i</th>
+                                <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 183px;" aria-label="Há» tÃªn: activate to sort column ascending">Há» tÃªn</th>
+                                <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 122px;" aria-label="Tiá»n: activate to sort column ascending">Tiá»n</th>
+                                <th class="sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 209px;" aria-label="NgÃ y ÄÄng kÃœ: activate to sort column ascending">
                                     <i class="icon-time bigger-110 hidden-480"></i>
                                     NgÃ y ÄÄng kÃœ
-                                </th><th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Tráº¡ng thÃ¡i: activate to sort column ascending">Tráº¡ng thÃ¡i</th><th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr>
+                                </th>
+                                <th class="hidden-480 sorting" role="columnheader" tabindex="0" aria-controls="sample-table-2" rowspan="1" colspan="1" style="width: 158px;" aria-label="Tráº¡ng thÃ¡i: activate to sort column ascending">Tráº¡ng thÃ¡i</th><th class="sorting_disabled" role="columnheader" rowspan="1" colspan="1" style="width: 133px;" aria-label=""></th></tr>
                         </thead>
 
Index: /pro-violet-viettel/sourcecode/application/config/routes.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/config/routes.php	(revision 359)
+++ /pro-violet-viettel/sourcecode/application/config/routes.php	(revision 360)
@@ -46,4 +46,5 @@
 $route['admin/cong_tac_vien'] = 'admin/collaborator';
 $route['admin/cong_tac_vien/trang'] = 'admin/collaborator/getCollaborators/1';
+$route['admin/cong_tac_vien/them'] = 'admin/collaborator/addCollaborator';
 $route['admin/cong_tac_vien/trang/:any'] = 'admin/collaborator/getCollaborators/$1';
 $route['admin/cong_tac_vien/test'] = 'admin/collaborator/test';
Index: /pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php	(revision 359)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/controllers/collaborator.php	(revision 360)
@@ -12,89 +12,62 @@
 
     public function index() {
-        $data=array();
+        $data = array();
         $this->load->driver("pp");
         $admin_info = $this->session->userdata('adminInfo');
         if ($admin_info) {
             $data['content'] = $this->getCollaborators();
-            $this->load->view('collaborator/index',$data);
+            $this->load->view('collaborator/index', $data);
         } else {
             $this->load->view('login');
         }
     }
-    public function getCollaborators($filters=array())
-    {
-  
-        $data['current_page'] = $this->uri->segment(4,1);
-        $data['itemsoptions']=array(10,25,50,100);
-        $data['perpage'] = 10;   
+
+    public function getCollaborators($filters = array()) {
+        $this->load->helper('pagging');
+        $this->load->model('collabolator_model');
+        $data['current_page'] = $this->uri->segment(4, 1);
+        $data['itemsoptions'] = array(10, 25, 50, 100);
+        $data['perpage'] = 10;
+        $data['keyword'] = "";
+
+        if ($this->input->post('items')) {
+            $data['perpage'] = $this->input->post('items');
+        }
+        if ($this->input->post('keyword')) {
+            $data['keyword'] = $this->input->post('keyword');
+        }
         
-        if ($this->input->post('items'))
-        {
-        $data['perpage'] = $this->input->post('items');    
-        }
-        $sql="SELECT * FROM tblcollaborator";
-        $data['keyword']='';
-       
-        if ($this->input->post('keyword'))
-        {
-        $data['keyword']=$this->input->post('keyword');
-        $sql.=" WHERE (full_name LIKE '%".$data['keyword']."%' OR login_name LIKE '%".$data['keyword']."%')";
-        }
+        $data['start'] = ($data['current_page'] - 1) * $data['perpage'];
+        $data['total'] = $this->collabolator_model->countCollaborator($data);  
+        $data['collaborators'] = $this->collabolator_model->getCollaborator($data);
 
-        $data['total']=$this->db->query($sql)->num_rows();
-        $data['start']=($data['current_page']-1)*$data['perpage'];
-        $query = $this->db->query($sql." LIMIT ".$data['start'].", ".$data['perpage']."");
-        $data['collaborators']=$query->result_array();
-        $this->load->library('pagination');
-        $url = "http://$_SERVER[HTTP_HOST]/admin/cong_tac_vien/trang/";
-        $config['base_url'] = $url;
-        $config['total_rows'] = $data['total'];
-        $config['use_page_numbers'] = TRUE;
-        $config['per_page'] = $data['perpage'];
-        $config['num_tag_open'] = "<li>";
-        $config['num_tag_close'] = "</li>";
-        $config['cur_tag_open'] = "<li class='active'><a>";
-        $config['cur_tag_close'] = '</a></li>';
-        $config['last_link'] = 'Â»';
-        $config['first_link'] = 'Â«';
-        $config['first_tag_open'] = "<li title='Trang Äáº§u tiÃªn'>";
-        $config['first_tag_close'] = '</li>';
-        $config['last_tag_open'] = "<li title='Trang cuá»i cÃ¹ng'>";
-        $config['last_tag_close'] = '</li>';
-        $config['next_link'] = '>';
-        $config['next_tag_open'] = "<li title='Trang káº¿ tiáº¿p'>";
-        $config['next_tag_close'] = '</li>';
-        $config['prev_link'] = '<';
-        $config['prev_tag_open'] = "<li title='Trang trÆ°á»c'>";
-        $config['prev_tag_close'] = '</li>';
-        $config['num_links'] = 2;
-        $config['current_page'] = $data['current_page'];
-        $config['ajax_class'] = 'ajax_paging';
-        $this->pagination->initialize($config);
-        $data['paging'] = $this->pagination->create_links();
+        $data['paging_url'] = base_url() . "/admin/cong_tac_vien/trang/";
+        $data['num_links'] = 2;
+        $data['paging'] = pagging($data);
 
         if ($this->input->is_ajax_request()) {
-        return $this->load->view('collaborator/listview', $data);   
+            return $this->load->view('collaborator/listview', $data);
         }
-        return $this->load->view('collaborator/listview', $data,true);   
+        return $this->load->view('collaborator/listview', $data, true);
     }
-    public function addCollaborator()
-    {
-        $result=array();
-        $input=$this->input->post();
-        $this->db->insert('tblcollaborator', $input); 
-        $result['success']=1;
+
+    public function addCollaborator() {
+        $result = array();
+        $input = $this->input->post();
+        $this->db->insert('tblcollaborator', $input);
+        $result['success'] = 1;
         echo json_encode($result);
     }
+
     public function test() {
-        
+
         for ($i = 1; $i <= 500; $i++) {
             $collaborator = new Entities\Tblcollaborator();
             $collaborator->setActivated(rand(0, 1));
             $collaborator->setAuthor(1);
-            $collaborator->setCellphone('0' . (1695061706+$i));
+            $collaborator->setCellphone('0' . (1695061706 + $i));
             $collaborator->setCreatedTime(date("Y-m-d H:i:s"));
-            $collaborator->setFullName("Full Name ".$i);
-            $collaborator->setLoginName("loginname".$i);
+            $collaborator->setFullName("Full Name " . $i);
+            $collaborator->setLoginName("loginname" . $i);
             $collaborator->setPasswd(md5("12345678"));
             $collaborator->setUpdatedTime(date("Y-m-d H:i:s"));
Index: /pro-violet-viettel/sourcecode/application/modules/admin/controllers/home.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/controllers/home.php	(revision 359)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/controllers/home.php	(revision 360)
@@ -11,4 +11,5 @@
 	public function index ()
 	{
+            
 		$admin_info = $this->session->userdata('adminInfo');
 		if ($admin_info)
@@ -23,4 +24,5 @@
 	public function login()
 	{
+           
 		$username = $this->input->post('user_admin');
 		$password = $this->input->post('password');
Index: /pro-violet-viettel/sourcecode/application/modules/admin/models/admin_model.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/models/admin_model.php	(revision 359)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/models/admin_model.php	(revision 360)
@@ -16,5 +16,5 @@
 		$hash_password = md5($password);
 		$query = "SELECT * FROM tbladmin WHERE  login_name = ? AND  passwd = ?";
-		$result = $this->db->query($query, array($login_name, $hash_password));
+                $result = $this->db->query($query, array($login_name, $hash_password));
 		if($result->num_rows() == 1){
 			return $result->row(0);
Index: /pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 359)
+++ /pro-violet-viettel/sourcecode/application/modules/admin/models/collabolator_model.php	(revision 360)
@@ -11,4 +11,26 @@
 		parent::__construct();
 	}
-	
+	function getCollaborator($data)
+        {
+            $sql="SELECT * FROM tblcollaborator";
+            $data['keyword']='';
+
+            if ($data['keyword'])
+            {
+            $sql.=" WHERE (full_name LIKE '%".$data['keyword']."%' OR login_name LIKE '%".$data['keyword']."%')";
+            }
+            return $this->db->query($sql." LIMIT ".$data['start'].", ".$data['perpage']."")->result_array();
+
+        }
+        function countCollaborator($data)
+        {
+            $sql="SELECT COUNT(id) as total FROM tblcollaborator";
+            if (isset($data['keyword']))
+            {
+            $sql.=" WHERE (full_name LIKE '%".$data['keyword']."%' OR login_name LIKE '%".$data['keyword']."%')";
+            }
+
+            return $this->db->query($sql)->row_array()['total'];
+            
+        }
 }
Index: /pro-violet-viettel/sourcecode/application/views/layout/admin/sidebar.php
===================================================================
--- /pro-violet-viettel/sourcecode/application/views/layout/admin/sidebar.php	(revision 359)
+++ /pro-violet-viettel/sourcecode/application/views/layout/admin/sidebar.php	(revision 360)
@@ -66,5 +66,5 @@
 
 								<li>
-									<a href="assistant_acc.html">
+									<a href="<?php echo $base_url; ?>admin/cong_tac_vien">
 										<i class="icon-double-angle-right"></i>
 										Cá»ng tÃ¡c viÃªn
Index: /pro-violet-viettel/sourcecode/assets/js/admin/collaborator.js
===================================================================
--- /pro-violet-viettel/sourcecode/assets/js/admin/collaborator.js	(revision 359)
+++ /pro-violet-viettel/sourcecode/assets/js/admin/collaborator.js	(revision 360)
@@ -6,2 +6,22 @@
     };
 })(jQuery);
+$(".btn#add_user").click(function () 
+{
+    $.ajax({
+                url: "cong_tac_vien/them",
+                type: "POST",
+                data: $("#add_user").serialize(),
+                success: function (data, textStatus, jqXHR)
+                {
+                    // $result = jQuery.parseJSON(data);
+                    $("#content").html(data);
+                    init_page();
+
+                },
+                error: function (jqXHR, textStatus, errorThrown)
+                {
+                    $(".ajaxloading").hide();
+                }
+            });
+        
+        })
