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">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$("#province").html("<option value='0' selected = true style='display: none;'></option>");
|
|
|
|
|
2014-05-09 17:08:42 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
2014-04-30 20:26:15 +08:00
|
|
|
$.ajax({
|
|
|
|
type :"POST",
|
|
|
|
url :'/school/get_province',
|
2014-05-09 17:08:42 +08:00
|
|
|
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">
|
|
|
|
function get_school(value){
|
|
|
|
$.ajax({
|
|
|
|
type :"POST",
|
|
|
|
url :'/school/get_schoollist/'+encodeURIComponent(value),
|
|
|
|
data :'text',
|
|
|
|
success: function(data){
|
|
|
|
$("#schoollist").html(data);
|
|
|
|
|
|
|
|
//$("#schoollist").html(data);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
function test(id){
|
2014-07-04 11:51:26 +08:00
|
|
|
location.href = encodeURI('http://course.trustie.net/?school_id='+id);
|
2014-04-23 21:20:03 +08:00
|
|
|
}
|
2014-07-03 18:11:10 +08:00
|
|
|
|
2014-04-23 21:20:03 +08:00
|
|
|
</script>
|
2014-04-24 08:58:24 +08:00
|
|
|
<script type="text/javascript">
|
|
|
|
function ssearch(){
|
|
|
|
//alert($("#key_word").val());
|
|
|
|
value = $("#key_word").val();
|
|
|
|
province = $("#province").val();
|
|
|
|
//alert(province);
|
|
|
|
$.ajax({
|
|
|
|
type :"POST",
|
|
|
|
url :'/school/search_school/?key_word='+encodeURIComponent(value)+'&province='+province,
|
|
|
|
data :'text',
|
|
|
|
success: function(data){
|
|
|
|
$("#schoollist").html(data);
|
|
|
|
|
|
|
|
//$("#schoollist").html(data);
|
|
|
|
}
|
|
|
|
})
|
2014-04-23 21:20:03 +08:00
|
|
|
|
2014-04-24 08:58:24 +08:00
|
|
|
}
|
|
|
|
</script>
|
2014-04-23 21:20:03 +08:00
|
|
|
|
|
|
|
<div>
|
|
|
|
<p>
|
2014-07-03 17:25:51 +08:00
|
|
|
|
2014-07-03 18:11:10 +08:00
|
|
|
<%= link_to "全部学校",school_index_path %>
|
2014-07-11 13:41:05 +08:00
|
|
|
<% if User.current.logged? %>
|
|
|
|
<a href="http://course.trustie.net">我的学校</a>
|
|
|
|
<% end %>
|
2014-04-23 21:20:03 +08:00
|
|
|
</p>
|
2014-04-24 08:58:24 +08:00
|
|
|
<ul>
|
2014-04-30 20:26:15 +08:00
|
|
|
<li style="width: 40%; float: left">请选择省份:
|
|
|
|
<select id="province" name="province" onchange="get_school(this.value)"></select>
|
|
|
|
</li>
|
2014-04-24 08:58:24 +08:00
|
|
|
<li style="width: 50%; float: left"><input type="text" id="key_word" name="key_word" />
|
|
|
|
<input type="button" class="enterprise" value="搜索" 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-04-23 21:20:03 +08:00
|
|
|
<div>
|
|
|
|
<ul id="schoollist" style="line-height: 25px">
|
2014-07-03 18:11:10 +08:00
|
|
|
|
2014-04-23 21:20:03 +08:00
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|