mycompanyadd.jsp 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
  2. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  3. <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
  4. <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
  5. <%
  6. String base = pageContext.getServletContext().getContextPath();
  7. %>
  8. <script type="text/javascript">
  9. window.UEDITOR_SERVER_URL = '<%=base%>';
  10. </script>
  11. <html>
  12. <head>
  13. <meta charset="utf-8">
  14. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  15. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  16. <meta name="viewport"
  17. content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
  18. <meta http-equiv="Cache-Control" content="no-siteapp"/>
  19. <link rel="Bookmark" href="/favicon.ico">
  20. <link rel="Shortcut Icon" href="/favicon.ico"/>
  21. <!--[if lt IE 9]>
  22. <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/html5shiv.js"></script>
  23. <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/respond.min.js"></script>
  24. <![endif]-->
  25. <link rel="stylesheet" type="text/css"
  26. href="${pageContext.request.contextPath}/static/static/h-ui/css/H-ui.min.css"/>
  27. <link rel="stylesheet" type="text/css"
  28. href="${pageContext.request.contextPath}/static/static/h-ui.admin/css/H-ui.admin.css"/>
  29. <link rel="stylesheet" type="text/css"
  30. href="${pageContext.request.contextPath}/static/lib/Hui-iconfont/1.0.8/iconfont.css"/>
  31. <link rel="stylesheet" type="text/css"
  32. href="${pageContext.request.contextPath}/static/static/h-ui.admin/skin/default/skin.css" id="skin"/>
  33. <link rel="stylesheet" type="text/css"
  34. href="${pageContext.request.contextPath}/static/static/h-ui.admin/css/style.css"/>
  35. <!--[if IE 6]>
  36. <script type="text/javascript"
  37. src="${pageContext.request.contextPath}/static/lib/DD_belatedPNG_0.0.8a-min.js"></script>
  38. <script>DD_belatedPNG.fix('*');</script>
  39. <![endif]-->
  40. <!--/meta 作为公共模版分离出去-->
  41. <title>新增文章 - 资讯管理 - H-ui.admin v3.1</title>
  42. <meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
  43. <meta name="description" content="H-ui.admin v3.1,是一款由国人开发的轻量级扁平化网站后台模板,完全免费开源的网站后台管理系统模版,适合中小型CMS后台系统。">
  44. </head>
  45. <body>
  46. <article class="page-container">
  47. <form class="form form-horizontal" id="form-article-add"
  48. action="${pageContext.request.contextPath}/mycompany/insertmycompany.html"
  49. method="post">
  50. <input name="id" hidden="hidden" value="${mycompany.id}"/>
  51. <div class="row cl">
  52. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>公司名称:</label>
  53. <div class="formControls col-xs-8 col-sm-9">
  54. <input type="text" class="input-text" value="${mycompany.name}" placeholder="" id="name" name="name">
  55. </div>
  56. </div>
  57. <div class="row cl">
  58. <label class="form-label col-xs-4 col-sm-2">公司地址:</label>
  59. <div class="formControls col-xs-8 col-sm-9">
  60. <input type="text" class="input-text" value="${mycompany.address}" placeholder="" id="address"
  61. name="address">
  62. </div>
  63. </div>
  64. <div class="row cl">
  65. <label class="form-label col-xs-4 col-sm-2">公司邮箱:</label>
  66. <div class="formControls col-xs-8 col-sm-9">
  67. <input type="text" name="emil" id="emil" placeholder="" value="${mycompany.emil}"
  68. class="input-text">
  69. </div>
  70. </div>
  71. <div class="row cl">
  72. <label class="form-label col-xs-4 col-sm-2">公司电话:</label>
  73. <div class="formControls col-xs-8 col-sm-9">
  74. <input type="text" name="phone" id="phone" placeholder="" value="${mycompany.phone}"
  75. class="input-text">
  76. </div>
  77. </div>
  78. <div class="row cl">
  79. <label class="form-label col-xs-4 col-sm-2">显示状态:</label>
  80. <div class="formControls col-xs-8 col-sm-9">
  81. <input type="text" class="input-text" value="${mycompany.shows}" placeholder="" id="shows" name="shows">
  82. </div>
  83. <div class="formControls col-xs-8 col-sm-4">
  84. <span class="c-red"> 0 为隐藏,1为当前显示的公司</span>
  85. </div>
  86. </div>
  87. <div class="row cl">
  88. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
  89. <button class="btn btn-primary radius" onclick="checkform();" type="submit"><i class="Hui-iconfont">&#xe632;</i>
  90. 保存
  91. </button>
  92. <button class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
  93. </div>
  94. </div>
  95. </form>
  96. </article>
  97. <!--_footer 作为公共模版分离出去-->
  98. <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/jquery/1.9.1/jquery.min.js"></script>
  99. <script type="text/javascript" src="${pageContext.request.contextPath}/static/lib/layer/2.4/layer.js"></script>
  100. <script type="text/javascript" src="${pageContext.request.contextPath}/static/static/h-ui/js/H-ui.min.js"></script>
  101. <script type="text/javascript"
  102. src="${pageContext.request.contextPath}/static/static/h-ui.admin/js/H-ui.admin.js"></script>
  103. <!--/_footer /作为公共模版分离出去-->
  104. <!--请在下方写此页面业务相关的脚本-->
  105. <script type="text/javascript"
  106. src="${pageContext.request.contextPath}/static/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  107. <script type="text/javascript"
  108. src="${pageContext.request.contextPath}/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
  109. <script type="text/javascript"
  110. src="${pageContext.request.contextPath}/static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
  111. <script type="text/javascript"
  112. src="${pageContext.request.contextPath}/static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
  113. <script type="text/javascript"
  114. src="${pageContext.request.contextPath}/static/lib/webuploader/0.1.5/webuploader.min.js"></script>
  115. <script type="text/javascript"
  116. src="${pageContext.request.contextPath}/static/lib/ueditor/1.4.3/ueditor.config.js"></script>
  117. <script type="text/javascript"
  118. src="${pageContext.request.contextPath}/static/lib/ueditor/1.4.3/ueditor.all.min.js"></script>
  119. <script type="text/javascript"
  120. src="${pageContext.request.contextPath}/static/lib/ueditor/1.4.3/lang/zh-cn/zh-cn.js"></script>
  121. <script type="text/javascript">
  122. /**
  123. *添加
  124. * @returns {boolean}
  125. */
  126. function checkform() {
  127. var shows = $("#shows").val();
  128. if (shows == "" || shows == null) {
  129. alert("显示状态未填写");
  130. return false;
  131. } else {
  132. document.getElementById("form-article-add").submit();
  133. }
  134. // var s_province = $("#s_province").val();
  135. // var s_city = $("#s_city").val();
  136. // var s_county = $("#s_county").val();
  137. // var address = $("#address").val();
  138. // var title = $("#title").val();
  139. // var address = $("#address").val();
  140. // var time = $("#time").val();
  141. // if (s_province == '省份'){
  142. // alert("省份不能为空");
  143. // return false;
  144. // }
  145. // if (s_city == '地级市'){
  146. // alert("城市不能为空");
  147. // return false;
  148. // }
  149. // if (s_county == '市、县级市'){
  150. // alert("市区不能为空");
  151. // return false;
  152. // }
  153. // if (time == null || commentdatemin == ''){
  154. // alert("活动时间不能为空");
  155. // return false;
  156. // }if (title == null || title == ''){
  157. // alert("活动标题不能为空");
  158. // return false;
  159. // }
  160. // if (address == null || address == ''){
  161. // alert("详情地址不能为空");
  162. // return false;
  163. // }
  164. }
  165. $(function () {
  166. $('.skin-minimal input').iCheck({
  167. checkboxClass: 'icheckbox-blue',
  168. radioClass: 'iradio-blue',
  169. increaseArea: '20%'
  170. });
  171. //表单验证
  172. $("#form-article-add").validate({
  173. rules: {
  174. articletitle: {
  175. required: true,
  176. },
  177. articletitle2: {
  178. required: true,
  179. },
  180. articlecolumn: {
  181. required: true,
  182. },
  183. articletype: {
  184. required: true,
  185. },
  186. articlesort: {
  187. required: true,
  188. },
  189. keywords: {
  190. required: true,
  191. },
  192. abstract: {
  193. required: true,
  194. },
  195. author: {
  196. required: true,
  197. },
  198. sources: {
  199. required: true,
  200. },
  201. allowcomments: {
  202. required: true,
  203. },
  204. commentdatemin: {
  205. required: true,
  206. },
  207. commentdatemax: {
  208. required: true,
  209. },
  210. },
  211. onkeyup: false,
  212. focusCleanup: true,
  213. success: "valid",
  214. submitHandler: function (form) {
  215. //$(form).ajaxSubmit();
  216. var index = parent.layer.getFrameIndex(window.name);
  217. //parent.$('.btn-refresh').click();
  218. parent.layer.close(index);
  219. }
  220. });
  221. $list = $("#fileList"),
  222. $btn = $("#btn-star"),
  223. state = "pending",
  224. uploader;
  225. var uploader = WebUploader.create({
  226. auto: true,
  227. swf: 'lib/webuploader/0.1.5/Uploader.swf',
  228. // 文件接收服务端。
  229. server: 'fileupload.php',
  230. // 选择文件的按钮。可选。
  231. // 内部根据当前运行是创建,可能是input元素,也可能是flash.
  232. pick: '#filePicker',
  233. // 不压缩image, 默认如果是jpeg,文件上传前会压缩一把再上传!
  234. resize: false,
  235. // 只允许选择图片文件。
  236. accept: {
  237. title: 'Images',
  238. extensions: 'gif,jpg,jpeg,bmp,png',
  239. mimeTypes: 'image/*'
  240. }
  241. });
  242. uploader.on('fileQueued', function (file) {
  243. var $li = $(
  244. '<div id="' + file.id + '" class="item">' +
  245. '<div class="pic-box"><img></div>' +
  246. '<div class="info">' + file.name + '</div>' +
  247. '<p class="state">等待上传...</p>' +
  248. '</div>'
  249. ),
  250. $img = $li.find('img');
  251. $list.append($li);
  252. // 创建缩略图
  253. // 如果为非图片文件,可以不用调用此方法。
  254. // thumbnailWidth x thumbnailHeight 为 100 x 100
  255. uploader.makeThumb(file, function (error, src) {
  256. if (error) {
  257. $img.replaceWith('<span>不能预览</span>');
  258. return;
  259. }
  260. $img.attr('src', src);
  261. }, thumbnailWidth, thumbnailHeight);
  262. });
  263. // 文件上传过程中创建进度条实时显示。
  264. uploader.on('uploadProgress', function (file, percentage) {
  265. var $li = $('#' + file.id),
  266. $percent = $li.find('.progress-box .sr-only');
  267. // 避免重复创建
  268. if (!$percent.length) {
  269. $percent = $('<div class="progress-box"><span class="progress-bar radius"><span class="sr-only" style="width:0%"></span></span></div>').appendTo($li).find('.sr-only');
  270. }
  271. $li.find(".state").text("上传中");
  272. $percent.css('width', percentage * 100 + '%');
  273. });
  274. // 文件上传成功,给item添加成功class, 用样式标记上传成功。
  275. uploader.on('uploadSuccess', function (file) {
  276. $('#' + file.id).addClass('upload-state-success').find(".state").text("已上传");
  277. });
  278. // 文件上传失败,显示上传出错。
  279. uploader.on('uploadError', function (file) {
  280. $('#' + file.id).addClass('upload-state-error').find(".state").text("上传出错");
  281. });
  282. // 完成上传完了,成功或者失败,先删除进度条。
  283. uploader.on('uploadComplete', function (file) {
  284. $('#' + file.id).find('.progress-box').fadeOut();
  285. });
  286. uploader.on('all', function (type) {
  287. if (type === 'startUpload') {
  288. state = 'uploading';
  289. } else if (type === 'stopUpload') {
  290. state = 'paused';
  291. } else if (type === 'uploadFinished') {
  292. state = 'done';
  293. }
  294. if (state === 'uploading') {
  295. $btn.text('暂停上传');
  296. } else {
  297. $btn.text('开始上传');
  298. }
  299. });
  300. $btn.on('click', function () {
  301. if (state === 'uploading') {
  302. uploader.stop();
  303. } else {
  304. uploader.upload();
  305. }
  306. });
  307. var ue = UE.getEditor('introduction', {
  308. //关闭字数统计
  309. wordCount: false,
  310. toolbars: [['fullscreen', 'source', '|', 'undo', 'redo', '|',
  311. 'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'superscript', 'subscript', 'removeformat', 'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|', 'forecolor', 'backcolor', 'insertorderedlist', 'insertunorderedlist', 'selectall', 'cleardoc', '|',
  312. 'rowspacingtop', 'rowspacingbottom', 'lineheight', '|',
  313. 'customstyle', 'paragraph', 'fontfamily', 'fontsize', '|',
  314. 'directionalityltr', 'directionalityrtl', 'indent', '|',
  315. 'justifyleft', 'justifycenter', 'justifyright', 'justifyjustify', '|', 'touppercase', 'tolowercase', '|',
  316. 'link', 'unlink', 'anchor', '|', 'imagenone', 'imageleft', 'imageright', 'imagecenter', '|',
  317. 'insertimage', 'emotion', 'insertvideo', 'attachment', 'map', 'template', 'background', '|',
  318. 'horizontal', 'date', 'time', 'spechars', 'wordimage', '|',
  319. 'inserttable', 'deletetable', 'insertparagraphbeforetable', 'insertrow', 'deleterow', 'insertcol', 'deletecol', 'mergecells', 'mergeright', 'mergedown', 'splittocells', 'splittorows', 'splittocols', 'charts', '|',
  320. 'print', 'preview', 'searchreplace', 'help'
  321. ]],
  322. //关闭elementPath
  323. elementPathEnabled: false,
  324. });
  325. });
  326. </script>
  327. <!--/请在上方写此页面业务相关的脚本-->
  328. <script type="text/javascript">
  329. var currentBrowserId;
  330. function browserImage(targetId) {
  331. currentBrowserId = targetId;
  332. var weboxTemp = $.webox({
  333. height: 600,
  334. width: 1024,
  335. bgvisibel: true,
  336. title: '图片管理',
  337. iframe: '<%=base%>/admin/image/imgbox.html?' + Math.random()
  338. });
  339. }
  340. function setImagepath(imgPath) {
  341. $('#' + currentBrowserId).val(imgPath);
  342. }
  343. function closeFrame() {
  344. $('#locked .span').click();
  345. }
  346. </script>
  347. <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/js/laydate.dev.js"></script>
  348. <script type="text/javascript">
  349. laydate({
  350. elem: '#J-xl'
  351. });
  352. document.getElementById('J-xl-2-btn').onclick = function () {
  353. laydate({
  354. elem: '#J-xl-2'
  355. });
  356. }
  357. laydate({
  358. elem: '#J-xl-3'
  359. });
  360. laydate({
  361. elem: document.getElementById('J-xl-4')
  362. });
  363. </script>
  364. </body>
  365. </html>