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


PHP Tasks::updateTask方法代碼示例

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


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

示例1: __construct

 public function __construct(Site $site, &$session, $post)
 {
     $tasks = new Tasks($site);
     $user = $session[User::SESSION_NAME];
     $root = $site->getRoot();
     if (isset($post['add'])) {
         $day = strip_tags($post['day']);
         $title = strip_tags($post['title']);
         $notes = strip_tags($post['notes']);
         $notes = $notes === null ? '' : $notes;
         $priority = strip_tags($post['priority']);
         $row = array("id" => 0, "day" => $day, "title" => $title, "notes" => $notes, "priority" => $priority);
         $task = new Task($row);
         $tasks->addTask($user->getId(), $task);
         $this->redirect = "/tasks.php";
         return;
     }
     if (isset($post['edit'])) {
         $id = strip_tags($post['id']);
         $day = strip_tags($post['day']);
         $title = strip_tags($post['title']);
         $notes = strip_tags($post['notes']);
         $notes = $notes === null ? '' : $notes;
         $priority = strip_tags($post['priority']);
         $row = array("id" => $id, "day" => $day, "title" => $title, "notes" => $notes, "priority" => $priority);
         $task = new Task($row);
         $tasks->updateTask($user->getId(), $task);
         $this->redirect = "/tasks.php";
         return;
     }
     if (isset($post['delete'])) {
         $id = strip_tags($post['id']);
         $tasks->deleteTask($user->getId(), $id);
         $this->redirect = "/tasks.php";
         return;
     }
 }
開發者ID:patelas7,項目名稱:mi362ss16,代碼行數:37,代碼來源:TaskController.php

示例2: Tasks

if (isset($_REQUEST['id'])) {
    include_once "Tasks.php";
    $obj_task = new Tasks();
    $tid = $_REQUEST['id'];
    $tname = $_REQUEST['taskname'];
    $tdesc = $_REQUEST['description'];
    $start_date = $_REQUEST['sdate'];
    $end_date = $_REQUEST['edate'];
    $loc = $_REQUEST['location'];
    /**
     * A method to check is the task is successfully updated
     *
     *@param string  $tid id of the task
     *@param varchar $name name of the task
     *@param varchar description of task
     *@param date $s_date start date of the job
     *@param date $e_date end date of the job
     *@param string $location location of job
     *@return Task successfully updated or update not successful
     */
    if (!$obj_task->updateTask('$tid', '$tname', '$tdesc', '$start_date', '$end_date', '$loc')) {
        echo "The task was not updated";
    } else {
        echo "A task was successfully updated";
    }
}
?>
	</body>
</html>	

 
開發者ID:rahabwairimu05,項目名稱:Group10_NurseTaskManager,代碼行數:29,代碼來源:updateTask.php


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