<?php require_once 'common.php'; require_once 'db_functions.php'; $tasks = get_task_array(); $loc = $_GET['loc']; $taskcode = $_GET['taskcode']; $run = $_GET['run']; $iov_id = $_GET['iov_id']; $conn = connect($_GET['loc']); ?> <!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <?php echo "<title>bad channels list - run " . $run . " @ " . $loc . "</title>"; echo get_stylelinks(); ?> </head> <body> <?php // Tables to output for each task code $tables['CI'][0] = "MON_CRYSTAL_CONSISTENCY_DAT"; $tables['CI'][1] = "MON_TT_CONSISTENCY_DAT"; $tables['CI'][2] = "MON_MEM_CH_CONSISTENCY_DAT"; $tables['CI'][3] = "MON_MEM_TT_CONSISTENCY_DAT"; $tables['PO'][0] = "MON_PEDESTALS_ONLINE_DAT"; $tables['PD'][0] = "MON_PEDESTALS_DAT";
function draw_tasklist($list_bits, $outcome_bits, $run, $loc, $iov_id) { $tasks = get_task_array(); $outcome = get_task_outcome($list_bits, $outcome_bits); if (!$outcome) { return; } foreach ($outcome as $taskcode => $result) { $status = $result ? 'good' : 'bad'; $url = htmlentities("bad_channels.php?run={$run}&loc={$loc}&iov_id={$iov_id}&taskcode={$taskcode}"); $target = "bad_channels{$run}{$loc}{$iov_id}{$taskcode}"; echo "<div class='ttp bl {$status}'>\n <a onclick=\"return popup(this, '{$target}', 1000)\" href='{$url}'>{$taskcode}</a>\n <div class='tt' style='width: 150px'>{$tasks[$taskcode]}</div></div>"; } }
function get_task_outcome($list_bits, $outcome_bits) { if (!$list_bits && !$outcome_bits) { return false; } $tasks = get_task_array(); $result = array(); foreach (array_keys($tasks) as $i => $taskcode) { if ($list_bits & 1 << $i) { $result[$taskcode] = $outcome_bits & 1 << $i; } } return $result; }