2021年6月6日:
社团申请代码:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:include page="/index_head.jsp">
<jsp:param name="title" value="社团申请" />
<jsp:param name="needSwitch" value="true" />
<jsp:param name="needCropper" value="true" />
</jsp:include>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>
社团申请表<small style="color: red;">请认真填写此表,社长才能回应你的申请请求!</small>
</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<br>
<form action="${pageContext.request.contextPath}/club/apply"
method="post" id="demo-form2"
class="form-horizontal form-label-left">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">真实姓名<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" class="form-control col-md-7 col-xs-12"
required name="user_name" id="userno"></input> <input
type="hidden" name="club_name" value="${name}"> <input
type="hidden" name="clubusername" value="${username}">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12">性别</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="checkbox" id="chkSex" /> <input id="hidSex"
type="hidden" name="sex" value="男" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">学院<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" class="form-control col-md-7 col-xs-12"
required name="xueyuan"></input>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">班级<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" class="form-control col-md-7 col-xs-12"
required name="banji"></input>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">专业<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" class="form-control col-md-7 col-xs-12"
required name="zhuanye"></input>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">学号<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" class="form-control col-md-7 col-xs-12"
required name="stuid"></input>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">上传照片(请上传你的个人头像)<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12" id="imgdiv">
<button type="button" class="btn btn-success"
onclick="uploadLogo()" id="img">上传头像</button>
<input type="hidden" name="photo" id="imgData" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="true-name">申请的部门<span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select class="form-control" required id="empty" name="empty_name">
<option disabled selected style="display: none;"></option>
<c:forEach items="${emptys}" var="type">
<option value="${type.name}"
<c:if test="${type.renshu==type.peoplecount}">disabled</c:if>>${type.name}<c:if
test="${type.renshu==type.peoplecount}">(该部门人数已满,请选择其他部门)</c:if></option>
</c:forEach>
</select>
</div>
</div>
<div class="form-group" style="display: none;" id="reason">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="phone">申请缘由(可写个人简历或者本人的获奖经历)<span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<textarea rows="10" class="form-control col-md-7 col-xs-12 "
required name="content"></textarea>
</div>
</div>
<div class="form-group">
<label for="id-card"
class="control-label col-md-3 col-sm-3 col-xs-12">申请职位<span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select class="form-control" required name="job">
<option disabled selected style="display: none;"></option>
<option value="普通团员">普通团员</option>
<option value="部长" id="buzhang">部长</option>
</select>
</div>
</div>
<div class="form-group">
<div
class="col-md-6 col-sm-6 col-xs-12 col-sm-offset-3 col-md-offset-3">
<button type="submit" class="btn btn-primary" id="a">提交申请</button>
</div>
</div>
</form>
</div>
</div>
</div>
<jsp:include page="/index_foot.jsp">
<jsp:param name="needSwitch" value="true" />
<jsp:param name="needAlert" value="true" />
<jsp:param name="needCropper" value="true" />
</jsp:include>
<script type="text/javascript">
$("#empty").change(function(){
$.ajax({
url : "${pageContext.request.contextPath}/club/bumen",
data : "emptyname=" + $(this).val()+"&clubname=${name}",
type : "get",
success : function(data) {
if(data.user_name!=null){
$("#buzhang").attr("disabled",true).text("部长(该部门已有部长)");
}
}
})
})
function uploadLogo() {
Swal.fire({
title : '上传学生头像',
width : 800,
allowOutsideClick : false,
showConfirmButton : false,
html : `<input type="file" id="fileHead" onchange="show(this)" />`
})
}
function show(a) {
var $file = $(a);
var fileObj = $file[0];
var windowURL = window.URL || window.webkitURL;
var dataURL = null;
if (!fileObj || !fileObj.files || !fileObj.files[0]) {//没有选择图片
return;
}
dataURL = windowURL.createObjectURL(fileObj.files[0]);
var photo = `<img
style=" 90px; height: 100px;" src="" id="imgdata">`;
Swal.close();
$("#img").hide();
$("#imgdiv").append(photo);
$("#imgdata").attr('src', dataURL);
getBase64(dataURL,(dataURL)=>{
$("#imgData").val(dataURL);
});
}
function getBase64(url,callback){
var Img = new Image();
dataURL='';
Img.src=url;
Img.onload=function(){
var canvas = document.createElement("canvas"),
width=90,
height=100;
canvas.width=width;
canvas.height=height;
canvas.getContext("2d").drawImage(Img,0,0,width,height);
dataURL=canvas.toDataURL('image/jpeg');
callback?callback(dataURL):null;
};
}
$("#chkSex").bootstrapSwitch({
onText : "男",
offText : "女",
onColor : "primary",
offColor : "danger",
onSwitchChange : function(event, state) {
$("#hidSex").val(state ? "男" : "女")
}
})
$("#chkSex").bootstrapSwitch('state', true)
$("#empty").change(function() {
$("#reason").show();
})
</script>
编辑资料代码:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:if test="${param.isxiugai==false}">
<jsp:include page="/index_head.jsp">
<jsp:param name="title" value="个人资料" />
</jsp:include>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>
个人资料 <small>different form elements</small>
</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<br>
<form action="" method="post" id="demo-form2"
class="form-horizontal form-label-left">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">登录邮箱 </label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.login_mail}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="nick-name">昵称 <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.nick_name}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="true-name">真实姓名 <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.true_name}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="true-name">身份<span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.user_type==0? "团员" : "社长" }</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="phone">电话 <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.phone}</span>
</div>
</div>
<div class="form-group">
<label for="id-card"
class="control-label col-md-3 col-sm-3 col-xs-12">身份证号<span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.id_card}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12">性别</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.sex}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="qq-code">QQ号 </label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.qq_code}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="wechat-code">微信号 </label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.wechat_code}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="signature">个性签名 </label>
<div class="col-md-6 col-sm-6 col-xs-12">
<textarea id="signature" name="signature" rows="4"
class="form-control col-md-7 col-xs-12">${user.signature}</textarea>
</div>
</div>
<div class="ln_solid"></div>
<div class="form-group">
<div
class="col-md-6 col-sm-6 col-xs-12 col-sm-offset-3 col-md-offset-3">
<button type="button" class="btn btn-primary"
onclick="window.location.href='${pageContext.request.contextPath}/user/edit?action=change'">修改</button>
</div>
</div>
</form>
</div>
</div>
</div>
<jsp:include page="/index_foot.jsp"></jsp:include>
</c:if>
<c:if test="${param.isxiugai==true}">
<jsp:include page="/index_head.jsp">
<jsp:param name="title" value="个人资料修改" />
<jsp:param name="needSwitch" value="true" />
</jsp:include>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>
个人资料修改 <small style="color: red">请完善你的个人资料</small>
</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<br>
<form action="${pageContext.request.contextPath}/user/edit2"
method="post" id="demo-form2"
class="form-horizontal form-label-left">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">登录邮箱 </label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${user.login_mail}</span>
<input type="hidden" name="id" value="${user.id}" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="nick-name">昵称 <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" id="nick-name" value="${user.nick_name}"
name="nick_name" required="required"
class="form-control col-md-7 col-xs-12">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="true-name">真实姓名 <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" id="true-name" name="true_name"
value="${user.true_name}" required="required"
class="form-control col-md-7 col-xs-12">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="true-name">你的身份是 <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<select
<c:if test="${not empty user.nick_name}">
disabled
</c:if>
name="user_type" class="form-control col-md-7 col-xs-12"
id="usertype">
<option value="2">社长</option>
<option value="0">团员</option>
</select>
<c:if test="${not empty user.nick_name}">
<input type="hidden" name="user_type" value="${user.user_type }">
</c:if>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="phone">电话 <span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="text" id="phone" name="phone" maxlength="11"
value="${user.phone}" required
class="form-control col-md-7 col-xs-12"> <input
type="hidden" name="club_count" value="${user.club_count}">
</div>
</div>
<div class="form-group">
<label for="id-card"
class="control-label col-md-3 col-sm-3 col-xs-12">身份证号<span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="id-card" value="${user.id_card}" maxlength="18"
class="form-control col-md-7 col-xs-12" type="text" required
name="id_card">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12">性别</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input type="checkbox" id="chkSex" /> <input id="hidSex"
type="hidden" name="sex" value="男" />
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="qq-code">QQ号 </label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="qq-code" name="qq_code" value="${user.qq_code}"
class="form-control col-md-7 col-xs-12" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="wechat-code">微信号 </label>
<div class="col-md-6 col-sm-6 col-xs-12">
<input id="wechat-code" name="wechat_code"
value="${user.wechat_code}"
class="form-control col-md-7 col-xs-12" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="signature">个性签名 </label>
<div class="col-md-6 col-sm-6 col-xs-12">
<textarea id="signature" name="signature" rows="4"
class="form-control col-md-7 col-xs-12">${user.signature}</textarea>
</div>
</div>
<div class="ln_solid"></div>
<div class="form-group">
<div
class="col-md-6 col-sm-6 col-xs-12 col-sm-offset-3 col-md-offset-3">
<button type="submit" class="btn btn-primary">保存</button>
</div>
</div>
</form>
</div>
</div>
</div>
<jsp:include page="/index_foot.jsp">
<jsp:param name="needSwitch" value="true" />
</jsp:include>
<script type="text/javascript">
$("#chkSex").bootstrapSwitch({
onText : "男",
offText : "女",
onColor : "primary",
offColor : "danger",
onSwitchChange : function(event, state) {
$("#hidSex").val(state ? "男" : "女")
}
})
var usertype = "${user.user_type}";
if (usertype) {
if (usertype == 0) {
$("option").eq(1).prop("selected", true);
} else {
$("option").eq(0).prop("selected", true);
}
}
var sex = "${user.sex}";
if (sex.length > 0) {//需要设置一个性别
$("#chkSex").bootstrapSwitch('state', sex == "男" ? true : false);
} else {//需要设置一个默认值,男
$("#chkSex").bootstrapSwitch('state', true);
}
var msg = "${msg}";
if (msg.length > 0) {//保存后的提交结果
alert(msg);
if (msg.indexOf("成功") >= 0) {
window.location = "${pageContext.request.contextPath}/index.jsp";
}
}
</script>
</c:if>
修改头像代码:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<jsp:include page="/index_head.jsp">
<jsp:param name="title" value="头像修改" />
<jsp:param name="needCropper" value="true" />
</jsp:include>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>
头像修改 <small>different form elements</small>
</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<input style="padding-bottom: 5px;" type="file" id="fileHead"
onchange="show(this)" />
<button type="button" class="btn btn-success"
onclick="$('#imgTeset').cropper('setDragMode','move')">移动</button>
<button type="button" class="btn btn-success" onclick="horizontal()">水平翻转</button>
<button type="button" class="btn btn-success" onclick="vertical()">垂直翻转</button>
<button type="button" class="btn btn-success" onclick="cai()">裁剪</button>
<div style=" 600px; height: 600px;">
<!--必须通过父容器限定图像大小 -->
<img id="imgTeset" src="">
</div>
</div>
</div>
</div>
<jsp:include page="/index_foot.jsp">
<jsp:param name="needCropper" value="true" />
</jsp:include>
<script type="text/javascript">
function show(a) {
var $file = $(a);
var fileObj = $file[0];
var windowURL = window.URL || window.webkitURL;
var dataURL = null;
if (!fileObj || !fileObj.files || !fileObj.files[0]) {//没有选择图片
return;
}
dataURL = windowURL.createObjectURL(fileObj.files[0]);
$("#imgTeset").attr('src', dataURL);
$('#imgTeset').cropper({
aspectRatio : 1 / 1,
viewMode : 1
});
$("#imgTeset").cropper('replace', dataURL);
}
var currentHorizontal = 1;
var currentVertical = 1;
//水平翻转
function horizontal() {
currentHorizontal *= -1;
$('#imgTeset').cropper('scaleX', currentHorizontal);
}
//垂直翻转
function vertical() {
currentVertical *= -1;
$('#imgTeset').cropper('scaleY', currentVertical);
}
function cai() {
var size = {
width : 128,
height : 128
};//要裁剪成的图像大小
var cas = $('#imgTeset').cropper('getCroppedCanvas', size);
if (cas == null || cas.tagName == null) {
alert("请选择图片");
return false;
} else {
var base64url = cas.toDataURL('image/jpeg');
$
.ajax({
url : "${pageContext.request.contextPath}/user/cropper1",//上传地址
dataType : 'text',
type : "post",
data : {
imgBase64 : base64url
},
success : function(data) {
alert(data);
if (data.indexOf("成功") >= 0) {
window.location = "${pageContext.request.contextPath}/index.jsp";
}
}
});
}
}
</script>
参加活动的代码:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:include page="/index_head.jsp">
<jsp:param name="title" value="发起的活动" />
</jsp:include>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>
参加的活动 <small>different form elements</small>
</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div class="" role="tabpanel" data-example-id="togglable-tabs">
<ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
<li role="presentation" class="active"><a href="#tab_content1"
id="home-tab" role="tab" data-toggle="tab" aria-expanded="true">活动列表</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div role="tabpanel" class="tab-pane fade active in"
aria-labelledby="home-tab" style="height: 320px;">
<div style="height: 320px;">
<ul class="list-unstyled user_data">
<c:forEach items="${joinhuodong}" var="huodong">
<li><c:if test="${huodong.status==0}">
<a class='user-profile dropdown-toggle' href="javaScript:;"><span
style="display: block; float: left; 190px;">活动:${huodong.name}</span><span
style="display: block; float: left; 190px;">社团:${huodong.club}</span>
<span style="display: block; float: left; 460px;'">地点:${huodong.address}</span>
<span style="display: block; float: left; 250px;'">时间:<c:if
test="${huodong.stime.time==huodong.etime.time}">
<span id="${huodong.name}${huodong.stime.time}"> </span>
</c:if> <c:if test="${huodong.stime.time!=huodong.etime.time}">
<span id="${huodong.name}${huodong.stime.time}"> </span>~<span
id="${huodong.name}${huodong.etime.time}"> </span>
</c:if></span>
</a>
<a href="javaScript:;">社长:${huodong.people}</a>
</c:if> <c:if test="${huodong.status==1}">
<a class='user-profile dropdown-toggle huodong1'
href="javaScript:;"
style="pointer-events: none; opacity: 0.2"><span
style="display: block; float: left; 190px;">活动:${huodong.name}</span><span
style="display: block; float: left; 190px;">社团:${huodong.club}</span>
<span style="display: block; float: left; 460px;'">地点:${huodong.address}</span>
<span style="display: block; float: left; 250px;'">时间:<c:if
test="${huodong.stime.time==huodong.etime.time}">
<span id="${huodong.name}${huodong.stime.time}"> </span>
</c:if> <c:if test="${huodong.stime.time!=huodong.etime.time}">
<span id="${huodong.name}${huodong.stime.time}"> </span>~<span
id="${huodong.name}${huodong.etime.time}"> </span>
</c:if></span>
</a>
<a href="javaScript:;" style="color: red;">活动已结束</a>
</c:if></li>
<hr style="background-color: gray;">
</c:forEach>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<jsp:include page="/index_foot.jsp"></jsp:include>
<script type="text/javascript">
Date.prototype.toLocaleString = function() {
return this.getFullYear() + "年" + (this.getMonth() + 1) + "月" + this.getDate()+"日";
};
$(function(){
$.each(${joinhuodong},function(){
$("#"+this.name+this.stime.time).text(new Date(this.stime.time).toLocaleString());
$("#"+this.name+this.etime.time).text(new Date(this.etime.time).toLocaleString());
})
})
</script>
活动列表代码:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:include page="/index_head.jsp">
<jsp:param name="title" value="发起的活动" />
</jsp:include>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>
发起的活动 <small>different form elements</small>
</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<div class="" role="tabpanel" data-example-id="togglable-tabs">
<ul id="myTab" class="nav nav-tabs bar_tabs" role="tablist">
<li role="presentation" class="active"><a href="#tab_content1"
id="home-tab" role="tab" data-toggle="tab" aria-expanded="true">活动列表</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div role="tabpanel" class="tab-pane fade active in"
aria-labelledby="home-tab" style="height: 320px;">
<div style="height: 320px;">
<ul class="list-unstyled user_data">
<c:if test="${huodongshu==0}">
<li>当前还没有你发起的活动,如有需要,请多多开展活动</li>
</c:if>
<c:if test="${huodongshu!=0}">
<c:forEach items="${huodongs}" var="huodong">
<li><c:if test="${huodong.status==0}">
<a class='user-profile dropdown-toggle huodong1'
href="javaScript:;" data-club="${huodong.club}"
data-huo="${huodong.name}"><span
style="display: block; float: left; 190px;">活动:${huodong.name}</span><span
style="display: block; float: left; 190px;">社团:${huodong.club}</span>
<span style="display: block; float: left; 460px;'">地点:${huodong.address}</span>
<span style="display: block; float: left; 250px;'">时间:<c:if
test="${huodong.stime.time==huodong.etime.time}">
<span id="${huodong.name}${huodong.stime.time}"> </span>
</c:if> <c:if test="${huodong.stime.time!=huodong.etime.time}">
<span id="${huodong.name}${huodong.stime.time}"> </span>~<span
id="${huodong.name}${huodong.etime.time}"> </span>
</c:if></span> </a>
<a href="javaScript:;" class="jie">结束活动</a>
</c:if> <c:if test="${huodong.status==1}">
<a class='user-profile dropdown-toggle huodong1'
href="javaScript:;" data-club="${huodong.club}"
data-huo="${huodong.name}"
style="pointer-events: none; opacity: 0.2"><span
style="display: block; float: left; 190px;">活动:${huodong.name}</span><span
style="display: block; float: left; 190px;">社团:${huodong.club}</span>
<span style="display: block; float: left; 460px;'">地点:${huodong.address}</span>
<span style="display: block; float: left; 250px;'">时间:<c:if
test="${huodong.stime.time==huodong.etime.time}">
<span id="${huodong.name}${huodong.stime.time}"> </span>
</c:if> <c:if test="${huodong.stime.time!=huodong.etime.time}">
<span id="${huodong.name}${huodong.stime.time}"> </span>~<span
id="${huodong.name}${huodong.etime.time}"> </span>
</c:if></span> </a>
<a href="javaScript:;" style="color: red;">活动已结束</a>
</c:if></li>
<hr style="background-color: gray;">
</c:forEach>
</c:if>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<jsp:include page="/index_foot.jsp"></jsp:include>
<script type="text/javascript">
Date.prototype.toLocaleString = function() {
return this.getFullYear() + "年" + (this.getMonth() + 1) + "月" + this.getDate()+"日";
};
var page;
var l;
var pa;
var c;
var h;
var users;
$(function(){
$(".jie").click(function(){
$(this).parent().children("a:eq(0)").css("pointer-events","none").css("opacity","0.2");
$(this).text("活动已结束").css("color","red");
$.ajax({
url : "${pageContext.request.contextPath}/club/bian",
data : "club="+$(this).parent().children("a:eq(0)").attr("data-club")+"&huo1="+$(this).parent().children("a:eq(0)").attr("data-huo"),
success : function(data) {
}
})
})
$.each(${huodongs},function(){
$("#"+this.name+this.stime.time).text(new Date(this.stime.time).toLocaleString());
$("#"+this.name+this.etime.time).text(new Date(this.etime.time).toLocaleString());
})
$(".huodong1").click(function(){
page=1;
l=1;
$.ajax({
url : "${pageContext.request.contextPath}/club/qiandao",
data : "club="+$(this).attr("data-club"),
success : function(data) {
$("#mu").text(data.map.ren);
}
})
$.ajax({
url : "${pageContext.request.contextPath}/user/qiandao1",
data : "club="+$(this).attr("data-club")+"&huo1="+$(this).attr("data-huo"),
async: false,
success : function(data) {
users=data.length;
$("#zi").text(data.length);
}
})
$("#u").empty();
if(users>l){
$("#fenye").empty();
var li=`<li class="active" id="shang"><a href="" data-toggle="tab"
onclick="shangye()">上一页</a></li>
<li style="margin-left: 10px;" id="xia"><a href=""
data-toggle="tab" onclick="xiaye()">下一页</a></li>`;
$("#fenye").append(li);
$("#shang").attr("style","visibility:hidden");
$("#fenye").show();
}
c=$(this).attr("data-club");
h=$(this).attr("data-huo");
$.ajax({
url : "${pageContext.request.contextPath}/user/qiandao",
data : "p=1&club="+$(this).attr("data-club")+"&huo1="+$(this).attr("data-huo"),
success : function(data) {
$.each(data,function(){
var li=$("<li style='float: left; margin-right: 35px; 140px; margin-bottom: 50px;'></li>");
var a=$("<a class='user-profile dropdown-toggle'></a>").attr("href","javaScript:;");
var img=$("<img>").attr("src","${pageContext.request.contextPath}/statics/images/user/"+this.user+".jpg");
$("#u").append(li.append(a.append(img).append(this.user)));
})
}
})
$("#mh").modal({
backdrop : "static"
})
})
})
function shangye() {
$("#xia").attr("style","visibility:visible");
page--;
if(page==1){
$("#shang").attr("style","visibility:hidden");
}
$.ajax({
url : "${pageContext.request.contextPath}/user/qiandao",
data : "p=" + page+"&club="+c+"&huo1="+h,
type : "get",
success : function(data) {
l-=pa;
pa=data.length;
$("#u").empty();
$.each(data,function(){
var li=$("<li style='float: left; margin-right: 35px; 140px; margin-bottom: 50px;'></li>");
var a=$("<a class='user-profile dropdown-toggle'></a>").attr("href","javaScript:;");
var img=$("<img>").attr("src","${pageContext.request.contextPath}/statics/images/user/"+this.user+".jpg");
$("#u").append(li.append(a.append(img).append(this.user)));
})
}
})
}
function xiaye() {
page++;
$("#shang").attr("style","visibility:visible");
$.ajax({
url : "${pageContext.request.contextPath}/user/qiandao",
data : "p=" + page+"&club="+c+"&huo1="+h,
type : "get",
success : function(data) {
pa=data.length;
l+=data.length;
if(l==users){
$("#xia").attr("style","visibility:hidden");
}
$("#u").empty();
$.each(data,function(){
var li=$("<li style='float: left; margin-right: 35px; 140px; margin-bottom: 50px;'></li>");
var a=$("<a class='user-profile dropdown-toggle'></a>").attr("href","javaScript:;");
var img=$("<img>").attr("src","${pageContext.request.contextPath}/statics/images/user/"+this.user+".jpg");
$("#u").append(li.append(a.append(img).append(this.user)));
})
}
})
}
</script>
入团审核代码:
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<jsp:include page="/index_head.jsp">
<jsp:param name="title" value="申请审核" />
</jsp:include>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="x_panel">
<div class="x_title">
<h2>
入团申请审核<small style="color: red;"></small>
</h2>
<div class="clearfix"></div>
</div>
<div class="x_content">
<br>
<form action="" method="post" id="demo-form2"
class="form-horizontal form-label-left">
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">真实姓名<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${apply.user_name}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">个人照片<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12" id="imgdiv">
<img style=" 90px; height: 100px;"
src="${pageContext.request.contextPath}/statics/images/photos/${apply.photo}">
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">学院<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${apply.xueyuan}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">班级<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${apply.banji}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">专业<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${apply.zhuanye}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="login-mail">学号<span class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${apply.stuid}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="true-name">申请的社团<span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${apply.club_name}</span>
</div>
</div>
<div class="form-group">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="true-name">申请的部门<span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${apply.empty_name}</span>
</div>
</div>
<div class="form-group" id="reason">
<label class="control-label col-md-3 col-sm-3 col-xs-12"
for="phone">申请缘由<span class="required">*</span>
</label>
<div class="col-md-6 col-sm-6 col-xs-12">
<textarea rows="10" class="form-control col-md-7 col-xs-12 "
required style="pointer-events: none;">${apply.content}</textarea>
</div>
</div>
<div class="form-group">
<label for="id-card"
class="control-label col-md-3 col-sm-3 col-xs-12">申请职位<span
class="required">*</span></label>
<div class="col-md-6 col-sm-6 col-xs-12">
<span class="form-control col-md-7 col-xs-12">${apply.job}</span>
</div>
</div>
<div class="form-group">
<div
class="col-md-6 col-sm-6 col-xs-12 col-sm-offset-3 col-md-offset-3"
style="margin-left: 490px;">
<button type="button" class="btn btn-primary"
onclick="shenheyes()">同意申请</button>
<button type="button" class="btn btn-danger" onclick="shenheno()">申请驳回</button>
</div>
</div>
</form>
</div>
</div>
</div>
<jsp:include page="/index_foot.jsp"></jsp:include>
<script type="text/javascript">
function shenheyes() {
if (confirm("确定该学生加入社团?")) {
if (ifman("${apply.empty_name}", "${apply.club_name}") == "true") {
window.location.href = "${pageContext.request.contextPath}/user/qingqiu?ifyes=yes&job=${apply.job}&emptyname=${apply.empty_name}&photo=${apply.photo}&username=${apply.user_name}&clubname=${apply.club_name}";
} else {
alert("该部门人数已满");
}
}
}
function ifman(emptyname, clubname) {
var a;
$.ajax({
url : "${pageContext.request.contextPath}/club/ifman",
data : "emptyname=" + emptyname + "&clubname=" + clubname,
type : "get",
async : false,
dataType : "text",
success : function(data) {
a = data;
}
})
return a;
}
$("#queding")
.on(
"click",
function() {
var refuse = $("#refuse").val();
$("#modal").modal('hide');
window.location.href = "${pageContext.request.contextPath}/user/qingqiu?ifyes=no&photo=${apply.photo}&refuse="
+ refuse
+ "&username=${apply.user_name}&clubname=${apply.club_name}";
})
function shenheno() {
if (confirm("确定拒绝申请?")) {
$("#modal").modal({
backdrop : "static"
})
}
}
</script>