Diffstat (limited to 'backend/php/src/objects/class.record.php') (more/less context) (ignore whitespace changes)
-rw-r--r-- | backend/php/src/objects/class.record.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/backend/php/src/objects/class.record.php b/backend/php/src/objects/class.record.php index a269e75..37a9702 100644 --- a/backend/php/src/objects/class.record.php +++ b/backend/php/src/objects/class.record.php | |||
@@ -9,7 +9,7 @@ | |||
9 | `data` LONGTEXT NOT NULL, | 9 | `data` LONGTEXT NOT NULL, |
10 | `version` VARCHAR(255) NOT NULL, | 10 | `version` VARCHAR(255) NOT NULL, |
11 | `creation_date` TIMESTAMP NOT NULL, | 11 | `creation_date` TIMESTAMP NOT NULL, |
12 | `update_date` TIMESTAMP NOT NULL, | 12 | `update_date` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
13 | `access_date` TIMESTAMP NOT NULL, INDEX(`userid`), PRIMARY KEY (`recordid`)) ENGINE=MyISAM; | 13 | `access_date` TIMESTAMP NOT NULL, INDEX(`userid`), PRIMARY KEY (`recordid`)) ENGINE=MyISAM; |
14 | */ | 14 | */ |
15 | 15 | ||
@@ -126,7 +126,8 @@ class record extends POG_Base | |||
126 | $this->data = $this->Unescape($row['data']); | 126 | $this->data = $this->Unescape($row['data']); |
127 | $this->version = $this->Unescape($row['version']); | 127 | $this->version = $this->Unescape($row['version']); |
128 | $this->creation_date = $row['creation_date']; | 128 | $this->creation_date = $row['creation_date']; |
129 | $this->update_date = $row['update_date']; | 129 | $oDate = strtotime($row['update_date']); |
130 | $this->update_date = date('r', $oDate); | ||
130 | $this->access_date = $row['access_date']; | 131 | $this->access_date = $row['access_date']; |
131 | } | 132 | } |
132 | return $this; | 133 | return $this; |
@@ -218,7 +219,8 @@ class record extends POG_Base | |||
218 | $record->data = $this->Unescape($row['data']); | 219 | $record->data = $this->Unescape($row['data']); |
219 | $record->version = $this->Unescape($row['version']); | 220 | $record->version = $this->Unescape($row['version']); |
220 | $record->creation_date = $row['creation_date']; | 221 | $record->creation_date = $row['creation_date']; |
221 | $record->update_date = $row['update_date']; | 222 | $oDate = strtotime($row['update_date']); |
223 | $record->update_date = date('r', $oDate); | ||
222 | $record->access_date = $row['access_date']; | 224 | $record->access_date = $row['access_date']; |
223 | $recordList[] = $record; | 225 | $recordList[] = $record; |
224 | } | 226 | } |
@@ -233,6 +235,8 @@ class record extends POG_Base | |||
233 | function Save($deep = true) | 235 | function Save($deep = true) |
234 | { | 236 | { |
235 | $connection = Database::Connect(); | 237 | $connection = Database::Connect(); |
238 | $this->update_date = date( 'r'); | ||
239 | $this->access_date = date( 'r'); | ||
236 | $this->pog_query = "select `recordid` from `record` where `recordid`='".$this->recordId."' LIMIT 1"; | 240 | $this->pog_query = "select `recordid` from `record` where `recordid`='".$this->recordId."' LIMIT 1"; |
237 | $rows = Database::Query($this->pog_query, $connection); | 241 | $rows = Database::Query($this->pog_query, $connection); |
238 | if ($rows > 0) | 242 | if ($rows > 0) |
@@ -281,6 +285,7 @@ class record extends POG_Base | |||
281 | function SaveNew($deep = false) | 285 | function SaveNew($deep = false) |
282 | { | 286 | { |
283 | $this->recordId = ''; | 287 | $this->recordId = ''; |
288 | $this->creation_date = date( 'Y-m-d H:i:s'); | ||
284 | return $this->Save($deep); | 289 | return $this->Save($deep); |
285 | } | 290 | } |
286 | 291 | ||
@@ -433,4 +438,4 @@ class record extends POG_Base | |||
433 | } | 438 | } |
434 | } | 439 | } |
435 | } | 440 | } |
436 | ?> \ No newline at end of file | 441 | ?> |