//
//***************************************
// 類別名稱:CuTask
// 功 能:工作記錄 對資料表 task 資料維護
//***************************************/
class CuTaskDlg {
// 成員變數
// private
var $created;
// public
var $title;
var $description;
var $account_id;
// 資料庫關聯
var $ado;
var $record;
// 靜態變數
var $table_name = "hrc_task";
/************************************************
* 函式名稱: CuTaskDlg
* 函式說明: 使用CuRecord作業
************************************************/
function CuTaskDlg($ado) {
$this->ado = $ado;
$this->record = new CuRecord($ado, $this->table_name, "sn");
}
/************************************************
* 函式名稱: Save
* 函式說明: 儲存 這個 啞資料類別不處理
************************************************/
function Save()
{
if(!($this->title))
return;
$this->created = date("Y-m-d H:i:s", time());
$record = &$this->record;
// 檢查是否有留言過
$sn = $record->Load("title", "$this->title");
if( $sn != "" )
return;
$record->SetField("created", $this->created );
$record->SetField("title", $this->title);
$record->SetField("description", $this->description);
$record->SetField("account_id", $this->account_id);
$record->Save();
}
/************************************************
* 函式名稱: Load
* 函式說明: 指定SN值 載入指定的資料項
************************************************/
function Load($sn)
{
$record = &$this->record;
$record->Load("sn", $sn);
$this->created = $record->GetField("created");
$this->title = $record->GetField("title");
$this->description = $record->GetField("description");
$this->account_id = $record->GetField("account_id");
}
}
/*
--
-- 資料表格式: `hrc_task`
--
CREATE TABLE `hrc_task` (
`sn` int(11) NOT NULL auto_increment,
`created` timestamp NOT NULL default '0000-00-00 00:00:00',
`title` varchar(256) NOT NULL,
`description` text,
`account_id` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`sn`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
created 記錄建立日期
title 項目主旨
description 詳細內容
account_id 帳號索引 用來關聯是那位使用者寫入的 預設為0
*/
2010年2月14日 星期日
CuTaskDlg
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言