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


PHP task::getFromDB方法代碼示例

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


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

示例1: listTasksByUser

function listTasksByUser($inuserid)
{
    $tasks = array();
    $dbhandle = db_connect();
    $query = "SELECT TaskID FROM Tasks WHERE Lister={$inuserid}";
    $result = $dbhandle->query($query);
    while ($row = $result->fetch_array()) {
        $newtask = new task();
        $newtask->getFromDB($row['TaskID']);
        if ($newtask->active == 0) {
            continue;
        }
        array_push($tasks, $newtask);
    }
    $dbhandle->close();
    return $tasks;
}
開發者ID:sammyr2011,項目名稱:Task_Master,代碼行數:17,代碼來源:lister.php

示例2: time

<?php

require_once 'db_connect.php';
require_once 'task_class.php';
//Is run by the server periodically to check if a task has ended.
$dbhandle = db_connect();
$stmt = $dbhandle->stmt_init();
$stmt->prepare("SELECT TaskID, (EndDateTime - ?) AS TimeRemaining FROM Tasks WHERE Active=1 HAVING TimeRemaining<=0");
$stmt->bind_param("i", time());
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($taskID, $tmptime);
while ($stmt->fetch()) {
    $task = new task();
    $task->getFromDB($taskID);
    $task->endTask();
    unset($task);
}
$stmt->close();
$dbhandle->close();
開發者ID:sammyr2011,項目名稱:Task_Master,代碼行數:20,代碼來源:task_end_sentinel.php

示例3: array

    session_start();
}
//get the id of the task to be reviewed, blank page if none
$intaskid;
if (isset($_GET['id'])) {
    $intaskid = $_GET['id'];
} else {
    die;
}
if (!isset($_SESSION['userid'])) {
    die;
}
$error = array();
//get the task info
$task = new task();
$error = $task->getFromDB($intaskid);
if ($error != NULL) {
    die;
}
//review form was submitted
if (isset($_POST['submit'])) {
    //prepare review info to be sent to POST
    $_POST['taskid'] = $intaskid;
    $review = new review();
    $error = $review->getFromPOST($_POST);
    if (count($error) == 0) {
        $_SESSION['msg_reviewed'] = "Review placed";
        header("Location: /ViewTask.php?id=" . $intaskid);
        die;
    } else {
        die;
開發者ID:sammyr2011,項目名稱:Task_Master,代碼行數:31,代碼來源:TaskFeedback.php

示例4: initialize

 public function initialize($info)
 {
     $error = array();
     //check if task exists
     $task = new task();
     if (isset($info['taskid']) && $task->checkExistence($info['taskid'])) {
         $this->taskid = $info['taskid'];
     } else {
         $error['taskid'] = true;
     }
     //check if task is already rated
     //strip tags from comment before adding
     if (isset($info['comment'])) {
         $this->comment = strip_tags($info['comment']);
     } else {
         $error['comment'] = true;
     }
     //check if rating is a number between 0 and 5 inclusive
     if (isset($info['rating']) && is_numeric($info['rating']) && $info['rating'] >= 0 && $info['rating'] <= 5) {
         $this->rating = $info['rating'];
     } else {
         $error['rating'] = true;
     }
     //1 if a Doer rating, 0 if a Lister rating
     //determine if Lister or Doer
     $task->getFromDB($this->taskid);
     $bidwinner = $task->getBidLeaderID();
     //Must be logged in
     if (!isset($_SESSION['userid'])) {
         $error['login'] = true;
     } else {
         //If you're the winner, you are leaving a review for the Lister
         if ($_SESSION['userid'] == $bidwinner) {
             $this->reviewee_uid = $task->userid;
             $this->listerOrDoer = false;
         } else {
             if ($_SESSION['userid'] == $task->userid) {
                 $this->reviewee_uid = $bidwinner;
                 $this->listerOrDoer = true;
             } else {
                 $error['notinvolved'] = true;
             }
         }
     }
     $this->timestamp = time();
     return $error;
 }
開發者ID:sammyr2011,項目名稱:Task_Master,代碼行數:47,代碼來源:review_class.php

示例5: task

<?php

require_once 'task_class.php';
if (isset($_POST['taskid'])) {
    $task = new task();
    $task->getFromDB($_POST['taskid']);
} else {
    $error['invalidtaskid'] = true;
    echo json_encode($error);
    return;
}
if (isset($_POST['bidderid']) && isset($_POST['bidamt'])) {
    $error = $task->addBid($_POST['bidderid'], $_POST['bidamt']);
    if ($error == null) {
        $error['Success'] = true;
    }
    echo json_encode($error);
} else {
    $error['invalidbidderidorbidamt'] = true;
    echo json_encode($error);
}
開發者ID:sammyr2011,項目名稱:Task_Master,代碼行數:21,代碼來源:place_bid_android.php


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