Ejemplo n.º 1
0
function test()
{
    $oper = new Operations();
    $table_name = "my_table";
    $googleFile = "google_sees";
    $userFile = "user_sees";
    // $oper->createTable($table_name);
    // $oper->loadComparisonTask($userFile, $googleFile, $table_name);
    $result = $oper->processing($table_name);
    print var_dump($result);
    $id = $result["id"];
    $label = 'Yes';
    $oper->processed($table_name, $label, $id);
    print $oper->countRows($table_name);
}
Ejemplo n.º 2
0
    $action = $_POST["submit"];
    if ($action == "submit") {
        $oper->processed($table_name, $_POST["response"], $_POST["id"], $_POST["url"], $_POST["user"]);
    } else {
        if ($action == "exit") {
            $oper->processed($table_name, "TODO", $_POST["id"]);
        } else {
            if ($action == "label and skip url") {
                $oper->processed($table_name, $_POST["response"], $_POST["id"], $_POST["url"], $_POST["user"]);
                $oper->skipUrl($table_name, $_POST["response"], $_POST["url"]);
            }
        }
    }
}
// check whether there is more to show
$count = $oper->countRows($table_name);
if ($count == -1) {
    $oper->createTableAndLoadComparisonTask($userFile, $googleFile, $table_name);
    // $oper->createTable($table_name);
    // $oper->loadComparisonTask($userFile, $googleFile, $table_name);
} else {
    if ($count == 0) {
        die("The table has no items");
        // $oper->loadComparisonTask($userFile, $googleFile, $table_name);
        // $result = $oper->processing($table_name);
        // $count = $oper->countRows($table_name);
    } else {
        if ($count > 0) {
            $result = $oper->processing($table_name);
        }
    }