socialforge/app/views/school/index.html.erb

65 lines
1.6 KiB
Plaintext
Raw Normal View History

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-04-25 09:29:18 +08:00
location.href = encodeURI('http://course.trustie.net&school_id=')+id;
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-04-25 09:29:18 +08:00
<a href="http://course.trustie.net&school_id=0">全部学校</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href="http://course.trustie.net">我的学校</a>
2014-04-23 21:20:03 +08:00
</p>
2014-04-24 08:58:24 +08:00
<ul>
<li style="width: 40%; float: left">请选择省份:<%= select_tag "province",
options_from_collection_for_select(School.find_by_sql("select distinct province from schools"), :province, :province),
:onclick => "get_school(this.value)" %></li>
<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>
<div>
<ul id="schoollist" style="line-height: 25px">
</ul>
</div>