當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Tasks::fetch方法代碼示例

本文整理匯總了PHP中Tasks::fetch方法的典型用法代碼示例。如果您正苦於以下問題:PHP Tasks::fetch方法的具體用法?PHP Tasks::fetch怎麽用?PHP Tasks::fetch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Tasks的用法示例。


在下文中一共展示了Tasks::fetch方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: Tasks

		$('.close-button').click(function(){
		$('#table_overlay').fadeOut('fast');
		$('#table_overlay_div').fadeOut('fast');
			});
		});
		</script>
	</head>
	<body>
		<?php 
/**
 *function to view all task
 */
include "Tasks.php";
$obj = new Tasks();
$obj->viewTasks();
if (!($row = $obj->fetch())) {
    echo "there are no tasks currently";
}
/**
 *Setting a table to contain the contents of tasks objects
 */
echo "<table border='2'>";
echo "<tr><td>TASK ID</td><td>TASK NAME</td><td>TASK DESCRIPTION</td><td>START DATE</td>\n                 <td>END DATE</td><td>LOCATION</td></tr>";
while ($row) {
    echo "<tr><td>{$row["task_id"]}</td><td><a href=tasksdisplayselected.php?id=" . $row["task_name"] . ">{$row["task_name"]}</td>";
    echo "<td>{$row["task_description"]}</td><td>{$row["start_date"]}</td>\n                  <td>{$row["end_date"]}</td><td>{$row["location"]}</td>";
    $row = $obj->fetch();
}
echo "</table>";
?>
			</div>
開發者ID:rahabwairimu05,項目名稱:Group10_NurseTaskManager,代碼行數:31,代碼來源:taskFunction.php

示例2: Tasks

 *COde standard: PSR
 *function to retrieve and display the tasks that have been assigned to nurses
 *The method fetches the details of the task
 *The method prints to screen an error message when query fails
 */
include_once "Tasks.php";
$obj = new Tasks();
$obj->displayAllTasks();
if (!($row = $objnurse->fetch())) {
    echo "There are no tasks currently";
}
/**
 *Creating code to display a table to contain the contents of tasks objects
 *
 *The details of the tasks that are printed in a table.
 *There's a loop that echoes the details of the task.
 *The loop steps through all the task and fetches in rows 
 */
echo "<center><table border='1'>";
echo "<tr><td>task_id</td><td>task_name</td><td>task_description</td><td>start_date</td>\n\t          <td>end_date</td><td>location</td></tr>";
while ($row) {
    echo "<tr><td>{$row['task_id']}</td><td>{$row['task_name']}</td><td>{$row['task_description']}</td>";
    echo "<td>{$row['start_date']}</td><td>{$row['end_date']}</td><td>{$row['location']}</td></tr>";
    $row = $obj->fetch();
}
echo "</table></center>";
?>
		</div>
	</body>
</html>
開發者ID:rahabwairimu05,項目名稱:Group10_NurseTaskManager,代碼行數:30,代碼來源:taskFunctionNurse.php


注:本文中的Tasks::fetch方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。