Ignore:
Timestamp:
Jan 6, 2015 11:52:00 AM (10 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pro-violet-viettel/sourcecode/application/modules/services/models/services_model.php

    r685 r688  
    420420                return $result;
    421421        }
     422       
     423       
     424        public function syncCollaborator($data){
     425                if ($data){
     426                        $sql = $this->db->insert_string('tblcollaborator', $data) . ' ON DUPLICATE KEY UPDATE address = "'.$data['address'].'",
     427                                                                                                                                                                                                code = "'.$data['code'].'",
     428                                                                                                                                                                                                district = "'.$data['district'].'",
     429                                                                                                                                                                                                email = "'.$data['email'].'",
     430                                                                                                                                                                                                full_name = "'.$data['full_name'].'",
     431                                                                                                                                                                                                cellphone = "'.$data['cellphone'].'",
     432                                                                                                                                                                                                precinct = "'.$data['precinct'].'",
     433                                                                                                                                                                                                province = "'.$data['province'].'",
     434                                                                                                                                                                                                updated_time = "'.$data['updated_time'].'"';
     435                        $this->db->query($sql);
     436                        $id = $this->db->insert_id();
     437                        if ($this->db->affected_rows()){
     438                                echo "Collaborator ID: ".$id.". Sync Success !<br/>";
     439                        }else{
     440                                echo "Collaborator ID: ".$id.". Sync fail!. Sql = ".$sql."<br/>";
     441                        }
     442                }else {
     443                        var_dump($data);
     444                }
     445        }
    422446}
Note: See TracChangeset for help on using the changeset viewer.