?> </td> <td class="tbLogBody"><?php echo fixFieldForHTML($ride->f_riderID_firstName . " " . $ride->f_riderID_lastName, 0); ?> </td> <td class="tbLogHeader">Distance</td> <td class="tbLogBody"><?php echo number_format($ride->f_distance, 2) . " " . $units->distanceString(); ?> </td> </tr> <tr> <td class="tbLogHeader">Location</td> <td class="tbLogBody"><?php echo "<img width='16' height='16' src=\"" . "templates/" . $RD_template . "/loc" . locationTypeToNumber($ride->f_locationID_type) . ".png\"> " . fixFieldForHTML($ride->f_locationID_location, 0) . " (" . $ride->f_locationID_type . ")"; ?> </td> <td class="tbLogHeader">Avg Speed</td> <td class="tbLogBody"><?php echo number_format($ride->c_avgSpeed, 2) . " " . $units->velocityString(); ?> </td> </tr> <tr> <td class="tbLogHeader">Effort</td> <td class="tbLogBody"><?php echo $ride->f_effortLevel; ?> </td> <td class="tbLogHeader">Temp</td>
$totalTime = 0; $totalDist = 0; $numRides = 0; //Not really num rides, used to see if more data is available. while ($rides->parseNextRow($result)) { $numRides++; if ($numRides > $num) { break; } echo "<TR>"; echo "<TD class=\"tbLogBody\">" . "<a href=\"showRide.php"; $tgetvars = $getVars; $tgetvars["rideID"] = $rides->f_rideID; echo encodeGet($tgetvars) . "\">" . $rides->getDatePart() . " " . $rides->getTimePart() . "</a> " . "<img width='10' height='16' src=\"" . getImgForTemp($rides->f_temperature, $units) . "\">" . "<img width='25' height='16' src=\"s" . $rides->f_sky . ".png\">" . "<img width='16' height='16' src=\"w" . $rides->f_wind . ".png\">" . "</TD>"; echo "<TD class=\"tbLogBody\">" . fixFieldForHTML($rides->f_riderID_firstName . " " . $rides->f_riderID_lastName, 0) . "</TD>"; echo "<TD class=\"tbLogBody\">" . "<img width='16' height='16' src=\"" . "templates/" . $RD_template . "/loc" . locationTypeToNumber($rides->f_locationID_type) . ".png\"> " . fixFieldForHTML($rides->f_locationID_location, 0) . "</TD>"; echo "<TD class=\"tbLogBody\">" . number_format($rides->f_distance, 2) . "</TD>"; echo "<TD class=\"tbLogBody\">{$rides->f_time}</TD>"; echo "<TD class=\"tbLogBody\">" . number_format($rides->c_avgSpeed, 2) . "</TD>"; echo "<TD class=\"tbLogBody\">{$rides->f_effortLevel}</TD>"; echo "</TR>\n"; echo "<TR>"; echo "<TD class=\"tbLogBody2\" colspan='7'>" . fixFieldForHTML(firstLine($rides->f_notes, 70), 0) . " </TD>" . "</TR>\n"; $totalTime += $rides->f_timeSecs; $totalDist += $rides->f_distance; } echo "<TR>"; echo "<TD class=\"tbLogFootHead\"><b>Sum/Avg/Max of Displayed:</b></TD>"; echo "<TD class=\"tbLogFoot\"> </TD>"; echo "<TD class=\"tbLogFoot\"> </TD>"; echo "<TD class=\"tbLogFoot\">" . number_format($totalDist, 2) . "</TD>";
/** * Builds a QueryObj which represents the current query. * If nothing is to be searched upon, returns NULL. * If a queryObj is passed in, the current query will * be "and"ed on. */ function getWhereStatement($currentWhere = NULL) { $currentWhere = $currentWhere; if ($this->riderID > 0) { $newClause = new QueryBinaryOp(new QueryColumnRef(DB_RIDES . ".riderID"), "=", new QueryIntLiteral($this->riderID)); $currentWhere = $this->_andOn($currentWhere, $newClause); } if ((int) $this->locationID > 0) { $newClause = new QueryBinaryOp(new QueryColumnRef(DB_RIDES . ".locationID"), "=", new QueryIntLiteral((int) $this->locationID)); $currentWhere = $this->_andOn($currentWhere, $newClause); } elseif ($this->locationID) { $newClause = new QueryBinaryOp(new QueryColumnRef(DB_LOCATIONS . ".type"), "=", new QueryIntLiteral(locationTypeToNumber($this->locationID))); $currentWhere = $this->_andOn($currentWhere, $newClause); } if ($this->bikeID > 0) { $newClause = new QueryBinaryOp(new QueryColumnRef(DB_RIDES . ".bikeID"), "=", new QueryIntLiteral($this->bikeID)); $currentWhere = $this->_andOn($currentWhere, $newClause); } //TODO: effort and dates. return $currentWhere; }