You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mods-for-HESK-Netsyms/api/canned/index.php

19 lines
600 B
PHP

<?php
define('IN_SCRIPT', 1);
define('HESK_PATH', '../../');
require(HESK_PATH . 'hesk_settings.inc.php');
require(HESK_PATH . 'inc/common.inc.php');
hesk_load_api_database_functions();
hesk_dbConnect();
// Routing
if (isset($_GET['id'])) {
$response = hesk_dbQuery("SELECT `id`, `message`, `html`, `title`, `reply_order` FROM `"
. hesk_dbEscape($hesk_settings['db_pfix']) . "std_replies` WHERE `id` = ".intval($_GET['id']));
$result = hesk_dbFetchAssoc($response);
header('Content-Type: application/json');
print json_encode($result);
return http_response_code(200);
}