2014-04-25 10:42:57 +08:00
|
|
|
<% port = ":3000" if Rails.env.development? %>
|
2014-04-30 20:26:15 +08:00
|
|
|
|
|
|
|
<script type="text/javascript">
|
2014-10-24 14:22:35 +08:00
|
|
|
$(document).ready(function() {
|
|
|
|
$("#province").html("<option value='0' selected = true style='display: none;'></option>");
|
|
|
|
$.ajax({
|
|
|
|
type :"POST",
|
|
|
|
url :'http://<%= Setting.host_course %>/school/get_province',
|
|
|
|
data: "send",
|
|
|
|
success: function(data, textStatus){
|
|
|
|
$("#province").append(data.text);
|
|
|
|
$("#schoollist").html(data.text_s);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
});
|
2014-04-30 20:26:15 +08:00
|
|
|
</script>
|
|
|
|
|
2014-04-23 21:20:03 +08:00
|
|
|
<script type="text/javascript">
|
2014-10-24 14:22:35 +08:00
|
|
|
function get_school(value){
|
|
|
|
$.ajax({
|
|
|
|
type :"POST",
|
|
|
|
url :'http://<%= Setting.host_course %>/school/get_schoollist/'+encodeURIComponent(value),
|
|
|
|
data :'text',
|
|
|
|
success: function(data){
|
|
|
|
$("#schoollist").html(data);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2014-04-23 21:20:03 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2014-10-24 14:22:35 +08:00
|
|
|
function test(id){
|
|
|
|
location.href = encodeURI('http://<%= Setting.host_course %>/?school_id='+id);
|
|
|
|
}
|
2014-04-23 21:20:03 +08:00
|
|
|
</script>
|
2014-04-24 08:58:24 +08:00
|
|
|
<script type="text/javascript">
|
2014-10-24 14:22:35 +08:00
|
|
|
function ssearch(){
|
|
|
|
//alert($("#key_word").val());
|
|
|
|
var value = $("#key_word").val();
|
|
|
|
var province = $("#province").val();
|
2014-07-14 15:45:38 +08:00
|
|
|
//alert(value);
|
|
|
|
if(value == "")
|
|
|
|
{
|
2014-09-12 11:34:03 +08:00
|
|
|
alert("<%= l(:label_search_conditions_not_null) %>");
|
2014-07-14 15:45:38 +08:00
|
|
|
return;
|
|
|
|
}
|
2014-10-24 14:22:35 +08:00
|
|
|
$.ajax({
|
|
|
|
type :"POST",
|
|
|
|
url :'http://<%= Setting.host_course %>/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+province,
|
|
|
|
data :'text',
|
|
|
|
success: function(data){
|
|
|
|
$("#schoollist").html(data);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
2014-08-01 15:46:05 +08:00
|
|
|
function word_keydown(e){
|
|
|
|
if(e&& e.keyCode==13){
|
|
|
|
ssearch();
|
|
|
|
}
|
|
|
|
}
|
2014-04-24 08:58:24 +08:00
|
|
|
</script>
|
2014-04-23 21:20:03 +08:00
|
|
|
|
|
|
|
<div>
|
2014-10-24 14:22:35 +08:00
|
|
|
<p>
|
|
|
|
<%= link_to l(:label_all_schol),school_index_path %>
|
|
|
|
<% if User.current.logged? %>
|
|
|
|
<a href="http://<%= Setting.host_course %>">
|
|
|
|
<%= l(:label_my_school) %>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
|
|
|
<ul>
|
|
|
|
<li style="width: 40%; float: left">
|
|
|
|
<%= l(:label_select_province) %>:
|
|
|
|
<select id="province" name="province" onchange="get_school(this.value)"></select>
|
|
|
|
</li>
|
|
|
|
<li style="width: 50%; float: left">
|
|
|
|
<input type="text" id="key_word" name="key_word" onkeydown="word_keydown(event);"/>
|
|
|
|
<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="ssearch()">
|
|
|
|
</li>
|
|
|
|
</ul>
|
2014-04-23 21:20:03 +08:00
|
|
|
</div>
|
2014-05-08 16:51:45 +08:00
|
|
|
<div style="clear: both"></div>
|
2014-10-23 17:05:36 +08:00
|
|
|
<div class="school-index">
|
2014-10-24 14:22:35 +08:00
|
|
|
<ul id="schoollist" style="line-height: 25px">
|
|
|
|
</ul>
|
2014-04-23 21:20:03 +08:00
|
|
|
</div>
|
2014-10-15 17:26:58 +08:00
|
|
|
<% html_title(l(:label_school_all)) -%>
|