-
Notifications
You must be signed in to change notification settings - Fork 15
/
Search.aspx
130 lines (126 loc) · 6.32 KB
/
Search.aspx
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
<%@ Page Language="VB" AutoEventWireup="false" MasterPageFile="~/Skins/Kartris/Template.master"
CodeFile="Search.aspx.vb" Inherits="Search" %>
<asp:Content ID="cntMain" ContentPlaceHolderID="cntMain" runat="Server">
<div class="search">
<h1>
<asp:Literal ID="litHeader" runat="server" Text="<%$ Resources: Search, PageTitle_ProductSearch %>"></asp:Literal>
</h1>
<ajaxToolkit:TabContainer ID="tabSearchContainer" runat="server" EnableTheming="false"
CssClass="tab">
<ajaxToolkit:TabPanel ID="tabSearch_Basic" runat="server" OnClientClick="SetToBasic">
<HeaderTemplate>
<asp:Literal ID="litTextTabSearch_Basic" runat="server" Text="<%$ Resources: Search, FormLabel_Search %>"></asp:Literal>
</HeaderTemplate>
<ContentTemplate>
<div class="inputform row">
<!-- BASIC SEARCH FORM -->
<div class="small-12 large-4 columns">
<input type="search" size="40" class="textbox" id="searchbox_basic" onkeypress="javascript:presssearchkey_basic(event);" />
</div>
<div class="small-12 large-8 columns">
<input id="searchbutton_basic" type="button" value='<asp:Literal ID="litContentText_Search_Basic" runat="server" Text="<%$ Resources: Kartris, ContentText_Search%>" />'
class="button" onclick="javascript: submitsearchbox_basic()" />
</div>
<br />
<div class="spacer">
</div>
</div>
<script type="text/javascript">
function submitsearchbox_basic() {
window.location.href = document.getElementById('baseTag').href + 'Search.aspx?strSearchText=' + document.getElementById('searchbox_basic').value.replace(/ /gi, "+") + '&strType=basic';
}
function presssearchkey_basic(e) {
if (typeof e == 'undefined' && window.event) { e = window.event; }
if (e.keyCode == 13) {
document.getElementById('searchbutton_basic').click();
}
}
</script>
</ContentTemplate>
</ajaxToolkit:TabPanel>
<ajaxToolkit:TabPanel ID="tabSearch_Advanced" runat="server" OnClientClick="SetToAdvanced">
<HeaderTemplate>
<asp:Literal ID="litTextTabSearch_Advanced" runat="server" Text="<%$ Resources: Search, FormLabel_AdvancedSearch %>"></asp:Literal>
</HeaderTemplate>
<ContentTemplate>
<div class="inputform row">
<!-- ADVANCED SEARCH FORM -->
<div class="small-12 large-4 columns">
<input type="search" size="40" class="textbox" id="searchbox_advanced" onkeypress="javascript:presssearchkey_advanced(event);" />
</div>
<div class="small-12 large-3 columns"><select id="searchmethod">
<option value="any"><asp:Literal runat="server" ID="litSearchOption1" Text='<%$ Resources: Search, ContentText_SearchMethodAny %>' /></option>
<option value="all"><asp:Literal runat="server" ID="litSearchOption2" Text='<%$ Resources: Search, ContentText_SearchMethodAll %>' /></option>
<option value="exact"><asp:Literal runat="server" ID="litSearchOption3" Text='<%$ Resources: Search, ContentText_SearchMethodExact %>' /></option>
</select></div>
<div class="small-12 large-5 columns">
<input id="searchbutton_advanced" type="button" value='<asp:Literal ID="litContentText_Search_Advanced" runat="server" Text="<%$ Resources: Kartris, ContentText_Search%>" />'
class="button" onclick="javascript:submitsearchbox_advanced()" />
</div>
<div class="spacer">
</div>
<div class="advanceline small-12 columns">
<asp:Label ID="litTextFrom" runat="server" Text="<%$ Resources: Search, FormLabel_PriceRangeFrom %>"></asp:Label>
<asp:Literal ID="litPriceSymbol" runat="server"></asp:Literal>
<input type="text" size="4" id="pricefrom" class="small" />
<asp:Label ID="litTextTo" runat="server" Text="<%$ Resources: Search, FormLabel_PriceRangeTo %>"></asp:Label>
<asp:Literal ID="litPriceSymbol2" runat="server"></asp:Literal>
<input type="text" size="4" id="priceto" class="small" />
</div>
</div>
<script type="text/javascript">
function submitsearchbox_advanced() {
window.location.href = document.getElementById('baseTag').href + 'Search.aspx?strSearchText=' + document.getElementById('searchbox_advanced').value.replace(/ /gi, "+") + '&numPriceFrom=' + document.getElementById('pricefrom').value + '&numPriceTo=' + document.getElementById('priceto').value + '&strSearchMethod=' + document.getElementById('searchmethod').value + '&strType=advanced';
}
function presssearchkey_advanced(e) {
if (typeof e == 'undefined' && window.event) { e = window.event; }
if (e.keyCode == 13) {
document.getElementById('searchbutton_advanced').click();
}
}
</script>
</ContentTemplate>
</ajaxToolkit:TabPanel>
</ajaxToolkit:TabContainer>
<asp:UpdatePanel ID="updSearchResultArea" runat="server" UpdateMode="Conditional" Visible="False">
<ContentTemplate>
<div class="results">
<asp:HyperLink ID="lnkNewSearch" runat="server" CssClass="link2 floatright" NavigateUrl="~/Search.aspx"
Text="<%$ Resources: Search, ContentText_NewSearch %>"></asp:HyperLink><h2>
<asp:Literal ID="litTextSearchResults" runat="server" Text="<%$ Resources: Search, PageTitle_SearchResults %>"></asp:Literal>
</h2>
<p id="searchsummary">
<asp:Literal ID="litSearchResult" runat="server"></asp:Literal></p>
<user:SearchResult ID="UC_SearchResult" runat="server" />
<user:ItemPager ID="UC_ItemPager_Footer" runat="server" Visible="False" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
<script type="text/javascript">
function SetToBasic() {
setTimeout("DoFocus()", 100);
}
function DoFocus() {
document.getElementById("searchbox_basic").focus();
}
function SetToAdvanced() {
setTimeout("DoFocus2()", 100);
}
function DoFocus2() {
document.getElementById("searchbox_advanced").focus();
}
</script>
<% 'Default to basic search %>
<asp:Panel ID="pnlClassic" runat="server">
<script type="text/javascript">
SetToBasic();
</script>
</asp:Panel>
<% 'Can show this one to default to advanced search %>
<asp:Panel ID="pnlAdvanced" runat="server" Visible="false">
<script type="text/javascript">
SetToAdvanced();
</script>
</asp:Panel>
</div>
</asp:Content>