school.js 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. $(document).ready(function () {
  2. var a = getQueryString("tab");
  3. var b = 0;
  4. if (a == "practice") {
  5. var b = 1
  6. }
  7. $(".jnav .n").each(function () {
  8. if ($(this).index() == b) {
  9. $(this).addClass("on")
  10. }
  11. });
  12. $(".rpbox").hide();
  13. $(".rpbox").eq(b).show();
  14. $(".jnav .n").click(function () {
  15. var c = $(this).index();
  16. $(this).addClass("on").siblings().removeClass("on");
  17. $(".rpbox").hide();
  18. $(".rpbox").eq(c).show()
  19. });
  20. // $(".add_honour").click(function () {
  21. // var c = $("#userid").val();
  22. // location.href = $_CONFIG.domain + "resume/schoolhonour.php?userid=" + c
  23. // });
  24. $(".edit_honour").click(function () {
  25. var d = $("#userid").val();
  26. var c = $(this).attr("id");
  27. location.href = $_CONFIG.domain + "resume/schoolhonour.php?userid=" + d + "&honourid=" + c
  28. });
  29. $(".delete_honour").click(function () {
  30. var c = $(this).attr("id");
  31. var d = $(this).parents(".e").find("strong").html();
  32. var e = $(this).parents(".e").find("i").text();
  33. var f = {
  34. title: "是否删除以下校内荣誉?",
  35. msg: d + '</br></br><span class="c_orange">' + e + "</span>"
  36. };
  37. pop.confirmdel(f, ["deletehonour(" + c + ")"])
  38. });
  39. $(".saveschoolhonour").click(function () {
  40. var l = $(this).attr("click-data");
  41. if (l != 1) {
  42. return false
  43. }
  44. $(this).attr("click-data", 0);
  45. var g = $("#userid").val();
  46. var n = $("#honourid").val();
  47. var f = $("#bonustime").text();
  48. var j = $("#cbonusname").val();
  49. var i = $("#cbonusclass").val();
  50. var k = window.location.href;
  51. var e = {
  52. userid: g,
  53. honourid: n,
  54. bonustime: f,
  55. cbonusname: j,
  56. cbonusclass: i,
  57. jumpurl: k,
  58. operate: ""
  59. };
  60. var c = $_CONFIG.domain + "ajax/resume/schoolhonour.ajax.php";
  61. var o = ajaxRequest(c, e, "post", "json");
  62. if (o.status == "-1") {
  63. window.location.href = o.url;
  64. return false
  65. } else {
  66. if (o.status == "1") {
  67. window.location.href = $_CONFIG.domain + "resume/school.php?userid=" + g + "&tab=honour"
  68. } else {
  69. if (o.desc) {
  70. pop.ini([
  71. [o.desc, "warn"]
  72. ], ["确定"])
  73. } else {
  74. if (o.message) {
  75. var h = "";
  76. var d = 0;
  77. $.each(o.message, function (m, p) {
  78. if (d < 1) {
  79. h = p;
  80. d++
  81. }
  82. $("#err_" + m + " span").text(p);
  83. $("#err_" + m).show()
  84. });
  85. pop.ini([
  86. [h, "warn"]
  87. ], ["确定"])
  88. }
  89. }
  90. if ($(".saveschoolhonour").length > 0) {
  91. $(".saveschoolhonour").attr("click-data", 1)
  92. }
  93. }
  94. }
  95. return false
  96. });
  97. $(".edit_practice").click(function () {
  98. var c = $("#userid").val();
  99. var d = $(this).attr("id");
  100. location.href = $_CONFIG.domain + "resume/schoolpractice.php?userid=" + c + "&practiceid=" + d
  101. });
  102. // $(".add_job").click(function () {
  103. // var c = $("#userid").val();
  104. // location.href = $_CONFIG.domain + "resume/schoolpractice.php?userid=" + c
  105. // });
  106. $(".delete_practice").click(function () {
  107. var d = $(this).attr("id");
  108. var c = $(this).parents(".e").find("strong").html();
  109. var e = $(this).parents(".e").find("i").text();
  110. var f = {
  111. title: "是否删除以下校内职务?",
  112. msg: c + '</br></br><span class="c_orange">' + e + "</span>"
  113. };
  114. pop.confirmdel(f, ["deletepractice(" + d + ")"])
  115. });
  116. $(".savepractrice").click(function () {
  117. var o = $(this).attr("click-data");
  118. if (o != 1) {
  119. return false
  120. }
  121. $(this).attr("click-data", 0);
  122. var h = $("#userid").val();
  123. var l = $("#starttime").text();
  124. var e = $("#endtime").text();
  125. var j = $("#cpracticename").val();
  126. var c = $("#cdescribe").val();
  127. var i = $("#practiceid").val();
  128. var n = window.location.href;
  129. var g = {
  130. userid: h,
  131. practiceid: i,
  132. starttime: l,
  133. endtime: e,
  134. cname: j,
  135. cdescribe: c,
  136. jumpurl: n,
  137. operate: ""
  138. };
  139. var d = $_CONFIG.domain + "ajax/resume/schoolpractice.ajax.php";
  140. var p = ajaxRequest(d, g, "post", "json");
  141. if (p.status == "-1") {
  142. window.location.href = p.url;
  143. return false
  144. } else {
  145. if (p.status == "1") {
  146. window.location.href = $_CONFIG.domain + "resume/school.php?tab=practice&userid=" + h
  147. } else {
  148. if (p.desc) {
  149. pop.ini([
  150. [p.desc, "warn"]
  151. ], ["确定"])
  152. } else {
  153. if (p.message) {
  154. var k = "";
  155. var f = 0;
  156. $.each(p.message, function (m, q) {
  157. if (f < 1) {
  158. k = q;
  159. f++
  160. }
  161. $("#err_" + m + " span").text(q);
  162. $("#err_" + m).show()
  163. });
  164. pop.ini([
  165. [k, "warn"]
  166. ], ["确定"])
  167. }
  168. }
  169. if ($(".savepractrice").length > 0) {
  170. $(".savepractrice").attr("click-data", 1)
  171. }
  172. }
  173. }
  174. return false
  175. })
  176. });
  177. function deletehonour(d) {
  178. var c = $("#userid").val();
  179. var b = window.location.href;
  180. var f = {
  181. userid: c,
  182. honourid: d,
  183. operate: "delete",
  184. jumpurl: b
  185. };
  186. var e = $_CONFIG.domain + "ajax/resume/schoolhonour.ajax.php";
  187. var a = ajaxRequest(e, f, "post", "json");
  188. if (a.status == "1") {
  189. pop.ini([
  190. [a.desc]
  191. ], ["确定"]);
  192. $("#schoolhonour_" + d).remove();
  193. if ($(".honourbox").children(".e").length >= 20) {
  194. $(".add_honour").hide()
  195. } else {
  196. $(".add_honour").show()
  197. }
  198. } else {
  199. pop.ini([
  200. ["服务器正忙,请稍后再试"]
  201. ], ["确定"])
  202. }
  203. }
  204. function deletepractice(e) {
  205. var c = $("#userid").val();
  206. var b = window.location.href;
  207. var f = {
  208. userid: c,
  209. practiceid: e,
  210. operate: "delete",
  211. jumpurl: b
  212. };
  213. var d = $_CONFIG.domain + "ajax/resume/schoolpractice.ajax.php";
  214. var a = ajaxRequest(d, f, "post", "json");
  215. if (a.status == "1") {
  216. pop.ini([
  217. [a.desc]
  218. ], ["确定"]);
  219. $("#schoolpractice_" + e).remove();
  220. if ($(".practricerbox").children(".e").length >= 20) {
  221. $(".add_job").hide()
  222. } else {
  223. $(".add_job").show()
  224. }
  225. } else {
  226. pop.ini([
  227. ["服务器正忙,请稍后再试"]
  228. ], ["确定"])
  229. }
  230. }
  231. function getQueryString(a) {
  232. var b = new RegExp("(^|&)" + a + "=([^&]*)(&|$)", "i");
  233. var c = window.location.search.substr(1).match(b);
  234. if (c != null) {
  235. return unescape(c[2])
  236. }
  237. return null
  238. };