$('.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>
*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>