-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.php
More file actions
520 lines (437 loc) · 21.5 KB
/
Copy pathdata.php
File metadata and controls
520 lines (437 loc) · 21.5 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
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
<?php
include 'header.php';
$id = $_GET['id'];
?>
<section class="image-data-section mt-5 mb-5">
<div class="container">
<div class="row">
<div class="col-md-6" style="margin-top: 34px">
<?php
$result = mysqli_query($db, "SELECT * FROM all_images WHERE id=$id");
if($row = mysqli_fetch_array($result))
{
$title = $row['image_name'];
$imgId = $row['id'];
}
?>
<a href="image_preview.php?imgId=<?php echo $imgId; ?>" target="_blank">
<img class="w-100 tagging-img" src="data:image/jpg;charset=utf8;base64,<?php echo base64_encode($title); ?>" />
</a>
<p>Original size image is shown in a new tab by clicking the image.
画像をクリックすると,オリジナルサイズの画像が別のタブに表示されます.
</p>
<div class="group">
<?php
// Previous button
$previous= mysqli_query($db, "SELECT * FROM all_images WHERE id<$id order by id DESC");
if($row = mysqli_fetch_array($previous))
{
echo '<a href="data.php?id='.$row['id'].'"><button type="button" class="btn btn-info mr-2">Previous</button></a>';
}
// Next button
$next = mysqli_query($db, "SELECT * FROM all_images WHERE id>$id order by id ASC");
if($row = mysqli_fetch_array($next))
{
echo '<a href="data.php?id='.$row['id'].'"><button type="button" class="btn btn-success">Next</button></a>';
}
?>
</div>
<!-- <p>Original size image is shown in a new tab by clicking the image.
画像をクリックすると,オリジナルサイズの画像が別のタブに表示されます.
</p> -->
</div>
<div class="col-md-6">
<div id="error" class="alert alert-danger" style="display: none"></div>
<form id="testform" method="post">
<div class="form-group">
<input type="text" class="form-control" name="ImgId" id="ImgId" aria-describedby="ImgId" readonly value="<?php echo $id; ?>" >
</div>
<div class="form-group">
<label for="taggedId">Tagged by ID</label>
<input type="text" class="form-control" name="taggedId" id="taggedId" aria-describedby="taggedID" value="" placeholder="Tagged ID">
</div>
<div class="form-group">
<label for="analyzability">Analyzability (解析可能性)</label>
<div class="">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="analyzability" id="analyzYes" value="Yes">
<label class="form-check-label" for="analyzYes">Yes</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="analyzability" id="analyzeNo" value="No">
<label class="form-check-label" for="analyzeNo">No</label>
</div>
</div>
<small id="" class="form-text text-primary">Bad is -1 And Good in +1</small>
</div>
<div class="form-group">
<label for="focus">Focus (ピント位置が適切か)</label>
<div class="">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="focus" id="focusMinusOne" value="-1">
<label class="form-check-label" for="focusMinusOne">-1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="focus" id="focusZero" value="0">
<label class="form-check-label" for="focusZero">0</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="focus" id="focusPlusOne" value="+1">
<label class="form-check-label" for="focusPlusOne">+1</label>
</div>
</div>
</div>
<div class="form-group">
<label>Shooting range (撮影範囲は適切か)</label>
<div class="">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="shottingRange" id="shootingMinusOne" value="-1">
<label class="form-check-label" for="shootingMinusOne">-1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="shottingRange" id="shootingZero" value="0">
<label class="form-check-label" for="shootingZero">0</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="shottingRange" id="shootingPlusOne" value="+1">
<label class="form-check-label" for="shootingPlusOne">+1</label>
</div>
</div>
</div>
<div class="form-group">
<label>No halation (ハレーションはないか)</label>
<div class="">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="noHalation" id="noHalationMinusOne" value="-1">
<label class="form-check-label" for="noHalationMinusOne">-1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="noHalation" id="noHalationZero" value="0">
<label class="form-check-label" for="noHalationZero">0</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="noHalation" id="noHalationPlusOne" value="+1">
<label class="form-check-label" for="noHalationPlusOne">+1</label>
</div>
</div>
</div>
<div class="form-group">
<label>No muddiness (濁りはないか)</label>
<div class="">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="noMuddiness" id="noMuddinessMinusOne" value="-1">
<label class="form-check-label" for="noMuddinessMinusOne">-1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="noMuddiness" id="noMuddinessZero" value="0">
<label class="form-check-label" for="noMuddinessZero">0</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="noMuddiness" id="noMuddinessPlusOne" value="+1">
<label class="form-check-label" for="noMuddinessPlusOne">+1</label>
</div>
</div>
</div>
<div class="form-group">
<label>No OccludingObj (濁りはないか)</label>
<div class="">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="noOccludingObj" id="noOccludingObjMinusOne" value="-1">
<label class="form-check-label" for="noOccludingObjMinusOne">-1</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="noOccludingObj" id="noOccludingObjZero" value="0">
<label class="form-check-label" for="noOccludingObjZero">0</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="noOccludingObj" id="noOccludingObjPlusOne" value="+1">
<label class="form-check-label" for="noOccludingObjPlusOne">+1</label>
</div>
</div>
</div>
<div class="form-group">
<label for="exampleFormControlTextarea1">Remarks</label>
<textarea class="form-control" name="remark" id="remark" rows="3"></textarea>
<small id="emailHelp" class="form-text text-muted">please remark other reasons and evidence areas.
その他の要因や判断の根拠となる領域に関してのコメントをお願いします.</small>
</div>
<div class="form-group save-btn-wrapper">
<input type="submit" value="Save" name="submit" id="butsave" class="btn btn-primary"/>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- Modal HTML -->
<div id="myModal" class="modal fade bd-example-modal-lg" tabindex="-1">
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<div id="show_message" class="alert alert-success w-100" style="display: none">Success fully sent message </div>
<!-- <button type="button" class="close" data-dismiss="modal">×</button> -->
</div>
<div class="modal-body">
<div class="container" id="responsecontainer">
</div>
</div>
<div class="modal-footer">
<!-- <button type="button" class="btn btn-secondary" data-dismiss="modal" id="Btnclose">Cancel</button> -->
<button type="button" class="btn btn-secondary" data-dismiss="modal" id="CloseRequest" >Close</button>
<!-- <button type="button" class="btn btn-primary">Save</button> -->
</div>
</div>
</div>
</div>
</section>
<script type="text/javascript">
$(document).ready(function(){
$("#butsave").click(function(){
$("#butsave").attr("disabled", "disabled");
$("#error").hide();
//Tagged Id
var taggedId = $("#taggedId").val();
if(taggedId == ""){
$("#error").show().text("Tagged Id required.");
$("#taggedId").focus();
$("#butsave").removeAttr("disabled");
return false;
}
// remark
var remark = $("#remark").val();
if(remark == ""){
$("#error").show().text("Remark required");
$("#remark").focus();
$("#butsave").removeAttr("disabled");
return false;
}
// Analyzability
var getanalyzabilityValue = document.querySelector( 'input[name="analyzability"]:checked');
if(getanalyzabilityValue == null) {
//document.write(" Radio button is selected");
$("#error").show().text("Analyzability Nothing has been selected");
$("#butsave").removeAttr("disabled");
return false;
}
// focus
var getfocusValue = document.querySelector( 'input[name="focus"]:checked');
if(getfocusValue == null) {
//document.write(" Radio button is selected");
$("#error").show().text("Focus Nothing has been selected");
$("#butsave").removeAttr("disabled");
return false;
}
// shottingRange
var getshottingRangeValue = document.querySelector( 'input[name="shottingRange"]:checked');
if(getshottingRangeValue == null) {
//document.write(" Radio button is selected");
$("#error").show().text("ShottingRange Nothing has been selected");
$("#butsave").removeAttr("disabled");
return false;
}
// noHalation
var getnoHalationRangeValue = document.querySelector( 'input[name="noHalation"]:checked');
if(getnoHalationRangeValue == null) {
//document.write(" Radio button is selected");
$("#error").show().text("NoHalation Nothing has been selected");
$("#butsave").removeAttr("disabled");
return false;
}
// noMuddiness
var getnoMuddinessValue = document.querySelector( 'input[name="noMuddiness"]:checked');
if(getnoMuddinessValue == null) {
//document.write(" Radio button is selected");
$("#error").show().text("NoMuddiness Nothing has been selected");
$("#butsave").removeAttr("disabled");
return false;
}
// noMuddiness
var getnoOccludingObjValue = document.querySelector( 'input[name="noOccludingObj"]:checked');
if(getnoOccludingObjValue == null) {
//document.write(" Radio button is selected");
$("#error").show().text("NoOccludingObj Nothing has been selected");
$("#butsave").removeAttr("disabled");
return false;
}
var ImgId = $("#ImgId").val();
//alert(ImgId);
$.ajax({
url: "insert-data.php",
type: "POST",
data: $("#testform").serialize(),
//dataType: 'json',
async: true,
cache: false,
success: function(data){
// data=data.replace(/\\s+/g,"");
//alert(data);
if(data == "true"){
$("#butsave").removeAttr("disabled");
$('#testform').find('input:text').val('');
getData(ImgId);
//alert("Error occured !")
//$("#show_message").fadeIn();
}
else {
//alert("Error occured !");
$("#error").fadeIn().text("Error occured");
return false;
}
}
});
});
function getData(ImgId) {
//alert(ImgId);
$.ajax({ //create an ajax request to display.php
type: "GET",
url: "getImgTagData.php",
data: { id: ImgId },
dataType: "html", //expect html to be returned
success: function(response){
$("#show_message").show();
$('#show_message').html('Data added successfully !');
$("#responsecontainer").html(response);
$("#myModal").modal('show');
//alert(response);
}
})
}
$('#CloseRequest').click(function(){
var ImgId1 = $("#ImgId1").val();
//alert(ImgId1);
$.ajax({ //create an ajax request to display.php
type: "GET",
url: "getNextImg.php",
data: { id: ImgId1 },
dataType: 'json', //expect html to be returned
success: function(data){
var id = data[0];
var url = "data.php?id=";
url += id;
window.location.href = url;
}
})
});
});
// $(document).ready(function(){
// $("#butsave").click(function(){
// $.ajax({
// url:'insert-data.php',
// method:'POST',
// data: $("#testform").serialize(),
// success:function(data){
// alert(data);
// }
// });
// });
// });
// jQuery(document).ready(function($){
// $('#butsave').on('click', function() {
// $("#butsave").attr("disabled", "disabled");
// $("#error").hide();
// //Tagged Id
// var taggedId = $("#taggedId").val();
// if(taggedId == ""){
// $("#error").fadeIn(200).text("Tagged Id required.");
// $("#taggedId").focus();
// $("#butsave").removeAttr("disabled");
// return false;
// }
// // remark
// var remark = $("#remark").val();
// if(remark == ""){
// $("#error").fadeIn().text("Remark required");
// $("#remark").focus();
// $("#butsave").removeAttr("disabled");
// return false;
// }
// // Analyzability
// var getanalyzabilityValue = document.querySelector( 'input[name="analyzability"]:checked');
// if(getanalyzabilityValue == null) {
// //document.write(" Radio button is selected");
// $("#error").fadeIn().text("Analyzability Nothing has been selected");
// $("#butsave").removeAttr("disabled");
// return false;
// }
// // focus
// var getfocusValue = document.querySelector( 'input[name="focus"]:checked');
// if(getfocusValue == null) {
// //document.write(" Radio button is selected");
// $("#error").fadeIn().text("Focus Nothing has been selected");
// $("#butsave").removeAttr("disabled");
// return false;
// }
// // shottingRange
// var getshottingRangeValue = document.querySelector( 'input[name="shottingRange"]:checked');
// if(getshottingRangeValue == null) {
// //document.write(" Radio button is selected");
// $("#error").fadeIn().text("ShottingRange Nothing has been selected");
// $("#butsave").removeAttr("disabled");
// return false;
// }
// // noHalation
// var getnoHalationRangeValue = document.querySelector( 'input[name="noHalation"]:checked');
// if(getnoHalationRangeValue == null) {
// //document.write(" Radio button is selected");
// $("#error").fadeIn().text("NoHalation Nothing has been selected");
// $("#butsave").removeAttr("disabled");
// return false;
// }
// // noMuddiness
// var getnoMuddinessValue = document.querySelector( 'input[name="noMuddiness"]:checked');
// if(getnoMuddinessValue == null) {
// //document.write(" Radio button is selected");
// $("#error").fadeIn().text("NoMuddiness Nothing has been selected");
// $("#butsave").removeAttr("disabled");
// return false;
// }
// // noMuddiness
// var getnoOccludingObjValue = document.querySelector( 'input[name="noOccludingObj"]:checked');
// if(getnoOccludingObjValue == null) {
// //document.write(" Radio button is selected");
// $("#error").fadeIn().text("NoOccludingObj Nothing has been selected");
// $("#butsave").removeAttr("disabled");
// return false;
// }
// $.ajax({
// url: "insert-data.php",
// type: "POST",
// data: $("#testform").serialize(),
// //dataType: 'json',
// async: true,
// cache: false,
// success: function(data){
// // data=data.replace(/\\s+/g,"");
// //alert(data);
// if(data == "true"){
// $("#butsave").removeAttr("disabled");
// $('#testform').find('input:text').val('');
// $("#myModal").modal('show');
// // $("#success").show();
// // $('#success').html('Data added successfully !');
// //$("#show_message").fadeIn();
// }
// else {
// //alert("Error occured !");
// $("#error").fadeIn().text("Error occured");
// return false;
// }
// // var dataResult = JSON.parse(data);
// // if(dataResult.statusCode==200){
// // // $("#butsave").removeAttr("disabled");
// // // $('#fupForm').find('input:text').val('');
// // // $("#success").show();
// // // $('#success').html('Data added successfully !');
// // $("#show_message").fadeIn();
// // }
// // else if(dataResult.statusCode==201){
// // //alert("Error occured !");
// // $("#error").fadeIn().text("Error occured");
// // return false;
// // }
// }
// });
// });
// });
</script>
<?php include 'footer.php'; ?>