本文整理汇总了PHP中DataHandler::get_cardio_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP DataHandler::get_cardio_by_id方法的具体用法?PHP DataHandler::get_cardio_by_id怎么用?PHP DataHandler::get_cardio_by_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataHandler
的用法示例。
在下文中一共展示了DataHandler::get_cardio_by_id方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: DataHandler
<p>Edit Cardio:<br><br></p>
<?php
require_once 'library/DataHandler.php';
$id = $_GET['id'];
$dh = new DataHandler();
$cardio = $dh->get_cardio_by_id($id);
$exercise = $cardio->get_name();
$time = $cardio->get_time();
$distance = $cardio->get_distance();
$level = $cardio->get_level();
$date = $cardio->get_date();
echo "<form action=\"index.php\" method=\"post\">\n <p>Exercise:</p>\n <input type=\"text\" name=\"exercise\" value = \"{$exercise}\" size=\"10\" ><br><br>\n <p>Time (minutes):</p>\n <input type=\"text\" name=\"time\" value = \"{$time}\" size=\"10\" ><br><br>\n <p>distance (miles):</p>\n <input type=\"text\" name=\"distance\" value = \"{$distance}\" size=\"10\" ><br><br>\n <p>level:</p>\n <input type=\"text\" name=\"level\" value = \"{$level}\" size=\"10\" ><br><br>\n <p>Date:</p>\n <input type=\"text\" name=\"date\" value = \"{$date}\" size=\"10\" ><br><br>\n <input type=\"submit\" value=\"Update\" >\n <input type=\"hidden\" value=\"{$id}\" name=\"id\" >\n <input type=\"hidden\" value=\"action/update_cardio\" name=\"content\" >\n </form>";
?>
示例2: get_cardio_by_id
/**
* Returns a Cardio object
*
* @param int $cardio_id
* @return Cardio $cardio A Cardio object
*
*/
public function get_cardio_by_id($cardio_id)
{
$dh = new DataHandler();
return $dh->get_cardio_by_id($cardio_id);
}