You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/views/trainings/enroll.html.erb

256 lines
9.6 KiB

<% if false %>
6 years ago
<div>
<p class="collegeInfo">湖南警察学院大数据培训缴费</p>
<%= form_for @training do |f| %>
<p class="subtitle">基本信息</p>
<li class="clearfix infoBar">
<span class="left_tag fl">姓名</span>
<input type="text" class="right_input" id="username" name="name"
placeholder="请输入真实姓名" value="<%= @training.name %>"/>
</li>
<li class="clearfix infoBar" id="userSex" NavShow>
<span class="left_tag fl">性别</span>
<label class="fr" id="sexl" style="margin-right: 24px;"><%= @training.sex == 1 ? '男' : '女' %></label>
<i class="iconfont icon-youjiantou rightArrow"></i>
<input type="hidden" id="sex" name="sex" value="<%= @training.sex == 1 ? 1 : 2 %>">
</li>
6 years ago
<li class="clearfix infoBar">
<span class="left_tag fl">专业</span>
<input type="text" class="right_input" id="userMajor" placeholder="请输入专业"
name="major"
value="<%= @training.major %>"/>
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">学号</span>
<input type="text" class="right_input" id="userID" placeholder="请输入学号"
name="student_id"
value="<%= @training.student_id %>"/>
</li>
6 years ago
<!--<li class="clearfix infoBar">
6 years ago
<span class="left_tag fl">单位</span>
<input type="text" class="right_input" id="userunit" placeholder="请输入单位名称或学校"
name="school"
value="<%#= @training.school %>"/>
</li>-->
6 years ago
<!--<li class="clearfix infoBar">
6 years ago
<span class="left_tag fl">职称</span>
<input type="text" class="right_input" id="usertitle" placeholder="请输入职称"
name="position"
value="<%#= @training.position %>"/>
</li>-->
6 years ago
<!--<p class="subtitle">通讯地址</p>
6 years ago
<li class="clearfix infoBar">
&lt;!&ndash; <div class="clearfix" id="userArea" NavShow>&ndash;&gt;
&lt;!&ndash; <span class="left_tag fl">地区</span>&ndash;&gt;
&lt;!&ndash; <input type="text" class="right_input" id="usertitle" placeholder="填写区域"/>&ndash;&gt;
&lt;!&ndash; <i class="iconfont icon-youjiantou rightArrow"></i>&ndash;&gt;
&lt;!&ndash; </div>&ndash;&gt;
<textarea class="DetailAddress" placeholder="详细地址" name="address"
id="DetailAdd"><%#= @training.address %></textarea>
</li>-->
6 years ago
<li class="clearfix infoBar">
<span class="left_tag fl">手机号码</span>
<input type="text" class="right_input" placeholder="请输入手机号" id="userphone"
name="phone"
value="<%= @training.phone %>"/>
</li>
<!--<li class="clearfix infoBar">
6 years ago
<span class="left_tag fl">Email</span>
<input type="text" class="right_input" placeholder="请输入Email" id="userEmail"
name="email"
value="<%#= @training.email %>"/>
</li>-->
6 years ago
<p style="height: 50px;"></p>
<a href="javascript:void(0)" class="EnrollNext" onclick="NextStep();">下一步</a>
<% end %>
</div>
6 years ago
6 years ago
<div class="sexDownNav downNav">
<li>男</li>
<li>女</li>
</div>
<script>
$(function () {
var down = $('#userSex');
var downNav = $(".sexDownNav");
showNav(down, downNav, "down");
6 years ago
$(".sexDownNav li").on("click", function () {
$(down).find("#sexl").html($(this).html());
hideNav(downNav);
6 years ago
if ($(this).html() == '男') {
$('#sex').val("1");
} else {
$('#sex').val("2");
}
})
})
6 years ago
//下一步
function NextStep() {
var username = $("#username").val();
var userMajor = $("#userMajor").val();
var userphone = $("#userphone").val();
var userID = $("#userID").val();
6 years ago
if (username == '') {
alert("请输入真实姓名");
return;
}
if (userMajor == '') {
alert("请输入专业");
return;
}
6 years ago
if (userID == '') {
alert("请输入学号");
return;
}
6 years ago
if (userphone == '') {
alert("请输入手机号码");
return;
} else if (!/^1\d{10}$/.test(userphone) && !/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userphone)) {
alert("请输入正确的手机号码");
return;
}
6 years ago
$('form').submit();
6 years ago
}
6 years ago
</script>
<% end %>
<div>
<p class="collegeInfo"><%= @training_type == 3 ? '信息技术新工科产学研联盟师资培训班' : '工程教育认证' %></p>
6 years ago
<%= form_for @training do |f| %>
<%= hidden_field_tag(:friendly_id, @friendly_id) %>
6 years ago
<p class="subtitle">基本信息</p>
<li class="clearfix infoBar">
<span class="left_tag fl">姓名</span>
<input type="text" class="right_input" id="username" name="name"
placeholder="请输入真实姓名" value="<%= @training.name %>"/>
</li>
<li class="clearfix infoBar" id="userSex" NavShow>
<span class="left_tag fl">性别</span>
<label class="fr" id="sexl" style="margin-right: 24px;"><%= @training.sex == 1 ? '男' : '女' %></label>
<i class="iconfont icon-youjiantou rightArrow"></i>
<input type="hidden" id="sex" name="sex" value="<%= @training.sex == 1 ? 1 : 2 %>">
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">单位</span>
<input type="text" class="right_input" id="userUnit" placeholder="请输入单位名称或者学校"
6 years ago
name="school"
value="<%= @training.school %>"/>
6 years ago
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">职称</span>
6 years ago
<input type="text" class="right_input" id="userPositional" placeholder="请输入职称"
name="position"
value="<%= @training.position %>"/>
6 years ago
</li>
<li class="clearfix infoBar">
<span class="left_tag fl">手机号码</span>
<input type="text" class="right_input" placeholder="请输入手机号" id="userphone"
name="phone"
value="<%= @training.phone %>"/>
</li>
<% if @training_type == 3 %>
<p class="subtitle">您关注的课程类型最少选1项</p>
<% %w(程序设计 操作系统 数据库 软件工程 云计算 大数据 人工智能 计算机网络 物联网 信息安全 其他).each_with_index do |name, index| %>
<li class="clearfix infoBar">
<span class="left_tag fl"><%= name %></span>
<span class="fr">
<input type="checkbox" name="research_field[]" value="<%= name %>" <%= @training.research_field_include?(name) ? "checked" : "" %> id="check_<%= index %>" class="magic-checkbox">
<label for="check_<%= index %>" style="top:8px">&nbsp;</label>
</span>
</li>
<% end %>
6 years ago
<% end %>
6 years ago
<!-- <p class="subtitle">通讯地址</p>-->
<!-- <li class="clearfix infoBar">-->
<!-- <div class="clearfix" id="userArea" NavShow>-->
<!-- <span class="left_tag fl">地区</span>-->
<!-- <input type="text" class="right_input" id="usertitle" placeholder="填写区域"/>-->
<!-- <i class="iconfont icon-youjiantou rightArrow"></i>-->
<!-- </div>-->
<!-- <textarea class="DetailAddress" placeholder="请输入详细地址" name="address" id="DetailAdd" style="margin-top: 15px;"><%#= @training.address %></textarea>-->
<!-- </li>-->
<!-- <li class="clearfix infoBar">-->
<!-- <span class="left_tag fl">Email</span>-->
<!-- <input type="text" class="right_input" placeholder="请输入Email" id="userEmail" name="email" value="<%#= @training.email %>"/>-->
<!-- </li>-->
6 years ago
<p style="height: 50px;"></p>
<a href="javascript:void(0)" class="EnrollNext" onclick="NextStep();"><%= @training.new_record? ? '我要报名' : '保存' %></a>
<% end %>
</div>
6 years ago
<div class="sexDownNav downNav">
<li>男</li>
<li>女</li>
</div>
<script>
$(function () {
var down = $('#userSex');
var downNav = $(".sexDownNav");
showNav(down, downNav, "down");
$(".sexDownNav li").on("click", function () {
$(down).find("#sexl").html($(this).html());
hideNav(downNav);
6 years ago
if ($(this).html() == '男') {
6 years ago
$('#sex').val("1");
6 years ago
} else {
6 years ago
$('#sex').val("2");
}
6 years ago
});
6 years ago
})
//下一步
function NextStep() {
var username = $("#username").val();
var userUnit = $("#userUnit").val();
var userPositional = $("#userPositional").val();
var userphone = $("#userphone").val();
6 years ago
if (username == '') {
alert("请输入姓名");
return;
}
if (userUnit == '') {
alert("请输入单位名称或者学校");
return;
}
6 years ago
if (userPositional == '') {
alert("请输入职称");
return;
}
if (userphone == '') {
alert("请输入手机号码");
return;
} else if (!/^1\d{10}$/.test(userphone) && !/^[a-zA-Z0-9]+([.\-_\\]*[a-zA-Z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(userphone)) {
alert("请输入正确的手机号码");
return;
}
6 years ago
<% if @training_type == 3 %>
if ($("input[type='checkbox'][name='research_field[]']:checked").length == 0) {
alert('请选择您关注的课程类型');
return;
}
<% end %>
6 years ago
$('form').submit();
}
</script>