meet.jsp
上传用户:lm2018
上传日期:2015-12-12
资源大小:30449k
文件大小:11k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@ page language="java" pageEncoding="GBK"%>
  2. <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
  3. <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
  4. <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
  5. <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
  6. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  7. <head>
  8. <title>会议列表</title>
  9. <script src="${pageContext.request.contextPath}/Jsp_file/meet/Calendar.js"></script>
  10. <script src="${pageContext.request.contextPath}/Js_file/addmeet.js"></script>
  11. <link href="${pageContext.request.contextPath}/Css_file/oa.css" rel="stylesheet" type="text/css" />
  12. <script>
  13. var xmlHttp;
  14. function createHttpRequest(){
  15. if (window.ActiveXObject){
  16. xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  17. }else if (window.XMLHttpRequest){
  18. xmlHttp = new XMLHttpRequest();
  19. }
  20. }
  21. //send server time 
  22. function sendtime(url){
  23. if(!(form1.mstarttime.value=='')&&!(form1.mendtime.value=='')){
  24. createHttpRequest();
  25. url=url+'&tbegin='+form1.mstarttime.value;
  26. url=url+'&tend='+form1.mendtime.value;
  27. //alert(url);
  28. xmlHttp.open("get",url,true);
  29. xmlHttp.onreadystatechange=callback;
  30. xmlHttp.send(null);
  31. }
  32. }
  33. //recive from server 
  34. function callback(){
  35. if (xmlHttp.readyState == 4){
  36. if (xmlHttp.status == 200){
  37. var xmldoc=xmlHttp.responseXML;
  38. //获取xml文档的room节点列表
  39. var list=xmldoc.getElementsByTagName("room");
  40. //取得页面的下拉框
  41. var displayselect=document.form1.rmid;
  42. //遍历多个room节点
  43. form1.rmid.length=0;
  44. if(list.length>0){
  45. for(var i=0;i<list.length;i++){
  46. var rid = list[i].getAttribute("rid");
  47. var rname = list[i].getAttribute("rname");
  48. form1.rmid.options[form1.rmid.length]=new Option(rname,rid);
  49. }
  50. }else{
  51. alert('这段时间的会议室都被占用,请选择其他时间!');
  52. }
  53. }
  54. }
  55. }
  56. var flag=false;
  57. function choie(){
  58. if(flag==true || form1.rmid.length==0){
  59. sendtime('${pageContext.request.contextPath}/meet.do?task=roomlist');
  60. flag=false;
  61. }
  62. }
  63. </script>
  64. <script>
  65. var   FileMaxSize =5120;
  66.     function addFile(){
  67.         var Rows=tableFiles.rows;//类似数组的Rows 
  68.         if (tableFiles.rows.length==3) {
  69.         document.getElementById("file").innerHTML="<font color="red">最多只能传三个附件</font>";
  70.          return;
  71.         }else if(!(tableFiles.rows.length==3)){
  72.          document.getElementById("file").innerHTML="";
  73.         }
  74.         var newRow=tableFiles.insertRow(tableFiles.rows.length);//插入新的一行 
  75.          var Cells=newRow.cells;//类似数组的Cells 
  76.         var newCell=Rows(newRow.rowIndex).insertCell(Cells.length); 
  77.         newCell.align="left"; 
  78.         newCell.innerHTML= "<input type=file name=uploadFile["+(tableFiles.rows.length-1) + "].file value=''/> &nbsp;&nbsp;&nbsp;<input type=button name="btndele" value="删除" onclick=delFile(tableFiles.rows.length-1)>";
  79.     }
  80.     function delFile(id){
  81.      tableFiles.deleteRow(tableFiles.rows.length-1); 
  82.      document.getElementById("file").innerHTML="";
  83.     }  
  84.    
  85.     function checkfile(thisfile,id){
  86.      var  fso,  f,  s;  
  87.      fso  =  new  ActiveXObject("Scripting.FileSystemObject");  
  88.      f  =  fso.GetFile(thisfile);  
  89.      if (f.size>1024*FileMaxSize) {
  90.         alert("添加的附件大小不能大于5M!");
  91. delFile(id);
  92.      }
  93.     }
  94.    
  95.     function dele(path,name,rmid){
  96.     if(confirm("确认要删除?")){
  97. window.location.href="${pageContext.request.contextPath}/meet.do?task=delpath&path="+path+"&name="+name+"&rmid="+rmid;
  98. }
  99. }
  100. </script>
  101. <script>
  102. function check(){
  103. var mtitle = form1.mtitle.value;
  104. var mpeople=form1.mpeople.value;
  105. var mstarttime=form1.mstarttime.value;
  106. var mendtime=form1.mendtime.value;
  107. var rmid = form1.rmid.value;
  108. var addmeet =meetForm.addmeet;
  109. if(mtitle==""){
  110. document.getElementById("title").innerHTML="<font color="red">主题不能为空</font>";
  111. form1.mtitle.focus();
  112. return;
  113. }else{
  114. document.getElementById("title").innerHTML="";
  115. }
  116. if(mpeople==0){
  117. document.getElementById("people").innerHTML="<font color="red">请选择一个主持人</font>";
  118. form1.mpeople.focus();
  119. return;
  120. }else{
  121. document.getElementById("people").innerHTML="";
  122. }
  123. if(mstarttime==''){
  124. document.getElementById("starttime").innerHTML="<font color="red">开始时间不能为空</font>";
  125. form1.mstarttime.focus();
  126. return;
  127. }else{
  128. document.getElementById("starttime").innerHTML="";
  129. }
  130. if(mendtime==''){
  131. document.getElementById("endtime").innerHTML="<font color="red">结束时间不能为空</font>";
  132. form1.mendtime.focus();
  133. return ;
  134. }else{
  135. document.getElementById("endtime").innerHTML="";
  136. }
  137. if(mstarttime>=mendtime){
  138. document.getElementById("starttime").innerHTML="<font color="red">结束时间不能小于或等于开始时间</font>";
  139. form1.mendtime.focus();
  140. return;
  141. }else{
  142. document.getElementById("starttime").innerHTML="";
  143. }
  144. if(addmeet.options.length==0){
  145. document.getElementById("unos").innerHTML="<font color="red">参与人员不能为空</font>";
  146. form1.addmeet.focus();
  147. return ;
  148. }else{
  149. document.getElementById("unos").innerHTML="";
  150. for(var i=0;i<addmeet.options.length;i++){
  151. addmeet.options[i].selected=true;
  152. }
  153. }
  154. if(rmid==""){
  155. document.getElementById("addr").innerHTML="<font color="red">请选择会议地点</font>";
  156. form1.rmid.focus();
  157. return;
  158. }else{
  159. document.getElementById("addr").innerHTML="";
  160. }
  161. form1.submit();
  162. }
  163. </script>
  164. </head>
  165. <body onload="sendtime('${pageContext.request.contextPath}/meet.do?task=roomlist&rmid=<bean:write property='mid' name='meetForm' />')">
  166. <html:form action="/meet" styleId="form1" enctype="multipart/form-data">
  167. <html:hidden property="mid" />
  168. <html:hidden property="task" />
  169. <html:hidden property="mstatus" value="0" />
  170. <div class="t">
  171. <table width="100%" cellspacing="0" cellpadding="0" class="tr3 f_one">
  172. <tr class="tr3 f_one">
  173. <th>
  174. 会议主题:
  175. </th>
  176. <th>
  177. <html:text property="mtitle" name="meetForm" />
  178. &nbsp;&nbsp; <SPAN id="title"></span>
  179. </th>
  180. </tr>
  181. <tr class="tr3 f_one">
  182. <th>
  183. 会议主持人:
  184. </th>
  185. <th>
  186. <html:select property="mpeople" name="meetForm">
  187. <html:option value="0">===请选择==</html:option>
  188. <logic:present name="listuser1" scope="request">
  189. <logic:iterate id="plan" name="listuser1" scope="request">
  190. <html:option value="${plan.uno}">${plan.uname}</html:option>
  191. </logic:iterate>
  192. </logic:present>
  193. </html:select>
  194. <SPAN id="people"></span>
  195. </th>
  196. </tr>
  197. <tr class="tr3 f_two">
  198. <th>
  199. 会议时间:
  200. </th>
  201. <th>
  202. <html:text property="mstarttime" readonly="true" onclick="javascript:setDayHM(this); " name="meetForm" />
  203. &nbsp;&nbsp;&nbsp;至 &nbsp;&nbsp;&nbsp;
  204. <html:text property="mendtime" readonly="true" onclick="javascript:setDayHM(this); " name="meetForm" />
  205. <SPAN id="starttime"></span><SPAN id="endtime"></span>
  206. </th>
  207. </tr>
  208. <tr class="tr3 f_one">
  209. <th>
  210. 会议参与者:
  211. </th>
  212. <th>
  213. <table>
  214. <tr>
  215. <th width=3%>
  216. <FONT style="color: blue" size="2">所有员工列表:</font>
  217. <html:select property="arryusername" multiple="true" style="width: 120px;height: 100px">
  218. <logic:present name="listuser" scope="request">
  219. <logic:iterate id="plan" name="listuser" scope="request">
  220. <html:option value="${plan.uno}">${plan.uname}</html:option>
  221. </logic:iterate>
  222. </logic:present>
  223. </html:select>
  224. </th>
  225. <th width=3%>
  226. <input type="button" name="rightmove" value=">>" style="width=60px">
  227. <br>
  228. <br>
  229. <input type="button" name="leftmove" value="<<" style=" width=60px">
  230. </th>
  231. <th>
  232. <FONT style="color: blue" size="2">要参与的员工列表:</font>
  233. <br>
  234. <html:select property="addmeet" multiple="true" style="width: 120px;height: 100px" name="meetForm">
  235. <logic:equal name="meetForm" property="task" value="edit">
  236. <logic:present name="addmeet" scope="request">
  237. <logic:iterate id="plan" name="addmeet" scope="request">
  238. <html:option value="${plan.uno}">${plan.uname}</html:option>
  239. </logic:iterate>
  240. </logic:present>
  241. </logic:equal>
  242. </html:select>
  243. </th>
  244. </tr>
  245. </table>
  246. <SPAN id="unos"></span>
  247. </th>
  248. </tr>
  249. <tr class="tr3 f_two">
  250. <th>
  251. 会议地点:
  252. </th>
  253. <th>
  254. <html:select property="rmid" onclick="choie();">
  255. </html:select>
  256. <SPAN id="addr"></span>
  257. </th>
  258. </tr>
  259. <tr class="tr3 f_one">
  260. <th>
  261. 会议内容:
  262. </th>
  263. <th>
  264. <html:textarea cols="50" rows="5" property="mcontent"></html:textarea>
  265. </th>
  266. </tr>
  267. <tr>
  268. <th>
  269. 附件:
  270. </th>
  271. <th align="left">
  272. <logic:equal name="meetForm" property="task" value="add">
  273. <input type="button" name="hh" value="添加附件" onClick="addFile()" />
  274. <span id="file"></span>
  275. <table align="left" id="tableFiles"></table>
  276. </logic:equal>
  277. <logic:equal name="meetForm" property="task" value="edit">
  278. <logic:lessThan name="size" value="3">
  279. <input type="button" name="hh" value="添加附件" onClick="addFile()" />
  280. <span id="file"></span>
  281. <table align="left" id="tableFiles"></table>
  282. </logic:lessThan>
  283. </logic:equal>
  284. </br>
  285. <logic:equal name="meetForm" property="task" value="edit">
  286. <logic:present name="filelist" scope="request">
  287. <logic:iterate id="files" name="filelist">
  288. <html:link href="${pageContext.request.contextPath}/downLoadServlet?filepath=${files.maffixpath}">${files.maffixname}</html:link>
  289. &nbsp;&nbsp;&nbsp;<input type="button" name="btndele" value="删除" onclick="dele('${files.maffixpath}','${files.maffixname}','<bean:write property='mid' name='meetForm' />');" />
  290. <br>
  291. </logic:iterate>
  292. </logic:present>&nbsp;
  293. </logic:equal>
  294. </th>
  295. </tr>
  296. </table>
  297. </div>
  298. <br>
  299. <div style="text-align:center;margin-bottom:25px;">
  300. <input type="button" class="btn" value=" 保存 " onclick="check();">
  301. <input type="button" class="btn" value=" 返回 " onclick="javascript:window.history.back();" />
  302. </div>
  303. </html:form>
  304. <script>
  305. init();
  306. var moveright =document.getElementById("rightmove");
  307. moveright.onclick=right;
  308. var moveleft= document.getElementById("leftmove");
  309. moveleft.onclick=left;
  310. </script>
  311. </body>