- 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

@@ -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()
{