public_view.tpl.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. include $this->admin_tpl('header', 'admin');
  4. ?>
  5. <div class="pad-10" style="padding-bottom:0px;">
  6. <table width="100%" height="400" class="table_form">
  7. <?php if (isset($func)) :?>
  8. <tr>
  9. <td><?php echo L('characteristic_function')?>:<?php
  10. if ($func) {
  11. foreach ($func as $val) {
  12. if($val) {
  13. echo "<input type='button' onclick=\"fnSearch('$val');\" value='".$val."' class='button'> ";
  14. }
  15. }
  16. }
  17. ?></td>
  18. </tr>
  19. <?php endif;?>
  20. <?php if (isset($code)) :?>
  21. <tr>
  22. <td><?php echo L('characteristic_key')?>:<?php
  23. if($code) {
  24. foreach ($code as $val) {
  25. if($val) {
  26. echo "<input type='button' onclick=\"fnSearch('".new_html_special_chars($val)."');\" value='".new_html_special_chars($val)."' class='button'> ";
  27. }
  28. }
  29. }
  30. ?></td>
  31. </tr>
  32. <?php endif;?>
  33. <tr>
  34. <td><textarea name="code" id="code" style="width:650px;height: 380px;"><?php echo new_html_special_chars($html)?></textarea></td>
  35. </tr>
  36. </table>
  37. </div>
  38. <script type="text/javascript">
  39. var oRange;
  40. var intCount = 0;
  41. var intTotalCount = 100;
  42. function fnSearch(strBeReplaced) {
  43. var strBeReplaced;
  44. var strReplace;
  45. fnNext();
  46. $('#code').focus();
  47. oRange = document.getElementById('code').createTextRange();
  48. for (i=1; oRange.findText(strBeReplaced)!=false; i++) {
  49. if(i==intCount){
  50. oRange.select();
  51. oRange.scrollIntoView();
  52. break;
  53. }
  54. oRange.collapse(false);
  55. }
  56. }
  57. function fnNext(){
  58. if (intCount > 0 && intCount < intTotalCount){
  59. intCount = intCount + 1;
  60. } else {
  61. intCount = 1 ;
  62. }
  63. }
  64. //-->
  65. </SCRIPT>
  66. </script>
  67. </body>
  68. </html>