示例#1
0
function make_results_table($slices, $signer, $ma_url, $sa_url)
{
    print "<h3>Results</h3>";
    if (count($slices) == 0) {
        print "<p>No results found. (warning: no partial matches!)</p>";
    } else {
        print "<table><tr><th>Slice name</th><th>Owner</th><th>Expiration</th><th>Next resource exp.</th><th>Actions</th></tr>";
        foreach ($slices as $slice) {
            $slice_urn = $slice[SA_SLICE_TABLE_FIELDNAME::SLICE_URN];
            $name = $slice[SA_SLICE_TABLE_FIELDNAME::SLICE_NAME];
            $expiration = dateUIFormat($slice[SA_SLICE_TABLE_FIELDNAME::EXPIRATION]);
            $owner_id = $slice[SA_SLICE_TABLE_FIELDNAME::OWNER_ID];
            $owner_detail_list = lookup_member_details($ma_url, $signer, array($owner_id));
            $owner_details = $owner_detail_list[$owner_id];
            $member = new Member($owner_id);
            $member->init_from_record($owner_details);
            $owner_name = $member->prettyName();
            $owner_email = $owner_details[MA_ATTRIBUTE_NAME::EMAIL_ADDRESS];
            $mailto_link = "<a href='mailto:{$owner_email}'>{$owner_name}</a>";
            $slivers = lookup_sliver_info_by_slice($sa_url, $signer, $slice_urn);
            if (count($slivers) == 0) {
                $next_exp = "<i>No resources for this slice</i>";
            } else {
                $first_sliver = reset($slivers);
                $next_exp = new DateTime($first_sliver[SA_SLIVER_INFO_TABLE_FIELDNAME::SLIVER_INFO_EXPIRATION]);
                foreach ($slivers as $sliver) {
                    $this_date = new DateTime($sliver[SA_SLIVER_INFO_TABLE_FIELDNAME::SLIVER_INFO_EXPIRATION]);
                    if ($next_exp > $this_date) {
                        $next_exp = $this_date;
                    }
                }
                $next_exp = dateUIFormat($next_exp);
            }
            print "<tr><td>{$name}</td><td>{$mailto_link}</td><td>{$expiration}</td><td>{$next_exp}</td>";
            print "<td><button onclick='expand_info(this);'>More info</button>";
            print "<button class='hideinfo' onclick='hide_info(this);' style='display:none;'>Close</button></td></tr>";
            $project_info = get_project_info($slice, $signer, $ma_url, $sa_url);
            $aggregate_info = get_aggregate_info($slice, $signer, $sa_url);
            $member_info = get_member_info($slice, $signer, $ma_url, $sa_url);
            print "<tr style='display:none'>";
            print "<td style='vertical-align:top'>";
            print "<b style='text-decoration: underline;'>Slice URN</b><br> {$slice_urn}<br><br>";
            print $project_info;
            print "</td>";
            print "<td colspan='2' style='vertical-align:top'>{$aggregate_info}</td>";
            print "<td colspan='2' style='vertical-align:top'>{$member_info}</td> </tr>";
        }
        print "</table>";
    }
}
示例#2
0
文件: index.php 项目: n3wtron/viewgit
if (isset($_REQUEST['a'])) {
    $action = strtolower($_REQUEST['a']);
}
$page['action'] = $action;
/*
 * index - list of projects
 */
if ($action === 'index') {
    $template = 'index';
    $page['title'] = 'List of projects - ViewGit';
    foreach (array_keys($conf['projects']) as $p) {
        $page['projects'][] = get_project_info($p);
    }
} elseif ($action === 'archive') {
    $project = validate_project($_REQUEST['p']);
    $info = get_project_info($project);
    $tree = validate_hash($_REQUEST['h']);
    $type = $_REQUEST['t'];
    if (isset($_REQUEST['hb'])) {
        $hb = validate_hash($_REQUEST['hb']);
        $describe = git_describe($project, $hb);
    }
    // Archive prefix
    $archive_prefix = '';
    if (isset($info['archive_prefix'])) {
        $archive_prefix = "{$info['archive_prefix']}";
    } elseif (isset($conf['archive_prefix'])) {
        $archive_prefix = "{$conf['archive_prefix']}";
    }
    $archive_prefix = str_replace(array('{PROJECT}', '{DESCRIBE}'), array($project, $describe), $archive_prefix);
    // Basename
示例#3
0
$week_tot_h = 0; $week_tot_m = 0; $week_tot_s = 0;

if (isset($first_day)) {
	$start_date = $first_day;
	$end_date = $start_date + $TIMEPERIOD_LENGTH-1;
} else {
	Header("Location: calendar.php");
	exit;
}

$qh = mysql_query("select first_name, last_name, ssn from $USER_TABLE where username='******'") or die("Select failed: ". mysql_error());
list($first, $last, $ssn) = mysql_fetch_row($qh);
mysql_free_result($qh);

list($proj_title, $proj_client, $proj_description, $proj_deadline, $proj_link) = get_project_info($proj_id);

?>
<HTML>
<BODY BGCOLOR="#FFFFFF">
<B><? echo "$first $last </b><br>$ssn<br><br>$proj_title: $proj_client<br>$proj_description" ?>
<TABLE ALIGN=CENTER BORDER=1 WIDTH="100%">
<TR>
<?

for ($i=$start_date; $i <= $end_date; $i++) {
   $date = jdtogregorian($i);
   $tot_sec = 0; $tot_min = 0; $tot_hor = 0;
   list($day,$month,$year) = explode("/",$date);
   
   list($num, $qh) = get_time_date($i, $id, $proj_id);
示例#4
0
    }
    if (isset($_REQUEST['pg'])) {
        $page['pg'] = intval($_REQUEST['pg']);
    } else {
        $page['pg'] = 0;
    }
    $info = git_get_commit_info($page['project'], $page['ref']);
    $page['commit_id'] = $info['h'];
    $page['tree_id'] = $info['tree'];
    $page['shortlog'] = handle_shortlog($page['project'], $page['ref'], $page['pg']);
} elseif ($action === 'summary') {
    $template = 'summary';
    $page['project'] = validate_project($_REQUEST['p']);
    $page['title'] = "{$page['project']} - Summary";
    $page['subtitle'] = "Summary";
    $page['projectinfo'] = get_project_info($page['project']);
    $info = git_get_commit_info($page['project']);
    $page['commit_id'] = $info['h'];
    $page['tree_id'] = $info['tree'];
    $page['shortlog'] = handle_shortlog($page['project']);
    $page['tags'] = handle_tags($page['project'], $gitconf['summary_tags']);
    $page['ref'] = 'HEAD';
    $heads = git_get_heads($page['project']);
    $page['heads'] = array();
    foreach ($heads as $h) {
        $info = git_get_commit_info($page['project'], $h['h']);
        $page['heads'][] = array('date' => strftime($gitconf['datetime'], $info['author_utcstamp']), 'h' => $h['h'], 'fullname' => $h['fullname'], 'name' => $h['name']);
    }
} elseif ($action === 'tags') {
    $template = 'tags';
    $page['project'] = validate_project($_REQUEST['p']);