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/ticket-templates/index.php

24 lines
819 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`, `title`, `tpl_order` FROM `"
. hesk_dbEscape($hesk_settings['db_pfix']) . "ticket_templates` WHERE `id` = ".intval($_GET['id']));
if (hesk_dbNumRows($response) == 0) {
return http_response_code(404);
}
$result = hesk_dbFetchAssoc($response);
$result['title'] = hesk_html_entity_decode($result['title']);
$result['message'] = hesk_html_entity_decode($result['message']);
header('Content-Type: application/json');
print json_encode($result);
return http_response_code(200);
}