当前位置: 首页>>代码示例>>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;未经允许,请勿转载。