Viewing file: da_ea_CurriculumDetails.php (3 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once("my_ea_model.php");
class Da_ea_curriculumdetails extends My_ea_model {
// PK is curId
public $curId;
public $curImproveY;
public $curName;
public $curNameE;
public $curAbbr;
public $curAbbrE;
public $curStatus;
public $curCcId;
public $ccCode;
public $ccName;
public $curEdgId;
public $edgName;
public $edgNameE;
public $edgAbbr;
public $edgAbbrE;
public $curElvId;
public $levelName;
public $levelNameEng;
public $levelAbbr;
public $levelAbbrEng;
public $curAddType;
public $last_insert_id;
function Da_ea_curriculumdetails() {
parent::__construct();
$this->load->database('ea', TRUE);
}
function insert() {
// if there is no auto_increment field, please remove it
$sql = "INSERT INTO $this->ea_dbname.ea_CurriculumDetails (curId, curImproveY, curName, curNameE, curAbbr, curAbbrE, curStatus, curCcId, ccCode, ccName, curEdgId, edgName, edgNameE, edgAbbr, edgAbbrE, curElvId, levelName, levelNameEng, levelAbbr, levelAbbrEng, curAddType)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
$this->db->query($sql, array($this->curId, $this->curImproveY, $this->curName, $this->curNameE, $this->curAbbr, $this->curAbbrE, $this->curStatus, $this->curCcId, $this->ccCode, $this->ccName, $this->curEdgId, $this->edgName, $this->edgNameE, $this->edgAbbr, $this->edgAbbrE, $this->curElvId, $this->levelName, $this->levelNameEng, $this->levelAbbr, $this->levelAbbrEng, $this->curAddType));
$this->last_insert_id = $this->db->insert_id();
}
function update() {
// if there is no primary key, please remove WHERE clause.
$sql = "UPDATE $this->ea_dbname.ea_CurriculumDetails
SET curImproveY=?, curName=?, curNameE=?, curAbbr=?, curAbbrE=?, curStatus=?, curCcId=?, ccCode=?, ccName=?, curEdgId=?, edgName=?, edgNameE=?, edgAbbr=?, edgAbbrE=?, curElvId=?, levelName=?, levelNameEng=?, levelAbbr=?, levelAbbrEng=?, curAddType=?
WHERE curId=?";
$this->db->query($sql, array($this->curImproveY, $this->curName, $this->curNameE, $this->curAbbr, $this->curAbbrE, $this->curStatus, $this->curCcId, $this->ccCode, $this->ccName, $this->curEdgId, $this->edgName, $this->edgNameE, $this->edgAbbr, $this->edgAbbrE, $this->curElvId, $this->levelName, $this->levelNameEng, $this->levelAbbr, $this->levelAbbrEng, $this->curAddType, $this->curId));
}
function delete() {
// if there is no primary key, please remove WHERE clause.
$sql = "DELETE FROM $this->ea_dbname.ea_CurriculumDetails
WHERE curId=?";
$this->db->query($sql, array($this->curId));
}
/*
* You have to assign primary key value before call this function.
*/
function get_by_key($withSetAttributeValue=FALSE) {
$sql = "SELECT *
FROM $this->ea_dbname.ea_CurriculumDetails
WHERE curId=?";
$query = $this->db->query($sql, array($this->curId));
if ( $withSetAttributeValue ) {
$this->row2attribute( $query->row() );
} else {
return $query ;
}
}
} //=== end class Da_ea_curriculumdetails
?>
|