本文整理汇总了PHP中task::fetch方法的典型用法代码示例。如果您正苦于以下问题:PHP task::fetch方法的具体用法?PHP task::fetch怎么用?PHP task::fetch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类task
的用法示例。
在下文中一共展示了task::fetch方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: task
$vivek = new task();
//echo $_SESSION['do_User']->iduser."<br /><br />";
//$users=$vivek->getAllTaskuser();
//print_r($users);
//echo "<br />";
$iduser = $_SESSION['do_User']->iduser;
//echo $user;
//$time = time();
//$key = "$iduser"."$time";
$e_set_api = new Event("do_User->eventGenerateAPIKey");
$e_set_api->addParam("goto", $_SERVER['PHP_SELF']);
if ($_SESSION['do_User']->api_key != '') {
$apikey = $_SESSION['do_User']->api_key;
$c->setConfig(array("directory" => "Calevents", "filename" => "{$iduser}.ics"));
$vivek->getAllTaskByuser($iduser);
while ($vivek->fetch()) {
$stdt = explode('-', $vivek->getData("due_date_dateformat"));
$startdate = "{$stdt['0']}" . "{$stdt['1']}" . "{$stdt['2']}";
$enddate = $startdate;
$e =& $c->newComponent('vevent');
//$e->setProperty( 'dtstart', $startdate );
//$e->setProperty( 'dtend', $enddate );
$e->setProperty("dtstart", "{$startdate}", array("VALUE" => "DATE"));
$e->setProperty('description', $vivek->getData("task_description"));
$e->setProperty('summary', $vivek->getData("task_description"));
$e->setProperty('class', 'PUBLIC');
}
$c->createCalendar();
$str = $c->saveCalendar();
$tt = $_SERVER["SERVER_NAME"];
$path = "http://" . "{$tt}" . "/" . "Calevents/" . "{$iduser}.ics";
示例2: getUnassignedtask
function getUnassignedtask()
{
include "task.php";
$obj = new task();
if (!$obj->getUnassignedTasks()) {
echo '{"result":0,"message": "failed to display"}';
return;
}
//at this point the search has been successful.
//generate the JSON message to echo to the browser
$row = $obj->fetch();
echo '{"result":1,"tasks":[';
//start of json object
while ($row) {
echo json_encode($row);
//convert the result array to json object
$row = $obj->fetch();
if ($row) {
echo ",";
//if there are more rows, add comma
}
}
echo "]}";
}
示例3: getAllAdminSpecTasks
function getAllAdminSpecTasks()
{
if (isset($_SESSION['admin_id'])) {
$admin_id = $_SESSION['admin_id'];
$task_status = $_REQUEST['task_status'];
include '../models/model_task.php';
$task = new task();
$row = $task->getAllAdminSpecTasks($admin_id, $task_status);
if (!$row) {
echo '{"result":0,"message": "No tasks set by you."}';
return;
}
echo '{"result":1,"tasks":[';
while ($row) {
echo json_encode($row);
$row = $task->fetch();
if ($row) {
echo ",";
}
}
echo "]}";
return;
}
echo '{"result":2,"message": "You need to login first."}';
return;
}