Exemple #1
0
} else {
    //file name, last commit time, page title, page sub title
    $db_array = fetch_file_change($f);
    $file_name = $db_array[0]['name'];
    $file_last_update = time_uk($db_array[0]['time']);
    $page_title = $file_name;
    $page_title_sub = "last commit : [" . $file_last_update . "]";
    $file_change_number = count($db_array);
    if ($file_change_number <= 1) {
        $version_title = "version";
    } else {
        $version_title = "versions";
    }
}
include 'style/header.inc.php';
if (fetch_file_change($f) == FALSE) {
    ?>
	<div class="alert-message info">
        <a class="close" href="<?php 
    echo $after_login_redirect;
    ?>
">×</a>
        <p><strong>Oops!</strong> File not exist or have not any changes, please create before use.</p>
    </div>
	<?php 
} else {
    //file change history list/table
    ?>
	<h3 class="underline"><?php 
    echo ucfirst($version_title) . ' of "' . $file_name;
    ?>
Exemple #2
0
function fetch_task_file($tid)
{
    $sql = 'SELECT fid FROM file WHERE tid=' . $tid . ' ORDER BY fid DESC';
    $db_array_fid = db_query($sql);
    if (!array_isset($db_array_fid)) {
        return FALSE;
    } else {
        $file_count = count($db_array_fid);
        for ($i = 0; $i < $file_count; $i++) {
            $db_array_file = fetch_file_change($db_array_fid[$i]['fid']);
            $db_array_file_change[$i] = $db_array_file[0];
        }
        return $db_array_file_change;
    }
}