Exemplo n.º 1
0
 public function testSearchTask()
 {
     newtask("Test3", "23/25/2016", "");
     $lignes = searchtask("Test3");
     $this->assertEquals("1;:!:;Test3;:!:;23/25/2016\n", $lignes);
     $lignes = searchtask("tache et plus");
     $this->assertEquals("1;:!:;tache et plus;:!:;23/25/2016\n", $lignes);
     $lignes = searchtask("Test");
     $this->assertEquals("1;:!:;Test;:!:;23-01-2016;:!:;This is a test\n", $lignes);
 }
Exemplo n.º 2
0
<?php

include 'sessionstarter.php';
include 'function_task.php';
if (!checkParam($_POST['nom']) || !checkParam($_POST['deadline'])) {
    $_SESSION['error'] = 10;
    header('location: newtask.php');
} elseif (strpbrk($_POST['nom'], ";:!") || strpbrk($_POST['deadline'], ";:!")) {
    $_SESSION['error'] = 40;
    header('location: newtask.php');
} else {
    if (0 == newtask($_POST['nom'], $_POST['deadline'], $_POST['content'])) {
        header('location:tasklist.php');
    } else {
        $_SESSION['error'] = 30;
        header('location: newtask.php');
    }
}
Exemplo n.º 3
0
function edittask($code, $nom, $deadline, $content, $oldname)
{
    deletetask($oldname);
    newtask($nom, $deadline, $content);
    uptask($nom, $code - 1);
}