/
configurationvfat.php
264 lines (215 loc) · 8.53 KB
/
configurationvfat.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
<?php
// Form Submitted , need to generate XML
//if (isset($_POST['foilsnumbersubmitted'])) {
if(isset($_POST["submit"])) {
include_once "functions/functions.php";
include_once "functions/generate_xml.php";
include_once "functions/globals.php";
$head = array();
$headRun =array();
$headType =array();
$foils =array();
$foil = array();
$part = array();
$partdata = array();
$data = array();
// Header Data
$headType['EXTENSION_TABLE_NAME'] ="GEM_VFAT_STRIP_MASKING";
$headType['NAME'] = "GEM VFAT STRIP MASKING";
$head['TYPE'] = $headType;
$headRun['RUN_NUMBER'] = $_POST['RUN_NUMBER'];
$headRun['RUN_TYPE'] = $_POST['RUN_TYPE'];
$headRun['RUN_BEGIN_TIMESTAMP'] = date($_POST['RUN_BEGIN_TIMESTAMP'].':s');
$RUN = "check";
$headRun['RUN_END_TIMESTAMP'] = date($_POST['RUN_END_TIMESTAMP'].':s');
$headRun['LOCATION'] = $_POST['LOCATION'];
$headRun['INITIATED_BY_USER'] = $_POST['INITIATED_BY_USER'];
$headRun['COMMENT_DESCRIPTION'] = $_POST['COMMENT_DESCRIPTION'];
$head['RUN'] = $headRun;
//Foils Data
for($i = 1; $i <= $_POST['foilsnumbersubmitted']; $i++){
//$_POST['foil'.$i];
$foil['COMMENT_DESCRIPTION'] = $_POST['COMMENT_DESCRIPTION_foil'.$i];
$foil['VERSION'] = $_POST['VERSION_foil'.$i];
$part['SERIAL_NUMBER'] = $_POST['foil'.$i];
$part['VERSION'] = "Batch ".$_POST['VERSIONbatch'.$i];
$part['KIND_OF_PART'] = $FOIL_KIND_OF_PART_NAME;
$foil['PART'] = $part;
$partdata['TEST_TIME'] = $_POST['HUMIDITY_PERCENT_foil'.$i];
$partdata['INCRMNT_SEC'] = $_POST['TEMP_DEG_CENT_foil'.$i];
$partdata['MANF_PRSR_MBAR'] = $_POST['PRESSURE_MBAR_foil'.$i];
$partdata['AMB_PRSR_MBAR'] = $_POST['PRESSURE_MBAR_foil'.$i];
$partdata['TEMP_DEGC'] = $_POST['PRESSURE_MBAR_foil'.$i];
$foil['DATA'] = $partdata;
$foils['foil'.$i] = $foil;
}
$data['head'] = $head;
$data['foils'] = $foils;
//print_r($data);
$res_arr = generateDatasetXml($data);
// Set session variables with the return
session_start() ;
$_SESSION['post_return'] = $res_arr;
$_SESSION['new_chamber_ntfy'] = '<div role="alert" class="alert alert-success">
<strong>Well done!</strong> You successfully generated XML file for a list of GEM FOIL(s) data
</div>';
// redirect to confirm page
header('Location: https://gemdb.web.cern.ch/gemdb/confirmation.php'); //?msg='.$msg."&statusCode=".$statusCode."&return=".$return
die();
}
?>
<?php
include "head.php";
?>
<?php include "head_panel.php"; ?>
<style>
.scrollable-menu {
height: auto;
max-height: 200px;
overflow-x: hidden;
}
/* Flashing */
.hover13 a:hover img {
opacity: 1;
-webkit-animation: flash 1.5s;
animation: flash 1.5s;
border: 1px inset;
}
@-webkit-keyframes flash {
0% {
opacity: .4;
}
100% {
opacity: 1;
}
}
@keyframes flash {
0% {
opacity: .4;
}
100% {
opacity: 1;
}
}
.rellists{
display: none;
}
.rellists .dropdown{
margin: 15px;
}
</style>
<div class="container-fluid">
<div class="row">
<?php include "side.php"; ?>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<h2 class="sub-header"> <img src="images/ROPCB.png" width="4%"> <span class="glyphicon glyphicon-plus" aria-hidden="true"></span> Configuration </h2>
<?php
echo '<div style="display: none" role="alert" class="alert alert-danger ">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span><strong>Error!</strong> Please fill the required fields.
</div>';
?>
<!--<form method="POST" action="qc3_leak_test.php" enctype='multipart/form-data'>-->
<form method="POST" action="convert_configurationvfat.php" enctype='multipart/form-data'>
<input type="hidden" name="submited" value="true" /><br>
<div class="row">
<div class="col-xs-6 panel-info panel" style="padding-left: 0px; padding-right: 0px;">
<div class="panel-heading">
<h3 class="panel-title" > <span aria-hidden="true" class="glyphicon glyphicon-info-sign"></span>Enter following details:</h3>
</div>
<div class="panel-body">
<div class="form-group">
<div class="panel-body">
<!-- <div class="form-group">
<lable>RUN Number:</lable><br>
<span class="alert-danger foilalert" hidden> <i class="ace-icon fa fa-times-circle alert-danger"></i> </span>
<input class="runinput" name='RUN_NUMBER' >
</div>
<div class="form-group">
<lable>RUN Type:</lable><br>
<span class="alert-danger foilalert" hidden> <i class="ace-icon fa fa-times-circle alert-danger"></i> </span>
<input class="runinput" name='RUN_TYPE' >
</div>-->
<div class="form-group">
<lable>Test Begin:</lable><br>
<span class="alert-danger foilalert" hidden> <i class="ace-icon fa fa-times-circle alert-danger"></i> </span>
<input class="runinput date" name="RUN_BEGIN_TIMESTAMP" >
</div>
<div class="form-group">
<lable>Test End :</lable><br>
<span class="alert-danger foilalert" hidden> <i class="ace-icon fa fa-times-circle alert-danger"></i> </span>
<input class="runinput date" name='RUN_END_TIMESTAMP' >
</div>
<div class="form-group">
<lable>Location:</lable><br>
<span class="alert-danger foilalert" hidden> <i class="ace-icon fa fa-times-circle alert-danger"></i> </span>
<input class="runinput" name="LOCATION" value="" hidden >
<div class="dropdown" scrollable-menu>
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
Choose Location
<span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
<?php get_locations(); ?>
<//?php list_chambers(); ?>
</ul>
</div>
</div>
<div class="form-group">
<lable>Initiated by user:</lable><br>
<span class="alert-danger foilalert" hidden> <i class="ace-icon fa fa-times-circle alert-danger"></i> </span>
<input class="runinput" name='INITIATED_BY_USER' >
</div>
<div class="form-group">
<lable>COMMENT_DESCRIPTION</lable><br>
<textarea name='COMMENT_DESCRIPTION' > Please Put the comment of your detector:</textarea>
</div>
</div>
</div>
<div class="form-group">
<label> Upload Data (EXCEL only) <i class="ace-icon glyphicon glyphicon-barcode"></i></label><br>
<!--<input type="file" name="file" id="file" required >
<input type="file" name="file" accept=".xls,.xlsx,.xlsm" required >-->
<input type="file" name="file" id="file" onchange="checkfile(this);" required/>
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-default subbutt">Submit</button>
</form>
<?php
include "foot.php";
?>
<script type="text/javascript">
//$(document).ready(function () {
// $("#add").click(function () {
// $('#mytable tbody>tr:last').clone(true).insertAfter('#mytable tbody>tr:last');
// alert($('#mytable tbody>tr:last').find("input").first().val());
// $('#mytable tbody>tr:last').find("input").first().val( $(this).val()+100);
// return false;
//});
jQuery(document).ready(function ($) {
$( ".date" ).datetimepicker();
$.fn.datetimepicker.defaults = {
pickSeconds: false // disables seconds in the time picker
};
$(".imon").focus(function() {
console.log('in');
}).blur(function() {
console.log('out');
$(this).parent().next().find("input").attr("value","3300")
});
});
</script>
<script type="text/javascript" language="javascript">
function checkfile(sender) {
var validExts = new Array(".xlsx", ".xls", ".xlsm");
var fileExt = sender.value;
fileExt = fileExt.substring(fileExt.lastIndexOf('.'));
if (validExts.indexOf(fileExt) < 0) {
alert("Invalid file selected, valid files are of " +
validExts.toString() + " types.");
return false;
}
else return true;
}
</script>