forked from ArctosDB/arctos
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpecimenResultsHTML.cfm
1903 lines (1763 loc) · 70.2 KB
/
SpecimenResultsHTML.cfm
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
<cfinclude template="/includes/_header.cfm">
<script>
function checkUncheck(formName,CollObjValue) {
var newStr;
if ( document.forms[formName].exclCollObjId.checked ){
newStr = document.reloadThis.exclCollObjId.value + "," + CollObjValue + ",";
document.reloadThis.exclCollObjId.value=newStr;
}else{
newStr=replaceSubstring(document.reloadThis.exclCollObjId.value, "," + CollObjValue + ",", "");
document.reloadThis.exclCollObjId.value=newStr;
}
}
</script>
<cfset detail_level = 1>
<!------
<cfif not isdefined("detail_level") OR len(#detail_level#) is 0>
<cfif isdefined("session.detailLevel") AND #session.detailLevel# gt 0>
<cfset detail_level = #session.detailLevel#>
<cfelse>
<cfset detail_level = 1>
</cfif>
</cfif>
---------->
<cfoutput>
</cfoutput>
<cfset title="Specimen Results">
<cfif not isdefined("displayrows")>
<cfset displayrows = session.displayrows>
</cfif>
<cfif not isdefined("SearchParams")>
<cfset SearchParams = "">
</cfif>
<cfif not isdefined("newQuery")>
<cfset newQuery = 1>
</cfif>
<cfif not isdefined("sciNameOper")>
<cfset sciNameOper = "LIKE">
</cfif>
<cfif not isdefined("oidOper")>
<cfset oidOper = "LIKE">
</cfif>
<cfif not isdefined("mapurl")>
<cfset mapurl = "null">
</cfif>
<cfif #action# contains ",">
<cfset action = #left(action,find(",",action)-1)#>
</cfif>
<cfif #detail_level# contains ",">
<cfset detail_level = #left(detail_level,find(",",detail_level)-1)#>
</cfif>
<cfif #newQuery# is 1> <!--- build and send the query--->
<cfset basSelect = " SELECT
#session.flatTableName#.collection_object_id,
#session.flatTableName#.cat_num,
#session.flatTableName#.institution_acronym,
#session.flatTableName#.collection_cde,
#session.flatTableName#.collection_id,
#session.flatTableName#.parts,
#session.flatTableName#.sex,
#session.flatTableName#.scientific_name,
#session.flatTableName#.country,
#session.flatTableName#.state_prov,
#session.flatTableName#.spec_locality,
#session.flatTableName#.verbatim_date
">
<cfif len(#session.CustomOtherIdentifier#) gt 0>
<cfset basSelect = "#basSelect#
,concatSingleOtherId(#session.flatTableName#.collection_object_id,'#session.CustomOtherIdentifier#') AS CustomID,
to_number(ConcatSingleOtherIdInt(#session.flatTableName#.collection_object_id,'#session.CustomOtherIdentifier#')) AS CustomIDInt">
</cfif>
<cfset basFrom = " FROM #session.flatTableName#">
<cfset basJoin = "INNER JOIN cataloged_item ON (#session.flatTableName#.collection_object_id =cataloged_item.collection_object_id)">
<cfset basWhere = " WHERE #session.flatTableName#.collection_object_id IS NOT NULL ">
<!--------------------------------------------------------------->
<cfset basQual = "">
<cfset mapurl="">
<cfinclude template="includes/SearchSql.cfm">
<cfif #detail_level# gte 2>
<cfset basSelect = "#basSelect#,
#session.flatTableName#.accession,
#session.flatTableName#.coll_obj_disposition,
#session.flatTableName#.county,
#session.flatTableName#.feature,
#session.flatTableName#.quad,
#session.flatTableName#.remarks,
#session.flatTableName#.ISLAND,
#session.flatTableName#.ISLAND_GROUP,
#session.flatTableName#.associated_species,
#session.flatTableName#.habitat,
round(MIN_ELEV_IN_M) MIN_ELEV_IN_M,
round(MAX_ELEV_IN_M) MAX_ELEV_IN_M">
</cfif><!--- end detail_level 2---->
<cfif #detail_level# gte 3>
<cfquery name="ctAtt" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select distinct(attribute_type) from ctattribute_type
</cfquery>
<cfloop query="ctAtt">
<cfset thisName = #ctAtt.attribute_type#>
<cfset thisName = #replace(thisName," ","_","all")#>
<cfset thisName = #replace(thisName,"-","_","all")#>
<cfset thisName = #left(thisName,20)#>
<cfif #thisName# is not "sex"><!--- already got it --->
<cfset basSelect = "#basSelect# ,
ConcatAttributeValue(#session.flatTableName#.collection_object_id,'#ctAtt.attribute_type#')
#thisName#">
</cfif>
</cfloop>
<cfset basSelect = "#basSelect# ,
#session.flatTableName#.began_date,
#session.flatTableName#.ended_date,
get_scientific_name_auths(#session.flatTableName#.collection_object_id) sci_name_with_auth,
concatAcceptedIdentifyingAgent(#session.flatTableName#.collection_object_id) identified_by">
</cfif><!--- end detail_level 3---->
<cfif #detail_level# gte 4>
<cfset basSelect = "#basSelect#,
#session.flatTableName#.datum,
#session.flatTableName#.orig_lat_long_units,
#session.flatTableName#.lat_long_determiner,
#session.flatTableName#.lat_long_ref_source,
#session.flatTableName#.lat_long_remarks,
#session.flatTableName#.COORDINATEUNCERTAINTYINMETERS,
#session.flatTableName#.CONTINENT_OCEAN,
#session.flatTableName#.SEA,
get_taxon(cataloged_item.collection_object_id,'family') family,
get_taxon(cataloged_item.collection_object_id,'phylorder') phylorder
">
</cfif><!--- end detail_level 4---->
<cfset basSelect = "#basSelect#,#session.flatTableName#.dec_lat,#session.flatTableName#.dec_long">
<cfif #detail_level# gte 2>
<cfset basSelect = "#basSelect#, collectors,VerbatimLatitude,VerbatimLongitude,OTHERCATALOGNUMBERS">
</cfif>
<!---
</cfif>
--->
<!--- wrap everything up in a string --->
<cfset SqlString = "#basSelect# #basFrom# #basJoin# #basWhere# #basQual#">
<!--- define the list of search paramaters that we need to get back here --->
<cfoutput>
<cfset searchParams = "">
<!--- set up hidden form variables to use when customizing.
Explicitly exclude things we don't want --->
<cfset searchParams = "">
<cfset returnURL = "">
<cfloop list="#StructKeyList(form)#" index="key">
<cfif len(#form[key]#) gt 0>
<cfif #key# is not "FIELDNAMES"
AND #key# is not "SEARCHPARAMS"
AND #key# is not "mapurl"
AND #key# is not "cbifurl"
and #key# is not "newquery"
and #key# is not "ORDER_ORDER"
and #key# is not "ORDER_BY"
and #key# is not "newsearch"
and #key# is not "STARTROW">
<cfif len(#returnURL#) is 0>
<cfset returnURL='SpecimenResultsHTML.cfm?#key#=#form[key]#'>
<cfelse>
<cfset returnURL='#returnURL#&#key#=#form[key]#'>
</cfif>
<cfif #key# is not "detail_level">
<cfif len(#searchParams#) is 0>
<cfset searchParams='<input type="hidden" name="#key#" value="#form[key]#">'>
<cfelse>
<cfset searchParams='#searchParams#<input type="hidden" name="#key#" value="#form[key]#">'>
</cfif>
</cfif>
</cfif>
</cfif>
</cfloop>
<!---- also grab anything from the URL --->
<cfloop list="#StructKeyList(url)#" index="key">
<cfif len(#url[key]#) gt 0>
<cfif #key# is not "FIELDNAMES"
AND #key# is not "SEARCHPARAMS"
AND #key# is not "mapurl"
AND #key# is not "cbifurl"
and #key# is not "newquery"
and #key# is not "ORDER_ORDER"
and #key# is not "ORDER_BY"
and #key# is not "newsearch"
and #key# is not "STARTROW"
and #key# is not "detail_level">
<cfif len(#returnURL#) is 0>
<cfset returnURL='SpecimenResultsHTML.cfm?#key#=#url[key]#'>
<cfelse>
<cfset returnURL='#returnURL#&#key#=#url[key]#'>
</cfif>
<cfif #key# is not "detail_level">
<cfif len(#searchParams#) is 0>
<cfset searchParams='<input type="hidden" name="#key#" value="#url[key]#">'>
<cfelse>
<cfset searchParams='#searchParams#<input type="hidden" name="#key#" value="#url[key]#">'>
</cfif>
</cfif>
</cfif>
</cfif>
</cfloop>
<cfset strippyReturnURL = replace(returnURL,'"','"','all')>
<cfset searchParams = '#searchParams#<input type="hidden" name="returnURL" value="#strippyReturnURL#"'>
<cfset searchParams = #replace(searchParams,"'","","all")#>
</cfoutput>
<cfif len(#basQual#) is 0 AND basFrom does not contain "binary_object">
<CFSETTING ENABLECFOUTPUTONLY=0>
<font color="##FF0000" size="+2">You must enter some search criteria!</font>
<cfabort>
</cfif>
<!-------------------------- dlkm debug --
<cfif isdefined("session.username") and (#session.username# is "dlm" or #session.username# is "dusty")>
<cfoutput>
--#session.username#--
#preserveSingleQuotes(SqlString)#
<br>ReturnURL: #returnURL#
<br>MapURL: #mapURL#
<cfdump var=#variables#>
</cfoutput>
</cfif>
---------------<--------------------->
<!-------------------------- / dlm debug -------------------------------------->
<cfquery name="getData" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
#preserveSingleQuotes(SqlString)#
</cfquery>
<cfset userSql = #preserveSingleQuotes(SqlString)#>
<cfif getData.recordcount is 0>
<CFSETTING ENABLECFOUTPUTONLY=0>
<cfoutput>
<font color="##FF0000" size="+2">Your search returned no results.</font>
<p>Some possibilities include:</p>
<ul>
<li>
If you searched by taxonomy, please consult <a href="/taxonomy.cfm" class="novisit">Arctos Taxonomy</a>.
</li>
<li>
Try broadening your search criteria. Try the next-higher geographic element, remove criteria, etc. Don't assume we've accurately or predictably recorded data!
</li>
<li>
Use dropdowns or partial word matches instead of text strings, which may be entered in unexpected ways. "Doe" is a good choice for a collector if "John P. Doe" didn't match anything.
</li>
<li>
Read the documentation for individual search fields (click the title of the field to see documentation). Arctos fields may not be what you expect them to be.
</li>
</ul>
</cfoutput>
<cfabort>
</cfif>
<CFSETTING ENABLECFOUTPUTONLY=0>
<!---- clear old queries from cache and cache flatquery ---->
<cfquery name="SpecRes#left(session.sessionKey,10)#" dbtype="query" cachedwithin="#createtimespan(0,0,0,0)#">
select * from getData where collection_object_id > 0
</cfquery>
<cfquery name="SpecRes#left(session.sessionKey,10)#" dbtype="query" cachedwithin="#createtimespan(0,0,120,0)#">
select * from getData where collection_object_id > 0
</cfquery>
<cfquery name="uCollObj" dbtype="query">
select distinct(collection_object_id) as collection_object_id from getData
where collection_object_id > 0
</cfquery>
<cfset collObjIdList = valuelist(uCollObj.collection_object_id)>
<cfset newQuery=0>
<cfset newSearch = 1><!---- assign a variable that says we've destroyed the cached query
and should destroy the cache of it used to navigate pages ---->
</cfif><!---- end newquery ---->
<cfif not isdefined("order_by") or len(#order_by#) is 0>
<cfset order_by = "cat_num">
</cfif>
<cfif not isdefined("order_order") or len(#order_order#) is 0>
<cfset order_order = "asc">
</cfif>
<cfif isdefined("newSearch") and #newSearch# is 1>
<cfquery name="SpecRes#left(session.sessionKey,10)#" dbtype="query" cachedwithin="#createtimespan(0,0,0,0)#">
select * from SpecRes#left(session.sessionKey,10)#
</cfquery>
<cfquery name="mapCount#left(session.sessionKey,10)#" dbtype="query" cachedwithin="#createtimespan(0,0,0,0)#">
select * from SpecRes#left(session.sessionKey,10)#
</cfquery>
</cfif>
<cfquery name="SpecRes#left(session.sessionKey,10)#" dbtype="query" cachedwithin="#createtimespan(0,0,120,0)#">
select * from SpecRes#left(session.sessionKey,10)#
</cfquery>
<cfquery name="getBasic" dbtype="query">
select * from SpecRes#left(session.sessionKey,10)# order by #order_by# #order_order#
</cfquery>
<!---
<cfif #getBasic.recordcount# is 1 and #action# is "nothing">
<cflocation url="SpecimenDetail.cfm?collection_object_id=#getBasic.collection_object_id#">
</cfif>
--->
<cfquery name="mappable" dbtype="query">
select count(distinct(collection_object_id)) as cnt from getBasic where dec_long is not null and
dec_lat is not null
<!---
and
encumbrance_action <> 'mask coordinates'
--->
</cfquery>
<cfset mapCount = #mappable.cnt#>
<!---- error reporting ---->
<cfquery name="collectionObjectIds" dbtype="query">
select distinct(collection_object_id) from getBasic
</cfquery>
<cfif #getBasic.recordcount# lt 1000>
<cfquery name="collectionObjectIds" dbtype="query">
select distinct(collection_object_id) from getBasic
</cfquery>
<cfset collectionObjectIdList = "">
<cfloop query="collectionObjectIds">
<cfif len(#collectionObjectIdList#) is 0>
<cfset collectionObjectIdList = #collection_object_id#>
<cfelse>
<cfset collectionObjectIdList = "#collectionObjectIdList#,#collection_object_id#">
</cfif>
</cfloop>
<cfoutput>
<div id="suggestOtherForm"></div>
<script>
document.getElementById('suggestOtherForm').innerHTML='We recommend <a href="/SpecimenResults.cfm?mapurl=#mapurl#">SpecimenResults</a> for JavaScript-capable browsers.';
</script>
<span style="float:right; clear:left;">
<span class="infoLink" onclick="document.location='/info/reportBadData.cfm?collection_object_id=#collectionObjectIdList#';">
Report Bad Data
</span>
</span>
</cfoutput>
</cfif>
<CFOUTPUT>
<!---- define values used to browse records ---->
<cfparam name="StartRow" default="1">
<CFSET ToRow = #StartRow# + (#DisplayRows# - 1)>
<CFIF ToRow GT collectionObjectIds.RecordCount>
<CFSET ToRow = collectionObjectIds.RecordCount>
</CFIF>
<cfif ToRow lt collectionObjectIds.recordcount AND ToRow lt displayRows>
<cfset ToRow = displayRows>
</cfif>
<cfif #StartRow# lt 0>
<cfset StartRow = 1>
</cfif>
<CFSET LastRecs = #collectionObjectIds.RecordCount# - DisplayRows + 1>
<CFSET Next = StartRow + DisplayRows>
<CFSET Previous = StartRow - DisplayRows>
<cfif #collectionObjectIds.RecordCount# - #toRow# lt #DisplayRows#>
<cfset nextRows = #collectionObjectIds.RecordCount# - #torow#>
<cfelse>
<cfset nextRows = #DisplayRows#>
</cfif>
<form name="map" method="post" action="/bnhmMaps/bnhmMapData.cfm?#mapurl#" target="_blank">
<H4>List of specimens #StartRow# through #ToRow# of the #collectionObjectIds.RecordCount# records that matched your criteria.
<br>Click on catalog numbers for individual details.
<cfset bnhmUrl="/bnhmMaps/bnhmMapData.cfm?#mapurl#">
<br>Map #mapCount# of these #collectionObjectIds.RecordCount# records using
<input type="submit" value="BerkeleyMapper" class="lnkBtn"
onmouseover="this.className='lnkBtn btnhov'" onmouseout="this.className='lnkBtn'">
<span class="infoLink" onclick="getDocs('maps');">
What's this?
</span>
</td>
</H4>
</form>
<script>
function cForm(){
mywin=windowOpener('','myWin','height=300,width=400,resizable,location,menubar ,scrollbars ,status ,titlebar,toolbar');
document.getElementById('saveme').submit();
}
</script>
<cfif isdefined("returnURL")>
<form name="saveme" id="saveme" method="post" action="saveSearch.cfm" target="myWin">
<input type="hidden" name="returnURL" value="#Application.ServerRootUrl#/SpecimenResultsHTML.cfm?#mapURL#&detail_level=#detail_level#" />
<input type="button" value="Save This Search" onclick="cForm();" class="savBtn"
onmouseover="this.className='savBtn btnhov'" onmouseout="this.className='savBtn'">
</form>
</cfif>
<cfif #Action# is "dispCollObj">
<br><a href="Loan.cfm?transaction_id=#transaction_id#&Action=editLoan">Back to Loan</a>
</cfif>
<form name="browse" action="SpecimenResultsHTML.cfm" method="post">
#searchparams#
<input type="hidden" name="searchParams" value='#searchParams#'>
<input name="mapurl" type="hidden" value="#mapurl#">
<input name="StartRow" type="hidden" value="1">
<input type="hidden" name="Action" value="#Action#">
<input name="NewQuery" type="hidden" value="0">
<input name="NewSearch" type="hidden" value="0">
<input type="hidden" name="detail_level" value="#detail_level#">
<input type="hidden" name="collobjidlist" value="#collobjidlist#">
<input type="hidden" name="order_by" value="#order_by#">
<input type="hidden" name="order_order" value="#order_order#">
<input type="hidden" name="displayRows" value="#session.displayRows#">
</form>
<!---- browse buttons ---->
<table cellpadding="10">
<tr>
<CFIF startrow GT 1>
<td width="20">
<span class="infoLink" onclick="document.browse.StartRow.value='1';
document.browse.submit();">First Page</span>
</td>
<td width="20">
<span class="infoLink" onclick="document.browse.StartRow.value='#previous#';
document.browse.submit();">Previous Page</span>
</td>
</CFIF>
<CFIF Next LTE getBasic.RecordCount>
<td width="20">
<span class="infoLink" onclick="document.browse.StartRow.value='#Next#';
document.browse.submit();">Next Page</span>
</td>
<td width="20">
<span class="infoLink" onclick="document.browse.StartRow.value='#LastRecs#';
document.browse.submit();">Last Page</span>
</td>
</CFIF>
<CFIF displayrows LT getBasic.RecordCount + 1>
<td>
<span class="infoLink" onclick="document.browse.StartRow.value='1';
document.browse.displayRows.value='#getBasic.RecordCount#';
document.browse.submit();">View All</span>
</td>
</CFIF>
<CFIF displayrows is getBasic.RecordCount>
<td>
<span class="infoLink" onclick="document.browse.StartRow.value='1';
document.browse.displayRows.value='#session.displayRows#';
document.browse.submit();">View Pages</span>
</td>
</CFIF>
</tr>
</table>
<!---- end browse buttons ---------------------->
<table width="95%" border="1">
<tr>
<form name="reorder" action="SpecimenResultsHTML.cfm" method="post">
#searchParams#
<input type="hidden" name="searchParams" value='#searchParams#'>
<input name="mapurl" type="hidden" value="#mapurl#">
<input name="StartRow" type="hidden" value="1">
<input type="hidden" name="Action" value="#Action#">
<input name="NewQuery" type="hidden" value="0">
<input type="hidden" name="detail_level" value="#detail_level#">
<input name="NewSearch" type="hidden" value="0">
<input type="hidden" name="order_by" value="#order_by#">
<input type="hidden" name="order_order" value="#order_order#">
<input type="hidden" name="collobjidlist" value="#collobjidlist#">
<cfquery name="ctAtt" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select distinct(attribute_type) from ctAttribute_type order by attribute_type
</cfquery>
<cfset attList = "">
<cfloop query="ctAtt">
<cfif len(#attList#) is 0>
<cfset attList = "#ctAtt.attribute_type#">
<cfelse>
<cfset attList = "#attList#,#ctAtt.attribute_type#">
</cfif>
</cfloop>
<cfquery name="ctOID" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select distinct(other_id_type) from ctcoll_other_id_type order by other_id_type
</cfquery>
<cfset OIDlist = "">
<cfloop query="ctOID">
<cfif len(#OIDlist#) is 0>
<cfset OIDlist = "#ctOID.other_id_type#">
<cfelse>
<cfset OIDlist = "#OIDlist#,#ctOID.other_id_type#">
</cfif>
</cfloop>
<!---- always on --->
<cfif #detail_level# gte 1>
<cfif #session.killrow# is 1>
<td nowrap>
<form name="UpSubRem" method="post" action="SpecimenResultsHTML.cfm">
<img src="/images/delete.gif" border="0" width="24" onClick="reloadThis.submit();">
</form>
</td>
</cfif>
<cfif isdefined("session.loan_request_coll_id") and #session.loan_request_coll_id# gt 0>
<cfquery name="active_loan_id" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select USER_LOAN_ID from
cf_user_loan,cf_users where
cf_user_loan.user_id=cf_users.user_id and
IS_ACTIVE=1
and username='#session.username#'
</cfquery>
<cfif len(#active_loan_id.USER_LOAN_ID#) is 0>
<cfset thisLoanId = "-1">
<cfelse>
<cfset thisLoanId = #active_loan_id.USER_LOAN_ID#>
</cfif>
<td><b>Request</b></td>
</cfif>
<td nowrap><strong>Catalog ##</strong>
<cfif
(isdefined("session.username") AND #detail_level# gte 2)
and (
#session.username# is "cindy"
OR #session.username# is "dusty"
OR #session.username# is "ahope"
OR #session.username# is "jmalaney"
OR #session.username# is "rsampson"
OR #session.username# is "cmcclarin"
)
>
<a href="##"
onClick="reorder.order_by.value='scientific_name,country,state_prov,county,cat_num';reorder.order_order.value='asc';reorder.submit();"
>
Cindy Sort</a>
</cfif>
<a href="##"
onClick="reorder.order_by.value='cat_num';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';catup.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';catup.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="catup"></a>
<a href="##"
onClick="reorder.order_by.value='cat_num';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';catdn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';catdn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="catdn"></a>
</td>
<cfif len(#session.CustomOtherIdentifier#) gt 0>
<td nowrap>
<strong>#session.CustomOtherIdentifier#</strong>
<cfset thisTerm = "CustomID">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="##"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="##"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
<cfset thisTerm = "CustomIDInt">
<cfset thisName = #replace(thisTerm,",","_","all")#>
(
<a href="##"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="##"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
)
</td>
</cfif>
<td nowrap><strong>Identified As</strong>
<a href="##"
onClick="reorder.order_by.value='scientific_name';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';sciup.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';sciup.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="sciup"></a>
<a href="##"
onClick="reorder.order_by.value='scientific_name';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';scidn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';scidn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="scidn"></a>
</td>
</cfif>
<cfif #detail_level# gte 3>
<td nowrap><strong>Scientific Name</strong></td>
<td nowrap><strong>Identified By</strong></td>
</cfif>
<cfif #detail_level# gte 4>
<td nowrap><strong>Order</strong></td>
<td nowrap><strong>Family</strong></td>
</cfif>
<cfif #detail_level# gte 2>
<td nowrap>
<strong>Other Identifiers</strong>
<cfset thisTerm = "OTHERCATALOGNUMBERS">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="##"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="##"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
</td>
<td nowrap>
<strong>Accession</strong>
<cfset thisTerm = "accession">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
</td>
<td nowrap>
<strong>Collectors</strong>
<cfset thisTerm = "collectors">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
</td>
<td nowrap>
<strong>Latitude</strong>
<cfset thisTerm = "verbatimlatitude">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
</td>
<td nowrap>
<strong>Longitude</strong>
<cfset thisTerm = "verbatimlongitude">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
</td>
</cfif>
<cfif #detail_level# gte 4>
<td nowrap>
<strong>Decimal Latitude</strong>
<cfset thisTerm = "dec_lat">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
</td>
<td nowrap>
<strong>Decimal Longitude</strong>
<cfset thisTerm = "dec_long">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
</td>
<td nowrap>
<cfset thisTerm = "COORDINATEUNCERTAINTYINMETERS">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
<strong>Max Error</strong>
</td>
<td nowrap>
<strong>Datum</strong>
</td>
<td nowrap>
<strong>Original Units</strong>
</td>
<td nowrap>
<strong>Georeferenced By</strong>
</td>
<td nowrap>
<strong>Reference</strong>
</td>
<td nowrap>
<strong>Lat/Long Remarks</strong>
</td>
</cfif>
<cfif #detail_level# gte 4>
<td nowrap><strong>Continent</strong></td>
</cfif>
<cfif #detail_level# gte 1>
<td nowrap><strong>Country</strong>
<a href="##"
onClick="reorder.order_by.value='country';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';cntup.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';cntup.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="cntup"></a>
<a href="##"
onClick="reorder.order_by.value='country';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';cntdn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';cntdn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="cntdn"> </a>
</td>
<td nowrap><strong>State</strong>
<a href="##"
onClick="reorder.order_by.value='state_prov';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';stup.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';stup.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="stup"></a>
<a href="##"
onClick="reorder.order_by.value='state_prov';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';stdn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';stdn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="stdn"> </a>
</td>
</cfif>
<cfif #detail_level# gte 4>
<td nowrap><strong>Sea</strong></td>
</cfif>
<cfif #detail_level# gte 2>
<td nowrap><strong>Map Name</strong>
<a href="javascript: void"
onClick="reorder.order_by.value='quad';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="qdup.src='/images/up_mo.gif';return true;"
onmouseout="qdup.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="qdup"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='quad';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';qddn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';qddn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="qddn"></a> </td>
<td nowrap>
<strong>Feature</strong>
</td>
<td nowrap><strong>County</strong>
<a href="javascript: void"
onClick="reorder.order_by.value='county';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';cotup.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';cotup.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="cotup"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='county';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';cotdn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';cotdn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="cotdn"></a>
</td>
<td nowrap><strong>Island Group</strong></td>
<td nowrap><strong>Island</strong></td>
<td nowrap><strong>Associated Species</strong></td>
<td nowrap><strong>Microhabitat</strong></td>
<td nowrap><strong>Elevation in Meters</strong></td>
</cfif>
<cfif #detail_level# gte 1>
<td nowrap>
<strong>Specific Locality</strong>
<a href="javascript: void"
onClick="reorder.order_by.value='spec_locality';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';cotup.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';cotup.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="cotup"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='spec_locality';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';cotdn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';cotdn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="cotdn"></a>
</td>
<td nowrap>
<strong>Verbatim Date</strong>
<cfset thisTerm = "verbatim_date">
<cfset thisName = #replace(thisTerm,",","_","all")#>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='asc';reorder.submit();"
onMouseOver="self.status='Sort Ascending.';#thisName#up.src='/images/up_mo.gif';return true;"
onmouseout="self.status='';#thisName#up.src='/images/up.gif';return true;">
<img src="/images/up.gif" border="0" name="#thisName#up"></a>
<a href="javascript: void"
onClick="reorder.order_by.value='#thisTerm#';reorder.order_order.value='desc';reorder.submit();"
onMouseOver="self.status='Sort Descending.';#thisName#dn.src='/images/down_mo.gif';return true;"
onmouseout="self.status='';#thisName#dn.src='/images/down.gif';return true;">
<img src="/images/down.gif" border="0" name="#thisName#dn"></a>
</td>
</cfif>
<cfif #detail_level# gte 3>
<td nowrap>
<strong>
Coll Date
</strong>
</td>
</cfif>
<cfif #detail_level# gte 1>
<td nowrap>
<strong>Parts</strong>
</td>
<td nowrap>
<strong>Sex</strong>
</td>
</cfif>
<cfif #detail_level# gte 3>
<cfloop list="#attList#" index="val">
<cfif #val# is not "sex">
<td nowrap>
<b>#val#</b>
</td>
</cfif>
</cfloop>
</cfif>
<cfif #detail_level# gte 2>
<td nowrap>
<strong>Specimen Remarks</strong>
</td>
<td nowrap>
<strong>Specimen Disposition</strong>
</td>
</cfif>
</cfoutput>
</form>
<cfif #Action# is "dispCollObj">
<td><strong>Pick Parts</strong></td>
<td><strong>Encumbrances</strong></td>
</cfif>
</tr>
<cfset i=1>
<cfquery name="colls" dbtype="query">
select distinct(collection_cde) from getBasic
</cfquery>
<cfset coll="">
<cfloop query="colls">
<cfif len(#coll#) is 0>
<cfset coll = "#colls.collection_cde#">
<cfelse>
<cfset coll = "#coll#; #colls.collection_cde#">
</cfif>
</cfloop>
<cfset orderedCollObjIdList = "">
<cfif #getBasic.RecordCount# lt 200>
<cfloop query="getBasic">
<cfset orderedCollObjIdList="#orderedCollObjIdList#,#collection_object_id#">
</cfloop>
</cfif>
<cfoutput query="getBasic" StartRow="#StartRow#" MaxRows="#DisplayRows#" group="collection_object_id">
<tr #iif(i MOD 2,DE("class='evenRow'"),DE("class='oddRow'"))# >
<cfif #session.killrow# is 1>
<td>
<form name="remove#i#" action="SpecimenResultsHTML.cfm" method="post">
<input type="checkbox" name="exclCollObjId" value="#collection_object_id#" onchange="checkUncheck('remove#i#','#collection_object_id#');">
</form>
</td>
</cfif>
<cfif isdefined("session.loan_request_coll_id") and #session.loan_request_coll_id# gt 0>
<td>
<cfif listfind(#session.loan_request_coll_id#,#collection_id#,",")>
<!--- see if they've already got a part --->
<cfquery name="isThere" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select cf_loan_item.collection_object_id from
cf_loan_item,specimen_part
where cf_loan_item.collection_object_id=specimen_part.collection_object_id
and specimen_part.derived_from_cat_item=#collection_object_id#
and cf_loan_item.user_loan_id = #thisLoanId#
</cfquery>
<a href="javascript:void(0);" onClick="addLoanItem(#collection_object_id#)"><img src="/images/cart.gif" border="0"></a>
<span id="shopcart#collection_object_id#">
<cfif len(#isThere.collection_object_id#) gt 0>
<img src="/images/check.gif" border="0">
</cfif>
</span>
<cfelse>
<img src="/images/del.gif" border="0">
</cfif>
</td>
</cfif>
<td nowrap>
<a href="SpecimenDetail.cfm?collection_object_id=#collection_object_id#&orderedCollObjIdList=#orderedCollObjIdList#">
<div class="linkButton"
onmouseover="this.className='linkButton btnhov'"
onmouseout="this.className='linkButton'"
>
#institution_acronym# #collection_cde# #cat_num#
</div></a>
</td>
<cfif len(#session.CustomOtherIdentifier#) gt 0>
<td>
#CustomID#
</td>
</cfif>
<td nowrap>
<i>#replace(Scientific_Name," or ","</i> or <i>")#</i>
</td>
<cfif #detail_level# gte 3>
<td nowrap>#sci_name_with_auth#</td>
<td nowrap>#identified_by#</td>
</cfif>
<cfif #detail_level# gte 4>
<td>#phylorder#</td>
<td>#family#</td>
</cfif>
<cfif #detail_level# gte 2>
<td nowrap>
<cfset oid = #replace(OTHERCATALOGNUMBERS,";","<br>","all")#>
<cfset oid = #replace(oid," "," ","all")#>
<cfset oid = #replace(oid,"<br> ","<br>","all")#>
#oid#
</td>
<td nowrap>
#Accession#
</td>
<td nowrap>
<cfset c = #replace(Collectors,",","<br>","all")#>
<cfset c = #replace(c," "," ","all")#>