本文整理汇总了PHP中hesk_POST函数的典型用法代码示例。如果您正苦于以下问题:PHP hesk_POST函数的具体用法?PHP hesk_POST怎么用?PHP hesk_POST使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了hesk_POST函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: hesk_iTestDatabaseConnection
function hesk_iTestDatabaseConnection()
{
global $hesk_settings, $hesklang;
$db_success = 1;
$hesk_settings['db_host'] = hesk_input(hesk_POST('host'));
$hesk_settings['db_name'] = hesk_input(hesk_POST('name'));
$hesk_settings['db_user'] = hesk_input(hesk_POST('user'));
$hesk_settings['db_pass'] = hesk_input(hesk_POST('pass'));
// Allow & in password
$hesk_settings['db_pass'] = str_replace('&', '&', $hesk_settings['db_pass']);
// Use MySQLi extension to connect?
$use_mysqli = function_exists('mysqli_connect') ? true : false;
// Start output buffering
ob_start();
// Connect to database
if ($use_mysqli) {
// Do we need a special port? Check and connect to the database
if (strpos($hesk_settings['db_host'], ':')) {
list($hesk_settings['db_host'], $hesk_settings['db_port']) = explode(':', $hesk_settings['db_host']);
$hesk_db_link = mysqli_connect($hesk_settings['db_host'], $hesk_settings['db_user'], $hesk_settings['db_pass'], $hesk_settings['db_name'], intval($hesk_settings['db_port'])) or $db_success = 0;
} else {
$hesk_db_link = mysqli_connect($hesk_settings['db_host'], $hesk_settings['db_user'], $hesk_settings['db_pass'], $hesk_settings['db_name']) or $db_success = 0;
}
} else {
$hesk_db_link = mysql_connect($hesk_settings['db_host'], $hesk_settings['db_user'], $hesk_settings['db_pass']) or $db_success = 0;
// Select database works OK?
if ($db_success == 1 && !mysql_select_db($hesk_settings['db_name'], $hesk_db_link)) {
// No, try to create the database
if (function_exists('mysql_create_db') && mysql_create_db($hesk_settings['db_name'], $hesk_db_link)) {
if (mysql_select_db($hesk_settings['db_name'], $hesk_db_link)) {
$db_success = 1;
} else {
$db_success = 0;
}
} else {
$db_success = 0;
}
}
}
ob_end_clean();
// Any errors?
if (!$db_success) {
global $mysql_log;
$mysql_log = $use_mysqli ? mysqli_connect_error() : mysql_error();
hesk_iDatabase(1);
}
// Check MySQL version
define('MYSQL_VERSION', hesk_dbResult(hesk_dbQuery('SELECT VERSION() AS version')));
if (version_compare(MYSQL_VERSION, REQUIRE_MYSQL_VERSION, '<')) {
hesk_iDatabase(5);
}
return $hesk_db_link;
}
示例2: define
*******************************************************************************/
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
// Get all the required files and functions
require HESK_PATH . 'hesk_settings.inc.php';
require HESK_PATH . 'inc/common.inc.php';
require HESK_PATH . 'inc/setup_functions.inc.php';
// Print header
header('Content-Type: text/html; charset=' . $hesklang['ENCODING']);
// Demo mode?
if (defined('HESK_DEMO')) {
hesk_show_notice($hesklang['ddemo']);
exit;
}
// Test type?
$test_type = hesk_POST('test');
// Test MySQL connection
if ($test_type == 'mysql') {
if (hesk_testMySQL()) {
hesk_show_success($hesklang['conok']);
} elseif (!empty($mysql_log)) {
hesk_show_error($mysql_error . '<br /><br /><b>' . $hesklang['mysql_said'] . ':</b> ' . $mysql_log);
} else {
hesk_show_error($mysql_error);
}
} elseif ($test_type == 'pop3') {
if (hesk_testPOP3()) {
hesk_show_success($hesklang['conok']);
} else {
hesk_show_error($pop3_error . '<br /><br /><textarea name="pop3_log" rows="10" cols="60">' . $pop3_log . '</textarea>');
}
示例3: new_sm
function new_sm()
{
global $hesk_settings, $hesklang, $listBox;
global $hesk_error_buffer;
// A security check
# hesk_token_check('POST');
$hesk_error_buffer = array();
$style = intval(hesk_POST('style', 0));
if ($style > 4 || $style < 0) {
$style = 0;
}
$type = empty($_POST['type']) ? 0 : 1;
$title = hesk_input(hesk_POST('title')) or $hesk_error_buffer[] = $hesklang['sm_e_title'];
$message = hesk_getHTML(hesk_POST('message'));
// Any errors?
if (count($hesk_error_buffer)) {
$_SESSION['new_sm'] = array('style' => $style, 'type' => $type, 'title' => $title, 'message' => hesk_input(hesk_POST('message')));
$tmp = '';
foreach ($hesk_error_buffer as $error) {
$tmp .= "<li>{$error}</li>\n";
}
$hesk_error_buffer = $tmp;
$hesk_error_buffer = $hesklang['rfm'] . '<br /><br /><ul>' . $hesk_error_buffer . '</ul>';
hesk_process_messages($hesk_error_buffer, 'service_messages.php');
}
// Just preview the message?
if (isset($_POST['sm_preview'])) {
$_SESSION['preview_sm'] = true;
$_SESSION['new_sm'] = array('style' => $style, 'type' => $type, 'title' => $title, 'message' => $message);
header('Location: service_messages.php');
exit;
}
// Get the latest service message order
$res = hesk_dbQuery("SELECT `order` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "service_messages` ORDER BY `order` DESC LIMIT 1");
$row = hesk_dbFetchRow($res);
$my_order = intval($row[0]) + 10;
// Insert service message into database
hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "service_messages` (`author`,`title`,`message`,`style`,`type`,`order`) VALUES (\n '" . intval($_SESSION['id']) . "',\n '" . hesk_dbEscape($title) . "',\n '" . hesk_dbEscape($message) . "',\n '{$style}',\n '{$type}',\n '{$my_order}'\n )");
$_SESSION['smord'] = hesk_dbInsertID();
hesk_process_messages($hesklang['sm_added'], 'service_messages.php', 'SUCCESS');
}
示例4: change_manager
function change_manager()
{
global $hesklang, $hesk_settings;
$catid = hesk_POST('catid');
$newManagerId = hesk_POST('managerid');
hesk_dbQuery('UPDATE `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'categories` SET `manager` = ' . intval($newManagerId) . ' WHERE `id` = ' . intval($catid));
if (hesk_dbAffectedRows() != 1) {
hesk_process_messages($hesklang['int_error'] . ': ' . $hesklang['cat_not_found'], './manage_categories.php');
}
if ($newManagerId == 0) {
// There is no new manager.
return;
}
// Add the category to the user's categories list, if not already present
$currentCatRs = hesk_dbQuery('SELECT `categories` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'users` WHERE `id` = ' . intval($newManagerId));
$currentCategories = hesk_dbFetchAssoc($currentCatRs);
$categories = explode(',', $currentCategories['categories']);
if (!in_array($catid, $categories)) {
hesk_dbQuery('UPDATE `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'users` SET `categories` = \'' . $currentCategories['categories'] . ',' . $catid . '\' WHERE `id` = ' . intval($newManagerId));
}
hesk_process_messages($hesklang['manager_updated'], './manage_categories.php', 'SUCCESS');
}
示例5: define
* a license please visit the page below:
* https://www.hesk.com/buy.php
*******************************************************************************/
define('IN_SCRIPT', 1);
define('HESK_PATH', '../');
/* Get all the required files and functions */
require HESK_PATH . 'hesk_settings.inc.php';
require HESK_PATH . 'inc/common.inc.php';
require HESK_PATH . 'inc/admin_functions.inc.php';
hesk_load_database_functions();
hesk_session_start();
hesk_dbConnect();
hesk_isLoggedIn();
/* Check permissions for this feature */
hesk_checkPermission('can_view_tickets');
hesk_checkPermission('can_reply_tickets');
/* A security check */
hesk_token_check('POST');
/* Ticket ID */
$trackingID = hesk_cleanID() or die($hesklang['int_error'] . ': ' . $hesklang['no_trackID']);
$priority = intval(hesk_POST('priority'));
if ($priority < 0 || $priority > 3) {
hesk_process_messages($hesklang['inpr'], 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'NOTICE');
}
$options = array(0 => '<font class="critical">' . $hesklang['critical'] . '</font>', 1 => '<font class="important">' . $hesklang['high'] . '</font>', 2 => '<font class="medium">' . $hesklang['medium'] . '</font>', 3 => $hesklang['low']);
$revision = sprintf($hesklang['thist8'], hesk_date(), $options[$priority], $_SESSION['name'] . ' (' . $_SESSION['user'] . ')');
hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET `priority`='{$priority}', `history`=CONCAT(`history`,'" . hesk_dbEscape($revision) . "') WHERE `trackid`='" . hesk_dbEscape($trackingID) . "' LIMIT 1");
if (hesk_dbAffectedRows() != 1) {
hesk_process_messages($hesklang['inpr'], 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'NOTICE');
}
hesk_process_messages(sprintf($hesklang['chpri2'], $options[$priority]), 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'SUCCESS');
示例6: new_saved
function new_saved()
{
global $hesk_settings, $hesklang;
/* A security check */
hesk_token_check('POST');
$hesk_error_buffer = '';
$savename = hesk_input(hesk_POST('name')) or $hesk_error_buffer .= '<li>' . $hesklang['ent_ticket_tpl_title'] . '</li>';
$msg = hesk_input(hesk_POST('msg')) or $hesk_error_buffer .= '<li>' . $hesklang['ent_ticket_tpl_msg'] . '</li>';
// Avoid problems with utf-8 newline chars in Javascript code, detect and remove them
$msg = preg_replace('/\\R/u', "\r\n", $msg);
$_SESSION['canned']['what'] = 'NEW';
$_SESSION['canned']['name'] = $savename;
$_SESSION['canned']['msg'] = $msg;
/* Any errors? */
if (strlen($hesk_error_buffer)) {
$hesk_error_buffer = $hesklang['rfm'] . '<br /><br /><ul>' . $hesk_error_buffer . '</ul>';
hesk_process_messages($hesk_error_buffer, 'manage_ticket_templates.php');
}
/* Get the latest tpl_order */
$result = hesk_dbQuery('SELECT `tpl_order` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'ticket_templates` ORDER BY `tpl_order` DESC LIMIT 1');
$row = hesk_dbFetchRow($result);
$my_order = $row[0] + 10;
hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "ticket_templates` (`title`,`message`,`tpl_order`) VALUES ('" . hesk_dbEscape($savename) . "','" . hesk_dbEscape($msg) . "','" . intval($my_order) . "')");
unset($_SESSION['canned']['what']);
unset($_SESSION['canned']['name']);
unset($_SESSION['canned']['msg']);
hesk_process_messages($hesklang['ticket_tpl_saved'], 'manage_ticket_templates.php', 'SUCCESS');
}
示例7: mail_list_messages
function mail_list_messages()
{
global $hesk_settings, $hesklang, $admins;
$href = 'mail.php';
$query = '';
if ($hesk_settings['mailtmp']['folder'] == 'outbox') {
$query .= 'folder=outbox&';
}
$query .= 'page=';
$maxresults = 30;
$tmp = intval(hesk_POST('page', 1));
$page = $tmp > 1 ? $tmp : 1;
/* List of private messages */
$res = hesk_dbQuery("SELECT COUNT(*) FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` WHERE `" . hesk_dbEscape($hesk_settings['mailtmp']['this']) . "`='" . intval($_SESSION['id']) . "' AND `deletedby`!='" . intval($_SESSION['id']) . "'");
$total = hesk_dbResult($res, 0, 0);
if ($total > 0) {
$pages = ceil($total / $maxresults) or $pages = 1;
if ($page > $pages) {
$page = $pages;
}
$limit_down = $page * $maxresults - $maxresults;
$prev_page = $page - 1 <= 0 ? 0 : $page - 1;
$next_page = $page + 1 > $pages ? 0 : $page + 1;
if ($pages > 1) {
echo $hesklang['pg'] . ': ';
/* List pages */
if ($pages >= 7) {
if ($page > 2) {
echo '<a href="' . $href . '?' . $query . '1"><b>«</b></a> ';
}
if ($prev_page) {
echo '<a href="' . $href . '?' . $query . $prev_page . '"><b>‹</b></a> ';
}
}
for ($i = 1; $i <= $pages; $i++) {
if ($i <= $page + 5 && $i >= $page - 5) {
if ($i == $page) {
echo ' <b>' . $i . '</b> ';
} else {
echo ' <a href="' . $href . '?' . $query . $i . '">' . $i . '</a> ';
}
}
}
if ($pages >= 7) {
if ($next_page) {
echo ' <a href="' . $href . '?' . $query . $next_page . '"><b>›</b></a> ';
}
if ($page < $pages - 1) {
echo ' <a href="' . $href . '?' . $query . $pages . '"><b>»</b></a>';
}
}
echo '<br /> ';
}
// end PAGES > 1
// Get messages from the database
$res = hesk_dbQuery("SELECT `id`, `from`, `to`, `subject`, `dt`, `read` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mail` WHERE `" . hesk_dbEscape($hesk_settings['mailtmp']['this']) . "`='" . intval($_SESSION['id']) . "' AND `deletedby`!='" . intval($_SESSION['id']) . "' ORDER BY `id` DESC LIMIT " . intval($limit_down) . " , " . intval($maxresults) . " ");
?>
<form action="mail.php<?php
if ($hesk_settings['mailtmp']['folder'] == 'outbox') {
echo '?folder=outbox';
}
?>
" name="form1" method="post">
<div class="container table-responsive">
<table class="table table-bordered table-hover" style="background: #E0EEEE;">
<tr>
<th class="admin_white" style="width:1px"><input type="checkbox" name="checkall" value="2" onclick="hesk_changeAll(this)" /></th>
<th class="admin_white" style="text-align:left; white-space:nowrap;"><?php
echo $hesklang['m_sub'];
?>
</th>
<th class="admin_white" style="text-align:left; white-space:nowrap;"><?php
echo $hesk_settings['mailtmp']['m_from'];
?>
</th>
<th class="admin_white" style="text-align:left; white-space:nowrap;"><?php
echo $hesklang['date'];
?>
</th>
</tr>
<?php
$i = 0;
while ($pm = hesk_dbFetchAssoc($res)) {
if ($i) {
$color = "admin_gray";
$i = 0;
} else {
$color = "admin_white";
$i = 1;
}
$pm['subject'] = '<a href="mail.php?a=read&id=' . $pm['id'] . '">' . $pm['subject'] . '</a>';
if ($hesk_settings['mailtmp']['this'] == 'to' && !$pm['read']) {
$pm['subject'] = '<b>' . $pm['subject'] . '</b>';
}
$pm['name'] = isset($admins[$pm[$hesk_settings['mailtmp']['other']]]) ? '<a href="mail.php?a=new&id=' . $pm[$hesk_settings['mailtmp']['other']] . '">' . $admins[$pm[$hesk_settings['mailtmp']['other']]] . '</a>' : ($pm['from'] == 9999 ? '<a href="http://www.hesk.com" target="_blank">HESK.com</a>' : $hesklang['e_udel']);
$pm['dt'] = hesk_dateToString($pm['dt'], 0, 0, 0, true);
echo <<<EOC
//.........这里部分代码省略.........
示例8: hesk_input
if ($_SESSION['step'] == 3 && isset($_POST['dbtest'])) {
// Username
$_SESSION['admin_user'] = hesk_input(hesk_POST('admin_user'));
if (strlen($_SESSION['admin_user']) == 0) {
$_SESSION['admin_user'] = 'Administrator';
}
// Password
$_SESSION['admin_pass'] = hesk_input(hesk_POST('admin_pass'));
if (strlen($_SESSION['admin_pass']) == 0) {
$_SESSION['admin_pass'] = substr(str_shuffle("23456789abcdefghijkmnpqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"), 0, mt_rand(8, 12));
}
// Password hash for the database
$_SESSION['admin_hash'] = hesk_Pass2Hash($_SESSION['admin_pass']);
$hesk_db_link = hesk_iTestDatabaseConnection();
// Get table prefix, don't allow any special chars
$hesk_settings['db_pfix'] = preg_replace('/[^0-9a-zA-Z_]/', '', hesk_POST('pfix', 'hesk_'));
// Generate HESK table names
$hesk_tables = array($hesk_settings['db_pfix'] . 'attachments', $hesk_settings['db_pfix'] . 'banned_emails', $hesk_settings['db_pfix'] . 'banned_ips', $hesk_settings['db_pfix'] . 'categories', $hesk_settings['db_pfix'] . 'kb_articles', $hesk_settings['db_pfix'] . 'kb_attachments', $hesk_settings['db_pfix'] . 'kb_categories', $hesk_settings['db_pfix'] . 'logins', $hesk_settings['db_pfix'] . 'mail', $hesk_settings['db_pfix'] . 'notes', $hesk_settings['db_pfix'] . 'online', $hesk_settings['db_pfix'] . 'pipe_loops', $hesk_settings['db_pfix'] . 'replies', $hesk_settings['db_pfix'] . 'reply_drafts', $hesk_settings['db_pfix'] . 'reset_password', $hesk_settings['db_pfix'] . 'service_messages', $hesk_settings['db_pfix'] . 'std_replies', $hesk_settings['db_pfix'] . 'tickets', $hesk_settings['db_pfix'] . 'ticket_templates', $hesk_settings['db_pfix'] . 'users');
// Check if any of the HESK tables exists
$res = hesk_dbQuery('SHOW TABLES FROM `' . hesk_dbEscape($hesk_settings['db_name']) . '`');
while ($row = hesk_dbFetchRow($res)) {
if (in_array($row[0], $hesk_tables)) {
hesk_iDatabase(2);
}
}
// All ok, let's save settings
hesk_iSaveSettings();
// Now install HESK database tables
hesk_iTables();
// And move to the next step
$_SESSION['step'] = 4;
示例9: hesk_dbQuery
// Get note info
$result = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "notes` WHERE `id`={$noteID}");
if (hesk_dbNumRows($result) != 1) {
hesk_error($hesklang['no_note']);
}
$note = hesk_dbFetchAssoc($result);
// Make sure the note matches the ticket and the user has permission to edit it
if ($note['ticket'] != $ticket['id'] || !hesk_checkPermission('can_del_notes', 0) && $note['who'] != $_SESSION['id']) {
hesk_error($hesklang['perm_deny']);
}
// Save changes?
if (isset($_POST['save'])) {
// A security check
hesk_token_check('POST');
// Get message
$tmpvar['message'] = nl2br(hesk_makeURL(hesk_input(hesk_POST('message'))));
// If we have message or attachments do the update
if (strlen($tmpvar['message']) || strlen($note['attachments'])) {
hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "notes` SET `message`='" . hesk_dbEscape($tmpvar['message']) . "' WHERE `id`={$noteID}");
hesk_process_messages($hesklang['ednote2'], 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'SUCCESS');
} else {
hesk_dbQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "notes` WHERE `id`={$noteID}");
header('Location: admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999));
exit;
}
}
$note['message'] = hesk_msgToPlain($note['message'], 0, 0);
/* Print header */
require_once HESK_PATH . 'inc/header.inc.php';
/* Print admin navigation */
require_once HESK_PATH . 'inc/show_admin_nav.inc.php';
示例10: print_login
function print_login()
{
global $hesk_settings, $hesklang;
$hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['admin_login'];
require_once HESK_PATH . 'inc/header.inc.php';
if (hesk_isREQUEST('notice')) {
hesk_process_messages($hesklang['session_expired'], 'NOREDIRECT');
}
if (!isset($_SESSION['a_iserror'])) {
$_SESSION['a_iserror'] = array();
}
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3"><img src="../img/headerleftsm.jpg" width="3" height="25" alt="" /></td>
<td class="headersm"><?php
echo $hesklang['login'];
?>
</td>
<td width="3"><img src="../img/headerrightsm.jpg" width="3" height="25" alt="" /></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td><span class="smaller"><a href="<?php
echo $hesk_settings['site_url'];
?>
" class="smaller"><?php
echo $hesk_settings['site_title'];
?>
</a> >
<?php
echo $hesklang['admin_login'];
?>
</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<br />
<?php
/* This will handle error, success and notice messages */
hesk_handle_messages();
?>
<br />
<div align="center">
<table border="0" cellspacing="0" cellpadding="0" width="<?php
echo $hesk_settings['secimg_use'] == 2 ? '60' : '50';
?>
% ">
<tr>
<td width="7" height="7"><img src="../img/roundcornerslt.jpg" width="7" height="7" alt="" /></td>
<td class="roundcornerstop"></td>
<td><img src="../img/roundcornersrt.jpg" width="7" height="7" alt="" /></td>
</tr>
<tr>
<td class="roundcornersleft"> </td>
<td>
<form action="index.php" method="post" name="form1">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="60" style="text-align:center"><img src="../img/login.png" alt="" width="24" height="24" /></td>
<td>
<p><b><?php
echo $hesklang['admin_login'];
?>
</a></b></p>
</td>
</tr>
<tr>
<td width="60"> </td>
<td> </td>
</tr>
<tr>
<td width="60"> </td>
<td><?php
echo $hesklang['username'];
?>
:<br />
<?php
$cls = in_array('user', $_SESSION['a_iserror']) ? ' class="isError" ' : '';
if (defined('HESK_USER')) {
$savedUser = HESK_USER;
} else {
$savedUser = hesk_htmlspecialchars(hesk_COOKIE('hesk_username'));
}
$is_1 = '';
$is_2 = '';
$is_3 = '';
$remember_user = hesk_POST('remember_user');
//.........这里部分代码省略.........
示例11: forgot_tid
function forgot_tid()
{
global $hesk_settings, $hesklang;
require HESK_PATH . 'inc/email_functions.inc.php';
$email = hesk_validateEmail(hesk_POST('email'), 'ERR', 0) or hesk_process_messages($hesklang['enter_valid_email'], 'ticket.php?remind=1');
/* Prepare ticket statuses */
$my_status = array(0 => $hesklang['open'], 1 => $hesklang['wait_staff_reply'], 2 => $hesklang['wait_cust_reply'], 3 => $hesklang['closed'], 4 => $hesklang['in_progress'], 5 => $hesklang['on_hold']);
/* Get ticket(s) from database */
hesk_load_database_functions();
hesk_dbConnect();
// Get tickets from the database
$res = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'tickets` FORCE KEY (`statuses`) WHERE ' . ($hesk_settings['open_only'] ? "`status` IN ('0','1','2','4','5') AND " : '') . ' ' . hesk_dbFormatEmail($email) . ' ORDER BY `status` ASC, `lastchange` DESC ');
$num = hesk_dbNumRows($res);
if ($num < 1) {
if ($hesk_settings['open_only']) {
hesk_process_messages($hesklang['noopen'], 'ticket.php?remind=1&e=' . $email);
} else {
hesk_process_messages($hesklang['tid_not_found'], 'ticket.php?remind=1&e=' . $email);
}
}
$tid_list = '';
$name = '';
$email_param = $hesk_settings['email_view_ticket'] ? '&e=' . rawurlencode($email) : '';
while ($my_ticket = hesk_dbFetchAssoc($res)) {
$name = $name ? $name : hesk_msgToPlain($my_ticket['name'], 1, 0);
$tid_list .= "\r\n{$hesklang['trackID']}: " . $my_ticket['trackid'] . "\r\n{$hesklang['subject']}: " . hesk_msgToPlain($my_ticket['subject'], 1, 0) . "\r\n{$hesklang['status']}: " . $my_status[$my_ticket['status']] . "\r\n{$hesk_settings['hesk_url']}/ticket.php?track={$my_ticket['trackid']}{$email_param}\r\n";
}
/* Get e-mail message for customer */
$msg = hesk_getEmailMessage('forgot_ticket_id', '', 0, 0, 1);
$msg = str_replace('%%NAME%%', $name, $msg);
$msg = str_replace('%%NUM%%', $num, $msg);
$msg = str_replace('%%LIST_TICKETS%%', $tid_list, $msg);
$msg = str_replace('%%SITE_TITLE%%', hesk_msgToPlain($hesk_settings['site_title'], 1), $msg);
$msg = str_replace('%%SITE_URL%%', $hesk_settings['site_url'], $msg);
$subject = hesk_getEmailSubject('forgot_ticket_id');
/* Send e-mail */
hesk_mail($email, $subject, $msg);
/* Show success message */
$tmp = '<b>' . $hesklang['tid_sent'] . '!</b>';
$tmp .= '<br /> <br />' . $hesklang['tid_sent2'] . '.';
$tmp .= '<br /> <br />' . $hesklang['check_spambox'];
hesk_process_messages($tmp, 'ticket.php?e=' . $email, 'SUCCESS');
exit;
/* Print header */
$hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['tid_sent'];
require_once HESK_PATH . 'inc/header.inc.php';
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3"><img src="img/headerleftsm.jpg" width="3" height="25" alt="" /></td>
<td class="headersm"><?php
hesk_showTopBar($hesklang['tid_sent']);
?>
</td>
<td width="3"><img src="img/headerrightsm.jpg" width="3" height="25" alt="" /></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td><span class="smaller"><a href="<?php
echo $hesk_settings['site_url'];
?>
" class="smaller"><?php
echo $hesk_settings['site_title'];
?>
</a> >
<a href="<?php
echo $hesk_settings['hesk_url'];
?>
" class="smaller"><?php
echo $hesk_settings['hesk_title'];
?>
</a>
> <?php
echo $hesklang['tid_sent'];
?>
</span></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="7" height="7"><img src="img/roundcornerslt.jpg" width="7" height="7" alt="" /></td>
<td class="roundcornerstop"></td>
<td><img src="img/roundcornersrt.jpg" width="7" height="7" alt="" /></td>
</tr>
<tr>
<td class="roundcornersleft"> </td>
<td>
<p> </p>
<p align="center"><?php
echo $hesklang['tid_sent2'];
//.........这里部分代码省略.........
示例12: hesk_REQUEST
function hesk_REQUEST($in, $default = false)
{
return isset($_GET[$in]) ? hesk_input(hesk_GET($in)) : (isset($_POST[$in]) ? hesk_input(hesk_POST($in)) : $default);
}
示例13: hesk_getEmailSubject
/* Format email subject and message for staff */
$subject = hesk_getEmailSubject('new_note', $ticket);
$message = hesk_getEmailMessage('new_note', $ticket, 1);
/* Send email to staff */
hesk_mail($owner['email'], $subject, $message);
}
}
}
header('Location: admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999));
exit;
}
/* Update time worked */
if ($hesk_settings['time_worked'] && ($can_reply || $can_edit) && isset($_POST['h']) && isset($_POST['m']) && isset($_POST['s']) && hesk_token_check('POST')) {
$h = intval(hesk_POST('h'));
$m = intval(hesk_POST('m'));
$s = intval(hesk_POST('s'));
/* Get time worked in proper format */
$time_worked = hesk_getTime($h . ':' . $m . ':' . $s);
/* Update database */
$revision = sprintf($hesklang['thist14'], hesk_date(), $time_worked, $_SESSION['name'] . ' (' . $_SESSION['user'] . ')');
hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET `time_worked`='" . hesk_dbEscape($time_worked) . "', `history`=CONCAT(`history`,'" . hesk_dbEscape($revision) . "') WHERE `trackid`='" . hesk_dbEscape($trackingID) . "' LIMIT 1");
/* Show ticket */
hesk_process_messages($hesklang['twu'], 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'SUCCESS');
}
/* Delete attachment action */
if (isset($_GET['delatt']) && hesk_token_check()) {
if (!$can_delete || !$can_edit) {
hesk_process_messages($hesklang['no_permission'], 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999));
}
$att_id = intval(hesk_GET('delatt')) or hesk_error($hesklang['inv_att_id']);
$reply = intval(hesk_GET('reply', 0));
示例14: hesk_input
else {return false;}
}
//-->
</script>
<?php
if (isset($_POST['action']) && $_POST['action'] == 'update') {
$value_contract_name = hesk_input(hesk_POST('contract_name'));
$value_company_id = hesk_input(hesk_POST('company_id'));
$value_project_id = hesk_input(hesk_POST('project_id'));
$value_staff_id = hesk_input(hesk_POST('staff_id'));
$value_starting_date = hesk_input(hesk_POST('starting_date'));
$value_ending_date = hesk_input(hesk_POST('ending_date'));
$value_sla = hesk_input(hesk_POST('sla'));
$value_priority = hesk_input(hesk_POST('priority'));
$value_reply_time = hesk_input(hesk_POST('reply_time'));
$value_resolved_time = hesk_input(hesk_POST('resolved_time'));
$value['lastchange'] = hesk_date($value['lastchange'], true);
$query = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "contracts` SET\n\t\t`contract_name`='" . hesk_dbEscape($value_contract_name) . "',\n\t\t`company_id`='" . hesk_dbEscape($value_company_id) . "',\n\t\t`project_id`='" . hesk_dbEscape($value_project_id) . "',\n\t\t`starting_date`='" . hesk_dbEscape($value_starting_date) . "',\n\t\t`ending_date`='" . hesk_dbEscape($value_ending_date) . "',\n\t\t`sla`='" . hesk_dbEscape($value_sla) . "',\n\t\t`priority`='" . hesk_dbEscape($value_priority) . "',\n\t\t`reply_time`='" . hesk_dbEscape($value_reply_time) . "',\n\t\t`resolved_time`='" . hesk_dbEscape($value_resolved_time) . "',\n\t\t`lastchange`=NOW()\n\t\tWHERE `id`='" . intval($value_id) . "' ");
$query2 = hesk_dbQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "userforcontract` WHERE `contractId`='" . intval($value_id) . "'");
foreach ($_POST['staff_id'] as $staff) {
$sql = hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "userforcontract` (\n\t\t\t`userId`, \n\t\t\t`contractId`\n\t\t\t)\n\t\t\tVALUES(\n\t\t\t'" . hesk_dbEscape($staff) . "', \n\t\t\t'" . $value_id . "'\n\t\t\t)");
}
//$flag = hesk_dbQuery('SELECT id FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'contracts` where active = 1');
}
if ($_SESSION['isadmin']) {
$res = hesk_dbQuery("SELECT \n\t\tC.id, \n\t\tC.contract_name,\n\t\tCO.company_name,\n\t\tC.active,\n\t\tP.project_name,\n\t\tS.name as staff_name,\n\t\tC.starting_date,\n\t\tC.ending_date,\n\t\tC.sla,\n\t\tC.priority,\n\t\tC.reply_time,\n\t\tC.resolved_time,\n\t\tC.lastchange,\n\t\tCB.name AS created_by \n\t\tFROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "contracts` AS C\n\t\tLEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS S ON C.staff_id=S.Id\n\t\tLEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS CB ON C.created_by=CB.Id\n\t\tLEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "companies` AS CO on C.company_id=CO.id\n\t\tLEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "projects` AS P on C.project_id=P.id\n\t\tORDER BY `id`");
$custom_filters = "SELECT \n\t\tC.id, \n\t\tC.contract_name,\n\t\tCO.company_name,\n\t\tC.active,\n\t\tP.project_name,\n\t\tS.name as staff_name,\n\t\tC.starting_date,\n\t\tC.ending_date,\n\t\tC.sla,\n\t\tC.priority,\n\t\tC.reply_time,\n\t\tC.resolved_time,\n\t\tC.lastchange,\n\t\tCB.name AS created_by \n\t\tFROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "contracts` AS C\n\t\tLEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS S ON C.staff_id=S.Id\n\t\tLEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` AS CB ON C.created_by=CB.Id\n\t\tLEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "companies` AS CO on C.company_id=CO.id\n\t\tLEFT JOIN `" . hesk_dbEscape($hesk_settings['db_pfix']) . "projects` AS P on C.project_id=P.id";
//FILTRAT NGA ERMEDITA
if (isset($_POST['submitbutton_contracts'])) {
if (!empty($_POST['search_by_contract_name'])) {
$res = hesk_dbQuery($custom_filters . ' WHERE C.contract_name ="' . $_POST['search_by_contract_name'] . '"');
示例15: empty
$set['category_order_column'] = empty($_POST['category_order_column']) ? 'cat_order' : 'name';
if ($set['customer-email-verification-required']) {
//-- Don't allow multiple emails if verification is required
$set['multi_eml'] = 0;
}
$set['navbarBackgroundColor'] = hesk_input(hesk_POST('navbarBackgroundColor'));
$set['navbarBrandColor'] = hesk_input(hesk_POST('navbarBrandColor'));
$set['navbarBrandHoverColor'] = hesk_input(hesk_POST('navbarBrandHoverColor'));
$set['navbarItemTextColor'] = hesk_input(hesk_POST('navbarItemTextColor'));
$set['navbarItemTextHoverColor'] = hesk_input(hesk_POST('navbarItemTextHoverColor'));
$set['navbarItemTextSelectedColor'] = hesk_input(hesk_POST('navbarItemTextSelectedColor'));
$set['navbarItemSelectedBackgroundColor'] = hesk_input(hesk_POST('navbarItemSelectedBackgroundColor'));
$set['dropdownItemTextColor'] = hesk_input(hesk_POST('dropdownItemTextColor'));
$set['dropdownItemTextHoverColor'] = hesk_input(hesk_POST('dropdownItemTextHoverColor'));
$set['questionMarkColor'] = hesk_input(hesk_POST('questionMarkColor'));
$set['dropdownItemTextHoverBackgroundColor'] = hesk_input(hesk_POST('dropdownItemTextHoverBackgroundColor'));
$modsForHesk_file_content = '<?php
//-- Mods For Hesk Theme Color Settings
$modsForHesk_settings[\'navbarBackgroundColor\'] = \'' . $set['navbarBackgroundColor'] . '\';
$modsForHesk_settings[\'navbarBrandColor\'] = \'' . $set['navbarBrandColor'] . '\';
$modsForHesk_settings[\'navbarBrandHoverColor\'] = \'' . $set['navbarBrandHoverColor'] . '\';
$modsForHesk_settings[\'navbarItemTextColor\'] = \'' . $set['navbarItemTextColor'] . '\';
$modsForHesk_settings[\'navbarItemTextHoverColor\'] = \'' . $set['navbarItemTextHoverColor'] . '\';
$modsForHesk_settings[\'navbarItemTextSelectedColor\'] = \'' . $set['navbarItemTextSelectedColor'] . '\';
$modsForHesk_settings[\'navbarItemSelectedBackgroundColor\'] = \'' . $set['navbarItemSelectedBackgroundColor'] . '\';
$modsForHesk_settings[\'dropdownItemTextColor\'] = \'' . $set['dropdownItemTextColor'] . '\';
$modsForHesk_settings[\'dropdownItemTextHoverColor\'] = \'' . $set['dropdownItemTextHoverColor'] . '\';
$modsForHesk_settings[\'dropdownItemTextHoverBackgroundColor\'] = \'' . $set['dropdownItemTextHoverBackgroundColor'] . '\';
$modsForHesk_settings[\'questionMarkColor\'] = \'' . $set['questionMarkColor'] . '\';