Viewing file: da_sa_health_privilege.php (1.82 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once("sa_model.php");
class Da_sa_health_privilege extends Sa_model { // PK is htp_id public $htp_id; public $htp_std_id; public $htp_hpId; public $htp_status; public $htp_create_date; public $htp_update_date;
public $last_insert_id;
function __construct() { parent::__construct(); $this->load->database('esa',TRUE); } function insert() { // if there is no auto_increment field, please remove it $sql = "INSERT INTO $this->sa_dbname.sa_health_privilege (htp_id, htp_std_id, htp_hpId, htp_status, htp_create_date, htp_update_date) VALUES(?, ?, ?, ?, ?, ?)"; $this->db->query($sql, array($this->htp_id, $this->htp_std_id, $this->htp_hpId, $this->htp_status, $this->htp_create_date, $this->htp_update_date)); $this->last_insert_id = $this->db->insert_id(); } function update() { // if there is no primary key, please remove WHERE clause. $sql = "UPDATE $this->sa_dbname.sa_health_privilege SET htp_std_id=?, htp_hpId=?, htp_status=?, htp_create_date=?, htp_update_date=? WHERE htp_id=?"; $this->db->query($sql, array($this->htp_std_id, $this->htp_hpId, $this->htp_status, $this->htp_create_date, $this->htp_update_date, $this->htp_id)); } function delete() { // if there is no primary key, please remove WHERE clause. $sql = "DELETE FROM $this->sa_dbname.sa_health_privilege WHERE htp_id=?"; $this->db->query($sql, array($this->htp_id)); } /* * You have to assign primary key value before call this function. */ function get_by_key($withSetAttributeValue=FALSE) { $sql = "SELECT * FROM $this->sa_dbname.sa_health_privilege WHERE htp_id=?"; $query = $this->db->query($sql, array($this->htp_id)); if ( $withSetAttributeValue ) { $this->row2attribute( $query->row() ); } else { return $query ; } } } //=== end class Da_sa_health_privilege ?>
|