Esempio n. 1
0
$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";
Esempio n. 2
0
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 "]}";
}
Esempio n. 3
0
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;
}