|
588 | 588 | </tr>
|
589 | 589 | <tr>
|
590 | 590 | <td>
|
591 |
| - <label for="ent_Date">Entry Date</label> |
592 |
| - <input type="text" name="b_ent_date" id="b_ent_date">-<input type="text" name="e_ent_date" id="e_ent_date"> |
| 591 | + <table cellspacing='0' cellpadding='0'> |
| 592 | + <td> |
| 593 | + <label for="b_ent_date">Entry Date:</label> |
| 594 | + <input type="text" name="b_ent_date" id="b_ent_date"> |
| 595 | + </td> |
| 596 | + <td> |
| 597 | + <label for="e_ent_date">Until: (leave blank otherwise)</label> |
| 598 | + <input type='text' name='e_ent_date' id='e_ent_date'> |
| 599 | + </td> |
| 600 | + </table> |
593 | 601 | </td>
|
594 | 602 | <td colspan=2 nowrap>
|
595 | 603 | <table cellspacing='0' cellpadding='0'>
|
|
821 | 829 | <cfquery name="getAccns" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
|
822 | 830 | #preservesinglequotes(thisSQL)#
|
823 | 831 | </cfquery>
|
| 832 | + <cfif not isdefined("csv")> |
| 833 | + <cfset csv=false> |
| 834 | + </cfif> |
824 | 835 | <cfif getAccns.recordcount is 0>
|
825 | 836 | Nothing matched your search criteria.
|
826 | 837 | <cfabort>
|
|
836 | 847 | View #specs.c# items in these #c.c# Accessions
|
837 | 848 | </a>
|
838 | 849 | </cfif>
|
| 850 | + <cfset rURL="editAccn.cfm?csv=true"> |
| 851 | + <cfloop list="#StructKeyList(form)#" index="key"> |
| 852 | + <cfif len(form[key]) gt 0> |
| 853 | + <cfset rURL='#rURL#&#key#=#form[key]#'> |
| 854 | + </cfif> |
| 855 | + </cfloop> |
| 856 | + <br><a href="#rURL#">[ download CSV ]</a> |
| 857 | + </cfif> |
| 858 | + <cfif csv is true> |
| 859 | + <cfset dlFile = "ArctosAccnSearchData.csv"> |
| 860 | + <cfset variables.fileName="#Application.webDirectory#/download/#dlFile#"> |
| 861 | + <cfset variables.encoding="UTF-8"> |
| 862 | + <cfscript> |
| 863 | + variables.joFileWriter = createObject('Component', '/component.FileWriter').init(variables.fileName, variables.encoding, 32768); |
| 864 | + d='accn_number,accn_status,received_from,received_date,nature_of_material,remarks,estimated_count,entered_by'; |
| 865 | + variables.joFileWriter.writeLine(d); |
| 866 | + </cfscript> |
839 | 867 | </cfif>
|
840 |
| - |
841 | 868 | <cfset i=1>
|
842 |
| - <cfif #project_id# gt 0> |
| 869 | + <cfif project_id gt 0> |
843 | 870 | <cfquery name="sfproj" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
|
844 | 871 | select project_name from project where project_id=#project_id#
|
845 | 872 | </cfquery>
|
|
883 | 910 | </CFIF>
|
884 | 911 | </div>
|
885 | 912 | </div>
|
886 |
| - <cfset i=#i#+1> |
| 913 | + <cfif csv is true> |
| 914 | + <cfset d='"#escapeDoubleQuotes(collection)# #escapeDoubleQuotes(accn_number)#"'> |
| 915 | + <cfset d=d &',"#c.c#","#escapeDoubleQuotes(recFromAgent)#"'> |
| 916 | + <cfset d=d &',"#c.c#","#escapeDoubleQuotes(accn_status)#"'> |
| 917 | + <cfset d=d &',"#DateFormat(received_date, "yyyy-mm-dd")#"'> |
| 918 | + <cfset d=d &',"#escapeDoubleQuotes(nature_of_material)#"'> |
| 919 | + <cfset d=d &',"#escapeDoubleQuotes(trans_remarks)#"'> |
| 920 | + <cfset d=d &',"#escapeDoubleQuotes(estimated_count)#"'> |
| 921 | + <cfset d=d &',"#escapeDoubleQuotes(entAgent)#"'> |
| 922 | + <cfscript> |
| 923 | + variables.joFileWriter.writeLine(d); |
| 924 | + </cfscript> |
| 925 | + </cfif> |
| 926 | + <cfset i=i+1> |
887 | 927 | </cfoutput>
|
| 928 | + |
| 929 | + |
| 930 | + |
| 931 | + <cfif csv is true> |
| 932 | + <cfscript> |
| 933 | + variables.joFileWriter.close(); |
| 934 | + </cfscript> |
| 935 | + <cfoutput> |
| 936 | + <cflocation url="/download.cfm?file=#dlFile#" addtoken="false"> |
| 937 | + </cfoutput> |
| 938 | + </cfif> |
| 939 | + |
| 940 | + |
| 941 | + |
888 | 942 | </cfif>
|
889 | 943 | <!------------------------------------------------------------------------------------------->
|
890 | 944 | <cfif #action# is "delePermit">
|
|
0 commit comments