<%form_for (@checkin) do|f|%>
<%=f.hidden_field :event_id, :value =>@event.id%>
<%=f.hidden_field :student_class_id, :value =>@student_class.id%>
<%=f.hidden_field :course_id, :value =>@course.id%>
<table style="border:solid 1px;border-color:#FFE66F">
<tr class="even"><td><b>学生名称</b></td><td><b>迟到</b></td><td><b>早退</b></td><td><b>旷课</b></td><td><b>跨班上</b></td></tr>
<%if @team&&@team!=""%>
<!--<%=f.hidden_field :team_id, :value => @team.id%>-->
<%for team in @teams%>
<%if team.stu_reg_infs.size>0%>
<%sameevent=Event.find(:last,:conditions=>"team_id=#{team.id} and course_order=#{@event.course_order}")%>
<tr class="even"><td colspan="1"><font color="#FF0000"><%=team.name%></font></td><td colspan="4"><font color="#FF0000"><%=sameevent.starttime.strftime("%Y年%m月%d日%H时")%></font></td></tr>
<%end%>
<%for stu_reg_inf in team.stu_reg_infs%>
<tr class="even"><td><%=stu_reg_inf.name%></td><td><div><div style="float:left;"><input id="checkin_late_stu_reg_inf_<%=stu_reg_inf.id%>_" name="checkin[late_stu_reg_inf_<%=stu_reg_inf.id%>][]" type="checkbox" value="<%=stu_reg_inf.id%>" onclick="buttonDisable('<%=stu_reg_inf.id%>')"/>迟到</div><div id="latediv<%=stu_reg_inf.id%>" name="latediv<%=stu_reg_inf.id%>" style="display:none;"><input name="late<%=stu_reg_inf.id%>" type="text" class="late" id="late<%=stu_reg_inf.id%>" style="width:20px;"/>分钟</div></div></td>
<td><div><div style="float:left;"><input id="checkin_leaver_stu_reg_inf_<%=stu_reg_inf.id%>_" name="checkin[leaver_stu_reg_inf_<%=stu_reg_inf.id%>][]" type="checkbox" value="<%=stu_reg_inf.id%>" onclick="leaverbuttonDisable('<%=stu_reg_inf.id%>')"/>早退</div><div id="leaverdiv<%=stu_reg_inf.id%>" name="leaverdiv<%=stu_reg_inf.id%>" style="display:none;"><input name="leaver<%=stu_reg_inf.id%>" type="text" class="leaver" id="leaver<%=stu_reg_inf.id%>" style="width:20px;"/>分钟</div></div></td>
<td><div><div style="float:left;"><input id="checkin_truant_stu_reg_inf_<%=stu_reg_inf.id%>_" name="checkin[truant_stu_reg_inf_<%=stu_reg_inf.id%>][]" type="checkbox" value="<%=stu_reg_inf.id%>" onclick="truantbuttonDisable('<%=stu_reg_inf.id%>')"/>旷课</div><div id="truantdiv<%=stu_reg_inf.id%>" name="truantdiv<%=stu_reg_inf.id%>" style="display:none;"><input name="truant<%=stu_reg_inf.id%>" type="text" class="truant" id="truant<%=stu_reg_inf.id%>" style="width:20px;"/>记录</div></div></td>
<td><div><div style="float:left;"><input id="checkin_kuaban_stu_reg_inf_<%=stu_reg_inf.id%>_" name="checkin[kuaban_stu_reg_inf_<%=stu_reg_inf.id%>][]" type="checkbox" value="<%=stu_reg_inf.id%>" onclick="kuabanbuttonDisable('<%=stu_reg_inf.id%>')"/>跨班</div><div id="kuabandiv<%=stu_reg_inf.id%>" name="kuabandiv<%=stu_reg_inf.id%>" style="display:none;"><input name="kuaban<%=stu_reg_inf.id%>" type="text" class="kuaban" id="kuaban<%=stu_reg_inf.id%>" style="width:20px;"/>记录</div></div></td>
</tr>
<%end%>
<%end%>
courses_stu_reg_infs=CoursesStuRegInf.find(:all,:conditions=>"student_class_id=#{params[:checkin][:student_class_id]} and course_id=#{params[:checkin][:course_id]} and (situation='已选' or situation='通过' or situation='不过')")
stu_reg_infs=[]
for courses_stu_reg_inf in courses_stu_reg_infs
stu_reg_infs<<courses_stu_reg_inf.stu_reg_inf
end
for stu_reg_inf in stu_reg_infs
if params["checkin"]["late_stu_reg_inf_#{stu_reg_inf.id}"] || params["checkin"]["leaver_stu_reg_inf_#{stu_reg_inf.id}"] || params["checkin"]["truant_stu_reg_inf_#{stu_reg_inf.id}"]|| params["checkin"]["kuaban_stu_reg_inf_#{stu_reg_inf.id}"]
checkin = Checkin.new
checkin.stu_reg_inf_id=stu_reg_inf.id
checkin.event_id=params[:checkin][:event_id]
checkin.student_class_id=params[:checkin][:student_class_id]
checkin.course_id=params[:checkin][:course_id]
if params["checkin"]["late_stu_reg_inf_#{stu_reg_inf.id}"]
checkin.late="迟到"
checkin.latetime=params["late#{stu_reg_inf.id}"]
end
if params["checkin"]["leaver_stu_reg_inf_#{stu_reg_inf.id}"]
checkin.leaver="早退"
checkin.leavertime=params["leaver#{stu_reg_inf.id}"]
end
if params["checkin"]["truant_stu_reg_inf_#{stu_reg_inf.id}"]
checkin.truant="旷课"
checkin.truantrecord=params["truant#{stu_reg_inf.id}"]
end
if params["checkin"]["kuaban_stu_reg_inf_#{stu_reg_inf.id}"]
checkin.kuaban="跨班"
checkin.kuabanrecord=params["kuaban#{stu_reg_inf.id}"]
end
checkin.save
end
end
redirect_to :action =>"show",:id=>params[:checkin][:event_id]
分享到:
相关推荐
如下所示: form表单ID:postform 设置表单请求url document.postform.action = SaveReturnInfo...以上就是小编为大家带来的js 提交form表单和设置form表单请求路径的实现方法全部内容了,希望大家多多支持软件开发网~
C# post方式提交Form表单。 C# post方式提交Form表单,可以支持带参数传入,供大家学习参考。 C# post提交表单。
form多表单同时提交以及使用js支持下拉框可编辑(删除,修改、新增),并且实现特定聚集焦点等功能
今天小编就为大家分享一篇layui form表单提交之后重新加载数据表格的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧
本文实例讲述了JS提交form表单。分享给大家供大家参考,具体如下: 一、javascript 页面加裁时自动提交表单: Form表单: <form method="post" id="myform" action="a.php"> <input type="submit" value=...
使用jQuery.form插件,实现完美的表单异步提交
js实现form表单自动回显功能
在form表单提交中,使用button来间接完成submit的提交更为灵活。下面是实现方法: 使用button按钮实现submit提交,需要在button标签中的使用onclick方法,然后在JavaScript中实现具体,代码如下: <head> ...
php curl模仿form表单提交图片或文件 用的tp5做的例子
ajaxForm异步提交表单(含图片)ajaxForm异步提交表单(含图片)ajaxForm异步提交表单(含图片)
//增加的函数 begin function queryFun(){ var type = $("#artType").val(); var hasInputed = "1";//表示输入了要搜索 的信息 if($("#query").val()=="选手姓名/编号"){ //表示没有输入要搜索的值 ...
使用JQuery实现从JSON对象转换为form提交数据
在form表单上添加一个提交事件调用验证数据方法 <form name="listform" action="resume-doAdd" method="post" onsubmit="return Validator.Validate(this,3);"> 请输入正确的手机号!" requiremsg="移动电话不能为...
在接入Spring-Cloud-Gateway时,可能有需求进行缓存Json-Body数据或者Form-Urlencoded数据的情况。这篇文章主要介绍了SpringCloud Finchley Gateway 缓存请求Body和Form表单的实现,感兴趣的小伙伴们可以参考一下
Jquery中使用ajax,表单post提交数据 插入oracle数据库, html对应的文件中 将form 表单数据 转化为json 格式
Ajax如何无刷新提交form里面的内容。
layui使用form表单实现post请求,避免信息泄露(设置form表单隐藏,也可以初始化时隐藏): 这里是在数据表格查询数据时的按钮操作,其他操作类似 <table id=myTable class=layui-table lay-filter=myTableDetail></...
JAVA表单上传多个文件 java web form表单上传多个文件.zip
接收来自form表单提交的数据; 并在网页上显示出来