scan_index.tpl.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 class="common-form">
  7. <form name="myform" action="?m=scan&c=index&a=public_update_config" method="post" id="myform" onsubmit="return check_form()">
  8. <table width="100%" class="table_form">
  9. <tr>
  10. <td width="80"><?php echo L('ravsingle')?>:</td>
  11. <td><ul id="file" style="list-style:none; height:200px;overflow:auto;width:300px;">
  12. <?php $dir = $file= ''; foreach ($list as $v){
  13. $filename = basename($v);
  14. if (is_dir($v)) {
  15. $dir .= '<li><input type="checkbox" name="dir[]" value="'.$v.'" '.(isset($scan['dir']) && is_array($scan['dir']) && !empty($scan['dir']) && in_array($v, $scan['dir']) ? 'checked' :'').'><img src="'.IMG_PATH.'folder.gif"> '.$filename.'</li>';
  16. } elseif (substr(strtolower($v), -3, 3)=='php'){
  17. $file .= '<li><input type="checkbox" name="dir[]" value="'.$v.'" '.(isset($scan['dir']) && is_array($scan['dir']) && !empty($scan['dir']) && in_array($v, $scan['dir']) ? 'checked' :'').'><img src="'.IMG_PATH.'file.gif">'.$filename.'</li>';
  18. } else {
  19. continue;
  20. }
  21. }
  22. echo $dir,$file;
  23. ?>
  24. </ul></td>
  25. </tr>
  26. <tr>
  27. <td><?php echo L('file_type')?>:</td>
  28. <td><input type="text" name="info[file_type]" size="100" class="input-text" value="<?php echo $scan['file_type']?>"></input></td>
  29. </tr>
  30. <tr>
  31. <td><?php echo L('characteristic_function')?>:</td>
  32. <td><input type="text" name="info[func]" size="100" class="input-text" value="<?php echo $scan['func']?>"></input></td>
  33. </tr>
  34. <tr>
  35. <td><?php echo L('characteristic_key')?>:</td>
  36. <td><input type="text" name="info[code]" size="100" class="input-text" value="<?php echo $scan['code']?>"></input></td>
  37. </tr>
  38. <tr>
  39. <td><?php echo L('md5_the_mirror')?>:</td>
  40. <td>
  41. <?php echo form::select($md5_file_list, $scan['md5_file'], 'name="info[md5_file]"')?>
  42. </td>
  43. </tr>
  44. </table>
  45. <div class="bk15"></div>
  46. <input name="dosubmit" type="submit" id="dosubmit" value="<?php echo L('submit')?>" class="button">
  47. </form>
  48. </div>
  49. </div>
  50. <script type="text/javascript">
  51. function check_form() {
  52. var checked = 0;
  53. $("input[type='checkbox'][name='dir[]']").each(function(i,n){if ($(this).attr('checked')=='checked') {checked = 1;}});
  54. if (checked) {
  55. return true;
  56. } else {
  57. alert('<?php echo L('please_select_the_content')?>');
  58. return false;
  59. }
  60. }
  61. </script>
  62. </body>
  63. </html>