Passed
Pull Request — dev (#25)
by
unknown
03:47
created

make_interface_tableau_visites_supervisor()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 26
Code Lines 26

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 26
nc 1
nop 1
dl 0
loc 26
c 0
b 0
f 0
cc 1
rs 9.504
1
<?php
2
/**
3
 Copyright (C) 2018 KANOUN Salim
4
 This program is free software; you can redistribute it and/or modify
5
 it under the terms of the Affero GNU General Public v.3 License as published by
6
 the Free Software Foundation;
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
 Affero GNU General Public Public for more details.
11
 You should have received a copy of the Affero GNU General Public Public along
12
 with this program; if not, write to the Free Software Foundation, Inc.,
13
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
14
 */
15
?>
16
17
<script>
18
$(document).ready(function(){
19
20
	//Display the contoller form
21
	<?php if ($visitObject->stateQualityControl != Visit::QC_NOT_DONE) {?>
22
    	$("#quality_control_form").load('/controller_form', {
23
    		id_visit :<?=$id_visit?>,
24
    		type_visit : '<?=$visit_type?>',
25
    		patient_num : <?=$patientNumber?>
26
    	});
27
   	<?php
28
	}
29
    
30
	//If a corrective action has been made and QC not concluded, display the corrective action form
31
	if ($visitObject->stateQualityControl!=Visit::QC_ACCEPTED && $visitObject->stateQualityControl !=Visit::QC_REFUSED 
32
		 && $visitObject->correctiveActionDate!= null) {
33
	?>
34
		$("#corrective_action_form").load('/corrective_action', {
35
			id_visit :<?=$id_visit?>,
36
			type_visit : '<?=$visit_type?>',
37
			patient_num : <?=$patientNumber?>
38
		});
39
	<?php 
40
	}
41
	
42
	if ($visitObject->stateInvestigatorForm != Visit::LOCAL_FORM_NOT_DONE) {
43
	?>
44
		//Display the local investigator specific form
45
		$("#investigatorForm").load('/specific_form', {
46
			id_visit :<?=$id_visit?>,
47
			type_visit : '<?=$visit_type?>',
48
			patient_num : <?=$patientNumber?>,
49
			getLocal : true
50
		})
51
	<?php 
52
	}?>
53
	//Show / hide div on element click in visit table
54
	$(".visitDetails").on('click', function() {
55
		$('.visitInfoDiv').hide();
56
		var title=$(this).attr('title');
57
		$('#'+title).show();
58
		$.fn.dataTable
59
	    .tables( { visible: true, api: true } )
60
	    .columns.adjust();
61
		
62
	})
63
64
	$(".visitDetails").css('text-decoration', 'underline');
65
66
	$('.visitHistory').DataTable( {
67
		"sDom": 'lrtip',
68
		"bSortCellsTop": true,
69
		"scrollX": true
70
	});
71
72
});
73
</script>
74
75
<div class="text-center">
76
	<h1>Patient <?=$patientNumber?> - <?=htmlspecialchars($visit_type)?></h1>
77
</div>
78
79
<div id="change_patient_status"> </div>
80
81
<div> 
82
	<?=make_interface_tableau_visites_supervisor($visitObject)?>
83
</div>
84
85
<div id="visit" class="visitInfoDiv" style="display:none">
86
	<table class="table table-striped">
87
		<tr>
88
			<th>Created by</th>
89
			<td><?=htmlspecialchars($visitObject->creatorName)?></td>
90
		</tr>
91
		<tr>
92
			<th>Creation date</th>
93
			<td><?=$visitObject->creationDate?></td>
94
		</tr>
95
		<tr>
96
			<th>If Not done, Reason</th>
97
			<td><?=htmlspecialchars($visitObject->reasonForNotDone)?></td>
98
		</tr>
99
	</table>
100
	<a href=scripts/delete_visit.php?id_visit=<?=$id_visit?>  class="ajaxLinkConfirm refreshVisitSupervisor"><input class='btn btn-danger' type="button" value='Delete Visit'></a><br>
101
	<?php makeHistoryTable("Visit", $trackerVisitResponses); ?>
102
</div>
103
104
<div id="serie" class="visitInfoDiv" style="display:none" >
105
	<table class="table table-striped ">
106
		<tr>
107
			<th>Uploaded by</th>
108
			<td><?=htmlspecialchars($visitObject->uploaderUsername)?></td>
109
		</tr>
110
		<tr>
111
			<th>Upload date</th>
112
			<td><?=$visitObject->uploadDate?></td>
113
		</tr>
114
	</table>
115
	<?php
116
	echo(make_study_table($visitObject));
117
	makeHistoryTable("Serie", $trackerVisitResponses);
118
	?>
119
</div>
120
121
<div id="quality" class="visitInfoDiv" style="display:none">
122
	<div>
123
		<table class="table table-striped">
124
			<tr>
125
				<th>Quality Controle Done by</th>
126
				<td><?=htmlspecialchars($visitObject->controllerUsername)?></td>
127
			</tr>
128
			<tr>
129
				<th>date</th>
130
				<td><?=$visitObject->controlDate?></td>
131
			</tr>
132
		</table>
133
		
134
		<div id="quality_control_form" ></div>
135
		<?php 
136
		if($visitObject->reviewStatus== Visit::NOT_DONE){
137
			?>
138
		    <a href=scripts/reset_qc.php?id_visit=<?=$id_visit?> class="ajaxLinkConfirm refreshVisitSupervisor" ><input class='btn btn-danger' type="button" value='Reset QC'></a>
139
       		<?php
140
		}?>
141
		
142
   	</div>
143
   	<br>
144
	<?php 
145
	//If QC not finalized and existe corrective action data, display the user's corrective action data
146
	if ($visitObject->stateQualityControl != Visit::QC_ACCEPTED && $visitObject->stateQualityControl != Visit::QC_REFUSED && $visitObject->correctiveActionDate != null) {
147
	?>
148
		<table class="table table-striped">
149
			<tr>
150
				<th>Corrective Action Done by</th>
151
				<td><?=$visitObject->correctiveActionUsername?></td>
152
			</tr>
153
			<tr>
154
				<th>date</th>
155
				<td><?=$visitObject->correctiveActionDate?></td>
156
			</tr>
157
		</table>
158
	<?php 
159
	}
160
	?>
161
	<div id="corrective_action_form"></div>
162
	
163
	<?php makeHistoryTable("Qc", $trackerVisitResponses); ?>
164
</div>
165
166
<div id="form" class="visitInfoDiv" style="display:none">
167
168
	<table class='table table-striped'>
169
    	<tr>
170
    		<th>Filled in by</th>
171
    		<td><?php if(!empty($localReviewObject)) {
172
	echo(htmlspecialchars($localReviewObject->username));
173
}
174
?></td>
175
    	</tr>
176
    	<tr>
177
    		<th>Date</th>
178
    		<td><?php if(!empty($localReviewObject)) {
179
	echo($localReviewObject->reviewDate);
180
}
181
?></td>
182
    	</tr>
183
    </table>
184
   
185
    <?php 
186
	if(!empty($localReviewObject) && $visitObject->stateQualityControl !=Visit::QC_ACCEPTED && $visitObject->stateQualityControl !=Visit::QC_REFUSED){
187
		?>
188
         <a href=scripts/unlock_form.php?id_review=<?=$localReviewObject->id_review.'&id_visit='.$id_visit?> class="ajaxLinkConfirm refreshVisitSupervisor" ><input class='btn btn-danger' type="button" value='Unlock Form'></a>
189
		 <a href=scripts/delete_form.php?id_review=<?=$localReviewObject->id_review.'&id_visit='.$id_visit?> class="ajaxLinkConfirm refreshVisitSupervisor" ><input class='btn btn-danger' type=button value='Delete Form'></a>
190
        <?php 
191
	}?>
192
   <br>
193
   <div id="investigatorForm"></div>
194
   <?php makeHistoryTable("Form", $trackerVisitResponses, true); ?>
195
</div>
196
197
198
<div id="review_div" class="visitInfoDiv" style="display:none; overflow-x:auto;">
199
200
	<table class='table table-striped'>
201
    	<tr>
202
    		<th>Conclusion Date</th>
203
    		<td><?php if(!empty($visitObject->reviewConclusionDate)) {
204
	echo($visitObject->reviewConclusionDate);
205
} else {
206
	echo("N/A") ?></td>
207
    	</tr>
208
    	<tr>
209
    		<th>Conclusion Value</th>
210
    		<td><?php if(!empty($visitObject->reviewConclusion)) echo(htmlspecialchars($visitObject->reviewConclusion));
211
}
212
else {
0 ignored issues
show
Bug introduced by
A parse error occurred: Syntax error, unexpected T_ELSE on line 212 at column 0
Loading history...
213
	echo("N/A") ?></td>
214
    	</tr>
215
    </table>
216
    
217
	<?php make_interface_tableau_review_supervisor($data_reviews)?>
218
	<?php makeHistoryTable("Form", $trackerVisitResponses, false);
219
}
220
?>
221
</div>
222
223
<?php
224
function makeHistoryTable($actionGroup, $trackerVisitResponses, bool $formInvestigator=null){
225
    
226
	if($actionGroup=="Visit"){
227
		$actionArray=array("Create Visit", "Delete Visit", "Reactivate Visit");
228
	}else if($actionGroup=="Form"){
229
		$actionArray=array("Save Form", "Unlock Form", "Delete Form");
230
	}else if($actionGroup=="Qc"){
231
		$actionArray=array("Reset QC", "Quality Control", "Corrective Action");
232
	}else if($actionGroup=="Serie"){
233
		$actionArray=array("Import Series", "Change Serie");
234
	}
235
	?>
236
    <div class="mt-4">
237
    	<h3>History</h3>
238
        <table class="table table-striped visitHistory block" style="width: 100%;">
239
            <thead>
240
            	<tr>
241
        			<td>Date</td>
242
            		<td>Username</td>
243
            		<td>Role</td>
244
            		<td>Action Type</td>
245
            		<td>Details</td>
246
            	</tr>
247
        	</thead>
248
        	<tbody>
249
            	<?php 
250
				foreach ($trackerVisitResponses as $response){
251
            	    
252
					if(in_array($response['action_type'], $actionArray)){
253
            	        
254
						$details=json_decode($response['action_details'], true);
255
            	        
256
						if($actionGroup=="Form"){ 
257
							if($formInvestigator && $details['local_review']=="0") continue(1);
258
							if(!$formInvestigator && $details['local_review']=="1") continue(1);  
259
						}
260
            	        
261
					?>
262
                	    <tr>
263
            				<td><?=$response['date']?></td>
264
                	    	<td><?=htmlspecialchars($response['username'])?></td>
265
                	    	<td><?=$response['role']?></td>
266
            				<td><?=$response['action_type']?></td>
267
                	    	<td><?='<pre><code>'.json_encode($details, JSON_PRETTY_PRINT|JSON_HEX_QUOT|JSON_HEX_TAG|JSON_HEX_AMP|JSON_HEX_APOS).'</code></pre>'?></td>
268
                	    </tr>
269
            	    <?php 
270
					}
271
				}
272
				?>
273
    		</tbody>
274
        </table>
275
    </div>
276
<?php 
277
}
278
279
function make_study_table($visitObject){
280
    
281
	$dicomStudies=$visitObject->getStudyDicomDetails();
282
    
283
	if(empty($dicomStudies)){
284
		//If no available studies, show all deleted studies in the DB
285
		make_interface_tableau_study_supervisor($visitObject);
286
	}else{
287
		make_interface_tableau_series_supervisor($visitObject);
288
	}
289
    
290
}
291
292
/**
293
 * Display all deleted DICOM studies
294
 * @param Visit $visitObject
295
 */
296
function make_interface_tableau_study_supervisor(Visit $visitObject){
297
	$data_studies=$visitObject->getStudyDicomDetails(true);
298
299
	$studies_number = count($data_studies);
300
    
301
	//if no deleted studies do not display table at all
302
	if($studies_number==0){
303
		return;
304
	}
305
    
306
	?>
307
        <div style="overflow-x:auto;"> 
308
        	<h2> Deleted Dicom Studies</h2>
309
        	<table id="tab_series_super" class="table table-striped block">
310
    			<tr>
311
    				<th colspan=<?=($studies_number+1)?>>Studies information</th>
312
    			</tr>
313
    			<tr>
314
    				<td>Uploader</td>
315
    				<?php 
316
					for($i = 0; $i < $studies_number; $i ++) {
317
					?>
318
    				    <td><?=htmlspecialchars($data_studies [$i]->uploaderUsername)?></td>
319
    				<?php 
320
					}
321
					?>
322
    			</tr>
323
				<tr>
324
    				<td>Upload Date</td>
325
    				<?php 
326
					for($i = 0; $i < $studies_number; $i ++) {
327
					?>
328
    				    <td><?=$data_studies [$i]->uploadDate?></td>
329
				    <?php
330
					}
331
					?>
332
    			</tr>
333
    			<tr>
334
    				<td>Study Description</td>
335
    				<?php 
336
					for($i = 0; $i < $studies_number; $i ++) {
337
						if (empty ($data_studies[$i]->studyDescription) ){ ?>
338
                        	<td>/</td>
339
                    	<?php
340
						}else{ ?>
341
                            <td><?=htmlspecialchars($data_studies[$i]->studyDescription)?></td>
342
                		<?php 
343
						}
344
					}
345
					?>
346
    			</tr>
347
    			<tr>
348
    				<td>Acquisition Date Time</td>
349
    				<?php 
350
					for($i = 0; $i < $studies_number; $i ++) {
351
						if (empty ($data_studies[$i]->studyAcquisitionDateTime) ){ ?>
352
                        	<td>/</td>
353
                    	<?php
354
						}else{ ?>
355
                            <td><?=htmlspecialchars($data_studies[$i]->studyAcquisitionDateTime)?></td>
356
                		<?php 
357
						}
358
					}
359
					?>
360
    			</tr>
361
    			<tr>
362
    				<td>Nb Series / Nb Instances</td>
363
    				<?php 
364
					for($i = 0; $i < $studies_number; $i ++) {
365
						?>
366
                            <td><?=$data_studies [$i]->nbOfSeries?> / <?=$data_studies [$i]->numberOfInstances?></td>
367
                            <?php 
368
					}
369
					?>
370
    			</tr>
371
    			
372
            <?php 
373
			if($visitObject->stateQualityControl !=Visit::QC_ACCEPTED && $visitObject->stateQualityControl !=Visit::QC_REFUSED) {
374
			?>
375
                <tr>
376
                	<td></td>
377
            	<?php 
378
				   for($i = 0; $i < $studies_number; $i ++) {
379
						?>
380
                        <td>
381
                        	<a href='scripts/reactivate_study.php?Study_Orthanc_Id=<?=$data_studies[$i]->studyOrthancId?>&id_visit=<?=$visitObject->id_visit?>' class="ajaxLinkConfirm refreshVisitSupervisor"><input class="btn btn-danger" type="button" value="Reactivate Study"></a>
382
                        </td>
383
                    <?php 
384
					}
385
				}
386
				?>
387
            	</tr>
388
    		</table>
389
    	</div>
390
<?php
391
}
392
393
/**
394
 * Generate table series of the activated study Dicom
395
 * @param Visit $visitObject
396
 */
397
function make_interface_tableau_series_supervisor(Visit $visitObject) {
398
    
399
	$data_series=$visitObject->getSeriesDetails(false);
400
	$deleted_series=$visitObject->getSeriesDetails(true);
401
	//Add deleted series at the end of array
402
	foreach ($deleted_series as $deleted_serie) {
403
		$data_series[]=$deleted_serie;
404
	}
405
	$series_number = count($data_series);
406
	?>
407
        <div style="overflow-x:auto;"> 
408
        	<table id="tab_series_super" class="table table-striped block">
409
    			<tr>
410
    				<th colspan=<?=($series_number+1)?>>Series information</th>
411
    			</tr>
412
    			<tr>
413
    				<td></td>
414
                	<?php 
415
					for($i = 0; $i < $series_number; $i ++) {
416
						if (empty ($data_series[$i]->seriesNumber) ){ ?>
417
                        	<td>/</td>
418
                    	<?php
419
						}else{ ?>
420
                            <td>Serie <?=htmlspecialchars($data_series [$i]->seriesNumber)?></td>
421
                		<?php 
422
						}
423
					}
424
					?>
425
    			</tr>
426
    			<tr>
427
    				<td>Series Description</td>
428
    				<?php 
429
					for($i = 0; $i < $series_number; $i ++) {
430
						if (empty ($data_series[$i]->seriesDescription) ){ ?>
431
                        	<td>/</td>
432
                    	<?php
433
						}else{ ?>
434
                            <td><?=htmlspecialchars($data_series [$i]->seriesDescription)?></td>
435
                		<?php 
436
						}
437
					}
438
					?>
439
    			</tr>
440
    			<tr>
441
    				<td>Manufacturer</td>
442
    				<?php 
443
					for($i = 0; $i < $series_number; $i ++) {
444
						if (empty ($data_series[$i]->manufacturer) ){ ?>
445
                        	<td>/</td>
446
                    	<?php
447
						}else{ ?>
448
                            <td><?=htmlspecialchars($data_series [$i]->manufacturer)?></td>
449
                		<?php 
450
						}
451
					}
452
					?>
453
    			</tr>
454
    			<tr>
455
    				<td>Modality</td>
456
    				<?php 
457
					for($i = 0; $i < $series_number; $i ++) {
458
						if (empty ($data_series[$i]->modality) ){ ?>
459
                        	<td>/</td>
460
                    	<?php
461
						}else{ ?>
462
                            <td><?=htmlspecialchars($data_series [$i]->modality)?></td>
463
                		<?php 
464
						}
465
					}
466
					?>
467
    			</tr>
468
    			<tr>
469
    				<td>Acquisition Date Time</td>
470
    				<?php 
471
					for($i = 0; $i < $series_number; $i ++) {
472
						if (empty ($data_series[$i]->acquisitionDateTime) ){ ?>
473
                        	<td>/</td>
474
                    	<?php
475
						}else{ ?>
476
                            <td><?=htmlspecialchars($data_series [$i]->acquisitionDateTime)?></td>
477
                		<?php 
478
						}
479
					}
480
					?>
481
    			</tr>
482
    			<tr>
483
    				<td>Injected Dose (MBq)</td>
484
    				<?php 
485
					for($i = 0; $i < $series_number; $i ++) {
486
						if (empty ($data_series[$i]->injectedDose) ){ ?>
487
                        	<td>/</td>
488
                    	<?php
489
						}else{ ?>
490
                            <td><?=htmlspecialchars(($data_series [$i]->injectedDose/10**6)) ?></td>
491
                		<?php 
492
						}
493
					}
494
					?>
495
    			</tr>
496
    			<tr>
497
    				<td>Injection Date Time</td>
498
    				<?php 
499
					for($i = 0; $i < $series_number; $i ++) {
500
						if (empty ($data_series[$i]->injectedDateTime) ){ ?>
501
                        	<td>/</td>
502
                    	<?php
503
						}else{ ?>
504
                            <td><?=htmlspecialchars($data_series [$i]->injectedDateTime) ?></td>
505
                		<?php 
506
						}
507
					}
508
					?>
509
        		</tr>
510
    			<tr>
511
    				<td>Radiopharm. Specific Activity (MBq)</td>
512
    				<?php 
513
					for($i = 0; $i < $series_number; $i ++) {
514
						if (empty ($data_series[$i]->injectedActivity) ){ ?>
515
                        	<td>/</td>
516
                    	<?php
517
						}else{ ?>
518
                            <td><?=htmlspecialchars(($data_series [$i]->injectedActivity/10**6)) ?></td>
519
                		<?php 
520
						}
521
					}
522
					?>
523
    			</tr>
524
    			<tr>
525
    				<td>Patient's weight (kg)</td>
526
    				<?php 
527
					for($i = 0; $i < $series_number; $i ++) {
528
						if (empty ($data_series[$i]->patientWeight) ){ ?>
529
                        	<td>/</td>
530
                    	<?php
531
						}else{ ?>
532
                            <td><?=htmlspecialchars($data_series [$i]->patientWeight)?></td>
533
                		<?php 
534
						}
535
					}
536
					?>
537
    			</tr>
538
    			<tr>
539
    				<td>Slice count</td>
540
    				<?php 
541
					for($i = 0; $i < $series_number; $i ++) {
542
						if (empty ($data_series[$i]->numberInstances) ){ ?>
543
                        	<td>/</td>
544
                    	<?php
545
						}else{ ?>
546
                            <td><?=$data_series [$i]->numberInstances?></td>
547
                		<?php 
548
						}
549
					}
550
					?>
551
    			</tr>
552
    			<tr>
553
    				<td>Insert Date</td>
554
    				<?php 
555
					for($i = 0; $i < $series_number; $i ++) {
556
						if (empty ($data_series[$i]->uploadDate) ){ ?>
557
                        	<td>/</td>
558
                    	<?php
559
						}else{ ?>
560
                            <td><?=$data_series [$i]->uploadDate?></td>
561
                		<?php 
562
						}
563
					}
564
					?>
565
                </tr>
566
            <?php 
567
			if($visitObject->stateQualityControl !=Visit::QC_ACCEPTED && $visitObject->stateQualityControl !=Visit::QC_REFUSED) {
568
			?>
569
                <tr>
570
                	<td></td>
571
            	<?php 
572
					for($i = 0; $i < $series_number; $i ++) {
573
						$deleted=false;
574
						$action="delete";
575
						if($data_series[$i]->deleted){
576
							$deleted=true;
577
							$action="reactivate";
578
						}
579
                            
580
						?>
581
                        <td>
582
                        	<a href='scripts/change_series_deletion.php?action=<?=$action?>&Series_Orthanc_Id=<?=$data_series[$i]->seriesOrthancID?>&id_visit=<?=$visitObject->id_visit?>' class="ajaxLinkConfirm refreshVisitSupervisor"><input class="btn btn-danger" type="button" value="<?=$action?> Series"></a>
583
                        </td>
584
                    <?php 
585
					}
586
				}
587
				?>
588
            	</tr>
589
    		</table>
590
    	</div>
591
<?php 
592
}
593
594
595
/**
596
 * Generate table with selected visit details for supervisor interface
597
 * @param $id_visit
598
 * @return string
599
 */
600
function make_interface_tableau_visites_supervisor($visitObject) {
601
?>
602
    <div style="overflow-x:auto;">
603
    	<table id='tab_visit_super' class='table table-striped block'>
604
			<tr>
605
    			<th colspan=7>Visit information</th>
606
			</tr>
607
			<tr>
608
    			<td rowspan=2>Visit</td>
609
    			<td colspan=4>Visit status</td>
610
    			<td rowspan=2>Review Status</td>
611
			</tr>
612
			<tr>
613
    			<td>Visit</td>
614
    			<td>Series upload</td>
615
    			<td>Investigator form</td>
616
    			<td>Quality control</td>
617
			</tr>
618
    
619
    		<tr>
620
    			<td><?=$visitObject->visitType?></td>
621
    			<td class="visitDetails" title="visit" ><?=$visitObject->statusDone?></td>
622
    			<td class="visitDetails" title="serie" ><?=$visitObject->uploadStatus?></td>
623
    			<td class="visitDetails" title="form" ><?=$visitObject->stateInvestigatorForm?></td>
624
    			<td class="visitDetails" title="quality" ><?=$visitObject->stateQualityControl?></td>
625
    			<td class="visitDetails" title="review_div" ><?=$visitObject->reviewStatus?></td>
626
			</tr>
627
		</table>
628
	</div>
629
<?php 
630
}
631
632
633
function make_interface_tableau_review_supervisor($data_reviews){
634
    
635
	$res_nb_reviews=count($data_reviews);
636
    
637
	if($res_nb_reviews==0){
638
		return;
639
	}
640
	?>
641
    <div>
642
    	<table class="table table-striped block">
643
    		<tr>
644
    			<th></th>
645
    			<?php 
646
				for ($i=1 ; $i <= $res_nb_reviews ; $i++) {
647
				?>
648
                    <th>Review <?=$i?></th>
649
                <?php 
650
				}
651
				?>
652
            </tr>
653
        	<tr>
654
        		<td>Name</td>
655
            		<?php 
656
					for ($i=0 ; $i < $res_nb_reviews ; $i++) {
657
					?>
658
                        <td><?=$data_reviews[$i]->username?>
659
                        <?php  if($data_reviews[$i]->isLocal) echo('- Local Investigator');
660
							   if($data_reviews[$i]->isAdjudication) echo('- Adjudication Form');
661
						?>
662
        				</td>
663
                    <?php 
664
					}
665
				?>
666
            </tr>
667
            <tr>
668
                <td>Reading Date</td>
669
                <?php
670
				for ($i=0 ; $i < $res_nb_reviews ; $i++) {
671
					?>
672
                    <td><?=$data_reviews[$i]->reviewDate ?>
673
        			</td>
674
                <?php 
675
				}
676
				?>
677
            </tr>
678
    		<tr>
679
        		<td>Reading Form</td>
680
        		<?php 
681
				for ($i=0 ; $i < $res_nb_reviews ; $i++) {
682
					$dataSpecific=$data_reviews[$i]->getSpecificData();
683
					?>
684
                    <td style="text-align:unset;">
685
                    	<pre><code><?=json_encode($dataSpecific, JSON_PRETTY_PRINT|JSON_HEX_QUOT|JSON_HEX_TAG|JSON_HEX_AMP|JSON_HEX_APOS)?></code></pre>
686
                	</td>
687
            	<?php 
688
				}
689
				?>
690
        	</tr>
691
    		<tr>
692
            	<td>Status</td>
693
            	<?php 
694
				for ($i=0 ; $i < $res_nb_reviews ; $i++) {
695
				?>
696
                    <td>
697
                    	<?php 
698
						   if ($data_reviews[$i]->validated) echo('Validated'); else echo('Draft');
699
						?>
700
                	</td>
701
            	<?php 
702
				}
703
				?>
704
            </tr>
705
    		<tr>
706
    			<td>Action</td>
707
    			<?php 
708
				for ($i=0 ; $i < $res_nb_reviews ; $i++) {
709
					if($data_reviews[$i]->isLocal==0){
710
						//If validated show both unlock and delete button
711
						if($data_reviews[$i]->validated){
712
							?>
713
                            <td>
714
            		        	<a href="scripts/unlock_form.php?id_review=<?=$data_reviews[$i]->id_review?>&id_visit=<?=$data_reviews[$i]->id_visit?>" class="ajaxLinkConfirm refreshVisitSupervisor"><input class="btn btn-danger" type="button" value="Unlock Form"> </a>
715
            		        	<a href="scripts/delete_form.php?id_review=<?=$data_reviews[$i]->id_review?>&id_visit=<?=$data_reviews[$i]->id_visit?>" class="ajaxLinkConfirm refreshVisitSupervisor"><input class="btn btn-danger" type="button" value="Delete Form"> </a>
716
            		        </td>
717
            		        <?php
718
						//if not validated (not locked) show only delete button
719
						}else{
720
							?>
721
                            <td>
722
            		        	<a href="scripts/delete_form.php?id_review=<?=$data_reviews[$i]->id_review?>&id_visit=<?=$data_reviews[$i]->id_visit?>" class="ajaxLinkConfirm refreshVisitSupervisor"><input class="btn btn-danger" type="button" value="Delete Form"> </a>
723
            		        </td>
724
        		        <?php 
725
						}
726
                
727
					}else{
728
					?>
729
        				<td></td>
730
        			<?php 
731
					}
732
            
733
				}
734
				?>
735
        </tr>
736
    	</table>
737
	</div>
738
<?php 
739
}
740
?>