PHP-Code:
$sql= "SELECT
W.info, SEC_TO_TIME(W.duration) as fduration, W.duration as duration, SEC_TO_TIME(SUM(W.duration)) as gduration, W.wid,
T.name as tname, T.tid,
P.name as pname, DATE_FORMAT(P.date,'%m%y') as fstart, P.pid as pid,
C.name as cname,
E.name as ename
FROM
".PREFIX."worksheet W
LEFT JOIN ".PREFIX."employee E
ON E.eid = W.eid
LEFT JOIN ".PREFIX."projekt P
ON P.pid = W.pid
LEFT JOIN ".PREFIX."client C
ON C.cid = P.cid
LEFT JOIN ".PREFIX."type T
ON T.tid = W.tid
WHERE
YEAR( W.date ) = ".$this->intyear." AND
MONTH( W.date ) = ".$this->intmonth." AND
DAYOFMONTH( W.date ) = ".$this->intday."
AND W.eid = '".$this->userid."'
GROUP BY
W.duration
ORDER BY
W.wid ASC";
//echo $sql;
$result = $objDB->query($sql);
if(DB::isError($result)) {
die($result->getMessage());
}
$this->worksheetdata = array();
while($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {
$this->worksheetdata[] = $row;
$fulldone = $row['gduration'];
}
echo "<hr>".$fulldone;
Es werden die werte leider nicht addiert, sondern es wird immer nur der letze wert ausgegeben .. warum ?
W.duration enthalt nen einen sekundenwert z.b. : 3600 für 1h
Kommentar