Esempio n. 1
0
if (isset($_SESSION['task']) && $_SESSION['task'] != '') {
    switch ($_SESSION['task']) {
        case 'edit':
            $message = 'Successfully saved the changes of tasks: ' . $_SESSION['title'];
            break;
        case 'add':
            $message = 'Successfully saved the tasks: ' . $_SESSION['title'];
            break;
        case 'delete':
            $message = 'Successfully delete the task(s) ';
            break;
    }
    unset($_SESSION['task']);
}
$db = new database();
$created = simpledate(time());
$sql = "select * from tasks order by created_t desc";
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$tasks = array();
while ($tasks[] = $db->fetcharray()) {
}
$totalrows = count($tasks);
$limit = 10;
$paging = ceil($totalrows / $limit);
$scroll = 0;
$scrollnumber = 5;
if (isset($_GET['page'])) {
    $page = $_GET['page'];
} else {
Esempio n. 2
0
if (isset($_SESSION['task']) && $_SESSION['task'] != '') {
    switch ($_SESSION['task']) {
        case 'edit':
            $message = 'Successfully saved the changes of tasks: ' . $_SESSION['title'];
            break;
        case 'add':
            $message = 'Successfully saved the tasks: ' . $_SESSION['title'];
            break;
    }
    unset($_SESSION['task']);
}
//print_r($_POST);
$priority = $_POST['priority'];
$_SESSION['priority'] = $priority;
$db = new database();
$currentdate = simpledate(time());
//echo $currentdate;
$sql = "select * from tasks where assignedto = '{$userID}' ";
$sql .= " and status != 'completed' ";
$sql .= " and created = '{$currentdate}'";
if ($priority) {
    $sql .= " and priority = '{$priority}' ";
}
$sql .= " order by created desc ";
//echo $sql;
if (!($result = $db->query($sql))) {
    die('Error:' . $db->error());
}
$tasks = array();
while ($tasks[] = $db->fetcharray()) {
}