Location: PHPKode > projects > Polaring > view/samples.php
<?php
// vim: sw=4:ts=4
/**
* @version 00.04.09
* @package polaring
* @license This component in released under the GNU/GPL License
*
* File: view/samples.php
* Role: View all samples in workout
*
**/

function viewSamples($dateTime) {

  $workout = fileFunctions::selectFullWorkout($dateTime);

?>
<table>
  <thead>
    <tr>
      <td><? visa::tillbaka("1"); ?></td>
    </tr>
  </thead>
  <tfoot>
    <tr>
      <td><? visa::tillbaka("1"); ?></td>
    </tr>
  </tfoot>
  <tbody>
    <tr>
      <th><? echo strings::expression("polar", "time"); ?></th>
	<?
		echo "<th>Hr (".$workout['unitHr'].") </th>\n";
	if ($workout['recordingSpeed'] == true) {
		echo "<th>".strings::expression("polar", "speed")." (".
		  $workout['unitSpeed'].")</th>\n";
		echo "<th>".strings::expression("polar", "distance")." (".
		  $workout['unitDistance'].")</th>\n";
	}
	if ($workout['recordingCadence'] == true) {
		echo "<th>".strings::expression("polar", "cadence")." (".
		  $workout['unitCadence'].") </th>\n";
	}
	if ($workout['recordingAltitude'] == true) {
		echo "<th>".strings::expression("polar", "altitude")." (".
		  $workout["unitAltitude"].")</th>\n";
	}
	if ($workout['recordingPower'] == true) {
		echo "<th>".strings::expression("polar", "power")." (".
		  $workout['unitPower'].")</th>\n";
	}
	if ($workout["recordingAirPressure"] == true) {
		echo "<th>".strings::expression("polar", "airpressure")."</th>\n";
	}
	echo "</tr>";
	for ($i = 0; $i < $workout["numberOfSamples"]; $i++) {
		if ($i%2 == 0) {
			$css = "nm center";
		} else {
			$css = "gra center";
		}
		echo "<tr class=".$css.">";
		$sampleTime = $workout["sampleTime"][$i];
		echo "<td class=\"center\" >".$sampleTime."</td>";
		echo "<td class=\"center\" >".$workout["sampleHr"][$i].
		  "</td>\n";
		if ($workout["recordingSpeed"] == true) {
			echo "<td class=\"center\" >".
			  $workout["sampleSpeed"][$i]."</td>\n";
			echo "<td class=\"center\" >".
			  round($workout["sampleDistance"][$i],2)."</td>\n";
		}
		if($workout["recordingCadence"] == true) {
			echo "<td class=\"center\" >".
			  $workout["sampleCadence"][$i]."</td>\n";
		}
		if ($workout["recordingAltitude"] == true) {
			echo "<td class=\"center\" >".
			  $workout["sampleAltitude"][$i]."</td>\n";
		}
		if ($workout["recordingPower"] == true) {
			echo "<td class=\"center\" >".
			  $workout["samplePower"][$i]."</td>\n";
		}
		if ($workout["recordingPowerPedallingIndex"] == true) {
			echo "<td class=\"center\" >".
			  $workout["samplePowerPedallingIndex"][$i]."</td>\n";
		}
		if ($workout["recordingPowerLeftRightBalance"] == true) {
			echo "<td class=\"center\" >".
			  $workout["samplePowerLeftRightBalance"][$i]."</td>";
		}
		if ($workout["recordingAirPressure"] == true) {
			echo "<td class=\"center\" >".
			  $workout["sampleAirPressure"][$i]."</td>\n";
		}
		echo "</tr>";
	}
	?>
  </tbody>
 </table>
	<?
	

	    } // end function viewSamples
?>
Return current item: Polaring