Bootswatch, Summernote, and Captcheck mods for Mods for HESK (mods-for-hesk.com). In use at support.netsyms.com.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

manage_canned.php 23KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. <?php
  2. /**
  3. *
  4. * This file is part of HESK - PHP Help Desk Software.
  5. *
  6. * (c) Copyright Klemen Stirn. All rights reserved.
  7. * https://www.hesk.com
  8. *
  9. * For the full copyright and license agreement information visit
  10. * https://www.hesk.com/eula.php
  11. *
  12. */
  13. define('IN_SCRIPT', 1);
  14. define('HESK_PATH', '../');
  15. define('VALIDATOR', 1);
  16. define('PAGE_TITLE', 'ADMIN_CANNED');
  17. define('MFH_PAGE_LAYOUT', 'TOP_ONLY');
  18. /* Get all the required files and functions */
  19. require(HESK_PATH . 'hesk_settings.inc.php');
  20. require(HESK_PATH . 'inc/common.inc.php');
  21. require(HESK_PATH . 'inc/admin_functions.inc.php');
  22. require(HESK_PATH . 'inc/mail_functions.inc.php');
  23. hesk_load_database_functions();
  24. hesk_session_start();
  25. hesk_dbConnect();
  26. hesk_isLoggedIn();
  27. define('WYSIWYG', 1);
  28. /* Check permissions for this feature */
  29. hesk_checkPermission('can_man_canned');
  30. // Load custom fields
  31. require_once(HESK_PATH . 'inc/custom_fields.inc.php');
  32. /* What should we do? */
  33. if ($action = hesk_REQUEST('a')) {
  34. if (defined('HESK_DEMO')) {
  35. hesk_process_messages($hesklang['ddemo'], 'manage_canned.php', 'NOTICE');
  36. } elseif ($action == 'new') {
  37. new_saved();
  38. } elseif ($action == 'edit') {
  39. edit_saved();
  40. } elseif ($action == 'remove') {
  41. remove();
  42. } elseif ($action == 'order') {
  43. order_saved();
  44. }
  45. }
  46. $modsForHesk_settings = mfh_getSettings();
  47. /* Print header */
  48. require_once(HESK_PATH . 'inc/headerAdmin.inc.php');
  49. /* Print main manage users page */
  50. require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
  51. ?>
  52. <script language="javascript" type="text/javascript"><!--
  53. function confirm_delete() {
  54. if (confirm('<?php echo hesk_makeJsString($hesklang['delete_saved']); ?>')) {
  55. return true;
  56. }
  57. else {
  58. return false;
  59. }
  60. }
  61. function hesk_insertTag(tag) {
  62. var text_to_insert = '%%' + tag + '%%';
  63. var msg = '';
  64. <?php
  65. if ($modsForHesk_settings['rich_text_for_tickets']) { ?>
  66. msg = $('#message').val();
  67. $("#message").summernote('reset');
  68. $("#message").summernote('editor.insertText', msg + text_to_insert));
  69. <?php } else { ?>
  70. msg = document.getElementById('message').value;
  71. document.getElementById('message').value = msg + text_to_insert;
  72. <?php }
  73. ?>
  74. document.form1.msg.focus();
  75. }
  76. function hesk_insertAtCursor(myField, myValue) {
  77. if (document.selection) {
  78. myField.focus();
  79. sel = document.selection.createRange();
  80. sel.text = myValue;
  81. } else if (myField.selectionStart || myField.selectionStart == '0') {
  82. var startPos = myField.selectionStart;
  83. var endPos = myField.selectionEnd;
  84. myField.value = myField.value.substring(0, startPos)
  85. + myValue
  86. + myField.value.substring(endPos, myField.value.length);
  87. } else {
  88. myField.value += myValue;
  89. }
  90. }
  91. //-->
  92. </script>
  93. <?php
  94. $result = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'std_replies` ORDER BY `reply_order` ASC');
  95. $options = '';
  96. $javascript_messages = '';
  97. $javascript_titles = '';
  98. $i = 1;
  99. $j = 0;
  100. $num = hesk_dbNumRows($result);
  101. ?>
  102. <div class="content-wrapper">
  103. <section class="content">
  104. <div class="box">
  105. <div class="box-header with-border">
  106. <h1 class="box-title">
  107. <?php echo $hesklang['savedResponses']; ?>
  108. </h1>
  109. <div class="box-tools pull-right">
  110. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  111. <i class="fa fa-minus"></i>
  112. </button>
  113. </div>
  114. </div>
  115. <div class="box-body">
  116. <?php if ($num < 1)
  117. {
  118. echo '<p>' . $hesklang['no_saved'] . '</p>';
  119. }
  120. else
  121. { ?>
  122. <table class="table table-hover">
  123. <tr>
  124. <th><?php echo $hesklang['saved_title']; ?></th>
  125. <th><?php echo $hesklang['opt']; ?></th>
  126. </tr>
  127. <?php
  128. while ($mysaved = hesk_dbFetchAssoc($result)) {
  129. $j++;
  130. if (isset($_SESSION['canned']['selcat2']) && $mysaved['id'] == $_SESSION['canned']['selcat2']) {
  131. $color = 'admin_green';
  132. unset($_SESSION['canned']['selcat2']);
  133. } else {
  134. $color = $i ? 'admin_white' : 'admin_gray';
  135. }
  136. $tmp = $i ? 'White' : 'Blue';
  137. $style = 'class="option' . $tmp . 'OFF" onmouseover="this.className=\'option' . $tmp . 'ON\'" onmouseout="this.className=\'option' . $tmp . 'OFF\'"';
  138. $i = $i ? 0 : 1;
  139. $options .= '<option value="' . $mysaved['id'] . '"';
  140. $options .= (isset($_SESSION['canned']['id']) && $_SESSION['canned']['id'] == $mysaved['id']) ? ' selected="selected" ' : '';
  141. $options .= '>' . $mysaved['title'] . '</option>';
  142. $javascript_titles .= 'myTitle[' . $mysaved['id'] . ']=\'' . addslashes($mysaved['title']) . "';\n";
  143. if ($modsForHesk_settings['rich_text_for_tickets']) {
  144. $theMessage = hesk_html_entity_decode($mysaved['message']);
  145. $theMessage = addslashes($theMessage);
  146. $javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", $theMessage) . "';\n";
  147. } else {
  148. $javascript_messages .= 'myMsgTxt[' . $mysaved['id'] . ']=\'' . str_replace("\r\n", "\\r\\n' + \r\n'", addslashes($mysaved['message'])) . "';\n";
  149. }
  150. echo '
  151. <tr>
  152. <td>' . $mysaved['title'] . '</td>
  153. <td>
  154. ';
  155. if ($num > 1) {
  156. if ($j == 1) {
  157. echo '<img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" /> <a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-fw fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a>';
  158. } elseif ($j == $num) {
  159. echo '<a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a> <img src="../img/blank.gif" width="16" height="16" alt="" style="padding:3px;border:none;" />';
  160. } else {
  161. echo '
  162. <a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=-15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-up icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_up'] . '"></i></a>
  163. <a href="manage_canned.php?a=order&amp;replyid=' . $mysaved['id'] . '&amp;move=15&amp;token=' . hesk_token_echo(0) . '"><i class="fa fa-arrow-down icon-link green" data-toggle="tooltip" data-placement="top" title="' . $hesklang['move_dn'] . '"></i></a>
  164. ';
  165. }
  166. } else {
  167. echo '';
  168. }
  169. echo '
  170. <a name="'.$mysaved['title'].'" href="manage_canned.php?a=remove&amp;id=' . $mysaved['id'] . '&amp;token=' . hesk_token_echo(0) . '" onclick="return confirm_delete();"><i class="fa fa-times icon-link red" data-toggle="tooltip" data-placement="top" title="' . $hesklang['delete'] . '"></i></a>&nbsp;</td>
  171. </tr>
  172. ';
  173. } // End while
  174. }
  175. ?>
  176. </table>
  177. </div>
  178. </div>
  179. <?php if ($modsForHesk_settings['rich_text_for_tickets']): ?>
  180. <script type="text/javascript">
  181. /* <![CDATA[ */
  182. $(document).ready(function() {
  183. $('.htmlEditor').summernote({
  184. height: 200,
  185. toolbar: [
  186. ['style', ['bold', 'italic', 'underline', 'clear']],
  187. ['font', ['strikethrough', 'superscript', 'subscript']],
  188. ['para', ['ul', 'ol']]
  189. ]
  190. });
  191. });
  192. /* ]]> */
  193. </script>
  194. <?php endif; ?>
  195. <div class="box">
  196. <div class="box-header with-border">
  197. <h1 class="box-title">
  198. <?php echo $hesklang['manage_saved']; ?> <a href="javascript:void(0)"
  199. onclick="javascript:alert('<?php echo hesk_makeJsString($hesklang['manage_intro']); ?>')"><i
  200. class="fa fa-question-circle settingsquestionmark"></i></a>
  201. </h1>
  202. <div class="box-tools pull-right">
  203. <button type="button" class="btn btn-box-tool" data-widget="collapse">
  204. <i class="fa fa-minus"></i>
  205. </button>
  206. </div>
  207. </div>
  208. <div class="box-body">
  209. <script language="javascript" type="text/javascript"><!--
  210. // -->
  211. var myMsgTxt = new Array();
  212. var myTitle = new Array();
  213. myMsgTxt[0] = '';
  214. myTitle[0] = '';
  215. <?php
  216. echo $javascript_titles;
  217. echo $javascript_messages;
  218. ?>
  219. function setMessage(msgid) {
  220. var useHtmlEditor = <?php echo $modsForHesk_settings['rich_text_for_tickets']; ?>;
  221. var myMsg = myMsgTxt[msgid];
  222. var mySubject = myTitle[msgid];
  223. if (myMsg == '') {
  224. if (useHtmlEditor) {
  225. $("#message").summernote("reset");
  226. }
  227. else {
  228. $('#message').val('');
  229. }
  230. $('#subject').val('');
  231. return true;
  232. }
  233. if (document.getElementById) {
  234. if (useHtmlEditor) {
  235. $("#message").summernote('reset');
  236. $("#message").summernote('editor.insertText', myMsg));
  237. } else {
  238. myMsg = $('<textarea />').html(myMsg).text();
  239. $('#message').val(myMsg).trigger('input');
  240. }
  241. mySubject = $('<textarea />').html(mySubject).text();
  242. $('#subject').val(mySubject).trigger('input');
  243. }
  244. else {
  245. document.form1.message.value = myMsg;
  246. document.form1.subject.value = mySubject;
  247. }
  248. if (msgid == 0) {
  249. document.form1.a[0].checked = true;
  250. } else {
  251. document.form1.a[1].checked = true;
  252. }
  253. }
  254. //-->
  255. </script>
  256. <?php
  257. /* This will handle error, success and notice messages */
  258. hesk_handle_messages();
  259. ?>
  260. <?php
  261. $onsubmit = '';
  262. if ($modsForHesk_settings['rich_text_for_tickets']) {
  263. $onsubmit = 'onsubmit="return validateRichText(\'message-help-block\', \'message-group\', \'message\', \''.htmlspecialchars($hesklang['this_field_is_required']).'\')"';
  264. }
  265. ?>
  266. <form action="manage_canned.php" method="post" name="form1" class="form-horizontal" role="form" data-toggle="validator" <?php echo $onsubmit; ?>>
  267. <div class="form-group">
  268. <div class="col-sm-12">
  269. <?php
  270. if ($num > 0) {
  271. ?>
  272. <div class="row">
  273. <div class="col-sm-12">
  274. <div class="radio">
  275. <label><input type="radio" name="a"
  276. value="new" <?php echo (!isset($_SESSION['canned']['what']) || $_SESSION['canned']['what'] != 'EDIT') ? 'checked="checked"' : ''; ?> /> <?php echo $hesklang['canned_add']; ?>
  277. </label>
  278. </div>
  279. </div>
  280. </div>
  281. <div class="row">
  282. <div class="col-sm-6">
  283. <div class="radio">
  284. <label><input type="radio" name="a"
  285. value="edit" <?php echo (isset($_SESSION['canned']['what']) && $_SESSION['canned']['what'] == 'EDIT') ? 'checked="checked"' : ''; ?> /> <?php echo $hesklang['canned_edit']; ?>
  286. </label>:
  287. </div>
  288. </div>
  289. <div class="col-sm-6">
  290. <select class="form-control" name="saved_replies" onchange="setMessage(this.value)">
  291. <option value="0"> - <?php echo $hesklang['select_empty']; ?>-
  292. </option><?php echo $options; ?></select>
  293. </div>
  294. </div>
  295. <?php
  296. } else {
  297. echo '<input type="hidden" name="a" value="new" /><label> ' . $hesklang['canned_add'] . '</label>';
  298. }
  299. ?>
  300. </div>
  301. </div>
  302. <div class="form-group">
  303. <label for="name" class="col-sm-2 control-label"><?php echo $hesklang['saved_title']; ?></label>
  304. <div class="col-sm-10">
  305. <span id="HeskTitle"><input id="subject" class="form-control"
  306. placeholder="<?php echo htmlspecialchars($hesklang['saved_title']); ?>"
  307. type="text" name="name" size="40"
  308. data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
  309. maxlength="50" <?php if (isset($_SESSION['canned']['name'])) {
  310. echo ' value="' . stripslashes($_SESSION['canned']['name']) . '" ';
  311. } ?> required></span>
  312. <div class="help-block with-errors"></div>
  313. </div>
  314. </div>
  315. <div class="form-group" id="message-group">
  316. <label for="msg" class="col-sm-2 control-label"><?php echo $hesklang['message']; ?></label>
  317. <div class="col-sm-10">
  318. <span id="HeskMsg">
  319. <textarea id="message" class="htmlEditor form-control"
  320. placeholder="<?php echo htmlspecialchars($hesklang['message']); ?>" name="msg"
  321. data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
  322. rows="15" cols="70" required><?php
  323. if (isset($_SESSION['canned']['msg'])) {
  324. echo stripslashes($_SESSION['canned']['msg']);
  325. }
  326. ?></textarea>
  327. </span>
  328. <div class="help-block with-errors" id="message-help-block"></div>
  329. <?php echo $hesklang['insert_special']; ?>:
  330. <a href="javascript:void(0)"
  331. onclick="hesk_insertTag('HESK_ID')"><?php echo $hesklang['seqid']; ?></a> |
  332. <a href="javascript:void(0)"
  333. onclick="hesk_insertTag('HESK_TRACK_ID')"><?php echo $hesklang['trackID']; ?></a> |
  334. <a href="javascript:void(0)"
  335. onclick="hesk_insertTag('HESK_NAME')"><?php echo $hesklang['name']; ?></a> |
  336. <a href="javascript:void(0)"
  337. onclick="hesk_insertTag('HESK_FIRST_NAME')"><?php echo $hesklang['fname']; ?></a> |
  338. <a href="javascript:void(0)"
  339. onclick="hesk_insertTag('HESK_EMAIL')"><?php echo $hesklang['email']; ?></a> |
  340. <a href="javascript:void(0)"
  341. onclick="hesk_insertTag('HESK_OWNER')"><?php echo $hesklang['owner']; ?></a>
  342. <?php
  343. foreach ($hesk_settings['custom_fields'] as $k => $v) {
  344. if ($v['use']) {
  345. if ($modsForHesk_settings['custom_field_setting']) {
  346. $v['name'] = $hesklang[$v['name']];
  347. }
  348. echo '| <a href="javascript:void(0)" onclick="hesk_insertTag(\'HESK_' . $k . '\')">' . $v['name'] . '</a> ';
  349. }
  350. }
  351. ?>
  352. </div>
  353. </div>
  354. <div class="form-group text-center">
  355. <input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
  356. <input type="submit" value="<?php echo $hesklang['save_changes']; ?>" class="btn btn-default"/>
  357. </div>
  358. </form>
  359. </div>
  360. </div>
  361. </section>
  362. </div>
  363. <?php
  364. require_once(HESK_PATH . 'inc/footer.inc.php');
  365. exit();
  366. /*** START FUNCTIONS ***/
  367. function edit_saved()
  368. {
  369. global $hesk_settings, $hesklang;
  370. /* A security check */
  371. hesk_token_check('POST');
  372. $hesk_error_buffer = '';
  373. $id = intval(hesk_POST('saved_replies')) or $hesk_error_buffer .= '<li>' . $hesklang['selcan'] . '</li>';
  374. $savename = hesk_input(hesk_POST('name')) or $hesk_error_buffer .= '<li>' . $hesklang['ent_saved_title'] . '</li>';
  375. $msg = hesk_input(hesk_POST('msg')) or $hesk_error_buffer .= '<li>' . $hesklang['ent_saved_msg'] . '</li>';
  376. // Avoid problems with utf-8 newline chars in Javascript code, detect and remove them
  377. $msg = preg_replace('/\R/u', "\r\n", $msg);
  378. $_SESSION['canned']['what'] = 'EDIT';
  379. $_SESSION['canned']['id'] = $id;
  380. $_SESSION['canned']['name'] = $savename;
  381. $_SESSION['canned']['msg'] = $msg;
  382. /* Any errors? */
  383. if (strlen($hesk_error_buffer)) {
  384. $hesk_error_buffer = $hesklang['rfm'] . '<br /><br /><ul>' . $hesk_error_buffer . '</ul>';
  385. hesk_process_messages($hesk_error_buffer, 'manage_canned.php?saved_replies=' . $id);
  386. }
  387. $result = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` SET `title`='" . hesk_dbEscape($savename) . "',`message`='" . hesk_dbEscape($msg) . "' WHERE `id`='" . intval($id) . "'");
  388. unset($_SESSION['canned']['what']);
  389. unset($_SESSION['canned']['id']);
  390. unset($_SESSION['canned']['name']);
  391. unset($_SESSION['canned']['msg']);
  392. hesk_process_messages($hesklang['your_saved'], 'manage_canned.php?saved_replies=' . $id, 'SUCCESS');
  393. } // End edit_saved()
  394. function new_saved()
  395. {
  396. global $hesk_settings, $hesklang;
  397. /* A security check */
  398. hesk_token_check('POST');
  399. $hesk_error_buffer = '';
  400. $savename = hesk_input(hesk_POST('name')) or $hesk_error_buffer .= '<li>' . $hesklang['ent_saved_title'] . '</li>';
  401. $msg = hesk_input(hesk_POST('msg')) or $hesk_error_buffer .= '<li>' . $hesklang['ent_saved_msg'] . '</li>';
  402. // Avoid problems with utf-8 newline chars in Javascript code, detect and remove them
  403. $msg = preg_replace('/\R/u', "\r\n", $msg);
  404. $_SESSION['canned']['what'] = 'NEW';
  405. $_SESSION['canned']['name'] = $savename;
  406. $_SESSION['canned']['msg'] = $msg;
  407. /* Any errors? */
  408. if (strlen($hesk_error_buffer)) {
  409. $hesk_error_buffer = $hesklang['rfm'] . '<br /><br /><ul>' . $hesk_error_buffer . '</ul>';
  410. hesk_process_messages($hesk_error_buffer, 'manage_canned.php');
  411. }
  412. /* Get the latest reply_order */
  413. $result = hesk_dbQuery('SELECT `reply_order` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'std_replies` ORDER BY `reply_order` DESC LIMIT 1');
  414. $row = hesk_dbFetchRow($result);
  415. $my_order = $row[0] + 10;
  416. hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` (`title`,`message`,`reply_order`) VALUES ('" . hesk_dbEscape($savename) . "','" . hesk_dbEscape($msg) . "','" . intval($my_order) . "')");
  417. unset($_SESSION['canned']['what']);
  418. unset($_SESSION['canned']['name']);
  419. unset($_SESSION['canned']['msg']);
  420. hesk_process_messages($hesklang['your_saved'], 'manage_canned.php', 'SUCCESS');
  421. } // End new_saved()
  422. function remove()
  423. {
  424. global $hesk_settings, $hesklang;
  425. /* A security check */
  426. hesk_token_check();
  427. $mysaved = intval(hesk_GET('id')) or hesk_error($hesklang['id_not_valid']);
  428. hesk_dbQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` WHERE `id`='" . intval($mysaved) . "'");
  429. if (hesk_dbAffectedRows() != 1) {
  430. hesk_error("$hesklang[int_error]: $hesklang[reply_not_found].");
  431. }
  432. hesk_process_messages($hesklang['saved_rem_full'], 'manage_canned.php', 'SUCCESS');
  433. } // End remove()
  434. function order_saved()
  435. {
  436. global $hesk_settings, $hesklang;
  437. /* A security check */
  438. hesk_token_check();
  439. $replyid = intval(hesk_GET('replyid')) or hesk_error($hesklang['reply_move_id']);
  440. $_SESSION['canned']['selcat2'] = $replyid;
  441. $reply_move = intval(hesk_GET('move'));
  442. hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` SET `reply_order`=`reply_order`+" . intval($reply_move) . " WHERE `id`='" . intval($replyid) . "'");
  443. if (hesk_dbAffectedRows() != 1) {
  444. hesk_error("$hesklang[int_error]: $hesklang[reply_not_found].");
  445. }
  446. /* Update all category fields with new order */
  447. $result = hesk_dbQuery('SELECT `id` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'std_replies` ORDER BY `reply_order` ASC');
  448. $i = 10;
  449. while ($myreply = hesk_dbFetchAssoc($result)) {
  450. hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` SET `reply_order`=" . intval($i) . " WHERE `id`='" . intval($myreply['id']) . "'");
  451. $i += 10;
  452. }
  453. header('Location: manage_canned.php');
  454. exit();
  455. } // End order_saved()
  456. ?>