Repository navigation
Expand file tree
/
Copy pathedit_apparatus.php
More file actions
2745 lines (2402 loc) · 143 KB
/
Copy pathedit_apparatus.php
File metadata and controls
2745 lines (2402 loc) · 143 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
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?php
/**
* File: edit_apparatus.php
* Description: Apparatus editing interface
*
* @package StraboSpot Web Site
* @author Jason Ash <jasonash@ku.edu>
* @copyright 2025 StraboSpot
* @license https://opensource.org/licenses/MIT MIT License
* @link https://strabospot.org
*/
include("logincheck.php");
$userpkey = $_SESSION['userpkey'];
include("prepare_connections.php");
$credentials = $_SESSION['credentials'];
if(!in_array($userpkey, $admin_pkeys)){
//only admins for now...
$is_admin = false;
}else{
$is_admin = true;
}
if($_POST['jsonData']!=""){
//todo check for errors?
if($error==""){
$d = $_POST["jsonData"];
$d = json_decode($d);
$apparatus_pkey = $d->apparatus_pkey;
$name = $d->apparatus_name;
$type = $d->apparatus_type;
$sub_type = $d->apparatus_subtype;
$institute_pkey = $d->institute_pkey;
$json = $_POST["jsonData"] ?? '';
$apparatus_pkey = isset($d->apparatus_pkey) ? (int)$d->apparatus_pkey : 0;
$arow = $db->get_row_prepared("SELECT * FROM exp_apparatus WHERE pkey = $1", array($apparatus_pkey));
if(!$is_admin && $arow->userpkey != $userpkey){
echo "not authorized";
exit();
}else{
$db->prepare_query("UPDATE exp_apparatus SET
name = $1,
type = $2,
sub_type = $3,
json = $4,
last_modified = now()
WHERE
pkey = $5
", array($name, $type, $sub_type, $json, $apparatus_pkey));
}
}
if(is_writeable("log.txt")){
$data = print_r($d, true);
file_put_contents("log.txt", $data, FILE_APPEND);
}
$out["result"] = "success";
header('Content-Type: application/json');
echo json_encode($out);
exit();
}
$apparatus_pkey = isset($_GET['a']) ? (int)$_GET['a'] : 0;
if($apparatus_pkey == 0){
echo "No apparatus provided.";
exit();
}
$arow = $db->get_row_prepared("SELECT * FROM exp_apparatus WHERE pkey = $1", array($apparatus_pkey));
if(!$is_admin && $arow->userpkey != $userpkey){
echo "not authorized";
exit();
}
if($arow->pkey == ""){
echo "Apparatus not found.";
exit();
}
$num_sensors = 5;
$json = $arow->json;
$j = json_decode($json);
function getSensor($sensors, $insensornum){
foreach($sensors as $s){
if($s->sensornum == $insensornum){
return $s;
}else{
}
}
}
include 'includes/header.php';
//get groups based on userpkey
?>
<style type="text/css">
.rowdiv {
text-align:center;
padding-top:5px;
}
.rowdivv {
padding-top:5px;
}
.rowheader {
font-weight:bold;
color:#333;
font-size:1.2em;
}
.redred {
color:#ab1424;
font-weigth:bold;
padding-right:5px;
}
.button {
/* Green */
padding: 3px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 14px;
}
.checkheader {
font-size:1.3em;
font-weight:bold;
}
.checkbody {
border:1px dashed rgba(50, 50, 50, 0.5);border-radius:10px;padding:10px;display:none;margin-bottom:20px;
}
.displacementbox {
border:1px dashed #CCC;border-radius:5px;padding:10px;display:none;margin-bottom:10px;margin-top:5px;;
}
.notesbox {
border:1px dashed rgba(50, 50, 50, 0.5);border-radius:10px;padding:20px;margin-bottom:20px;
}
.separator {
display: flex;
align-items: center;
text-align: center;
}
.separator::before,
.separator::after {
content: '';
flex: 1;
border-bottom: 1px solid #666;
}
.separator:not(:empty)::before {
margin-right: .25em;
}
.separator:not(:empty)::after {
margin-left: .25em;
}
.only-numeric {
width:100px;
}
.errorbar {
color:#bf342c;
font-weight:bold;
font-size:1.2em;
}
</style>
<link rel="stylesheet" href="/assets/js/dropzone/dropzone.css" type="text/css" />
<script src='/assets/js/jquery/jquery.min.js'></script>
<script src="/assets/js/featherlight/featherlight.js"></script>
<script src="/assets/js/dropzone/dropzone.js"></script>
<script src="/assets/js/jquery-modal/jquery.modal.min.js"></script>
<link rel="stylesheet" href="/assets/js/jquery-modal/jquery.modal.min.css" type="text/css" />
<div id="successwrapper" style="display:none;">
<div class="rowdiv">
<h2>Success!</h2>
</div>
<div class="rowdiv">
Apparartus saved successfully.
</div>
<div class="rowdiv">
<a href="apparatus_repository">Continue</a>
</div>
</div>
<div id="wholewrapper">
<!--<form method="POST" onsubmit="return validateForm()">-->
<?php
if($error!=""){
?>
<div class="rowdiv" style="color:red; font-size:1.5em;"><?php echo $error?></div>
<?php
}
?>
<div class="rowdiv">
<h2>Edit Apparatus</h2>
</div>
<div class="rowdiv">
<h2>Facility Information</h2>
</div>
<input type="hidden" id="institute_pkey" value="<?php echo $j->institute_pkey?>">
<div class="rowdiv">
Lab Name: <input type="text" id="lab_name" name="lab_name" value="<?php echo $j->lab_name?>">
Facility ID: <input type="text" id="facility_id" name="facility_id" value="<?php echo $j->facility_id?>">
</div>
<div class="rowdiv">
Website: <input type="text" id="website" name="website" placeholder="https://ku.edu" value="<?php echo $j->website?>">
</div>
<div class="rowdiv rowheader">Address</div>
<div class="rowdiv">
Country:
<select name="country" id="country">
<option value="">Select...</option>
<option value="United States"<?php if($j->country=="United States"){echo " selected";}?>>United States</option>
<option value="Afghanistan"<?php if($j->country=="Afghanistan"){echo " selected";}?>>Afghanistan</option>
<option value="Åland Islands"<?php if($j->country=="Åland Islands"){echo " selected";}?>>Åland Islands</option>
<option value="Albania"<?php if($j->country=="Albania"){echo " selected";}?>>Albania</option>
<option value="Algeria"<?php if($j->country=="Algeria"){echo " selected";}?>>Algeria</option>
<option value="American Samoa"<?php if($j->country=="American Samoa"){echo " selected";}?>>American Samoa</option>
<option value="Andorra"<?php if($j->country=="Andorra"){echo " selected";}?>>Andorra</option>
<option value="Angola"<?php if($j->country=="Angola"){echo " selected";}?>>Angola</option>
<option value="Anguilla"<?php if($j->country=="Anguilla"){echo " selected";}?>>Anguilla</option>
<option value="Antarctica"<?php if($j->country=="Antarctica"){echo " selected";}?>>Antarctica</option>
<option value="Antigua and Barbuda"<?php if($j->country=="Antigua and Barbuda"){echo " selected";}?>>Antigua and Barbuda</option>
<option value="Argentina"<?php if($j->country=="Argentina"){echo " selected";}?>>Argentina</option>
<option value="Armenia"<?php if($j->country=="Armenia"){echo " selected";}?>>Armenia</option>
<option value="Aruba"<?php if($j->country=="Aruba"){echo " selected";}?>>Aruba</option>
<option value="Australia"<?php if($j->country=="Australia"){echo " selected";}?>>Australia</option>
<option value="Austria"<?php if($j->country=="Austria"){echo " selected";}?>>Austria</option>
<option value="Azerbaijan"<?php if($j->country=="Azerbaijan"){echo " selected";}?>>Azerbaijan</option>
<option value="Bahamas"<?php if($j->country=="Bahamas"){echo " selected";}?>>Bahamas</option>
<option value="Bahrain"<?php if($j->country=="Bahrain"){echo " selected";}?>>Bahrain</option>
<option value="Bangladesh"<?php if($j->country=="Bangladesh"){echo " selected";}?>>Bangladesh</option>
<option value="Barbados"<?php if($j->country=="Barbados"){echo " selected";}?>>Barbados</option>
<option value="Belarus"<?php if($j->country=="Belarus"){echo " selected";}?>>Belarus</option>
<option value="Belgium"<?php if($j->country=="Belgium"){echo " selected";}?>>Belgium</option>
<option value="Belize"<?php if($j->country=="Belize"){echo " selected";}?>>Belize</option>
<option value="Benin"<?php if($j->country=="Benin"){echo " selected";}?>>Benin</option>
<option value="Bermuda"<?php if($j->country=="Bermuda"){echo " selected";}?>>Bermuda</option>
<option value="Bhutan"<?php if($j->country=="Bhutan"){echo " selected";}?>>Bhutan</option>
<option value="Bolivia, Plurinational State of"<?php if($j->country=="Bolivia, Plurinational State of"){echo " selected";}?>>Bolivia, Plurinational State of</option>
<option value="Bonaire, Sint Eustatius and Saba"<?php if($j->country=="Bonaire, Sint Eustatius and Saba"){echo " selected";}?>>Bonaire, Sint Eustatius and Saba</option>
<option value="Bosnia and Herzegovina"<?php if($j->country=="Bosnia and Herzegovina"){echo " selected";}?>>Bosnia and Herzegovina</option>
<option value="Botswana"<?php if($j->country=="Botswana"){echo " selected";}?>>Botswana</option>
<option value="Bouvet Island"<?php if($j->country=="Bouvet Island"){echo " selected";}?>>Bouvet Island</option>
<option value="Brazil"<?php if($j->country=="Brazil"){echo " selected";}?>>Brazil</option>
<option value="British Indian Ocean Territory"<?php if($j->country=="British Indian Ocean Territory"){echo " selected";}?>>British Indian Ocean Territory</option>
<option value="Brunei Darussalam"<?php if($j->country=="Brunei Darussalam"){echo " selected";}?>>Brunei Darussalam</option>
<option value="Bulgaria"<?php if($j->country=="Bulgaria"){echo " selected";}?>>Bulgaria</option>
<option value="Burkina Faso"<?php if($j->country=="Burkina Faso"){echo " selected";}?>>Burkina Faso</option>
<option value="Burundi"<?php if($j->country=="Burundi"){echo " selected";}?>>Burundi</option>
<option value="Cambodia"<?php if($j->country=="Cambodia"){echo " selected";}?>>Cambodia</option>
<option value="Cameroon"<?php if($j->country=="Cameroon"){echo " selected";}?>>Cameroon</option>
<option value="Canada"<?php if($j->country=="Canada"){echo " selected";}?>>Canada</option>
<option value="Cape Verde"<?php if($j->country=="Cape Verde"){echo " selected";}?>>Cape Verde</option>
<option value="Cayman Islands"<?php if($j->country=="Cayman Islands"){echo " selected";}?>>Cayman Islands</option>
<option value="Central African Republic"<?php if($j->country=="Central African Republic"){echo " selected";}?>>Central African Republic</option>
<option value="Chad"<?php if($j->country=="Chad"){echo " selected";}?>>Chad</option>
<option value="Chile"<?php if($j->country=="Chile"){echo " selected";}?>>Chile</option>
<option value="China"<?php if($j->country=="China"){echo " selected";}?>>China</option>
<option value="Christmas Island"<?php if($j->country=="Christmas Island"){echo " selected";}?>>Christmas Island</option>
<option value="Cocos (Keeling) Islands"<?php if($j->country=="Cocos (Keeling) Islands"){echo " selected";}?>>Cocos (Keeling) Islands</option>
<option value="Colombia"<?php if($j->country=="Colombia"){echo " selected";}?>>Colombia</option>
<option value="Comoros"<?php if($j->country=="Comoros"){echo " selected";}?>>Comoros</option>
<option value="Congo"<?php if($j->country=="Congo"){echo " selected";}?>>Congo</option>
<option value="Congo, the Democratic Republic of the"<?php if($j->country=="Congo, the Democratic Republic of the"){echo " selected";}?>>Congo, the Democratic Republic of the</option>
<option value="Cook Islands"<?php if($j->country=="Cook Islands"){echo " selected";}?>>Cook Islands</option>
<option value="Costa Rica"<?php if($j->country=="Costa Rica"){echo " selected";}?>>Costa Rica</option>
<option value="Côte d'Ivoire"<?php if($j->country=="Côte d'Ivoire"){echo " selected";}?>>Côte d'Ivoire</option>
<option value="Croatia"<?php if($j->country=="Croatia"){echo " selected";}?>>Croatia</option>
<option value="Cuba"<?php if($j->country=="Cuba"){echo " selected";}?>>Cuba</option>
<option value="Curaçao"<?php if($j->country=="Curaçao"){echo " selected";}?>>Curaçao</option>
<option value="Cyprus"<?php if($j->country=="Cyprus"){echo " selected";}?>>Cyprus</option>
<option value="Czech Republic"<?php if($j->country=="Czech Republic"){echo " selected";}?>>Czech Republic</option>
<option value="Denmark"<?php if($j->country=="Denmark"){echo " selected";}?>>Denmark</option>
<option value="Djibouti"<?php if($j->country=="Djibouti"){echo " selected";}?>>Djibouti</option>
<option value="Dominica"<?php if($j->country=="Dominica"){echo " selected";}?>>Dominica</option>
<option value="Dominican Republic"<?php if($j->country=="Dominican Republic"){echo " selected";}?>>Dominican Republic</option>
<option value="Ecuador"<?php if($j->country=="Ecuador"){echo " selected";}?>>Ecuador</option>
<option value="Egypt"<?php if($j->country=="Egypt"){echo " selected";}?>>Egypt</option>
<option value="El Salvador"<?php if($j->country=="El Salvador"){echo " selected";}?>>El Salvador</option>
<option value="Equatorial Guinea"<?php if($j->country=="Equatorial Guinea"){echo " selected";}?>>Equatorial Guinea</option>
<option value="Eritrea"<?php if($j->country=="Eritrea"){echo " selected";}?>>Eritrea</option>
<option value="Estonia"<?php if($j->country=="Estonia"){echo " selected";}?>>Estonia</option>
<option value="Ethiopia"<?php if($j->country=="Ethiopia"){echo " selected";}?>>Ethiopia</option>
<option value="Falkland Islands (Malvinas)"<?php if($j->country=="Falkland Islands (Malvinas)"){echo " selected";}?>>Falkland Islands (Malvinas)</option>
<option value="Faroe Islands"<?php if($j->country=="Faroe Islands"){echo " selected";}?>>Faroe Islands</option>
<option value="Fiji"<?php if($j->country=="Fiji"){echo " selected";}?>>Fiji</option>
<option value="Finland"<?php if($j->country=="Finland"){echo " selected";}?>>Finland</option>
<option value="France"<?php if($j->country=="France"){echo " selected";}?>>France</option>
<option value="French Guiana"<?php if($j->country=="French Guiana"){echo " selected";}?>>French Guiana</option>
<option value="French Polynesia"<?php if($j->country=="French Polynesia"){echo " selected";}?>>French Polynesia</option>
<option value="French Southern Territories"<?php if($j->country=="French Southern Territories"){echo " selected";}?>>French Southern Territories</option>
<option value="Gabon"<?php if($j->country=="Gabon"){echo " selected";}?>>Gabon</option>
<option value="Gambia"<?php if($j->country=="Gambia"){echo " selected";}?>>Gambia</option>
<option value="Georgia"<?php if($j->country=="Georgia"){echo " selected";}?>>Georgia</option>
<option value="Germany"<?php if($j->country=="Germany"){echo " selected";}?>>Germany</option>
<option value="Ghana"<?php if($j->country=="Ghana"){echo " selected";}?>>Ghana</option>
<option value="Gibraltar"<?php if($j->country=="Gibraltar"){echo " selected";}?>>Gibraltar</option>
<option value="Greece"<?php if($j->country=="Greece"){echo " selected";}?>>Greece</option>
<option value="Greenland"<?php if($j->country=="Greenland"){echo " selected";}?>>Greenland</option>
<option value="Grenada"<?php if($j->country=="Grenada"){echo " selected";}?>>Grenada</option>
<option value="Guadeloupe"<?php if($j->country=="Guadeloupe"){echo " selected";}?>>Guadeloupe</option>
<option value="Guam"<?php if($j->country=="Guam"){echo " selected";}?>>Guam</option>
<option value="Guatemala"<?php if($j->country=="Guatemala"){echo " selected";}?>>Guatemala</option>
<option value="Guernsey"<?php if($j->country=="Guernsey"){echo " selected";}?>>Guernsey</option>
<option value="Guinea"<?php if($j->country=="Guinea"){echo " selected";}?>>Guinea</option>
<option value="Guinea-Bissau"<?php if($j->country=="Guinea-Bissau"){echo " selected";}?>>Guinea-Bissau</option>
<option value="Guyana"<?php if($j->country=="Guyana"){echo " selected";}?>>Guyana</option>
<option value="Haiti"<?php if($j->country=="Haiti"){echo " selected";}?>>Haiti</option>
<option value="Heard Island and McDonald Islands"<?php if($j->country=="Heard Island and McDonald Islands"){echo " selected";}?>>Heard Island and McDonald Islands</option>
<option value="Holy See (Vatican City State)"<?php if($j->country=="Holy See (Vatican City State)"){echo " selected";}?>>Holy See (Vatican City State)</option>
<option value="Honduras"<?php if($j->country=="Honduras"){echo " selected";}?>>Honduras</option>
<option value="Hong Kong"<?php if($j->country=="Hong Kong"){echo " selected";}?>>Hong Kong</option>
<option value="Hungary"<?php if($j->country=="Hungary"){echo " selected";}?>>Hungary</option>
<option value="Iceland"<?php if($j->country=="Iceland"){echo " selected";}?>>Iceland</option>
<option value="India"<?php if($j->country=="India"){echo " selected";}?>>India</option>
<option value="Indonesia"<?php if($j->country=="Indonesia"){echo " selected";}?>>Indonesia</option>
<option value="Iran, Islamic Republic of"<?php if($j->country=="Iran, Islamic Republic of"){echo " selected";}?>>Iran, Islamic Republic of</option>
<option value="Iraq"<?php if($j->country=="Iraq"){echo " selected";}?>>Iraq</option>
<option value="Ireland"<?php if($j->country=="Ireland"){echo " selected";}?>>Ireland</option>
<option value="Isle of Man"<?php if($j->country=="Isle of Man"){echo " selected";}?>>Isle of Man</option>
<option value="Israel"<?php if($j->country=="Israel"){echo " selected";}?>>Israel</option>
<option value="Italy"<?php if($j->country=="Italy"){echo " selected";}?>>Italy</option>
<option value="Jamaica"<?php if($j->country=="Jamaica"){echo " selected";}?>>Jamaica</option>
<option value="Japan"<?php if($j->country=="Japan"){echo " selected";}?>>Japan</option>
<option value="Jersey"<?php if($j->country=="Jersey"){echo " selected";}?>>Jersey</option>
<option value="Jordan"<?php if($j->country=="Jordan"){echo " selected";}?>>Jordan</option>
<option value="Kazakhstan"<?php if($j->country=="Kazakhstan"){echo " selected";}?>>Kazakhstan</option>
<option value="Kenya"<?php if($j->country=="Kenya"){echo " selected";}?>>Kenya</option>
<option value="Kiribati"<?php if($j->country=="Kiribati"){echo " selected";}?>>Kiribati</option>
<option value="Korea, Democratic People's Republic of"<?php if($j->country=="Korea, Democratic People's Republic of"){echo " selected";}?>>Korea, Democratic People's Republic of</option>
<option value="Korea, Republic of"<?php if($j->country=="Korea, Republic of"){echo " selected";}?>>Korea, Republic of</option>
<option value="Kuwait"<?php if($j->country=="Kuwait"){echo " selected";}?>>Kuwait</option>
<option value="Kyrgyzstan"<?php if($j->country=="Kyrgyzstan"){echo " selected";}?>>Kyrgyzstan</option>
<option value="Lao People's Democratic Republic"<?php if($j->country=="Lao People's Democratic Republic"){echo " selected";}?>>Lao People's Democratic Republic</option>
<option value="Latvia"<?php if($j->country=="Latvia"){echo " selected";}?>>Latvia</option>
<option value="Lebanon"<?php if($j->country=="Lebanon"){echo " selected";}?>>Lebanon</option>
<option value="Lesotho"<?php if($j->country=="Lesotho"){echo " selected";}?>>Lesotho</option>
<option value="Liberia"<?php if($j->country=="Liberia"){echo " selected";}?>>Liberia</option>
<option value="Libya"<?php if($j->country=="Libya"){echo " selected";}?>>Libya</option>
<option value="Liechtenstein"<?php if($j->country=="Liechtenstein"){echo " selected";}?>>Liechtenstein</option>
<option value="Lithuania"<?php if($j->country=="Lithuania"){echo " selected";}?>>Lithuania</option>
<option value="Luxembourg"<?php if($j->country=="Luxembourg"){echo " selected";}?>>Luxembourg</option>
<option value="Macao"<?php if($j->country=="Macao"){echo " selected";}?>>Macao</option>
<option value="Macedonia, the former Yugoslav Republic of"<?php if($j->country=="Macedonia, the former Yugoslav Republic of"){echo " selected";}?>>Macedonia, the former Yugoslav Republic of</option>
<option value="Madagascar"<?php if($j->country=="Madagascar"){echo " selected";}?>>Madagascar</option>
<option value="Malawi"<?php if($j->country=="Malawi"){echo " selected";}?>>Malawi</option>
<option value="Malaysia"<?php if($j->country=="Malaysia"){echo " selected";}?>>Malaysia</option>
<option value="Maldives"<?php if($j->country=="Maldives"){echo " selected";}?>>Maldives</option>
<option value="Mali"<?php if($j->country=="Mali"){echo " selected";}?>>Mali</option>
<option value="Malta"<?php if($j->country=="Malta"){echo " selected";}?>>Malta</option>
<option value="Marshall Islands"<?php if($j->country=="Marshall Islands"){echo " selected";}?>>Marshall Islands</option>
<option value="Martinique"<?php if($j->country=="Martinique"){echo " selected";}?>>Martinique</option>
<option value="Mauritania"<?php if($j->country=="Mauritania"){echo " selected";}?>>Mauritania</option>
<option value="Mauritius"<?php if($j->country=="Mauritius"){echo " selected";}?>>Mauritius</option>
<option value="Mayotte"<?php if($j->country=="Mayotte"){echo " selected";}?>>Mayotte</option>
<option value="Mexico"<?php if($j->country=="Mexico"){echo " selected";}?>>Mexico</option>
<option value="Micronesia, Federated States of"<?php if($j->country=="Micronesia, Federated States of"){echo " selected";}?>>Micronesia, Federated States of</option>
<option value="Moldova, Republic of"<?php if($j->country=="Moldova, Republic of"){echo " selected";}?>>Moldova, Republic of</option>
<option value="Monaco"<?php if($j->country=="Monaco"){echo " selected";}?>>Monaco</option>
<option value="Mongolia"<?php if($j->country=="Mongolia"){echo " selected";}?>>Mongolia</option>
<option value="Montenegro"<?php if($j->country=="Montenegro"){echo " selected";}?>>Montenegro</option>
<option value="Montserrat"<?php if($j->country=="Montserrat"){echo " selected";}?>>Montserrat</option>
<option value="Morocco"<?php if($j->country=="Morocco"){echo " selected";}?>>Morocco</option>
<option value="Mozambique"<?php if($j->country=="Mozambique"){echo " selected";}?>>Mozambique</option>
<option value="Myanmar"<?php if($j->country=="Myanmar"){echo " selected";}?>>Myanmar</option>
<option value="Namibia"<?php if($j->country=="Namibia"){echo " selected";}?>>Namibia</option>
<option value="Nauru"<?php if($j->country=="Nauru"){echo " selected";}?>>Nauru</option>
<option value="Nepal"<?php if($j->country=="Nepal"){echo " selected";}?>>Nepal</option>
<option value="Netherlands"<?php if($j->country=="Netherlands"){echo " selected";}?>>Netherlands</option>
<option value="New Caledonia"<?php if($j->country=="New Caledonia"){echo " selected";}?>>New Caledonia</option>
<option value="New Zealand"<?php if($j->country=="New Zealand"){echo " selected";}?>>New Zealand</option>
<option value="Nicaragua"<?php if($j->country=="Nicaragua"){echo " selected";}?>>Nicaragua</option>
<option value="Niger"<?php if($j->country=="Niger"){echo " selected";}?>>Niger</option>
<option value="Nigeria"<?php if($j->country=="Nigeria"){echo " selected";}?>>Nigeria</option>
<option value="Niue"<?php if($j->country=="Niue"){echo " selected";}?>>Niue</option>
<option value="Norfolk Island"<?php if($j->country=="Norfolk Island"){echo " selected";}?>>Norfolk Island</option>
<option value="Northern Mariana Islands"<?php if($j->country=="Northern Mariana Islands"){echo " selected";}?>>Northern Mariana Islands</option>
<option value="Norway"<?php if($j->country=="Norway"){echo " selected";}?>>Norway</option>
<option value="Oman"<?php if($j->country=="Oman"){echo " selected";}?>>Oman</option>
<option value="Pakistan"<?php if($j->country=="Pakistan"){echo " selected";}?>>Pakistan</option>
<option value="Palau"<?php if($j->country=="Palau"){echo " selected";}?>>Palau</option>
<option value="Palestinian Territory, Occupied"<?php if($j->country=="Palestinian Territory, Occupied"){echo " selected";}?>>Palestinian Territory, Occupied</option>
<option value="Panama"<?php if($j->country=="Panama"){echo " selected";}?>>Panama</option>
<option value="Papua New Guinea"<?php if($j->country=="Papua New Guinea"){echo " selected";}?>>Papua New Guinea</option>
<option value="Paraguay"<?php if($j->country=="Paraguay"){echo " selected";}?>>Paraguay</option>
<option value="Peru"<?php if($j->country=="Peru"){echo " selected";}?>>Peru</option>
<option value="Philippines"<?php if($j->country=="Philippines"){echo " selected";}?>>Philippines</option>
<option value="Pitcairn"<?php if($j->country=="Pitcairn"){echo " selected";}?>>Pitcairn</option>
<option value="Poland"<?php if($j->country=="Poland"){echo " selected";}?>>Poland</option>
<option value="Portugal"<?php if($j->country=="Portugal"){echo " selected";}?>>Portugal</option>
<option value="Puerto Rico"<?php if($j->country=="Puerto Rico"){echo " selected";}?>>Puerto Rico</option>
<option value="Qatar"<?php if($j->country=="Qatar"){echo " selected";}?>>Qatar</option>
<option value="Réunion"<?php if($j->country=="Réunion"){echo " selected";}?>>Réunion</option>
<option value="Romania"<?php if($j->country=="Romania"){echo " selected";}?>>Romania</option>
<option value="Russian Federation"<?php if($j->country=="Russian Federation"){echo " selected";}?>>Russian Federation</option>
<option value="Rwanda"<?php if($j->country=="Rwanda"){echo " selected";}?>>Rwanda</option>
<option value="Saint Barthélemy"<?php if($j->country=="Saint Barthélemy"){echo " selected";}?>>Saint Barthélemy</option>
<option value="Saint Helena, Ascension and Tristan da Cunha"<?php if($j->country=="Saint Helena, Ascension and Tristan da Cunha"){echo " selected";}?>>Saint Helena, Ascension and Tristan da Cunha</option>
<option value="Saint Kitts and Nevis"<?php if($j->country=="Saint Kitts and Nevis"){echo " selected";}?>>Saint Kitts and Nevis</option>
<option value="Saint Lucia"<?php if($j->country=="Saint Lucia"){echo " selected";}?>>Saint Lucia</option>
<option value="Saint Martin (French part)"<?php if($j->country=="Saint Martin (French part)"){echo " selected";}?>>Saint Martin (French part)</option>
<option value="Saint Pierre and Miquelon"<?php if($j->country=="Saint Pierre and Miquelon"){echo " selected";}?>>Saint Pierre and Miquelon</option>
<option value="Saint Vincent and the Grenadines"<?php if($j->country=="Saint Vincent and the Grenadines"){echo " selected";}?>>Saint Vincent and the Grenadines</option>
<option value="Samoa"<?php if($j->country=="Samoa"){echo " selected";}?>>Samoa</option>
<option value="San Marino"<?php if($j->country=="San Marino"){echo " selected";}?>>San Marino</option>
<option value="Sao Tome and Principe"<?php if($j->country=="Sao Tome and Principe"){echo " selected";}?>>Sao Tome and Principe</option>
<option value="Saudi Arabia"<?php if($j->country=="Saudi Arabia"){echo " selected";}?>>Saudi Arabia</option>
<option value="Senegal"<?php if($j->country=="Senegal"){echo " selected";}?>>Senegal</option>
<option value="Serbia"<?php if($j->country=="Serbia"){echo " selected";}?>>Serbia</option>
<option value="Seychelles"<?php if($j->country=="Seychelles"){echo " selected";}?>>Seychelles</option>
<option value="Sierra Leone"<?php if($j->country=="Sierra Leone"){echo " selected";}?>>Sierra Leone</option>
<option value="Singapore"<?php if($j->country=="Singapore"){echo " selected";}?>>Singapore</option>
<option value="Sint Maarten (Dutch part)"<?php if($j->country=="Sint Maarten (Dutch part)"){echo " selected";}?>>Sint Maarten (Dutch part)</option>
<option value="Slovakia"<?php if($j->country=="Slovakia"){echo " selected";}?>>Slovakia</option>
<option value="Slovenia"<?php if($j->country=="Slovenia"){echo " selected";}?>>Slovenia</option>
<option value="Solomon Islands"<?php if($j->country=="Solomon Islands"){echo " selected";}?>>Solomon Islands</option>
<option value="Somalia"<?php if($j->country=="Somalia"){echo " selected";}?>>Somalia</option>
<option value="South Africa"<?php if($j->country=="South Africa"){echo " selected";}?>>South Africa</option>
<option value="South Georgia and the South Sandwich Islands"<?php if($j->country=="South Georgia and the South Sandwich Islands"){echo " selected";}?>>South Georgia and the South Sandwich Islands</option>
<option value="South Sudan"<?php if($j->country=="South Sudan"){echo " selected";}?>>South Sudan</option>
<option value="Spain"<?php if($j->country=="Spain"){echo " selected";}?>>Spain</option>
<option value="Sri Lanka"<?php if($j->country=="Sri Lanka"){echo " selected";}?>>Sri Lanka</option>
<option value="Sudan"<?php if($j->country=="Sudan"){echo " selected";}?>>Sudan</option>
<option value="Suriname"<?php if($j->country=="Suriname"){echo " selected";}?>>Suriname</option>
<option value="Svalbard and Jan Mayen"<?php if($j->country=="Svalbard and Jan Mayen"){echo " selected";}?>>Svalbard and Jan Mayen</option>
<option value="Swaziland"<?php if($j->country=="Swaziland"){echo " selected";}?>>Swaziland</option>
<option value="Sweden"<?php if($j->country=="Sweden"){echo " selected";}?>>Sweden</option>
<option value="Switzerland"<?php if($j->country=="Switzerland"){echo " selected";}?>>Switzerland</option>
<option value="Syrian Arab Republic"<?php if($j->country=="Syrian Arab Republic"){echo " selected";}?>>Syrian Arab Republic</option>
<option value="Taiwan, Province of China"<?php if($j->country=="Taiwan, Province of China"){echo " selected";}?>>Taiwan, Province of China</option>
<option value="Tajikistan"<?php if($j->country=="Tajikistan"){echo " selected";}?>>Tajikistan</option>
<option value="Tanzania, United Republic of"<?php if($j->country=="Tanzania, United Republic of"){echo " selected";}?>>Tanzania, United Republic of</option>
<option value="Thailand"<?php if($j->country=="Thailand"){echo " selected";}?>>Thailand</option>
<option value="Timor-Leste"<?php if($j->country=="Timor-Leste"){echo " selected";}?>>Timor-Leste</option>
<option value="Togo"<?php if($j->country=="Togo"){echo " selected";}?>>Togo</option>
<option value="Tokelau"<?php if($j->country=="Tokelau"){echo " selected";}?>>Tokelau</option>
<option value="Tonga"<?php if($j->country=="Tonga"){echo " selected";}?>>Tonga</option>
<option value="Trinidad and Tobago"<?php if($j->country=="Trinidad and Tobago"){echo " selected";}?>>Trinidad and Tobago</option>
<option value="Tunisia"<?php if($j->country=="Tunisia"){echo " selected";}?>>Tunisia</option>
<option value="Turkey"<?php if($j->country=="Turkey"){echo " selected";}?>>Turkey</option>
<option value="Turkmenistan"<?php if($j->country=="Turkmenistan"){echo " selected";}?>>Turkmenistan</option>
<option value="Turks and Caicos Islands"<?php if($j->country=="Turks and Caicos Islands"){echo " selected";}?>>Turks and Caicos Islands</option>
<option value="Tuvalu"<?php if($j->country=="Tuvalu"){echo " selected";}?>>Tuvalu</option>
<option value="Uganda"<?php if($j->country=="Uganda"){echo " selected";}?>>Uganda</option>
<option value="Ukraine"<?php if($j->country=="Ukraine"){echo " selected";}?>>Ukraine</option>
<option value="United Arab Emirates"<?php if($j->country=="United Arab Emirates"){echo " selected";}?>>United Arab Emirates</option>
<option value="United Kingdom"<?php if($j->country=="United Kingdom"){echo " selected";}?>>United Kingdom</option>
<option value="United States Minor Outlying Islands"<?php if($j->country=="United States Minor Outlying Islands"){echo " selected";}?>>United States Minor Outlying Islands</option>
<option value="Uruguay"<?php if($j->country=="Uruguay"){echo " selected";}?>>Uruguay</option>
<option value="Uzbekistan"<?php if($j->country=="Uzbekistan"){echo " selected";}?>>Uzbekistan</option>
<option value="Vanuatu"<?php if($j->country=="Vanuatu"){echo " selected";}?>>Vanuatu</option>
<option value="Venezuela, Bolivarian Republic of"<?php if($j->country=="Venezuela, Bolivarian Republic of"){echo " selected";}?>>Venezuela, Bolivarian Republic of</option>
<option value="Viet Nam"<?php if($j->country=="Viet Nam"){echo " selected";}?>>Viet Nam</option>
<option value="Virgin Islands, British"<?php if($j->country=="Virgin Islands, British"){echo " selected";}?>>Virgin Islands, British</option>
<option value="Virgin Islands, U.S."<?php if($j->country=="Virgin Islands, U.S."){echo " selected";}?>>Virgin Islands, U.S.</option>
<option value="Wallis and Futuna"<?php if($j->country=="Wallis and Futuna"){echo " selected";}?>>Wallis and Futuna</option>
<option value="Western Sahara"<?php if($j->country=="Western Sahara"){echo " selected";}?>>Western Sahara</option>
<option value="Yemen"<?php if($j->country=="Yemen"){echo " selected";}?>>Yemen</option>
<option value="Zambia"<?php if($j->country=="Zambia"){echo " selected";}?>>Zambia</option>
<option value="Zimbabwe"<?php if($j->country=="Zimbabwe"){echo " selected";}?>>Zimbabwe</option>
</select>
<span name="stateprovincewrapper" id="stateprovincewrapper" style="width: 300px;">
<?php
if($j->country=="United States"){
//select with us states
?>
State: <select id="state" name="state">
<option value="">Select...</option>
<option value="Alabama"<?php if($d->state=="Alabama"){echo " selected";}?>>Alabama</option>
<option value="Alaska"<?php if($d->state=="Alaska"){echo " selected";}?>>Alaska</option>
<option value="Arizona"<?php if($d->state=="Arizona"){echo " selected";}?>>Arizona</option>
<option value="Arkansas"<?php if($d->state=="Arkansas"){echo " selected";}?>>Arkansas</option>
<option value="California"<?php if($d->state=="California"){echo " selected";}?>>California</option>
<option value="Colorado"<?php if($d->state=="Colorado"){echo " selected";}?>>Colorado</option>
<option value="Connecticut"<?php if($d->state=="Connecticut"){echo " selected";}?>>Connecticut</option>
<option value="Delaware"<?php if($d->state=="Delaware"){echo " selected";}?>>Delaware</option>
<option value="District Of Columbia"<?php if($d->state=="District Of Columbia"){echo " selected";}?>>District Of Columbia</option>
<option value="Florida"<?php if($d->state=="Florida"){echo " selected";}?>>Florida</option>
<option value="Georgia"<?php if($d->state=="Georgia"){echo " selected";}?>>Georgia</option>
<option value="Hawaii"<?php if($d->state=="Hawaii"){echo " selected";}?>>Hawaii</option>
<option value="Idaho"<?php if($d->state=="Idaho"){echo " selected";}?>>Idaho</option>
<option value="Illinois"<?php if($d->state=="Illinois"){echo " selected";}?>>Illinois</option>
<option value="Indiana"<?php if($d->state=="Indiana"){echo " selected";}?>>Indiana</option>
<option value="Iowa"<?php if($d->state=="Iowa"){echo " selected";}?>>Iowa</option>
<option value="Kansas"<?php if($d->state=="Kansas"){echo " selected";}?>>Kansas</option>
<option value="Kentucky"<?php if($d->state=="Kentucky"){echo " selected";}?>>Kentucky</option>
<option value="Louisiana"<?php if($d->state=="Louisiana"){echo " selected";}?>>Louisiana</option>
<option value="Maine"<?php if($d->state=="Maine"){echo " selected";}?>>Maine</option>
<option value="Maryland"<?php if($d->state=="Maryland"){echo " selected";}?>>Maryland</option>
<option value="Massachusetts"<?php if($d->state=="Massachusetts"){echo " selected";}?>>Massachusetts</option>
<option value="Michigan"<?php if($d->state=="Michigan"){echo " selected";}?>>Michigan</option>
<option value="Minnesota"<?php if($d->state=="Minnesota"){echo " selected";}?>>Minnesota</option>
<option value="Mississippi"<?php if($d->state=="Mississippi"){echo " selected";}?>>Mississippi</option>
<option value="Missouri"<?php if($d->state=="Missouri"){echo " selected";}?>>Missouri</option>
<option value="Montana"<?php if($d->state=="Montana"){echo " selected";}?>>Montana</option>
<option value="Nebraska"<?php if($d->state=="Nebraska"){echo " selected";}?>>Nebraska</option>
<option value="Nevada"<?php if($d->state=="Nevada"){echo " selected";}?>>Nevada</option>
<option value="New Hampshire"<?php if($d->state=="New Hampshire"){echo " selected";}?>>New Hampshire</option>
<option value="New Jersey"<?php if($d->state=="New Jersey"){echo " selected";}?>>New Jersey</option>
<option value="New Mexico"<?php if($d->state=="New Mexico"){echo " selected";}?>>New Mexico</option>
<option value="New York"<?php if($d->state=="New York"){echo " selected";}?>>New York</option>
<option value="North Carolina"<?php if($d->state=="North Carolina"){echo " selected";}?>>North Carolina</option>
<option value="North Dakota"<?php if($d->state=="North Dakota"){echo " selected";}?>>North Dakota</option>
<option value="Ohio"<?php if($d->state=="Ohio"){echo " selected";}?>>Ohio</option>
<option value="Oklahoma"<?php if($d->state=="Oklahoma"){echo " selected";}?>>Oklahoma</option>
<option value="Oregon"<?php if($d->state=="Oregon"){echo " selected";}?>>Oregon</option>
<option value="Pennsylvania"<?php if($d->state=="Pennsylvania"){echo " selected";}?>>Pennsylvania</option>
<option value="Rhode Island"<?php if($d->state=="Rhode Island"){echo " selected";}?>>Rhode Island</option>
<option value="South Carolina"<?php if($d->state=="South Carolina"){echo " selected";}?>>South Carolina</option>
<option value="South Dakota"<?php if($d->state=="South Dakota"){echo " selected";}?>>South Dakota</option>
<option value="Tennessee"<?php if($d->state=="Tennessee"){echo " selected";}?>>Tennessee</option>
<option value="Texas"<?php if($d->state=="Texas"){echo " selected";}?>>Texas</option>
<option value="Utah"<?php if($d->state=="Utah"){echo " selected";}?>>Utah</option>
<option value="Vermont"<?php if($d->state=="Vermont"){echo " selected";}?>>Vermont</option>
<option value="Virginia"<?php if($d->state=="Virginia"){echo " selected";}?>>Virginia</option>
<option value="Washington"<?php if($d->state=="Washington"){echo " selected";}?>>Washington</option>
<option value="West Virginia"<?php if($d->state=="West Virginia"){echo " selected";}?>>West Virginia</option>
<option value="Wisconsin"<?php if($d->state=="Wisconsin"){echo " selected";}?>>Wisconsin</option>
<option value="Wyoming"<?php if($d->state=="Wyoming"){echo " selected";}?>>Wyoming</option>
</select>
<?php
}elseif($j->country!=""){
//text box
?>
State/Province: <input type="text" id="state" name="state" value="<?php echo $j->state?>">
<?php
}
?>
</span>
</div>
<div class="rowdiv">
Address Line 1: <input type="text" id="address1" name="address1" size="60" value="<?php echo $j->address1?>">
</div>
<div class="rowdiv">
Address Line 2: <input type="text" id="address2" name="address2" size="60" value="<?php echo $j->address2?>">
</div>
<div class="rowdiv">
City: <input type="text" id="city" name="city" value="<?php echo $j->city?>">
Postal Code: <input type="text" id="zip" name="zip" value="<?php echo $j->zip?>">
</div>
<div class="rowdiv rowheader">Facility Contact</div>
<div class="rowdiv">
First Name: <input type="text" id="contact_first_name" name="contact_first_name" value="<?php echo $j->contact_first_name?>">
Last Name: <input type="text" id="contact_last_name" name="contact_last_name" value="<?php echo $j->contact_last_name?>">
</div>
<div class="rowdiv">
Title: <input type="text" id="contact_title" name="contact_title" value="<?php echo $j->contact_title?>">
Email: <input type="text" id="contact_email" name="contact_email" value="<?php echo $j->contact_email?>">
</div>
<div class="rowdiv">
<h2>Apparatus Information</h2>
</div>
<div class="rowdiv">
<div style="float:left;padding-left:100px;">
Apparatus Type: <span class="redred">*</span>
<select name="apparatus_type" id="apparatus_type">
<option value="">Select...</option>
<option value="Hydrostatic Loading Apparatuses"<?php if($j->apparatus_type=="Hydrostatic Loading Apparatuses"){echo " selected";}?>>Hydrostatic Loading Apparatuses</option>
<option value="Uniaxial Apparatus"<?php if($j->apparatus_type=="Uniaxial Apparatus"){echo " selected";}?>>Uniaxial Apparatus</option>
<option value="Biaxial Apparatus"<?php if($j->apparatus_type=="Biaxial Apparatus"){echo " selected";}?>>Biaxial Apparatus</option>
<option value="Triaxial (Conventional) Apparatus"<?php if($j->apparatus_type=="Triaxial (Conventional) Apparatus"){echo " selected";}?>>Triaxial (Conventional) Apparatus</option>
<option value="True Triaxial Apparatus"<?php if($j->apparatus_type=="True Triaxial Apparatus"){echo " selected";}?>>True Triaxial Apparatus</option>
<option value="Rotary Shear Apparatus"<?php if($j->apparatus_type=="Rotary Shear Apparatus"){echo " selected";}?>>Rotary Shear Apparatus</option>
<option value="Split Hopkinson Pressure Bar"<?php if($j->apparatus_type=="Split Hopkinson Pressure Bar"){echo " selected";}?>>Split Hopkinson Pressure Bar</option>
<option value="Indenter"<?php if($j->apparatus_type=="Indenter"){echo " selected";}?>>Indenter</option>
<option value="Nanoindenter"<?php if($j->apparatus_type=="Nanoindenter"){echo " selected";}?>>Nanoindenter</option>
<option value="Load Stamp"<?php if($j->apparatus_type=="Load Stamp"){echo " selected";}?>>Load Stamp</option>
<option value="Viscosimeter"<?php if($j->apparatus_type=="Viscosimeter"){echo " selected";}?>>Viscosimeter</option>
</select>
</div>
<?php
$subtypedisplay = "none";
if($j->apparatus_type == "Hydrostatic Loading Apparatuses"){
$subtypedisplay = "block";
}elseif($j->apparatus_type == "Uniaxial Apparatus"){
$subtypedisplay = "block";
}elseif($j->apparatus_type == "Biaxial Apparatus"){
$subtypedisplay = "block";
}elseif($j->apparatus_type == "Triaxial (Conventional) Apparatus"){
$subtypedisplay = "block";
}elseif($j->apparatus_type == "Rotary Shear Apparatus"){
$subtypedisplay = "block";
}elseif($j->apparatus_type == "Indenter"){
$subtypedisplay = "block";
}elseif($j->apparatus_type == "Nanoindenter"){
$subtypedisplay = "block";
}
?>
<div style="float:left;padding-left:30px;display:<?php echo $subtypedisplay?>;" name="apparatus_subtype_wrapper" id="apparatus_subtype_wrapper">
Apparatus Subtype: <span class="redred">*</span>
<select name="apparatus_subtype" id="apparatus_subtype">
<option value="">Select...</option>
<?php
if($j->apparatus_type == "Hydrostatic Loading Apparatuses"){
?>
<option value="Multi Anvil Cell"<?php if($j->apparatus_subtype=="Multi Anvil Cell"){echo " selected";}?>>Multi Anvil Cell</option>
<option value="Diamond Anvil Cell"<?php if($j->apparatus_subtype=="Diamond Anvil Cell"){echo " selected";}?>>Diamond Anvil Cell</option>
<option value="Piston Cylinder"<?php if($j->apparatus_subtype=="Piston Cylinder"){echo " selected";}?>>Piston Cylinder</option>
<option value="Other Hydrostatic Loading Apparatus"<?php if($j->apparatus_subtype=="Other Hydrostatic Loading Apparatus"){echo " selected";}?>>Other Hydrostatic Loading Apparatus</option>
<?php
}elseif($j->apparatus_type == "Uniaxial Apparatus"){
?>
<option value="Dead Load Creep Apparatus"<?php if($j->apparatus_subtype=="Dead Load Creep Apparatus"){echo " selected";}?>>Dead Load Creep Apparatus</option>
<option value="Other Uniaxial Apparatus"<?php if($j->apparatus_subtype=="Other Uniaxial Apparatus"){echo " selected";}?>>Other Uniaxial Apparatus</option>
<?php
}elseif($j->apparatus_type == "Biaxial Apparatus"){
?>
<option value="Biaxial Direct (and Double Direct) Shear Apparatus"<?php if($j->apparatus_subtype=="Biaxial Direct (and Double Direct) Shear Apparatus"){echo " selected";}?>>Biaxial Direct (and Double Direct) Shear Apparatus</option>
<option value="Shear Box"<?php if($j->apparatus_subtype=="Shear Box"){echo " selected";}?>>Shear Box</option>
<option value="Other Biaxial Apparatus"<?php if($j->apparatus_subtype=="Other Biaxial Apparatus"){echo " selected";}?>>Other Biaxial Apparatus</option>
<?php
}elseif($j->apparatus_type == "Triaxial (Conventional) Apparatus"){
?>
<option value="Paterson Apparatus"<?php if($j->apparatus_subtype=="Paterson Apparatus"){echo " selected";}?>>Paterson Apparatus</option>
<option value="Griggs Apparatus"<?php if($j->apparatus_subtype=="Griggs Apparatus"){echo " selected";}?>>Griggs Apparatus</option>
<option value="Heard Apparatus"<?php if($j->apparatus_subtype=="Heard Apparatus"){echo " selected";}?>>Heard Apparatus</option>
<option value="D-DIA"<?php if($j->apparatus_subtype=="D-DIA"){echo " selected";}?>>D-DIA</option>
<option value="Paris-Edinburgh Rig"<?php if($j->apparatus_subtype=="Paris-Edinburgh Rig"){echo " selected";}?>>Paris-Edinburgh Rig</option>
<option value="Other Gas Medium Apparatus"<?php if($j->apparatus_subtype=="Other Gas Medium Apparatus"){echo " selected";}?>>Other Gas Medium Apparatus</option>
<option value="Other Liquid Medium Apparatus"<?php if($j->apparatus_subtype=="Other Liquid Medium Apparatus"){echo " selected";}?>>Other Liquid Medium Apparatus</option>
<option value="Other Solid Medium Apparatus"<?php if($j->apparatus_subtype=="Other Solid Medium Apparatus"){echo " selected";}?>>Other Solid Medium Apparatus</option>
<?php
}elseif($j->apparatus_type == "Rotary Shear Apparatus"){
?>
<option value="Rotary Shear Friction Apparatus"<?php if($j->apparatus_subtype=="Rotary Shear Friction Apparatus"){echo " selected";}?>>Rotary Shear Friction Apparatus</option>
<option value="Double Torsion Apparatus"<?php if($j->apparatus_subtype=="Double Torsion Apparatus"){echo " selected";}?>>Double Torsion Apparatus</option>
<option value="Large Volume Torsion Apparatus (LVT)"<?php if($j->apparatus_subtype=="Large Volume Torsion Apparatus (LVT)"){echo " selected";}?>>Large Volume Torsion Apparatus (LVT)</option>
<option value="Rheometer"<?php if($j->apparatus_subtype=="Rheometer"){echo " selected";}?>>Rheometer</option>
<option value="Rotational Drickamer Apparatus (RDA)"<?php if($j->apparatus_subtype=="Rotational Drickamer Apparatus (RDA)"){echo " selected";}?>>Rotational Drickamer Apparatus (RDA)</option>
<option value="Other Rotary Shear Apparatus"<?php if($j->apparatus_subtype=="Other Rotary Shear Apparatus"){echo " selected";}?>>Other Rotary Shear Apparatus</option>
<?php
}elseif($j->apparatus_type == "Indenter"){
?>
<option value="Vickers Hardness Tester"<?php if($j->apparatus_subtype=="Vickers Hardness Tester"){echo " selected";}?>>Vickers Hardness Tester</option>
<option value="Chevron Notch Test"<?php if($j->apparatus_subtype=="Chevron Notch Test"){echo " selected";}?>>Chevron Notch Test</option>
<option value="Indentation Cell"<?php if($j->apparatus_subtype=="Indentation Cell"){echo " selected";}?>>Indentation Cell</option>
<option value="Point Load"<?php if($j->apparatus_subtype=="Point Load"){echo " selected";}?>>Point Load</option>
<option value="Creep Cell"<?php if($j->apparatus_subtype=="Creep Cell"){echo " selected";}?>>Creep Cell</option>
<?php
}elseif($j->apparatus_type == "Nanoindenter"){
?>
<option value="Cube corner"<?php if($j->apparatus_subtype=="Cube corner"){echo " selected";}?>>Cube corner</option>
<option value="Bercovitch"<?php if($j->apparatus_subtype=="Bercovitch"){echo " selected";}?>>Bercovitch</option>
<option value="Spherical"<?php if($j->apparatus_subtype=="Spherical"){echo " selected";}?>>Spherical</option>
<option value="Micropillar"<?php if($j->apparatus_subtype=="Micropillar"){echo " selected";}?>>Micropillar</option>
<?php
}
?>
</select>
</div>
<div style="clear:left"></div>
</div>
<div class="rowdiv">
Apparatus Name: <span class="redred">*</span>
<input type="text" id="apparatus_name" value="<?php echo $j->apparatus_name?>">
</div>
<?php
$dropzone_rig_photo_display = "block";
$static_rig_photo_display = "none";
$dropzone_rig_schematic_display = "block";
$static_rig_schematic_display = "none";
if(file_exists($_SERVER['DOCUMENT_ROOT']."/expimages/photo_".$apparatus_pkey)){
$dropzone_rig_photo_display = "none";
$static_rig_photo_display = "block";
}
if(file_exists($_SERVER['DOCUMENT_ROOT']."/expimages/schematic_".$apparatus_pkey)){
$dropzone_rig_schematic_display = "none";
$static_rig_schematic_display = "block";
$schematic_filename = $db->get_var("select original_file_name from exp_images where type='schematic' and apparatus_pkey = $apparatus_pkey");
}
?>
<div class="rowdiv" style="padding-top:20px;">
<div style="float:left;padding-right:20px;font-size:1.3em;padding-top:60px;padding-left:170px;display:<?php echo $dropzone_rig_photo_display?>;" id="rigDZPhotoLabel">Upload Rig Photo:</div><div style="float:left;display:<?php echo $dropzone_rig_photo_display?>;" class="dropzone" id="rigPhoto"></div>
<div style="float:left;padding-right:20px;font-size:1.3em;padding-top:60px;padding-left:170px;display:<?php echo $static_rig_photo_display?>;" id="rigStaticPhotoLabel">Rig Photo:</div>
<div style="float:left;display:<?php echo $static_rig_photo_display?>;" id="rigStaticPhoto">
<div><a href="/apparatus_photo_<?php echo $apparatus_pkey?>_large.jpg" data-featherlight="image"><img src="/apparatus_photo_<?php echo $apparatus_pkey?>_small.jpg"></a></div>
<div><a href="javascript:deletePhoto();">DELETE</a></div>
</div>
<div style="float:left;padding-right:20px;font-size:1.3em;padding-top:60px;padding-left:20px;display:<?php echo $dropzone_rig_schematic_display?>;" id="rigDZSchematicLabel">Upload Rig Schematic:</div><div style="float:left;display:<?php echo $dropzone_rig_schematic_display?>;" class="dropzone" id="rigSchematic"></div>
<div style="float:left;padding-right:20px;font-size:1.3em;padding-top:60px;padding-left:20px;display:<?php echo $static_rig_schematic_display?>;" id="rigStaticSchematicLabel">Rig Schematic:</div>
<div style="float:left;display:<?php echo $static_rig_schematic_display?>;vertical-align:middle;padding-top:50px;" id="rigStaticSchematic">
<div><a href="/apparatus_schematic_<?php echo $apparatus_pkey?>">Download<?php echo $schematic_filenameddd?></a></div>
<div><a href="javascript:deleteSchematic();">DELETE</a></div>
</div>
<div style="clear:left;"></div>
</div>
<div class="rowdiv rowheader" style="padding-top:15px;">Possible Test Types</div>
<div style="border:1px dashed rgba(50, 50, 50, 0.5);border-radius:10px;padding:20px;width:300px;margin:auto;margin-top:10px;">
<div style="font-weight:bold;">Static:</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_hip" id="checkbox_hip"<?php if($j->test_types->hip == 1){echo " checked";}?>> HIP</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_synthesis" id="checkbox_synthesis"<?php if($j->test_types->synthesis == 1){echo " checked";}?>> Synthesis</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_depositionevaporation" id="checkbox_depositionevaporation"<?php if($j->test_types->depositionevaporation == 1){echo " checked";}?>> Deposition/Evaporation</div>
<div style="font-weight:bold;">Indentation:</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_indentationcreep" id="checkbox_indentationcreep"<?php if($j->test_types->indentationcreep == 1){echo " checked";}?>> Indentation-Creep</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_hardness" id="checkbox_hardness"<?php if($j->test_types->hardness == 1){echo " checked";}?>> Hardness</div>
<div style="font-weight:bold;">Pore Structure:</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_permeability" id="checkbox_permeability"<?php if($j->test_types->permeability == 1){echo " checked";}?>> Permeability</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_resistivity" id="checkbox_resistivity"<?php if($j->test_types->resistivity == 1){echo " checked";}?>> Resistivity</div>
<div style="font-weight:bold;">Shear Deformation:</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_simpleshear" id="checkbox_simpleshear"<?php if($j->test_types->simpleshear == 1){echo " checked";}?>> Simple Shear</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_rotaryshear" id="checkbox_rotaryshear"<?php if($j->test_types->rotaryshear == 1){echo " checked";}?>> Rotary Shear</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_pureshear" id="checkbox_pureshear"<?php if($j->test_types->pureshear == 1){echo " checked";}?>> Pure Shear</div>
<div style="font-weight:bold;">Uniaxial Deformation:</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_constantstress" id="checkbox_constantstress"<?php if($j->test_types->constantstress == 1){echo " checked";}?>> Constant Stress</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_constantrate" id="checkbox_constantrate"<?php if($j->test_types->constantrate == 1){echo " checked";}?>> Constant Rate</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_loadingunloading" id="checkbox_loadingunloading"<?php if($j->test_types->loadingunloading == 1){echo " checked";}?>> Loading/Unloading</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_stepping" id="checkbox_stepping"<?php if($j->test_types->stepping == 1){echo " checked";}?>> Stepping</div>
<div style="padding-left:20px;"><input type="checkbox" name="checkbox_extension" id="checkbox_extension"<?php if($j->test_types->extension == 1){echo " checked";}?>> Extension</div>
</div>
<div class="rowdiv rowheader" style="padding-top:25px;">Apparatus Capabilities, Sensors, and Corrections</div>
<?php
if($j->confining_pressure != ""){
$confining_checked = " checked";
$confining_display = " style=\"display:block;\"";
}
?>
<div style="padding-top:20px;margin-left:25px;margin-right:25px;">
<div class="checkheader"><input type="checkbox" id="checkbox_confiningpressure"<?php echo $confining_checked?>> Confining Pressure</div>
<div class="checkbody" id="confiningpressure_wrapper"<?php echo $confining_display?>>
<div><input type="checkbox" id="cp_servo_controlled"<?php if($j->confining_pressure->servo_controlled == 1) echo " checked";?>> Servo Controlled</div>
<div class="rowdivv">
Confining Medium:
<select id="cp_confiningmediumone">
<option value="">Select...</option>
<option value="Solid"<?php if($j->confining_pressure->confiningmediumone == "Solid"){echo " selected";}?>>Solid</option>
<option value="Liquid"<?php if($j->confining_pressure->confiningmediumone == "Liquid"){echo " selected";}?>>Liquid</option>
<option value="Gas"<?php if($j->confining_pressure->confiningmediumone == "Gas"){echo " selected";}?>>Gas</option>
</select>
<?php
if($j->confining_pressure->confiningmediumone != ""){
$cm1show = "inline";
}else{
$cm1show = "none";
}
?>
<select id="cp_confiningmediumtwo" style="display:<?php echo $cm1show?>;">
<option value="">Select...</option>
<?php
//set up different options
if($j->confining_pressure->confiningmediumone == "Solid"){
?>
<option value="Salt: NaCl"<?php if($j->confining_pressure->confiningmediumtwo == "Salt: NaCl"){echo " selected";}?>>Salt: NaCl</option>
<option value="Salt: KCl"<?php if($j->confining_pressure->confiningmediumtwo == "Salt: KCl"){echo " selected";}?>>Salt: KCl</option>
<option value="Diamond Anvil"<?php if($j->confining_pressure->confiningmediumtwo == "Diamond Anvil"){echo " selected";}?>>Diamond Anvil</option>
<option value="Other"<?php if($j->confining_pressure->confiningmediumtwo == "Other"){echo " selected";}?>>Other</option>
<?php
}elseif($j->confining_pressure->confiningmediumone == "Liquid"){
?>
<option value="Silicon Oil"<?php if($j->confining_pressure->confiningmediumtwo == "Silicon Oil"){echo " selected";}?>>Silicon Oil</option>
<option value="Hydraulic Oil"<?php if($j->confining_pressure->confiningmediumtwo == "Hydraulic Oil"){echo " selected";}?>>Hydraulic Oil</option>
<option value="Water"<?php if($j->confining_pressure->confiningmediumtwo == "Water"){echo " selected";}?>>Water</option>
<option value="Melt"<?php if($j->confining_pressure->confiningmediumtwo == "Melt"){echo " selected";}?>>Melt</option>
<option value="Other"<?php if($j->confining_pressure->confiningmediumtwo == "Other"){echo " selected";}?>>Other</option>
<?php
}elseif($j->confining_pressure->confiningmediumone == "Gas"){
?>
<option value="Argon"<?php if($j->confining_pressure->confiningmediumtwo == "Argon"){echo " selected";}?>>Argon</option>
<option value="Nitrogen"<?php if($j->confining_pressure->confiningmediumtwo == "Nitrogen"){echo " selected";}?>>Nitrogen</option>
<option value="Other"<?php if($j->confining_pressure->confiningmediumtwo == "Other"){echo " selected";}?>>Other</option>
<?php
}
?>
</select>
<?php
if($j->confining_pressure->confiningmediumtwo == "Other"){
$cmothershow = "inline";
}else{
$cmothershow = "none";
}
?>
<input type="text" id="cp_confiningmediumother" value="<?php echo $j->confining_pressure->confiningmediumother?>" placeholder="Enter other type..." style="display:<?php echo $cmothershow?>;">
</div>
<div class="rowdivv">
Min Confining Pressure:
<input type="text" value="<?php echo $j->confining_pressure->minconfiningpressure?>" class="only-numeric" id="cp_minconfiningpressure">
<?php
$thisselected = "MPa";
if($j->confining_pressure->minconfiningpressureunit == "kPa") $thisselected = "kPa";
if($j->confining_pressure->minconfiningpressureunit == "MPa") $thisselected = "MPa";
if($j->confining_pressure->minconfiningpressureunit == "GPa") $thisselected = "GPa";
?>
<select id="cp_minconfiningpressure_unit">
<option value="kPa"<?php if($thisselected=="kPa"){echo " selected";}?>>kPa</option>
<option value="MPa"<?php if($thisselected=="MPa"){echo " selected";}?>>MPa</option>
<option value="GPa"<?php if($thisselected=="GPa"){echo " selected";}?>>GPa</option>
</select>
Max Confining Pressure:
<input type="text" value="<?php echo $j->confining_pressure->maxconfiningpressure?>" class="only-numeric" id="cp_maxconfiningpressure">
<?php
$thisselected = "MPa";
if($j->confining_pressure->maxconfiningpressureunit == "kPa") $thisselected = "kPa";
if($j->confining_pressure->maxconfiningpressureunit == "MPa") $thisselected = "MPa";
if($j->confining_pressure->maxconfiningpressureunit == "GPa") $thisselected = "GPa";
?>
<select id="cp_maxconfiningpressure_unit">
<option value="kPa"<?php if($thisselected=="kPa"){echo " selected";}?>>kPa</option>
<option value="MPa"<?php if($thisselected=="MPa"){echo " selected";}?>>MPa</option>
<option value="GPa"<?php if($thisselected=="GPa"){echo " selected";}?>>GPa</option>
</select>
</div>
<div class="separator" style="margin-top:5px;">
Sensor(s)
</div>
<?php
for($cp_sensor_num = 1; $cp_sensor_num <= $num_sensors; $cp_sensor_num++){
$thissensor = getSensor($j->confining_pressure->sensors, $cp_sensor_num);
if($cp_sensor_num > 1){
if($thissensor->sensortype==""){
$sensorstyle=" style=\"display:none;\"";
}else{
$sensorstyle="";
}
}
?>
<div class="rowdivv" id="cp_sensor_wrapper_<?php echo $cp_sensor_num?>" <?php echo $sensorstyle?>>
<?php if($cp_sensor_num > 1){?>
<div class="separator" style="margin-top:10px;margin-bottom:5px;"></div>
<?php }?>
<?php if($cp_sensor_num > 1){?>
<div><a href="javascript:removecpsensor<?php echo $cp_sensor_num?>();">Remove</a></div>
<?php }?>
<div style="float:left;width:600px;">
<div class="rowdivv">
Sensor Type:
<select id="cp_sensortype_<?php echo $cp_sensor_num?>">
<option value="">Select...</option>
<option value="Pressure Cell"<?php if($thissensor->sensortype=="Pressure Cell"){echo " selected";}?>>Pressure Cell</option>
<option value="Analog Oil Pressure Gauge"<?php if($thissensor->sensortype=="Analog Oil Pressure Gauge"){echo " selected";}?>>Analog Oil Pressure Gauge</option>
<option value="X-Ray Diffraction"<?php if($thissensor->sensortype=="X-Ray Diffraction"){echo " selected";}?>>X-Ray Diffraction</option>
<option value="Ruby Fluorescence"<?php if($thissensor->sensortype=="Ruby Fluorescence"){echo " selected";}?>>Ruby Fluorescence</option>
<option value="Other"<?php if($thissensor->sensortype=="Other"){echo " selected";}?>>Other</option>
</select>
<?php
if($thissensor->sensortype!="Other"){
$otherstyle=" style=\"display:none;\"";
}else{
$otherstyle="";
}
?>
<input type="text" id="cp_sensorothertype_<?php echo $cp_sensor_num?>" value="<?php echo $thissensor->sensorothertype?>" <?php echo $otherstyle?> placeholder="Other Sensor Type...">
</div>
<div class="rowdivv">
Sensor Location:
<select id="cp_sensorlocation_<?php echo $cp_sensor_num?>">
<option value="">Select...</option>
<option value="Internal"<?php if($thissensor->sensorlocation=="Internal"){echo " selected";}?>>Internal</option>
<option value="External"<?php if($thissensor->sensorlocation=="External"){echo " selected";}?>>External</option>
</select>
Calibration: <input type="text" id="cp_sensorcalibration_<?php echo $cp_sensor_num?>" value="<?php echo $thissensor->sensorcalibration?>">
</div>
<div class="rowdivv">
Sensor Notes:
<textarea id="cp_sensornotes_<?php echo $cp_sensor_num?>" style="width:400px;"><?php echo $thissensor->sensornotes?></textarea>
</div>
</div>
<div style="float:left;padding-right:10px;font-size:1em;padding-top:60px;padding-left:17px;">Calibration File:</div>
<?php
if(file_exists($_SERVER['DOCUMENT_ROOT']."/expimages/cpsensor_".$apparatus_pkey."_".$cp_sensor_num)){
$dzshow = "none";
$imgshow = "inline";
}else{
$dzshow = "inline";
$imgshow = "none";
}
?>
<div style="float:left;display:<?php echo $dzshow?>;" class="dropzone" id="cp_sensorfile_<?php echo $cp_sensor_num?>"></div>
<div style="text-align:center;float:left;vertical-align:middle;padding-top:50px;display:<?php echo $imgshow?>;" id="cp_sensorlink_<?php echo $cp_sensor_num?>">
<a href="/sensor_calibration_file/cpsensor/<?php echo $apparatus_pkey?>/<?php echo $cp_sensor_num?>">Download</a><br>
<a href="javascript:deleteCalibration('cp', <?php echo $cp_sensor_num?>);">Delete</a>
</div>
<div style="clear:left;"></div>
</div>
<?php
}//end foreach
?>
<div class="rowdiv" id="cpaddsensorbutton">
<button onclick="add_cp_sensor(); return false;">Add Additional Sensor</button>
</div>
</div>
<?php
if($j->temp != ""){
$temp_checked = " checked";
$temp_display = " style=\"display:block;\"";
}
?>
<div class="checkheader"><input type="checkbox" id="checkbox_temperaturefurnacecryostat"<?php echo $temp_checked?>> Temperature (Furnace/Cryostat)</div>
<div class="checkbody" id="temperaturefurnacecryostat_wrapper"<?php echo $temp_display?>>
<div><input type="checkbox" id="temp_furnace"<?php if($j->temp->furnace!=""){echo " checked";}?>> Furnace
<input type="checkbox" id="temp_cryostat"<?php if($j->temp->cryostat!=""){echo " checked";}?>> Cryostat</div>
<div><input type="checkbox" id="temp_servo_controlled"<?php if($j->temp->servocontrolled!=""){echo " checked";}?>> Servo Controlled</div>
<div class="rowdivv">
Min Temperature:
<input type="text" class="only-numeric" id="temp_mintemperature" value="<?php echo $j->temp->mintemperature?>">
<select id="temp_mintemperature_unit">
<option value="°C"<?php if($j->temp->mintemperatureunit=="°C"){echo " selected";}?>>°C</option>
<option value="K"<?php if($j->temp->mintemperatureunit=="K"){echo " selected";}?>>K</option>
<option value="°F"<?php if($j->temp->mintemperatureunit=="°F"){echo " selected";}?>>°F</option>
</select>
Max Temperature:
<input type="text" class="only-numeric" id="temp_maxtemperature" value="<?php echo $j->temp->maxtemperature?>">
<select id="temp_maxtemperature_unit">
<option value="°C"<?php if($j->temp->maxtemperatureunit=="°C"){echo " selected";}?>>°C</option>
<option value="K"<?php if($j->temp->maxtemperatureunit=="K"){echo " selected";}?>>K</option>
<option value="°F"<?php if($j->temp->maxtemperatureunit=="°F"){echo " selected";}?>>°F</option>
</select>
</div>