-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSelectData_bak.php
More file actions
300 lines (289 loc) · 10.9 KB
/
SelectData_bak.php
File metadata and controls
300 lines (289 loc) · 10.9 KB
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
<!DOCTYPE html>
<html lang="en" style="overflow: auto">
<head>
<meta charset="UTF-8">
<!--<script type="text/javascript" src="js/jquery.jeditable.js"></script>-->
<title>TestCOE Site</title>
<link rel="stylesheet" href="css/w3.css">
<!-- <link rel="stylesheet" href="css/my.css"> -->
</head>
<body>
<?php
$Filter_Project_Name = isset($_POST['select']) ? $_POST['select'] : '';
?>
<div>
<table>
<tr>
<form action="#" method="post">
<th>
<select name="select">
<!--<option value='<?php echo (isset($Filter_Project_Name) ? $Filter_Project_Name: 'All')?>' ><?php echo (isset($Filter_Project_Name) ? $Filter_Project_Name: 'All Projects')?></option>-->
<option value='All' <?php echo $Filter_Project_Name == 'All' ? 'selected' : '' ?>> All Projects </option>
<?php
require "Define.php";
$Project_Name = "select Project_Name from project";
$Project_Result = mysqli_query($dbc, $Project_Name);
while ($result = mysqli_fetch_row($Project_Result)) {
$S_Project_Name = $result[0];
//echo "$S_Project_Name";
echo "<option value='$S_Project_Name' ". ($Filter_Project_Name == $S_Project_Name ? 'selected' : ''). " >".$S_Project_Name ."</option>";
}
?>
</select>
</th>
<th><input type="submit" name="submit" value="Filter"></th>
</form>
</tr>
</table>
</div>
<!--
<div>
<table>
<tr>
<th style="display:none;">ID</th>
<th width='112px'>Project Name</th>
<th width='300'>Build Name</th>
<th width='112px'>Build Started Time</th>
<th width='112px'>Build End Time</th>
<th>Regular No.</th>
<th>Regular Average Spend Hours</th>
<th>Intern NO.</th>
<th>Intern Average Spend Hours</th>
<th>Planned Cases</th>
<th>Actual Executed Cases</th>
<th>Submitted Defects</th>
<th>Critical Defects</th>
<th>Major Defects</th>
<th>Minor Defects</th>
<th>Planned to Verify Defects</th>
<th>Reopen Defects</th>
<th>Closed Defects</th>
<th>Rejected Defects</th>
<th>Notes</th>
<th>Data Owner</th>
</tr>
</table>
</div>
-->
<?php
/**
* Created by PhpStorm.
* User: e567802
* Date: 6/27/2017
* Time: 17:00
*/
//require "Define.php";
/*
if(!$_POST["Filter_Project_Name"]){
$Filter_Project_Name = $_POST["Filter_Project_Name"];
}else{
$Filter_Project_Name = "All";
}
*/
if ($Filter_Project_Name == "All" or $Filter_Project_Name == null) {
$Build_Data = "SELECT Project_Name,
Build_Name,Start_Time,End_Time,
Regular,
Regular_Work_Hour_AVG,
Intern,
Intern_Work_Hour_AVG,
Case_Plan,
Case_Run,
Defect_Submit,
Defect_Critical,
Defect_Major,
Defect_Minor,
Defect_Verified,
Defect_Reopen,
Defect_Closed,
Defect_Rejected,
Notes,
Data_Inputer,
Build_Id FROM
project a, build b, Build_Data c
where a.id = b.Project_Id and c.Build_Id=b.Id
ORDER by Build_Name, Project_Name DESC
";
$Build_Result = mysqli_query($dbc, $Build_Data);
}
else{
$Build_Data = "SELECT Project_Name,
Build_Name,Start_Time,End_Time,
Regular,
Regular_Work_Hour_AVG,
Intern,
Intern_Work_Hour_AVG,
Case_Plan,
Case_Run,
Defect_Submit,
Defect_Critical,
Defect_Major,
Defect_Minor,
Defect_Verified,
Defect_Reopen,
Defect_Closed,
Defect_Rejected,
Notes,
Data_Inputer,
Build_Id FROM
project a, build b, Build_Data c
where a.id = b.Project_Id and c.Build_Id=b.Id and a.Project_Name='$Filter_Project_Name'
ORDER by Build_Name, Project_Name DESC
";
$Build_Result = mysqli_query($dbc, $Build_Data);
}
if(!$Build_Result){
echo "No data";
exit;
}
echo "<div id='data'>";
echo "<table class=\"w3-table-all w3-hoverable w3-card-4\">";
echo "<tr id='title'>";
echo "<th style=\"display:none;\">ID</th>";
echo "<th >Project Name</th>";
echo "<th >Build Name</th>";
echo "<th width='120'>Build Started Time</th>";
echo "<th width='120'>Build End Time</th>";
echo "<th>Regular No.</th>";
echo "<th>Regular Average Spend Hours</th>";
echo "<th>Intern NO.</th>";
echo "<th>Intern Average Spend Hours</th>";
echo "<th>Planned Cases</th>";
echo "<th>Actual Executed Cases</th>";
echo "<th>Submitted Defects</th>";
echo "<th>Critical Defects</th>";
echo "<th>Major Defects</th>";
echo "<th>Minor Defects</th>";
echo "<th>Planned to Verify Defects</th>";
echo "<th>Reopen Defects</th>";
echo "<th>Closed Defects</th>";
echo "<th>Rejected Defects</th>";
echo "<th>Notes</th>";
echo "<th>Data Owner</th>";
echo "</tr>";
//echo "</table>";
//echo "</div>";
//echo "<div class='article'>";
//echo "<table class=\"w3-table-all w3-hoverable w3-card-4\">";
while ($result = mysqli_fetch_row($Build_Result)) {
$T_Project_Name = $result[0];
$T_Build_Name = $result[1];
$T_Build_Start_Time = $result[2];
$T_Build_End_Time = $result[3];
$T_Regular_NO = $result[4];
$T_Regular_AVG_WH = $result[5];
$T_Intern_NO = $result[6];
$T_Intern_AVG_WH = $result[7];
$T_Case_Plan = $result[8];
$T_Case_Run = $result[9];
$T_Defect_Sumbit = $result[10];
$T_Defect_Critical = $result[11];
$T_Defect_Major = $result[12];
$T_Defect_Minor = $result[13];
$T_Defect_Verified = $result[14];
$T_Defect_Reopen = $result[15];
$T_Defect_Closed = $result[16];
$T_Defect_Rejected = $result[17];
$T_Notes = $result[18];
$T_Data_Inputer = $result[19];
$T_Build_Id = $result[20];
echo "<tr>";
// echo "<tr id='$T_Build_Id'>";
echo "<th style=\"display:none;\">".$T_Build_Id."</th>";
echo "<th >".$T_Project_Name."</th>";
echo "<th >".$T_Build_Name."</th>";
echo "<td class='edit' width='120' id='Start_Time'>".$T_Build_Start_Time."</td>";
echo "<td class='edit' width='120' id='End_Time'>".$T_Build_End_Time."</td>";
echo "<td class='edit' id='Regular'>".$T_Regular_NO."</td>";
echo "<td class='edit' id='Regular_Work_Hour_AVG'>".$T_Regular_AVG_WH."</td>";
echo "<td class='edit' id='Intern'>".$T_Intern_NO."</td>";
echo "<td class='edit' id='Intern_Work_Hour_AVG'>".$T_Intern_AVG_WH."</td>";
echo "<td class='edit' id='Case_Plan'>".$T_Case_Plan."</td>";
echo "<td class='edit' id='Case_Run'>".$T_Case_Run."</td>";
echo "<td class='edit' id='Defect_Sumbit'>".$T_Defect_Sumbit."</td>";
echo "<td class='edit' id='Defect_Critical'>".$T_Defect_Critical."</td>";
echo "<td class='edit' id='Defect_Major'>".$T_Defect_Major."</td>";
echo "<td class='edit' id='Defect_Minor'>".$T_Defect_Minor."</td>";
echo "<td class='edit' id='Defect_Verified'>".$T_Defect_Verified."</td>";
echo "<td class='edit' id='Defect_Reopen'>".$T_Defect_Reopen."</td>";
echo "<td class='edit' id='Defect_Closed'>".$T_Defect_Closed."</td>";
echo "<td class='edit' id='Defect_Rejected'>".$T_Defect_Rejected."</td>";
echo "<td class='edit' id='Notes'>".$T_Notes."</td>";
echo "<td class='edit' id='Data_Inputer'>".$T_Data_Inputer."</td>";
echo "</tr>";
#mysqli_free_result($result);
}
echo "</table>";
echo "<table align='center'>";
echo "<tr><th><a href='Submit_Data_Table.php'>Add One More</a></th></tr>";
echo "<tr><th><a href='index.php'>Back To Home</a></th></tr>";
echo "</table>";
echo "</div>";
mysqli_close($dbc);
?>
<!--
<script type="text/javascript">
$(function(){
$('.edit').editable('Update.php', {
//width :120,
//height :18,
//onblur : 'ignore',
cancel : 'Cancel',
submit : 'OK',
indicator : 'Updating',
tooltip : 'Click To Edit...'
submitdata: function(value, settings) {
return {id: $(this).parent().attr('id'), field: $(this).attr('name')}
}
});
});
</script>
-->
<script type="text/javascript" src="js/jquery-3.2.1.js"></script>
<script type="text/javascript">
// jQuery (function ($)
// {
// var tr = $ ("table tr#title");
// $ ("div").scroll (function ()
// {
// tr.css (
// {
// position : 'fixed',
// top : $(this).css ('top')
// });
// });
// });
//$("#hide_title").hide();
function refresh() {
self.location.reload();
}
$(function(){
$('table td.edit').dblclick(function(){
if(!$(this).is('.input')){
$(this).addClass('input').html('<form><input type="text" value="'+ $(this).text() +'" autofocus /><input type="submit" value="Save" /><input type="button" onclick="refresh()" value="Cancel"></form>').find('form').click().submit(function(){
// if (!$(this).is(':submit')) {
var thisid = $(this).parent().siblings("th:eq(0)").text();
var thisvalue=$(this).find('input').val();
var thisclass = $(this).parent().attr("id");
$.ajax({
type: 'POST',
url: 'Update.php',
data: "thisid="+thisid+"&thisclass="+thisclass+"&thisvalue="+thisvalue
});
// }
/* if (!$(this).is(':button')) {
self.location.reload();
}
*/
$(this).parent().removeClass('input').html($(this).find('input').val() || 0);
});
}
}).hover(function(){
$(this).addClass('hover');
},function(){
$(this).removeClass('hover');
});
});
</script>
</body>
</html>