- display the submit time correctly in admin panels

- display the submitter correctly in admin panels
This commit is contained in:
Jonathan Ernst
2005-02-20 01:55:53 +00:00
committed by WineHQ
parent b103c6651d
commit 25f3f01412
7 changed files with 52 additions and 39 deletions

View File

@@ -61,15 +61,14 @@ if (!$_REQUEST['id'])
while($ob = mysql_fetch_object($hResult))
{
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
echo "<tr class=$bgcolor>\n";
echo " <td>".date("Y-n-t h:i:sa", $ob->submitTime)." &nbsp;</td>\n";
if($ob->userId)
{
$oUser = new User($ob->userId);
echo " <td>".$oUser->sRealname." (".$oUser->sEmail.")</td>\n";
}
else
echo " <td>Anonymous</td>\n";
echo "<tr class=\"$bgcolor\">\n";
echo "<td>".print_date(mysqltimestamp_to_unixtimestamp($oApp->sSubmitTime))."</td>\n";
$oUser = new User($ob->submitterId);
echo "<td>";
echo $oUser->sEmail ? "<a href=\"mailto:".$oUser->sEmail."\">":"";
echo $oUser->sRealname;
echo $oUser->sEmail ? "</a>":"";
echo "</td>\n";
echo "<td>".lookup_app_name($ob->appId)."</td>\n";
echo "<td>".lookup_version_name($ob->versionId)."</td>\n";
echo "<td>".$ob->type."</td>\n";

View File

@@ -287,8 +287,12 @@ else
}
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
echo "<tr class=\"$bgcolor\">\n";
echo " <td>".date("Y-n-t h:i:sa", $oApp->sSubmitTime)." &nbsp;</td>\n";
echo " <td><a href=\"mailto:".$oSubmitter->sEmail."\">".$oSubmitter->sRealname."</a></td>\n";
echo " <td>".print_date(mysqltimestamp_to_unixtimestamp($oApp->sSubmitTime))."</td>\n";
echo " <td>\n";
echo $oSubmitter->sEmail ? "<a href=\"mailto:".$oUser->sEmail."\">":"";
echo $oSubmitter->sRealname;
echo $oSubmitter->sEmail ? "</a>":"";
echo " </td>\n";
echo " <td>".$sVendor."</td>\n";
echo " <td>".$oApp->sName."</td>\n";
echo " <td align=\"center\">[<a href=\"adminAppQueue.php?sub=view&appId=".$oApp->iAppId."\">process</a>]</td>\n";
@@ -343,8 +347,12 @@ else
$sVendor = $oVendor->sName;
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
echo "<tr class=\"$bgcolor\">\n";
echo " <td>".date("Y-n-t h:i:sa", $oVersion->sSubmitTime)." &nbsp;</td>\n";
echo " <td><a href=\"mailto:".$oSubmitter->sEmail."\">".$oSubmitter->sRealname."</a></td>\n";
echo " <td>".print_date(mysqltimestamp_to_unixtimestamp($oApp->sSubmitTime))."</td>\n";
echo " <td>\n";
echo $oSubmitter->sEmail ? "<a href=\"mailto:".$oUser->sEmail."\">":"";
echo $oSubmitter->sRealname;
echo $oSubmitter->sEmail ? "</a>":"";
echo " </td>\n";
echo " <td>".$sVendor."</td>\n";
echo " <td>".$oApp->sName."</td>\n";
echo " <td>".$oVersion->sName."</td>\n";

View File

@@ -249,7 +249,7 @@ if ($_REQUEST['sub'])
$query = "SELECT queueId, appId, versionId,".
"userId, maintainReason,".
"superMaintainer,".
"UNIX_TIMESTAMP(submitTime) as submitTime ".
"submitTime as submitTime ".
"from appMaintainerQueue;";
$result = query_appdb($query);
@@ -290,7 +290,7 @@ if ($_REQUEST['sub'])
$oVersion = new Version($ob->versionId);
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
echo "<tr class=$bgcolor>\n";
echo " <td>".date("Y-n-t h:i:sa", $ob->submitTime)." &nbsp;</td>\n";
echo " <td>".print_date(mysqldatetime_to_unixtimestamp($ob->submitTime))." &nbsp;</td>\n";
echo " <td>".$oApp->sName."</td>\n";
if($ob->superMaintainer)

View File

@@ -68,9 +68,8 @@ if ($_REQUEST['sub'])
$oUser = new User($ob->userId);
if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
echo "<tr class=$bgcolor>\n";
echo " <td>".date("Y-n-t h:i:sa", $ob->submitTime)." &nbsp;</td>\n";
echo " <td>".print_date(mysqldatetime_to_unixtimestamp($ob->submitTime))." &nbsp;</td>\n";
echo " <td><a href=\"mailto:".$oUser->sEmail."\">".$oUser->sRealname."</a></td>\n";
if($ob->superMaintainer)
{
echo " <td><a href='".BASE."appview.php?appId=$ob->appId'>".lookup_app_name($ob->appId)."</a></td>\n";

View File

@@ -80,6 +80,7 @@ class Application {
$this->iVendorId = $oRow->vendorId;
$this->iCatId = $oRow->catId;
$this->iSubmitterId = $oRow->submitterId;
$this->sSubmitTime = $oRow->submitTime;
$this->sDate = $oRow->submitTime;
$this->sName = $oRow->appName;
$this->sKeywords = $oRow->keywords;

View File

@@ -1,7 +1,4 @@
<?php
require(BASE."include/"."parsedate.php");
class TableVE {
var $mode;
@@ -176,15 +173,6 @@ class TableVE {
echo html_frame_end();
}
function timestamp_to_unix($stamp)
{
$result = query_appdb("select unix_timestamp($stamp)");
if(!$result)
return 0;
$r = mysql_fetch_row($result);
return $r[0];
}
function make_option_list($varname, $cvalue, $table, $idField, $nameField, $where = "")
{
@@ -261,12 +249,12 @@ class TableVE {
echo "<textarea cols=$len rows=10 name='$varname'>".stripslashes($value)."</textarea>\n";
break;
case "timestamp":
$time = $this->timestamp_to_unix($value);
echo makedate($time);
$time = mysqltimestamp_to_unixtimestamp($value);
echo print_date($time);
break;
case "datetime":
$time = parsedate($value);
echo makedate($time);
$time = mysqldatetime_to_unixtimestamp($value);
echo print_date($time);
break;
default:
echo "$value &nbsp;\n";
@@ -315,12 +303,12 @@ class TableVE {
echo "$value &nbsp;\n";
break;
case "timestamp":
$time = $this->timestamp_to_unix($value);
echo makedate($time);
$time = mysqltimestamp_to_unixtimestamp($value);
echo print_date($time);
break;
case "datetime":
$time = parsedate($value);
echo makedate($time);
$time = mysqldatetime_to_unixtimestamp($value);
echo print_date($time);
break;
default:
echo "$value &nbsp;\n";

View File

@@ -34,11 +34,29 @@ function values($arr)
/*
* format date
*/
function makedate($time)
function print_date($sTimestamp)
{
return date("F d, Y H:i:s", $time);
return date("F d Y H:i:s", $sTimestamp);
}
function mysqltimestamp_to_unixtimestamp($sTimestamp)
{
$d = substr($sTimestamp,6,2); // day
$m = substr($sTimestamp,4,2); // month
$y = substr($sTimestamp,0,4); // year
$hours = substr($sTimestamp,8,2); // year
$minutes = substr($sTimestamp,10,2); // year
$seconds = substr($sTimestamp,12,2); // year
return mktime($hours,$minutes,$seconds,$m, $d, $y);
}
function mysqldatetime_to_unixtimestamp($sDatetime)
{
sscanf($sDatetime, "%4s-%2s-%2s %2s:%2s:%2s",
&$y, &$m, &$d,
&$hours, &$minutes, &$seconds);
return mktime($hours,$minutes,$seconds,$m, $d, $y);
}
function get_remote()
{