forked from ormestad/publications
-
Notifications
You must be signed in to change notification settings - Fork 4
/
lab_edit.php
70 lines (58 loc) · 1.98 KB
/
lab_edit.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
<?php
require 'lib/global.php';
$researchers=new NGIresearchers();
if($USER->auth>0) {
if(isset($_POST['submit'])) {
if($update=$researchers->setPI($_POST['lab_id'],$_POST['lab_pi'])) {
header('Location:researchers.php');
}
} else {
$lab=$researchers->getLab($_GET['id']);
if(trim($lab['lab']['lab_pi'])=='') {
$select[]='--- Please select PI ---';
}
foreach($lab['group_data'] as $researcher) {
$select[$researcher['email']]=$researcher['first_name'].' '.$researcher['last_name'];
}
$theform=new htmlForm("lab_edit.php");
$theform->addInput(FALSE,array('name' => 'lab_id', 'type' => 'hidden', 'value' => $_GET['id']));
$theform->addSelect("Lab PI","lab_pi",$select, array($lab['lab']['lab_pi']));
$theform->addInput(FALSE,array('name' => 'submit', 'type' => 'submit', 'value' => 'Save', 'class' => 'button'));
}
} else {
// Not logged in
header('Location:login.php');
}
// Render Page
//=================================================================================================
?>
<!doctype html>
<html class="no-js" lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo $CONFIG['site']['name']; ?></title>
<link rel="stylesheet" href="css/foundation.css">
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="css/icons/foundation-icons.css" />
</head>
<body>
<?php require '_menu.php'; ?>
<div class="row">
<br>
<div class="large-12 columns">
<p>Assign lab PI if this has not been done automatically.</p>
<ul>
<li>If PI is not in list, please add in LIMS</li>
<li>If lab name or affiliation needs to be edited, please edit in LIMS</li>
</ul>
<?php echo $theform->render(); ?>
</div>
</div>
<script src="js/vendor/jquery.js"></script>
<script src="js/vendor/what-input.js"></script>
<script src="js/vendor/foundation.js"></script>
<script src="js/app.js"></script>
</body>
</html>