Viewing file: da_sa_detail_project.php (3.74 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include_once("sa_model.php");
class Da_sa_detail_project extends Sa_model {
// PK is dpj_id
public $dpj_id;
public $dpj_mpj_id;
public $dpj_sub_name;
public $dpj_owner;
public $dpj_manager;
public $dpj_adviser;
public $dpj_objective;
public $dpj_result;
public $dpj_attribute;
public $dpj_indicator;
public $dpj_target;
public $dpj_place;
public $dpj_fr_date;
public $dpj_to_date;
public $dpj_procedure;
public $dpj_creator;
public $dpj_seq;
public $dpj_year;
public $dpj_bgY;
public $dpj_code;
public $dpj_status;
public $dpj_us_offer;
public $dpj_date_offer;
public $dpj_us_approve;
public $dpj_date_approve;
public $dpj_conclude;
public $last_insert_id;
function Da_sa_detail_project() {
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_detail_project (dpj_id, dpj_mpj_id, dpj_sub_name, dpj_owner, dpj_manager, dpj_adviser, dpj_objective, dpj_result, dpj_attribute, dpj_indicator, dpj_target, dpj_place, dpj_fr_date, dpj_to_date, dpj_procedure, dpj_creator, dpj_seq, dpj_year, dpj_bgY, dpj_code, dpj_status, dpj_us_offer, dpj_date_offer, dpj_us_approve, dpj_date_approve, dpj_conclude)
VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,?,?,?,?,?,?,?,?,?,?)";
$this->db->query($sql, array($this->dpj_id, $this->dpj_mpj_id, $this->dpj_sub_name, $this->dpj_owner, $this->dpj_manager, $this->dpj_adviser, $this->dpj_objective, $this->dpj_result, $this->dpj_attribute, $this->dpj_indicator, $this->dpj_target, $this->dpj_place, $this->dpj_fr_date, $this->dpj_to_date, $this->dpj_procedure, $this->dpj_creator
,$this->dpj_seq ,$this->dpj_year,$this->dpj_bgY,$this->dpj_code, $this->dpj_status, $this->dpj_us_offer, $this->dpj_date_offer, $this->dpj_us_approve, $this->dpj_date_approve, $this->dpj_conclude));
$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_detail_project
SET dpj_mpj_id=?, dpj_sub_name=?, dpj_owner=?, dpj_manager=?, dpj_adviser=?, dpj_objective=?, dpj_result=?, dpj_attribute=?, dpj_indicator=?, dpj_target=?, dpj_place=?, dpj_fr_date=?, dpj_to_date=?, dpj_procedure=?, dpj_creator=? ,
dpj_seq=? ,dpj_year=?,dpj_bgY=?,dpj_code=?, dpj_status=?, dpj_us_offer=?, dpj_date_offer=?, dpj_us_approve=?, dpj_date_approve=?, dpj_conclude=?
WHERE dpj_id=?";
$this->db->query($sql, array($this->dpj_mpj_id, $this->dpj_sub_name, $this->dpj_owner, $this->dpj_manager, $this->dpj_adviser, $this->dpj_objective, $this->dpj_result, $this->dpj_attribute, $this->dpj_indicator, $this->dpj_target, $this->dpj_place, $this->dpj_fr_date, $this->dpj_to_date, $this->dpj_procedure, $this->dpj_creator
,$this->dpj_seq , $this->dpj_year,$this->dpj_bgY,$this->dpj_code, $this->dpj_status, $this->dpj_us_offer, $this->dpj_date_offer, $this->dpj_us_approve, $this->dpj_date_approve, $this->dpj_conclude, $this->dpj_id));
}
function delete() {
// if there is no primary key, please remove WHERE clause.
$sql = "DELETE FROM $this->sa_dbname.sa_detail_project
WHERE dpj_id=?";
$this->db->query($sql, array($this->dpj_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_detail_project
WHERE dpj_id=?";
$query = $this->db->query($sql, array($this->dpj_id));
if ( $withSetAttributeValue ) {
$this->row2attribute( $query->row() );
} else {
return $query ;
}
}
} //=== end class Da_sa_detail_project
?>
|