Viewing file: da_ummenu.php (2.13 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once("ver_model.php");
class Da_ummenu extends Ver_model { // PK is MnID public $MnStID; public $MnID; public $MnSeq; public $MnIcon; public $MnNameT; public $MnNameE; public $MnURL; public $MnDesc; public $MnToolbar; public $MnToolbarSeq; public $MnToolbarIcon; public $MnParentMnID; public $MnLevel;
public $last_insert_id;
function __construct() { parent::__construct(); } function insert() { // if there is no auto_increment field, please remove it $sql = "INSERT INTO ".$this->ums_db.".ummenu (MnStID, MnID, MnSeq, MnIcon, MnNameT, MnNameE, MnURL, MnDesc, MnToolbar, MnToolbarSeq, MnToolbarIcon, MnParentMnID, MnLevel) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; $this->db->query($sql, array($this->MnStID, $this->MnID, $this->MnSeq, $this->MnIcon, $this->MnNameT, $this->MnNameE, $this->MnURL, $this->MnDesc, $this->MnToolbar, $this->MnToolbarSeq, $this->MnToolbarIcon, $this->MnParentMnID, $this->MnLevel)); $this->last_insert_id = $this->db->insert_id(); } function update() { // if there is no primary key, please remove WHERE clause. $sql = "UPDATE ".$this->ums_db.".ummenu SET MnStID=?, MnSeq=?, MnIcon=?, MnNameT=?, MnNameE=?, MnURL=?, MnDesc=?, MnToolbar=?, MnToolbarSeq=?, MnToolbarIcon=?, MnParentMnID=?, MnLevel=? WHERE MnID=?"; $this->db->query($sql, array($this->MnStID, $this->MnSeq, $this->MnIcon, $this->MnNameT, $this->MnNameE, $this->MnURL, $this->MnDesc, $this->MnToolbar, $this->MnToolbarSeq, $this->MnToolbarIcon, $this->MnParentMnID, $this->MnLevel, $this->MnID)); } function delete() { // if there is no primary key, please remove WHERE clause. $sql = "DELETE FROM ".$this->ums_db.".ummenu WHERE MnID=?"; $this->db->query($sql, array($this->MnID)); } /* * You have to assign primary key value before call this function. */ function get_by_key($withSetAttributeValue=FALSE) { $sql = "SELECT * FROM ".$this->ums_db.".ummenu WHERE MnID=?"; $query = $this->db->query($sql, array($this->MnID)); if ( $withSetAttributeValue ) { $this->row2attribute( $query->row() ); } else { return $query ; } } } //=== end class Da_ummenu ?>
|