comment_listinfo.tpl.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header', 'admin');
  4. ?>
  5. <div class="pad_10">
  6. <div id="searchid">
  7. <form name="searchform" action="" method="get" >
  8. <input type="hidden" value="comment" name="m">
  9. <input type="hidden" value="comment_admin" name="c">
  10. <input type="hidden" value="listinfo" name="a">
  11. <input type="hidden" value="1" name="search">
  12. <input type="hidden" value="<?php echo $_SESSION['pc_hash']?>" name="pc_hash">
  13. <table width="100%" cellspacing="0" class="search-form">
  14. <tbody>
  15. <tr>
  16. <td>
  17. <div class="explain-col">
  18. <?php if($max_table > 1) {?>
  19. <?php echo L('choose_database')?>:<select name="tableid" onchange="show_tbl(this)"><?php for($i=1;$i<=$max_table;$i++) {?><option value="<?php echo $i?>" <?php if($i==$tableid){?>selected<?php }?>><?php echo $this->comment_data_db->db_tablepre?>comment_data_<?php echo $i?></option><?php }?></select>
  20. <?php }?>
  21. <select name="searchtype">
  22. <option value='0' <?php if($_GET['searchtype']==0) echo 'selected';?>><?php echo L('original').L('title');?></option>
  23. <option value='1' <?php if($_GET['searchtype']==1) echo 'selected';?>><?php echo L('original');?>ID</option>
  24. <option value='2' <?php if($_GET['searchtype']==2) echo 'selected';?>><?php echo L('username');?></option>
  25. </select>
  26. <input name="keyword" type="text" value="<?php if(isset($keywords)) echo $keywords;?>" class="input-text" />
  27. <input type="submit" name="search" class="button" value="<?php echo L('search');?>" />
  28. </div>
  29. </td>
  30. </tr>
  31. </tbody>
  32. </table>
  33. </form>
  34. </div>
  35. </div>
  36. <div class="pad-lr-10">
  37. <form name="myform" id="myform" action="" method="get" >
  38. <input type="hidden" value="comment" name="m">
  39. <input type="hidden" value="comment_admin" name="c">
  40. <input type="hidden" value="del" name="a">
  41. <input type="hidden" value="<?php echo $tableid?>" name="tableid">
  42. <input type="hidden" value="1" name="dosubmit">
  43. <div class="table-list comment">
  44. <table width="100%">
  45. <thead>
  46. <tr>
  47. <th width="16"><input type="checkbox" value="" id="check_box" onclick="selectall('ids[]');"></th>
  48. <th width="130"><?php echo L('author')?></th>
  49. <th><?php echo L('comment')?></th>
  50. <th width="230"><?php echo L('original').L('title');?></th>
  51. <th width="72"><?php echo L('operations_manage');?></th>
  52. </tr>
  53. </thead>
  54. <tbody class="add_comment">
  55. <?php
  56. if(is_array($data)) {
  57. foreach($data as $v) {
  58. $comment_info = $this->comment_db->get_one(array('commentid'=>$v['commentid']));
  59. if (strpos($v['content'], '<div class="content">') !==false) {
  60. $pos = strrpos($v['content'], '</div>');
  61. $v['content'] = substr($v['content'], $pos+6);
  62. }
  63. ?>
  64. <tr id="tbody_<?php echo $v['id']?>">
  65. <td align="center" width="16"><input class="inputcheckbox " name="ids[]" value="<?php echo $v['id'];?>" type="checkbox"></td>
  66. <td width="130"><?php echo $v['username']?><br /><?php echo $v['ip']?></td>
  67. <td><font color="#888888"><?php echo L('chez')?> <?php echo format::date($v['creat_at'], 1)?> <?php echo L('release')?></font><br /><?php echo $v['content']?></td>
  68. <td width="230"><a href="?m=comment&c=comment_admin&a=listinfo&search=1&searchtype=0&keyword=<?php echo urlencode($comment_info['title'])?>&pc_hash=<?php echo $_SESSION['pc_hash']?>&tableid=<?php echo $tableid?>"><?php echo $comment_info['title']?></td>
  69. <td align='center' width="72"><a href="?m=comment&c=comment_admin&a=del&ids=<?php echo $v['id']?>&tableid=<?php echo $tableid?>&dosubmit=1" onclick="return check(<?php echo $v['id']?>, -1, '<?php echo new_html_special_chars($v['commentid']);?>')"><?php echo L('delete');?></a> </td>
  70. </tr>
  71. <?php }
  72. }
  73. ?>
  74. </tbody>
  75. </table>
  76. <div class="btn"><label for="check_box"><?php echo L('selected_all');?>/<?php echo L('cancel');?></label>
  77. <input type="hidden" value="<?php echo $_SESSION['pc_hash'];?>" name="pc_hash">
  78. <input type="submit" class="button" value="<?php echo L('delete');?>" />
  79. </div>
  80. <div id="pages"><?php echo $pages;?></div>
  81. </div>
  82. </form>
  83. </div>
  84. <script type="text/javascript">
  85. window.top.$('#display_center_id').css('display','none');
  86. function check(id, type, commentid) {
  87. if(type == -1 && !confirm('<?php echo L('are_you_sure_you_want_to_delete')?>')) {
  88. return false;
  89. }
  90. return true;
  91. }
  92. function show_tbl(obj) {
  93. var pdoname = $(obj).val();
  94. location.href='?m=comment&c=comment_admin&a=listinfo&tableid='+pdoname+'&pc_hash=<?php echo $_SESSION['pc_hash']?>';
  95. }
  96. function confirm_delete(){
  97. if(confirm('<?php echo L('confirm_delete', array('message' => L('selected')));?>')) $('#myform').submit();
  98. }
  99. </script>
  100. </body>
  101. </html>