Skip to content

Commit ddac464

Browse files
committedJul 1, 2021
Working on creating a mpid
1 parent ace80be commit ddac464

File tree

4 files changed

+77
-4
lines changed

4 files changed

+77
-4
lines changed
 

‎application/controllers/Ccdb_id_gen.php

+36
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public function select_user()
4545
$scopeID = $this->input->post('scope_list', TRUE);
4646
$this->session->set_userdata('scopeID', $scopeID);
4747

48+
4849
$userArray = $dbutil->getUsers();
4950
$data['userArray'] = $userArray;
5051
$this->load->view('templates/header', $data);
@@ -66,6 +67,8 @@ public function select_project()
6667
$dbutil = new DBUtil();
6768
$pArray = $dbutil->getAllProjects();
6869

70+
$data['userName'] = $userName;
71+
6972
$data['pArray'] = $pArray;
7073

7174
$this->load->view('templates/header', $data);
@@ -83,6 +86,10 @@ public function select_experiment()
8386
$projectID = $this->input->post('project_list', TRUE);
8487
$this->session->set_userdata('projectID', $projectID);
8588

89+
90+
$data['userName'] = $this->session->userdata('userName');
91+
$data['projectID'] = $projectID;
92+
8693
$dbutil = new DBUtil();
8794
$eArray = $dbutil->getExperimentByProjectID($projectID);
8895

@@ -107,6 +114,10 @@ public function create_microscopy()
107114
$experimentID = $this->input->post('experiment_list', TRUE);
108115
$this->session->set_userdata('experimentID', $experimentID);
109116

117+
$data['userName'] = $this->session->userdata('userName');
118+
$data['projectID'] = $this->session->userdata('projectID');
119+
$data['experimentID'] = $experimentID;
120+
110121
$this->load->view('templates/header', $data);
111122
$this->load->view('create/create_microscopy', $data);
112123
$this->load->view('templates/footer', $data);
@@ -122,6 +133,31 @@ public function submit_microscopy()
122133

123134
$imageBasename = $this->input->post('image_basename', TRUE);
124135
echo "<br/>Image basename:".$imageBasename;
136+
$description = $this->input->post('description', TRUE);
137+
echo "<br/>Description:".$description;
138+
139+
$dbutil = new DBUtil();
140+
141+
$scopeName = $this->session->userdata('scopeID');
142+
$userName = $this->session->userdata('userName');
143+
$projectID = $this->session->userdata('projectID');
144+
$experimentID = $this->session->userdata('experimentID');
145+
146+
147+
$array = array();
148+
$mp = array();
149+
$mp['Experiment_id'] = intval($experimentID);
150+
$mp['Image_basename'] = $imageBasename;
151+
$mp['User'] = $userName;
152+
$mp['Description'] = $description;
153+
$mp['Microscope_name'] = $scopeName;
154+
$array['Microscopy'] = $mp;
155+
156+
$json_str = json_encode($array);
157+
$json = json_decode($json_str);
158+
159+
$result = $dbutil->inserMicroscopy($json);
160+
var_dump($result);
125161
}
126162

127163
}

‎application/views/create/create_microscopy.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,17 @@
1313
<form action="/Ccdb_id_gen/submit_microscopy" method="post" onsubmit="return validateMP()">
1414
<br/>
1515
<center>
16-
<table style="width:30%;" >
16+
<table style="width:40%;" >
1717
<tr>
18-
<td style="width:20%;">Image basename:</td>
19-
<td style="width:80%;"><input type="text" id="image_basename" name="image_basename"></td>
18+
<td style="width:30%;">Image basename:</td>
19+
<td style="width:70%;"><input type="text" id="image_basename" name="image_basename"></td>
20+
</tr>
21+
<tr>
22+
<td>&nbsp;</td>
23+
</tr>
24+
<tr>
25+
<td style="width:30%;">Description:</td>
26+
<td style="width:70%;"><input type="text" id="description" name="description" size="100"></td>
2027
</tr>
2128
2229
</table>

‎application/views/main/select_scope.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
{
2424

2525
?>
26-
<option value="<?php echo $scope->Id; ?>"><?php echo $scope->Scope_name; ?></option>
26+
<!-- <option value="<?php echo $scope->Id; ?>"><?php echo $scope->Scope_name; ?></option> -->
27+
<option value="<?php echo $scope->Scope_name; ?>"><?php echo $scope->Scope_name; ?></option>
2728

2829
<?php
2930
}

‎application/views/templates/header.php

+29
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,32 @@ function eraseCookie(name) {
4040
</tr>
4141
</table>
4242

43+
<br/>
44+
<?php
45+
46+
if(isset($userName))
47+
{
48+
?>
49+
<center>
50+
<table style="width:50%;" cellspacing="0" cellpadding="0">
51+
<tr>
52+
<td style="width: 100%"><?php echo "/".$userName; ?>
53+
<?php
54+
if(isset($projectID))
55+
{
56+
echo "/Project:".$projectID;
57+
}
58+
59+
if(isset($experimentID))
60+
{
61+
echo "/Experiment:".$experimentID;
62+
}
63+
?>
64+
</td>
65+
</tr>
66+
67+
</table>
68+
</center>
69+
<?php
70+
}
71+
?>

0 commit comments

Comments
 (0)
Please sign in to comment.