Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:23:16

0001 <?php
0002 /* 
0003  * beam.php
0004  * 
0005  * page to display beam data 
0006  * $Id: 
0007  */
0008 
0009 
0010 require_once 'common.php';
0011 require_once 'db_functions.php';
0012 
0013 function input_errors() {
0014   $error = "";
0015   foreach (array('run_num', 'loc') as $input) {
0016     if (!isset($input)) { $error .= "<h1>ERROR:  Missing input parameter '$input'</h1>"; }
0017   }
0018 }
0019 function beam_to_out($run, $loc) {
0020 
0021   $beamresults = fetch_all_beam_data($run, $loc);
0022   $nbeamrows =  count($beamresults['IOV_ID']);
0023 
0024   if ($nbeamrows ==1) {
0025   
0026       foreach($beamresults as $cle=>$valeur)
0027   {
0028     $valeur=$beamresults[$cle][0];
0029     
0030     echo $cle.' : '.$valeur.'<br>';
0031   }
0032      
0033 
0034   } else {
0035     echo "<tr>
0036           <th class='typehead'>BEAM</th>
0037           <td class='noresults'>No BEAM results</td></tr>";
0038   }
0039 
0040 }
0041 
0042 
0043 
0044 // Input
0045 $run = $_GET['run_num'];
0046 $loc = $_GET['loc'];
0047 $title = "Beam data for run $run";
0048 
0049 
0050 
0051 ?>
0052 <!DOCTYPE html
0053 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
0054 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
0055 <html>
0056 <head>
0057 <title><?php echo $title ?></title>
0058 <?php echo get_stylelinks(); ?>
0059 </head>
0060 
0061 <body>
0062 
0063 <?php
0064 if ($errors = input_errors()) {
0065   echo $errors;
0066 } else {
0067   echo "<h1>$title</h1>";
0068   beam_to_out($run, $loc);
0069 }
0070 ?>
0071 
0072 </body>
0073 </html>