Access_index.html 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <script type="text/javascript">
  2. function checknode(obj)
  3. {
  4. var chk = $("input[type='checkbox']");
  5. var count = chk.length;
  6. var num = chk.index(obj);
  7. var level_top = level_bottom = chk.eq(num).attr('level');
  8. for (var i=num; i>=0; i--)
  9. {
  10. var le = chk.eq(i).attr('level');
  11. if(eval(le) < eval(level_top))
  12. {
  13. chk.eq(i).attr("checked",true);
  14. var level_top = level_top-1;
  15. }
  16. }
  17. for (var j=num+1; j<count; j++)
  18. {
  19. var le = chk.eq(j).attr('level');
  20. if(chk.eq(num).attr("checked")=='checked') {
  21. if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",true);
  22. else if(eval(le) == eval(level_bottom)) break;
  23. }
  24. else {
  25. if(eval(le) > eval(level_bottom)) chk.eq(j).attr("checked",false);
  26. else if(eval(le) == eval(level_bottom)) break;
  27. }
  28. }
  29. }
  30. </script>
  31. <style>.mainnav_title{display:none;}span.w1{float:left;width:89px}</style>
  32. <form id="myform" name="myform" action="{:U('Access/insert')}" method="post">
  33. <input type="hidden" id="rid" name="rid" value="{$rid}" />
  34. <div class="pad-lr-10">
  35. <div class="table-list">
  36. <table width="100%" cellspacing="0" style="border:1px solid #ccc;" id="dnd-example">
  37. <tbody>
  38. <tr>
  39. <td width=100 bgcolor="#CBE0F6">
  40. <input type='checkbox' name='nid[1]' value='1' level='0' {if array_key_exists(1,$alist)}checked{/if} onclick='javascript:checknode(this);' />{$topnode[0][title]}
  41. </td>
  42. <td bgcolor="#CBE0F6"></td>
  43. </tr>
  44. <volist name="node" id="r" >
  45. <tr>
  46. <td colspan="2" bgcolor="#F0F5FB" align="center" height="40"><b>{$r[groupinfo][name]}</b></td>
  47. </tr>
  48. <volist name="r[data]" id="rr">
  49. <if condition="$rr[level]==2">
  50. <tr>
  51. <td style='padding-left:15px;' bgcolor="#F8FAFC"><input type='checkbox' name='nid[{$rr.id}]' value='{$rr.id}' level='{$rr.level}' {$rr.selected} onclick='javascript:checknode(this);' />&nbsp;{$rr.title}
  52. </td>
  53. <td><volist name="node[$rr[groupid]][data]" id="rrr" >
  54. <if condition="$rrr[pid]==$rr[id]">
  55. <span class="w1"><input type='checkbox' name='nid[{$rrr.id}]' value='{$rrr.id}' level='{$rrr.level}' {$rrr.selected} onclick='javascript:checknode(this);' /> {$rrr.title} &nbsp;</span>
  56. </if>
  57. </volist></td>
  58. </tr>
  59. </if>
  60. </volist>
  61. </volist>
  62. <input type="hidden" name="isajax" value="1" />
  63. <input name="dosubmit" type="submit" value="1" class="hidden" id="dosubmit">
  64. </tbody>
  65. </table>
  66. </div>
  67. </div>
  68. </form></div>