File indexing completed on 2024-04-06 12:23:16
0001 <?php
0002
0003
0004
0005
0006
0007
0008 require_once 'common.php';
0009 require_once 'db_functions.php';
0010
0011 function draw_location_box() {
0012 $locations = get_loc_list();
0013
0014 echo "<select name='location'>";
0015 foreach($locations as $loc) {
0016 echo "<option value='$loc'>$loc";
0017 }
0018 echo "</select>";
0019 }
0020
0021 function draw_sm_box() {
0022 $supermodules = get_sm_list();
0023 array_unshift($supermodules, 'Any');
0024
0025 echo "<select name='SM'>";
0026 foreach($supermodules as $sm) {
0027 echo "<option value='$sm'>$sm";
0028 }
0029 echo "</select>";
0030 }
0031
0032
0033 function get_xtal_list() {
0034 $crystals= array();
0035 for ($i=1; $i<1701; $i++){
0036 $crystals[$i]=$i;
0037 }
0038
0039 return ($crystals);
0040 }
0041
0042 function draw_xtal_box() {
0043 $crystals = get_xtal_list();
0044 array_unshift($crystals, 'Any');
0045
0046 echo "<select name='CRYSTAL'>";
0047 foreach($crystals as $xt) {
0048 echo "<option value='$xt'>$xt";
0049 }
0050 echo "</select>";
0051 }
0052
0053 function draw_runtype_box() {
0054 $runtypes = get_runtype_list();
0055 array_unshift($runtypes, 'All');
0056 array_unshift($runtypes, 'All except TEST');
0057
0058 echo "<select name='run_type'>";
0059 foreach($runtypes as $type) {
0060 echo "<option value='$type'>$type";
0061 }
0062 echo "</select>";
0063 }
0064
0065 function draw_rungentag_box() {
0066 $gentags = get_rungentag_list();
0067 array_unshift($gentags, 'All');
0068
0069 echo "<select name='run_gen_tag'>";
0070 foreach($gentags as $tag) {
0071 echo "<option value='$tag'>$tag";
0072 }
0073 echo "</select>";
0074 }
0075
0076 function draw_run_num_range_box() {
0077 $extents = get_run_num_extents();
0078
0079 echo "<input type='radio' name='run_select' value='run_range'/> Select by run range: ";
0080 echo "<input type='text' name='min_run' value='$extents[MIN_RUN]'>";
0081 echo " to ";
0082 echo "<input type='text' name='max_run' value='$extents[MAX_RUN]'>";
0083 }
0084
0085 function draw_run_date_range_box() {
0086 $extents = get_run_date_extents();
0087 $min_start = $extents['MIN_START'];
0088 $max_start = $extents['MAX_START'];
0089 $fmt = "Y-m-d H:i:s";
0090 $ary = getdate(strtotime($max_start));
0091
0092 $def_start = date($fmt, mktime($ary['hours'], $ary['minutes'], $ary['seconds'],
0093 $ary['mon'], $ary['mday']-1, $ary['year']));
0094
0095
0096 echo "<input type='radio' name='run_select' value='date_range'/> Select by date range: ";
0097 echo "<input type='text' name='min_start' value='$def_start'>";
0098 echo " to ";
0099 echo "<input type='text' name='max_start' value='$max_start'>";
0100 }
0101
0102 function draw_run_select_box() {
0103 echo "<input type='radio' name='run_select' value='all_runs' checked='checked'/> Select all runs<br/>";
0104 echo "<input type='radio' name='run_select' value='last_100' /> Select last 100 runs (Auto-Refresh)<br/>";
0105 draw_run_num_range_box();
0106 echo "<br/>";
0107 draw_run_date_range_box();
0108 }
0109
0110 function draw_interested_box() {
0111 $datatypes = get_datatype_array();
0112
0113 foreach ($datatypes as $name => $prefix) {
0114 echo "<input type='checkbox' name='$prefix'>$name<br/>";
0115 }
0116 }
0117
0118 function draw_ordering_box() {
0119 echo "<select name='run_order'>";
0120 echo "<option value='desc'>Descending</option>";
0121 echo "<option value='asc'>Ascending</option>";
0122 echo "</select>";
0123 }
0124 ?>
0125
0126 <!DOCTYPE html
0127 PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
0128 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
0129 <html>
0130 <head>
0131 <title>ECAL CondDB Run Selection</title>
0132 <?php echo get_stylelinks(); ?>
0133 </head>
0134
0135 <body>
0136
0137 <h1>ECAL CondDB Run Selection</h1>
0138
0139 <form name='runselect' action='list_runs.php'>
0140 <table class='runselect'>
0141 <tr><th>Location:</th><td><?php draw_location_box(); ?></td></tr>
0142 <tr><th>SM:</th><td><?php draw_sm_box(); ?></td></tr>
0143 <tr><th>Crystal:</th><td><?php draw_xtal_box(); ?></td></tr>
0144 <tr><th>Run Type:</th><td><?php draw_runtype_box(); ?></td></tr>
0145 <tr><th>General Tag:</th><td><?php draw_rungentag_box(); ?></td></tr>
0146 <tr><th>Run Selection:</th><td><?php draw_run_select_box(); ?></td></tr>
0147 <tr><th>Run Order:</th><td><?php draw_ordering_box(); ?></td></tr>
0148 <tr><th>Data:</th><td><?php draw_interested_box(); ?></td></tr>
0149 <!--<tr><td align='left'><input type='checkbox' name='compact'>Compact view</td>-->
0150 <tr><td align='left'><input type='checkbox' name='expanded'>Expanded view</td>
0151 <td colspan='2' align='right'><input type='submit' value='Submit'></td></tr>
0152 </table>
0153 </form>
0154
0155 <p>Send bug reports and feature requests to <a href='mailto:Ricky.Egeland@cern.ch'>Ricky Egeland</a>.</p>
0156
0157 </body>
0158 </html>