Ignore:
Timestamp:
Jan 29, 2015 5:32:13 PM (10 years ago)
Author:
namnd
Message:
 
File:
1 edited

Legend:

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

    r716 r717  
    481481                }
    482482        }
     483       
     484        public function deleteCollaborator($id){
     485                $sql = "DELETE FROM tblcollaborator WHERE id = ". $id;
     486                $this->db->query($sql);
     487                if ($this->db->affected_rows()){
     488                        $logMsg = date('Y-m-d H:i:s') . " Collaborator ID: ".$id.". Delete success! !\n";
     489                        write_file('./log/delete_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
     490                }else{
     491                        $logMsg = date('Y-m-d H:i:s') . " Collaborator ID: ".$id.". Delete fail! !. Sql = ".$sql."\n";
     492                        write_file('./log/delete_collaborator.log', $logMsg, FOPEN_WRITE_CREATE);
     493                }
     494        }
     495       
     496        public function getAllCollaboratorID(){
     497                $sql = "Select id from tblcollaborator";
     498                $query = $this->db->query($sql);
     499                if ($this->db->affected_rows()){
     500                        return $query->result();
     501                }else
     502                {
     503                        return array();
     504                }
     505        }
    483506}
Note: See TracChangeset for help on using the changeset viewer.