-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdisplay_phenotype.php
521 lines (472 loc) · 21.6 KB
/
display_phenotype.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
<?php
/**
* Display phenotype information for experiment
*
* PHP version 5.3
*
* @license http://triticeaetoolbox.org/wheat/docs/LICENSE Berkeley-based
* @link http://triticeaetoolbox.org/wheat/display_phenotype.php
*
*/
//A php script to dynamically read data related to a particular experiment from the database and to
//display it in a nice table format. Utilizes the the tableclass Class by Manuel Lemos to display the
//table.
// author Kartic Ramesh; drastically rewritten by Julie Dickerson, 2009 to make usable and use sessions
// 08/22/2012 DEM Display multiple raw files, table rawfiles.
// 08/17/2012 DEM Display GRIN Accession instead of Line Synonym, for Jorge Dubcovsky.
// 03/25/2011 DEM Oops, the Collaborator should be the one in table phenotype_experiment_info.
// 02/07/2011 DEM Add CAPdata_program and Collaborator to the first table.
// 01/12/2011 JLee Add so experiment download data displays on separate page
// 01/12/2011 JLee Mod so mean and std.err values in experiment datafile do have signif digit applied to them
// 10/07/2010 DEM Stop rounding-off values when exported via "Download Experiment Data".
// 9/30/2010 DEM Fixed comma-separated header line in tab-delimited "Download Experiment Data" output.
// 9/30/2010 DEM Add "Experiment" to display list.
// 9/28/2010 J.Lee Add "Number of Entries" to display list
// 9/22/2010 DEM Output Source files loaded at the bottom of the page.
// 9/22/2010 DEM Output CAP Code for each germplasm line as column 2 of the data table.
// 8/19/2010 DEM Fixed scrolling table to work in IE too.
// 6/29/2010 J.Lee Fixed table display issue with MSIE7 and realign dataset download button
// 6/24/2010 J.Lee Merged with Julie's changes
// 3/01/2010 J.Lee Handle missing Raw Data files
// 2/18/2010 J.Lee Fix "Download Raw Data" button not showing with IE browser
session_start();
require 'config.php';
require $config['root_dir'].'includes/bootstrap.inc';
require $config['root_dir'].'theme/normal_header.php';
$delimiter = "\t";
$mysqli = connecti();
?>
<script type="text/javascript" src="display_phenotype.js"></script>
<?php
$trial_code=strip_tags($_GET['trial_code']);
// Display Header information about the experiment
$display_name=ucwords($trial_code); //used to display a beautiful name as the page header
// Restrict if private data.
if ($stmt = mysqli_prepare($mysqli, "SELECT data_public_flag FROM experiments WHERE trial_code = ?")) {
mysqli_stmt_bind_param($stmt, "s", $trial_code);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $data_public_flag);
if (mysqli_stmt_fetch($stmt)) {
echo "<h1>Trial ".$display_name."</h1>";
} else {
mysqli_stmt_close($stmt);
die("Error: trial not found\n");
}
mysqli_stmt_close($stmt);
} else {
die("Error: bad sql statement\n");
}
if (($data_public_flag == 0) and
(!authenticate(array(USER_TYPE_PARTICIPANT, USER_TYPE_CURATOR, USER_TYPE_ADMINISTRATOR)))) {
echo "Results of this trial are restricted to project participants.";
} else {
$sql="SELECT experiment_uid, experiment_set_uid, experiment_desc_name, experiment_year
FROM experiments WHERE trial_code = ?";
if ($stmt = mysqli_prepare($mysqli, $sql)) {
mysqli_stmt_bind_param($stmt, "s", $trial_code);
mysqli_stmt_execute($stmt);
mysqli_stmt_bind_result($stmt, $experiment_uid, $set_uid, $exptname, $year);
if (!mysqli_stmt_fetch($stmt)) {
mysqli_stmt_close($stmt);
die("Error: trial not found\n");
}
mysqli_stmt_close($stmt);
} else {
die("Error: bad sql statement\n");
}
$datasets_exp_uid=$experiment_uid;
if (!$experiment_uid) {
die("Trial $trial_code not found.");
}
$query="SELECT * FROM phenotype_experiment_info WHERE experiment_uid='$experiment_uid'";
$result_pei=mysqli_query($mysqli, $query) or die(mysqli_error($mysqli));
$row_pei=mysqli_fetch_array($result_pei);
// Get Experiment (experiment_set) too.
if ($set_uid) {
$exptset = mysql_grab("SELECT experiment_set_name from experiment_set where experiment_set_uid=$set_uid");
}
// Get CAPdata_program too.
$query="SELECT data_program_name, collaborator_name, program_type
from CAPdata_programs, experiments
where experiment_uid = $experiment_uid
and experiments.CAPdata_programs_uid = CAPdata_programs.CAPdata_programs_uid";
$result_cdp=mysqli_query($mysqli, $query) or die(mysqli_error($mysqli));
$row_cdp=mysqli_fetch_array($result_cdp);
$dataprogram = $row_cdp['data_program_name'];
$programType = ucfirst($row_cdp['program_type']);
echo "<table>";
if ($exptset) {
echo "<tr> <td>Experiment</td><td>".$exptset."</td></tr>";
}
echo "<tr> <td>Trial Year</td><td>$year</td></tr>";
if ($exptname) {
echo "<tr> <td>Description</td><td>$exptname</td></tr>";
}
echo "<tr> <td>Location (Latitude/Longitude)</td><td>".$row_pei['location']." ("
.$row_pei['latitude']." / ".$row_pei['longitude'].")</td></tr>";
echo "<tr> <td>Collaborator</td><td>".$row_pei['collaborator']."</td></tr>";
echo "<tr> <td>Planting Date</td><td>".$row_pei['planting_date']."</td></tr>";
echo "<tr> <td>Harvest Date</td><td>".$row_pei['harvest_date']."</td></tr>";
echo "<tr> <td>Begin Weather Date</td><td>".$row_pei['begin_weather_date']."</td></tr>";
echo "<tr> <td>Greenhouse?</td><td>".$row_pei['greenhouse_trial']."</td></tr>";
echo "<tr> <td>Seeding Rate (plants/m<sup>2</sup>)</td><td>".$row_pei['seeding_rate']."</td></tr>";
echo "<tr> <td>Experiment Design</td><td>".$row_pei['experiment_design']."</td></tr>";
echo "<tr> <td>Plot Size (m<sup>2</sup>)</td><td>".$row_pei['plot_size']."</td></tr>";
echo "<tr> <td>Harvest Area (m<sup>2</sup>)</td><td>".$row_pei['harvest_area']."</td></tr>";
echo "<tr> <td>Irrigation</td><td>".$row_pei['irrigation']."</td></tr>";
echo "<tr> <td>Number of Entries</td><td>".$row_pei['number_entries']."</td></tr>";
echo "<tr> <td>Number of Replications</td><td>".$row_pei['number_replications']."</td></tr>";
echo "<tr> <td>Comments</td><td>".$row_pei['other_remarks']."</td></tr>";
echo "<tr> <td>$programType Program</td><td>".$dataprogram."</td></tr>";
echo "</table><p>";
// get all line data for this experiment
$sql="SELECT tht_base_uid, line_record_uid, check_line FROM tht_base WHERE experiment_uid='$experiment_uid'";
$result_thtbase=mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli));
while ($row_thtbase=mysqli_fetch_array($result_thtbase)) {
$thtbase_uid[] = $row_thtbase['tht_base_uid'];
$linerecord_uid[] = $row_thtbase['line_record_uid'];
$check_line[] = $row_thtbase['check_line'];
//echo $row_thtbase['tht_base_uid']." ".$row_thtbase['line_record_uid']." ".$row_thtbase['check_line']."<br>";
}
$num_lines = count($linerecord_uid);
$num_phenotypes = 0;
$sql="SELECT count(distinct(phenotype_uid)) from tht_base, phenotype_data
WHERE tht_base.tht_base_uid = phenotype_data.tht_base_uid
AND experiment_uid = $experiment_uid";
$result_thtbase=mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli));
if ($row_thtbase=mysqli_fetch_array($result_thtbase)) {
$num_phenotypes = $row_thtbase[0];
}
//echo $num_lines."<br>";
$titles=array('Line Name'); //stores the titles for the display table with units
$titles[]="GRIN Accession";//add CAP Code column to titles
if ($num_phenotypes > 100) {
echo "$num_lines lines<br>$num_phenotypes phenotypes measured<br>\n";
echo "<font color=\"red\">Warning: Values will not be displayed when there are over 100 phenotypes measuered.</font><br>\n";
} elseif (!empty($thtbase_uid)) {
$thtbasestring = implode(",", $thtbase_uid);
$sql1="SELECT DISTINCT p.phenotypes_name as name, p.phenotype_uid as uid, units.unit_name as unit, units.sigdigits_display as sigdig
FROM phenotype_data as pd, phenotypes as p, units
WHERE p.phenotype_uid = pd.phenotype_uid
AND units.unit_uid = p.unit_uid
AND pd.tht_base_uid IN ($thtbasestring)";
//echo $sql1."<br>";
$result1=mysqli_query($mysqli, $sql1) or die(mysqli_error($mysqli));
$num_phenotypes = mysqli_num_rows($result1);
//echo "$num_phenotypes Rows\n";
while ($row1=mysqli_fetch_array($result1)) {
$phenotype_data_name[]=$row1['name'];
$phenotype_uid[]=$row1['uid'];
$unit_sigdigits[]=$row1['sigdig'];
$unit_name[]=$row1['unit'];
$titles[]=ucwords($row1['name'])." (".strtolower($row1['unit']).")";
}
$titles[]="Check"; //add the check column to the display table
$all_rows=array(); //2D array that will hold the values in table format to be displayed
$sum_rows=array(); //summary statistics
$all_rows_long=array(); // For the full unrounded values
$single_row=array(); //1D array which will hold each row values in the table format to be displayed
$single_row_long=array();
/* $dir ='./downloads/temp/'; */
$dir ='/tmp/tht/';
if (! file_exists('/tmp/tht')) {
mkdir('/tmp/tht');
}
// Clean up old files, older than 1 day.
system("find $dir -mtime +1 -name 'THT_Phenotypes_*.txt' -delete");
$stringData = implode($delimiter, $titles);
//---------------------------------------------------------------------------------------------------------------
//Go through lines to create a data table for display
for ($lr_i=0; $lr_i<$num_lines; $lr_i++) {
$thtbaseuid=$thtbase_uid[$lr_i];
$linerecorduid=$linerecord_uid[$lr_i];
//echo $linerecorduid." ".$thtbaseuid."<br>";
$sql_lnruid="SELECT line_record_name FROM line_records WHERE line_record_uid='$linerecorduid'";
$result_lnruid=mysqli_query($mysqli, $sql_lnruid) or die(mysqli_error($mysqli));
$row_lnruid=mysqli_fetch_assoc($result_lnruid);
$lnrname=$row_lnruid['line_record_name'];
$single_row[0]=$lnrname;
$single_row_long[0]=$lnrname;
/* Use GRIN accession instead of Synonym */
/* // get the CAP code */
/* $sql_cc="SELECT line_synonym_name */
/* FROM line_synonyms */
/* WHERE line_synonyms.line_record_uid = '$linerecorduid'"; */
/* $result_cc=mysql_query($sql_cc) or die(mysql_error()); */
/* $row_cc=mysql_fetch_assoc($result_cc); */
/* $single_row[1]=$row_cc['line_synonym_name']; */
/* $single_row_long[1]=$row_cc['line_synonym_name']; */
$sql_gr="select barley_ref_number
from barley_pedigree_catalog bc, barley_pedigree_catalog_ref bcr
where barley_pedigree_catalog_name = 'GRIN'
and bc.barley_pedigree_catalog_uid = bcr.barley_pedigree_catalog_uid
and bcr.line_record_uid = '$linerecorduid'";
$result_gr=mysqli_query($mysqli, $sql_gr) or die(mysqli_error($mysqli));
$row_gr=mysqli_fetch_assoc($result_gr);
$single_row[1]=$row_gr['barley_ref_number'];
$single_row_long[1]=$row_gr['barley_ref_number'];
for ($i=0; $i<$num_phenotypes; $i++) {
$puid=$phenotype_uid[$i];
$sigdig=$unit_sigdigits[$i];
$sql_val="SELECT value FROM phenotype_data
WHERE tht_base_uid='$thtbaseuid'
AND phenotype_uid = '$puid'";
//echo $sql_val."<br>";
$result_val=mysqli_query($mysqli, $sql_val);
if (mysqli_num_rows($result_val) > 0) {
$row_val=mysqli_fetch_assoc($result_val);
$val=$row_val['value'];
$val_long=$val;
if ($sigdig >= 0) {
$val = floatval($val);
$val=number_format($val, $sigdig);
}
} else {
$val = "--";
$val_long = "--";
}
if (empty($val)) {
$val = "--";
$val_long = "--";
}
$single_row[$i+2]=$val;
$single_row_long[$i+2]=$val_long;
}
//-----------------------------------------check line addition
if ($check_line[$lr_i]=='yes') {
$check=1;
} else {
$check=0;
}
//echo $check;
$single_row[$num_phenotypes+2]=$check;
$single_row_long[$num_phenotypes+2]=$check;
//-----------------------------------------
//var_dump($single_row_long);
$stringData= implode($delimiter, $single_row_long);
$all_rows[]=$single_row;
$all_rows_long[]=$single_row_long;
}
//-----------------------------------------get statistics
$mean_arr=array('Mean','');
$se_arr=array('Standard Error','');
// Unformatted mean and SE
$unformat_mean_arr=array('Mean','');
$unformat_se_arr=array('Standard Error','');
$nr_arr=array('Number Replicates','');
$prob_arr=array('Prob > F','');
$fmean="Mean,";
$fse="SE,";
$fnr="Number Replicates,";
$fprob="Prob gt F,";
for ($i=0; $i<$num_phenotypes; $i++) {
$puid=$phenotype_uid[$i];
$sigdig=$unit_sigdigits[$i];
$sql_mdata="SELECT mean_value,standard_error,number_replicates,prob_gt_F
FROM phenotype_mean_data
WHERE phenotype_uid='$puid'
AND experiment_uid='$experiment_uid'";
$res_mdata=mysqli_query($mysqli, $sql_mdata) or die(mysqli_error($mysqli));
$row_mdata=mysqli_fetch_array($res_mdata);
$mean=$row_mdata['mean_value'];
$se=$row_mdata['standard_error'];
$nr=$row_mdata['number_replicates'];
$prob=$row_mdata['prob_gt_F'];
if ($mean!=0) {
$unformat_mean_arr[] = $mean;
if ($sigdig>=0) {
$mean=number_format($mean, $sigdig);
}
$mean_arr[] = $mean;
} else {
$unformat_mean_arr[] = "--";
$mean_arr[]="--";
}
if ($se!=0) {
$unformat_se_arr[] = $se;
if ($sigdig>=0) {
$se=number_format($se, $sigdig);
}
$se_arr[] = $se;
} else {
$se_arr[]="--";
$unformat_se_arr[] = "--";
}
if ($nr==0) {
$nr="--";
}
$nr_arr[]=$nr;
# prob_gt_F is a varchar and can have nonnumeric values like "<.0001".
if ($prob!="" && $prob!="NULL") {
# $prob=number_format($prob,2);
$prob_arr[]=$prob;
} else {
$prob_arr[]="--";
}
}
$fmean= implode($delimiter, $mean_arr)."\n";
$fse= implode($delimiter, $se_arr)."\n";
$fnr= implode($delimiter, $nr_arr)."\n";
$fprob= implode($delimiter, $prob_arr)."\n";
$ufmean= implode($delimiter, $unformat_mean_arr)."\n";
$ufse= implode($delimiter, $unformat_se_arr)."\n";
$sum_rows[]=$mean_arr;
$sum_rows[]=$se_arr;
$sum_rows[]=$nr_arr;
$sum_rows[]=$prob_arr;
$all_rows_long[]=$mean_arr;
$all_rows_long[]=$se_arr;
$all_rows_long[]=$nr_arr;
$all_rows_long[]=$prob_arr;
//-----------------------------------------
$total_rows=count($all_rows); //used to determine the number of rows to be displayed in the result page
?>
<!--Style sheet for better user interface-->
<style type="text/css">
th {background: #5B53A6 !important; color: white !important; border-left: 2px solid #5B53A6}
table {background: none; border-collapse: collapse}
td {border: 1px solid #eee !important;}
h3 {border-left: 4px solid #5B53A6; padding-left: .5em;}
</style>
<!-- Calculate the width of the table based on the number of columns. -->
<?php $tablewidth = count($single_row) * 92 + 10; ?>
<div style="width: <?php echo $tablewidth; ?>px">
<table>
<tr>
<?php
for ($i=0; $i<count($titles); $i++) {
?>
<th><div style="width: 75px;">
<?php echo $titles[$i]?>
</div></th>
<?php
}
?>
</tr>
</table>
</div>
<div style="padding: 0; width: <?php echo $tablewidth; ?>px; height: 400px; overflow: scroll; overflow-x: hidden; border: 1px solid #5b53a6; clear: both">
<table>
<?php
for ($i = 0; $i < count($all_rows); $i++) {
?>
<tr>
<?php
for ($j = 0; $j < count($single_row); $j++) {
?>
<!-- <td><div style="width: 75px; overflow-x: hidden;"> -->
<td><div style="width: 75px; word-wrap: break-word">
<?php echo $all_rows[$i][$j] ?>
</div></td>
<?php
}/* end of for j loop */
?>
</tr>
<?php
}/* end of for i loop */
?>
</table>
</div>
<div style="padding: 0; width: <?php echo $tablewidth; ?>px; border: 1px solid #5b53a6; clear: both">
<table>
<?php
for ($i = 0; $i < 4; $i++) {
echo "<tr>";
for ($j = 0; $j < count($single_row); $j++) {
echo "<td><div style=\"width: 75px; word-wrap: break-word\">";
echo $sum_rows[$i][$j];
echo "</div></td>";
}
}
?>
</table>
</div>
<?php
}
echo "<br>";
echo "<form>";
echo "<input type='button' value='Download Trial Data' onclick=\"javascript:output_file2('$experiment_uid');\" />";
echo "</form>";
$sql = "select experiment_uid from phenotype_plot_data where experiment_uid = $experiment_uid";
$res = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli));
if ($row = mysqli_fetch_row($res)) {
echo "<form>";
echo "<input type='button' value='Download Plot Data' onclick=\"javascript:output_file_plot('$experiment_uid');\" />";
echo "</form>";
}
$sourcesql="SELECT input_data_file_name FROM experiments WHERE trial_code='$trial_code'";
$sourceres=mysqli_query($mysqli, $sourcesql) or die(mysqli_error($mysqli));
$sourcerow=mysqli_fetch_array($sourceres);
$sources=$sourcerow['input_data_file_name'];
if ($sources)
echo "<p><b>Means file:</b> $sources";
echo "<p><b>Raw data files:</b> ";
$rawsql="SELECT name, directory from rawfiles where experiment_uid = $experiment_uid";
$rawres=mysqli_query($mysqli, $rawsql) or die(mysqli_error($mysqli));
while ($rawrow = mysqli_fetch_assoc($rawres)) {
$rawfilename=$rawrow['name'];
$rawdir = $rawrow['directory'];
if ($rawdir)
$rawfilename=$rawrow['directory']."/".$rawfilename;
$rawfile="raw/phenotype/".$rawfilename;
echo "<a href=".$config['base_url'].$rawfile.">".$rawrow['name']."</a><br>";
}
if (empty($rawfilename)) echo "none<br>";
echo "<p><b>Field Book:</b> ";
$rawsql="SELECT experiment_uid from fieldbook where experiment_uid = $experiment_uid";
$rawres=mysqli_query($mysqli, $rawsql) or die(mysqli_error($mysqli));
if ($rawrow = mysqli_fetch_assoc($rawres)) {
$fieldbook="display_fieldbook.php?function=display&uid=$experiment_uid";
echo "<a href=".$config['base_url'].$fieldbook.">$trial_code</a><br>\n";
}
if (empty($fieldbook)) echo "none";
$pheno_str = "";
$rawsql="SELECT distinct(phenotypes_name) from phenotype_plot_data, phenotypes where phenotype_plot_data.phenotype_uid = phenotypes.phenotype_uid and experiment_uid = $experiment_uid";
$rawres=mysqli_query($mysqli, $rawsql) or die(mysqli_error($mysqli));
while ($rawrow = mysqli_fetch_assoc($rawres)) {
if ($pheno_str == "") {
$pheno_str = $rawrow['phenotypes_name'];
} else {
$pheno_str = $pheno_str . ", " . $rawrow['phenotypes_name'];
}
}
if ($pheno_str != "") {
echo "<b>Display Numeric map:</b> <a href=".$config['base_url']."display_map_exp.php?uid=$experiment_uid>$pheno_str</a><br>\n";
echo "<b>Display Heat map:</b> <a href=".$config['base_url']."display_heatmap_exp.php?uid=$experiment_uid>$pheno_str</a><br>\n";
}
$found = 0;
$sql="SELECT date_format(measure_date, '%m-%d-%Y'), date_format(start_time, '%H:%i'), spect_sys_uid, raw_file_name, measurement_uid from csr_measurement where experiment_uid = $experiment_uid order by measure_date";
$res = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli));
while ($row = mysqli_fetch_array($res)) {
if ($found == 0) {
echo "<table><tr><td>Measured Date<td>CSR Annotation<td>CSR Data<td>Spectrometer<br>System<td>CSR Data\n";
$found = 1;
}
$date = $row[0];
$time = $row[1];
$sys_uid = $row[2];
$raw_file = $row[3];
$measurement_uid = $row[4];
$trial="display_csr_exp.php?function=display&uid=$measurement_uid";
$tmp2 = $config['base_url'] . "raw/phenotype/" . $raw_file;
echo "<tr><td>$date $time";
echo "<td><a href=".$config['base_url'].$trial.">View</a>";
echo "<td><a href=\"$tmp2\">Open File</a>";
$sql="SELECT system_name from csr_system where system_uid = $sys_uid";
$res2 = mysqli_query($mysqli, $sql) or die(mysqli_error($mysqli));
if ($rawrow = mysqli_fetch_assoc($res2)) {
$system_name = $rawrow["system_name"];
$trial= $config['base_url'] . "display_csr_spe.php?function=display&uid=$sys_uid";
echo "<td><a href=$trial>$system_name</a>";
} else {
echo "<td>missing";
}
$trial= $config['base_url'] . "curator_data/cal_index.php";
echo "<td><a href=$trial>Calculate Index</a>";
}
echo "</table>";
}
//-----------------------------------------------------------------------------------
$footer_div = 1;
require $config['root_dir'].'theme/footer.php';
?>