ipbanned_list.tpl.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. $show_dialog = 1;
  4. include $this->admin_tpl('header','admin');
  5. ?>
  6. <div class="pad-lr-10">
  7. <form name="searchform" id="searchform" action="?m=admin&c=ipbanned&a=search_ip&menuid=<?php echo $_GET['menuid'];?>" method="get" >
  8. <input type="hidden" value="admin" name="m">
  9. <input type="hidden" value="ipbanned" name="c">
  10. <input type="hidden" value="search_ip" name="a">
  11. <table width="100%" cellspacing="0" class="search-form">
  12. <tbody>
  13. <tr>
  14. <td><div class="explain-col">IP: <input type="text" value="" class="input-text" id="ip" name="search[ip]"> <input type="submit" value="<?php echo L('search')?>" class="button" name="dosubmit">
  15. </div>
  16. </td>
  17. </tr>
  18. </tbody>
  19. </table>
  20. </form>
  21. <form name="myform" id="myform" action="?m=admin&c=ipbanned&a=delete" method="post" onsubmit="checkuid();return false;">
  22. <div class="table-list">
  23. <table width="100%" cellspacing="0">
  24. <thead>
  25. <tr>
  26. <th width="35" align="center"><input type="checkbox" value="" id="check_box" onclick="selectall('ipbannedid[]');"></th>
  27. <th width="30%">IP</th>
  28. <th ><?php echo L('deblocking_time')?></th>
  29. <th width="120"><?php echo L('operations_manage')?></th>
  30. </tr>
  31. </thead>
  32. <tbody>
  33. <?php
  34. if(is_array($infos)){
  35. foreach($infos as $info){
  36. ?>
  37. <tr>
  38. <td align="center">
  39. <input type="checkbox" name="ipbannedid[]" value="<?php echo $info['ipbannedid']?>">
  40. </td>
  41. <td width="30%" align="left"><span class="<?php echo $info['style']?>"><?php echo $info['ip']?></span> </td>
  42. <td align="center"><?php echo date('Y-m-d', $info['expires']);?></td>
  43. <td align="center"><a href="javascript:confirmurl('?m=admin&c=ipbanned&a=delete&ipbannedid=<?php echo $info['ipbannedid']?>', '<?php echo L('confirm', array('message' => L('selected')))?>')"><?php echo L('delete')?></a> </td>
  44. </tr>
  45. <?php
  46. }
  47. }
  48. ?></tbody>
  49. </table>
  50. <div class="btn">
  51. <a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('selected_all')?></a>/<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a>
  52. <input type="submit" name="submit" class="button" value="<?php echo L('remove_all_selected')?>" onClick="return confirm('<?php echo L('confirm', array('message' => L('selected')))?>')" />
  53. </div>
  54. <div id="pages"><?php echo $pages?></div>
  55. </div>
  56. </form></div>
  57. </body>
  58. </html>
  59. <script type="text/javascript">
  60. function checkuid() {
  61. var ids='';
  62. $("input[name='ipbannedid[]']:checked").each(function(i, n){
  63. ids += $(n).val() + ',';
  64. });
  65. if(ids=='') {
  66. window.top.art.dialog({content:"<?php echo L('before_select_operation')?>",lock:true,width:'200',height:'50',time:1.5},function(){});
  67. return false;
  68. } else {
  69. myform.submit();
  70. }
  71. }
  72. function checkSubmit()
  73. {
  74. if (searchform.ip.value=="")
  75. {
  76. searchform.ip.focus();
  77. alert("<?php echo L('parameters_error')?>");
  78. return false;
  79. }
  80. else
  81. {
  82. if(searchform.ip.value.split(".").length!=4)
  83. {
  84. searchform.ip.focus();
  85. alert("<?php echo L('ip_type_error')?>");
  86. return false;
  87. }
  88. else
  89. {
  90. for(i=0;i<searchform.ip.value.split(".").length;i++)
  91. {
  92. var ipPart;
  93. ipPart=searchform.ip.value.split(".")[i];
  94. if(isNaN(ipPart) || ipPart=="" || ipPart==null)
  95. {
  96. searchform.ip.focus();
  97. alert("<?php echo L('ip_type_error')?>");
  98. return false;
  99. }
  100. else
  101. {
  102. if(ipPart/1>255 || ipPart/1<0)
  103. {
  104. searchform.ip.focus();
  105. alert("<?php echo L('ip_type_error')?>");
  106. return false;
  107. }
  108. }
  109. }
  110. }
  111. }
  112. }
  113. </script>