コード例 #1
0
    try {
        $bootloader_state = update_bootloader();
    } catch (Exception $e) {
        header("Location: {$GLOBALS['failure_location']}");
        echo 'Caught exception: ', $e->getMessage(), "\n";
    }
    //if the bootloader was updated the mt has to reboot again. we'll check to see if it was updated and wait if necessary.
    if ($bootloader_state == 'justnowupdated') {
        do {
            is_connected(0);
        } while (is_connected(0) != '1');
        sleep(10);
    }
    //sing if successful.
    try {
        task_complete();
    } catch (Exception $e) {
        header("Location: {$GLOBALS['failure_location']}");
        echo 'Caught exception: ', $e->getMessage(), "\n";
    }
    //wait while user changes out mikrotiks so this can run again.
    sleep(22);
}
function logthis($entry)
{
    if ($GLOBALS[logging] != 'file') {
        //add in mysql support
    } else {
        file_put_contents(date("M/j H:i:s.u") . ', ' . $GLOBALS['log_file_handle'], $entry . PHP_EOL, FILE_APPEND | LOCK_EX);
    }
}
コード例 #2
0
function tick_task($taskID, $userID)
{
    $conn = get_conn();
    $userID = (int) mysql_fix_string($conn, $userID);
    $taskID = (int) mysql_fix_string($conn, $taskID);
    if (task_complete($taskID, $userID)) {
        $query = "UPDATE ajx_org_todo SET\n\t\t\t complete='false' WHERE taskID={$taskID}\n\t\t\t AND userID={$userID}";
    } else {
        $query = "UPDATE ajx_org_todo SET\n\t\t\t complete='true' WHERE taskID={$taskID}\n\t\t\t AND userID={$userID}";
    }
    get_result($conn, $query);
    $conn->close();
}
コード例 #3
0
									 <table class="table">
										<thead>
										  
										  <tr>
											<th>Task Title</th>
											<th>Task Description</th>
											<th>Date-Time</th>
											<th>Status</th>
										  </tr>
										</thead>
										<tbody>
											<?php 
/***********
			##	view completed task to the user.
			************/
list($result) = task_complete($ID, $taskstatus);
foreach ($result as $row) {
    ?>
											<tr>
											   <td><?php 
    echo $row['task_title'];
    ?>
</td>
											   <td><?php 
    echo $row['task_description'];
    ?>
</td>	
											   <td><?php 
    echo $row['date'];
    ?>
</td>