Viewing file: da_umuser.php (2.08 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php class Da_umuser extends CI_Model { // PK is UsID
public $UsID; public $UsName; public $UsLogin; public $UsPassword; public $UsPsCode; public $UsWgID; public $UsQsID; public $UsAnswer; public $UsEmail; public $UsActive; public $UsAdmin; public $UsDesc; public $UsPwdExpDt; public $UsUpdDt; public $UsUpdUsID; public $UsSessionID;
function Da_umuser() { parent::__construct(); $this->db = $this->load->database('alumniums', TRUE); }
function insert() { $sql = "INSERT INTO ".$this->config->item('alumni_ums_dbname').".umuser (UsName, UsLogin, UsPassword, UsPsCode, UsWgID, UsQsID, UsAnswer, UsEmail, UsActive, UsAdmin, UsDesc, UsPwdExpDt, UsUpdDt, UsUpdUsID, UsSessionID) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $this->db->query($sql, array($this->UsName, $this->UsLogin, $this->UsPassword, $this->UsPsCode, $this->UsWgID, $this->UsQsID, $this->UsAnswer, $this->UsEmail, $this->UsActive, $this->UsAdmin, $this->UsDesc, $this->UsPwdExpDt, $this->UsUpdDt, $this->UsUpdUsID, $this->UsSessionID)); $this->last_insert_id = $this->db->insert_id(); }
function update() { $sql = "UPDATE umuser SET UsName = ?, UsLogin = ?, UsPassword = ?, UsPsCode = ?, UsWgID = ?, UsQsID = ?, UsAnswer = ?, UsEmail = ?, UsActive = ?, UsAdmin = ?, UsDesc = ?, UsPwdExpDt = ?, UsUpdDt = ?, UsUpdUsID = ?, UsSessionID = ? WHERE UsID = ? "; $this->db->query($sql, array($this->UsName, $this->UsLogin, $this->UsPassword, $this->UsPsCode, $this->UsWgID, $this->UsQsID, $this->UsAnswer, $this->UsEmail, $this->UsActive, $this->UsAdmin, $this->UsDesc, $this->UsPwdExpDt, $this->UsUpdDt, $this->UsUpdUsID, $this->UsSessionID, $this->UsID)); }
function delete($key) { $sql = "DELETE FROM umuser WHERE UsID = ? "; $this->db->query($sql, array($key)); }
function getByKey($key) { $sql = "SELECT * FROM umuser WHERE UsID = ? "; $query = $this->db->query($sql, array($key)) ; return $query ; }
function last_insert_id(){ return $this->db->insert_id(); }
} //=== end class da_umuser
?>
|