Convert from timestamp to datetime. Datetime is consistent between mysql 4.0x and newer

versions and is faster for date/time computations. Modify object creation methods to specify
any time fields that were previously updated with timestamp properties.
This commit is contained in:
Chris Morgan
2007-07-31 23:48:22 +00:00
committed by WineHQ
parent 8b7fdf606c
commit b94a2a392b
22 changed files with 96 additions and 81 deletions

View File

@@ -121,12 +121,14 @@ class Application {
if(!$_SESSION['current']->canCreateApplication())
return;
$hResult = query_parameters("INSERT INTO appFamily (appName, description, keywords, ".
"webPage, vendorId, catId, submitterId, queued) VALUES (".
"'?', '?', '?', '?', '?', '?', '?', '?')",
$hResult = query_parameters("INSERT INTO appFamily (appName, description, ".
"keywords, webPage, vendorId, catId, ".
"submitTime, submitterId, ".
"queued) VALUES (".
"'?', '?', '?', '?', '?', '?', ?, '?', '?')",
$this->sName, $this->sDescription, $this->sKeywords,
$this->sWebpage, $this->iVendorId, $this->iCatId,
$_SESSION['current']->iUserId,
"NOW()", $_SESSION['current']->iUserId,
$this->mustBeQueued() ? "true" : "false");
if($hResult)
{
@@ -804,7 +806,7 @@ class Application {
$oTableRow->AddTextCell($oApp->objectMakeLink());
$oTableRow->AddTextCell($oRow->description);
$oTableRow->AddTextCell($oVendor->objectMakeLink());
$oTableRow->AddTextCell(print_date(mysqltimestamp_to_unixtimestamp($oRow->submitTime)));
$oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($oRow->submitTime)));
$oTableRow->SetClass(($i % 2) ? "color0" : "color1");
$oTable->AddRow($oTableRow);
@@ -902,7 +904,7 @@ class Application {
$sVendor = $oVendor->objectMakeLink();
$oTableRow = new TableRow();
$oTableRow->AddTextCell(print_date(mysqltimestamp_to_unixtimestamp($this->sSubmitTime)));
$oTableRow->AddTextCell(print_date(mysqldatetime_to_unixtimestamp($this->sSubmitTime)));
$oTableRow->AddTextCell($oUser->objectMakeLink());
$oTableRow->AddTextCell($sVendor);
$oTableRow->AddTextCell($this->sName);