cache.php
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:4k
源码类别:

电子政务应用

开发平台:

Java

  1. <?php
  2. // +-------------------------------------------------------------+
  3. // | DeskPRO v [2.0.1 Production]
  4. // | Copyright (C) 2001 - 2004 Headstart Solutions Limited
  5. // | Supplied by WTN-WDYL
  6. // | Nullified by WTN-WDYL
  7. // | Distribution via WebForum, ForumRU and associated file dumps
  8. // +-------------------------------------------------------------+
  9. // | DESKPRO IS NOT FREE SOFTWARE
  10. // +-------------------------------------------------------------+
  11. // | License ID : Full Enterprise License =) ...
  12. // | License Owner : WTN-WDYL Team
  13. // +-------------------------------------------------------------+
  14. // | $RCSfile: cache.php,v $
  15. // | $Date: 2004/02/10 01:34:28 $
  16. // | $Revision: 1.18 $
  17. // +-------------------------------------------------------------+
  18. // | File Details:
  19. // | - Load and buffer quick replies and provide ticket reply functions
  20. // +-------------------------------------------------------------+
  21. error_reporting(E_ALL ^ E_NOTICE);
  22. require("./../global.php");
  23. reload_index();
  24. ?>
  25. <HTML>
  26. <HEAD>
  27. <META HTTP-EQUIV="refresh" content="3600;cache.php">
  28. <SCRIPT language="Javascript">
  29. reply = new Array();
  30. reply[0] = new Array();
  31. function buildselect() {
  32. top.center.document.dpreply.drop.options[0] = new Option('--- Quick Replies ---', '0');
  33. <?php
  34. $db->query("SELECT * FROM quickreply_cat WHERE techid = '$user[id]' OR global");
  35. $i = 1;
  36. while ($cat = $db->row_array()) {
  37. $cat['name'] = addslashes_js($cat['name']);
  38. $cats .= $cat['id']  . ',';
  39. $cat_temp .= "nreply[$cat[id]] = new Array();n";
  40. echo " top.center.document.dpreply.drop.options[$i] = new Option('$cat[name]', '$cat[id]');n";
  41. $i++;
  42. }
  43. echo " return true;n}nn";
  44. $cats = substr($cats, 0, -1);
  45. $i=0;
  46. if (!$cats) {
  47. $cats = '0';
  48. }
  49. $db->query("SELECT * FROM quickreply WHERE (category IN ($cats) OR (category = 0 AND techid = $user[id])) ORDER BY category");
  50. echo $cat_temp;
  51. while ($article = $db->row_array()) {
  52. if ($article['category'] != $lastcat) {
  53. $i=0;
  54. }
  55. echo "reply[$article[category]][$i] = new Array('$article[id]', '" . addslashes_js($article['name']) . "', '" .  js_linespan(addslashes_js($article['response'])) . "');n";
  56. $i++;
  57. $lastcat = $article['category'];
  58. }
  59. ?>
  60. function showdata(i) {
  61. // empty old rows
  62. for (m=top.center.document.dpreply.list3.options.length;m>=0;m--) {
  63. top.center.document.dpreply.list3.options[m]=null;
  64. }
  65. // create new rows
  66. if (i != '') {
  67. var totalRows = reply[i].length;
  68. for (rowCount = 0; rowCount < totalRows; rowCount++) {
  69. top.center.document.dpreply.list3.options[rowCount] = new Option(reply[i][rowCount][1], rowCount);
  70. top.center.document.dpreply.category.value = i;
  71. }
  72. }
  73. }
  74. function godeep(entry, category) {
  75. if (entry == '') {
  76. alert('Please select an entry');
  77. } else {
  78. insertAtCaret (top.center.document.dpreply.reply, reply[category][entry][2]+" ");
  79. top.center.document.dpreply.reply.focus();
  80. }
  81. }
  82. function storeCaret (textEl) {
  83.     if (textEl.createTextRange) 
  84.         textEl.caretPos = document.selection.createRange().duplicate();
  85.     }
  86. function insertAtCaret (textEl, text) {
  87.     if (textEl.createTextRange && textEl.caretPos) {
  88.         var caretPos = textEl.caretPos;
  89.         caretPos.text =
  90.         caretPos.text.charAt(caretPos.text.length - 1) == ' ' ?
  91.         text + "n" : text;
  92.     }
  93.     else
  94.         textEl.value = text + "n" + textEl.value;
  95. }
  96. </SCRIPT>
  97. </HEAD>
  98. <body bgcolor="#6782B1" text="#000000" leftmargin="0" marginwidth="0" marginheight="0" topmargin="0" STYLE="margin-bottom:0px">
  99. </HTML>