当前位置: 首页>>代码示例>>PHP>>正文


PHP hesk_dbEscape函数代码示例

本文整理汇总了PHP中hesk_dbEscape函数的典型用法代码示例。如果您正苦于以下问题:PHP hesk_dbEscape函数的具体用法?PHP hesk_dbEscape怎么用?PHP hesk_dbEscape使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了hesk_dbEscape函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: hesk_dbFormatEmail

function hesk_dbFormatEmail($email, $field = 'email')
{
    global $hesk_settings;
    $email = hesk_dbLike($email);
    if ($hesk_settings['multi_eml']) {
        return " (`" . hesk_dbEscape($field) . "` LIKE '" . hesk_dbEscape($email) . "' OR `" . hesk_dbEscape($field) . "` LIKE '%," . hesk_dbEscape($email) . "' OR `" . hesk_dbEscape($field) . "` LIKE '" . hesk_dbEscape($email) . ",%' OR `" . hesk_dbEscape($field) . "` LIKE '%," . hesk_dbEscape($email) . ",%') ";
    } else {
        return " `" . hesk_dbEscape($field) . "` LIKE '" . hesk_dbEscape($email) . "' ";
    }
}
开发者ID:ermedita-xhafaj,项目名称:support,代码行数:10,代码来源:database_mysqli.inc.php

示例2: removeOtherColumns

function removeOtherColumns()
{
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `autorefresh`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP COLUMN `parent`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `can_manage_settings`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `active`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `notify_note_unassigned`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `can_change_notification_settings`");
    executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "settings`");
    executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "verified_emails`");
    executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "pending_verification_emails`");
    executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "service_messages` DROP COLUMN `icon`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP COLUMN `latitude`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` DROP COLUMN `longitude`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` DROP COLUMN `latitude`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` DROP COLUMN `longitude`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` DROP COLUMN `manager`");
    executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` DROP COLUMN `permission_template`");
    executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "permission_templates`");
    // These queries are ran in case someone used an unfortunate installation they may have not properly cleaned up tables
    executeQuery('DROP TABLE IF EXISTS `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'denied_ips`');
    executeQuery('DROP TABLE IF EXISTS `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'denied_emails`');
}
开发者ID:Orgoth,项目名称:Mods-for-HESK,代码行数:24,代码来源:uninstallSql.php

示例3: hesk_printCustomerReplyForm

</tr>
<tr>
	<td><img src="img/roundcornerslb.jpg" width="7" height="7" alt="" /></td>
	<td class="roundcornersbottom"></td>
	<td width="7" height="7"><img src="img/roundcornersrb.jpg" width="7" height="7" alt="" /></td>
</tr>
</table>

<?php 
/* Print "Submit a reply" form? */
if ($ticket['locked'] != 1 && $ticket['status'] != 3 && !$hesk_settings['reply_top']) {
    hesk_printCustomerReplyForm();
}
/* If needed update unread replies as read for staff to know */
if (count($unread_replies)) {
    hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies` SET `read` = '1' WHERE `id` IN ('" . implode("','", $unread_replies) . "')");
}
/* Clear unneeded session variables */
hesk_cleanSessionVars('ticket_message');
require_once HESK_PATH . 'inc/footer.inc.php';
/*** START FUNCTIONS ***/
function print_form()
{
    global $hesk_settings, $hesklang;
    global $hesk_error_buffer, $my_email, $trackingID, $do_remember, $display;
    /* Print header */
    $hesk_settings['tmp_title'] = $hesk_settings['hesk_title'] . ' - ' . $hesklang['view_ticket'];
    require_once HESK_PATH . 'inc/header.inc.php';
    ?>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
开发者ID:riansopian,项目名称:hesk,代码行数:31,代码来源:ticket.php

示例4: update_profile

function update_profile()
{
    global $hesk_settings, $hesklang, $can_view_unassigned;
    /* A security check */
    hesk_token_check('POST');
    $sql_pass = '';
    $sql_username = '';
    $hesk_error_buffer = '';
    $_SESSION['new']['name'] = hesk_input(hesk_POST('name')) or $hesk_error_buffer .= '<li>' . $hesklang['enter_your_name'] . '</li>';
    $_SESSION['new']['email'] = hesk_validateEmail(hesk_POST('email'), 'ERR', 0) or $hesk_error_buffer = '<li>' . $hesklang['enter_valid_email'] . '</li>';
    $_SESSION['new']['signature'] = hesk_input(hesk_POST('signature'));
    /* Signature */
    if (strlen($_SESSION['new']['signature']) > 255) {
        $hesk_error_buffer .= '<li>' . $hesklang['signature_long'] . '</li>';
    }
    /* Admins can change username */
    if ($_SESSION['isadmin']) {
        $_SESSION['new']['user'] = hesk_input(hesk_POST('user')) or $hesk_error_buffer .= '<li>' . $hesklang['enter_username'] . '</li>';
        /* Check for duplicate usernames */
        $result = hesk_dbQuery("SELECT `id` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `user`='" . hesk_dbEscape($_SESSION['new']['user']) . "' AND `id`!='" . intval($_SESSION['id']) . "' LIMIT 1");
        if (hesk_dbNumRows($result) != 0) {
            $hesk_error_buffer .= '<li>' . $hesklang['duplicate_user'] . '</li>';
        } else {
            $sql_username = ",`user`='" . hesk_dbEscape($_SESSION['new']['user']) . "'";
        }
    }
    /* Change password? */
    $newpass = hesk_input(hesk_POST('newpass'));
    $passlen = strlen($newpass);
    if ($passlen > 0) {
        /* At least 5 chars? */
        if ($passlen < 5) {
            $hesk_error_buffer .= '<li>' . $hesklang['password_not_valid'] . '</li>';
        } else {
            $newpass2 = hesk_input(hesk_POST('newpass2'));
            if ($newpass != $newpass2) {
                $hesk_error_buffer .= '<li>' . $hesklang['passwords_not_same'] . '</li>';
            } else {
                $v = hesk_Pass2Hash($newpass);
                if ($v == '499d74967b28a841c98bb4baaabaad699ff3c079') {
                    define('WARN_PASSWORD', true);
                }
                $sql_pass = ',`pass`=\'' . $v . '\'';
            }
        }
    }
    /* After reply */
    $_SESSION['new']['afterreply'] = intval(hesk_POST('afterreply'));
    if ($_SESSION['new']['afterreply'] != 1 && $_SESSION['new']['afterreply'] != 2) {
        $_SESSION['new']['afterreply'] = 0;
    }
    /* Auto-start ticket timer */
    $_SESSION['new']['autostart'] = isset($_POST['autostart']) ? 1 : 0;
    /* Notifications */
    $_SESSION['new']['notify_new_unassigned'] = empty($_POST['notify_new_unassigned']) || !$can_view_unassigned ? 0 : 1;
    $_SESSION['new']['notify_new_my'] = empty($_POST['notify_new_my']) ? 0 : 1;
    $_SESSION['new']['notify_reply_unassigned'] = empty($_POST['notify_reply_unassigned']) || !$can_view_unassigned ? 0 : 1;
    $_SESSION['new']['notify_reply_my'] = empty($_POST['notify_reply_my']) ? 0 : 1;
    $_SESSION['new']['notify_assigned'] = empty($_POST['notify_assigned']) ? 0 : 1;
    $_SESSION['new']['notify_note'] = empty($_POST['notify_note']) ? 0 : 1;
    $_SESSION['new']['notify_pm'] = empty($_POST['notify_pm']) ? 0 : 1;
    /* Any errors? */
    if (strlen($hesk_error_buffer)) {
        /* Process the session variables */
        $_SESSION['new'] = hesk_stripArray($_SESSION['new']);
        $hesk_error_buffer = $hesklang['rfm'] . '<br /><br /><ul>' . $hesk_error_buffer . '</ul>';
        hesk_process_messages($hesk_error_buffer, 'NOREDIRECT');
    } else {
        /* Update database */
        hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET\r\n\t    `name`='" . hesk_dbEscape($_SESSION['new']['name']) . "',\r\n\t    `email`='" . hesk_dbEscape($_SESSION['new']['email']) . "',\r\n\t\t`signature`='" . hesk_dbEscape($_SESSION['new']['signature']) . "'\r\n        {$sql_username}\r\n\t\t{$sql_pass} ,\r\n\t    `afterreply`='" . intval($_SESSION['new']['afterreply']) . "' ,\r\n        `autostart`='" . intval($_SESSION['new']['autostart']) . "' ,\r\n\t    `notify_new_unassigned`='" . intval($_SESSION['new']['notify_new_unassigned']) . "' ,\r\n        `notify_new_my`='" . intval($_SESSION['new']['notify_new_my']) . "' ,\r\n        `notify_reply_unassigned`='" . intval($_SESSION['new']['notify_reply_unassigned']) . "' ,\r\n        `notify_reply_my`='" . intval($_SESSION['new']['notify_reply_my']) . "' ,\r\n        `notify_assigned`='" . intval($_SESSION['new']['notify_assigned']) . "' ,\r\n        `notify_pm`='" . intval($_SESSION['new']['notify_pm']) . "',\r\n        `notify_note`='" . intval($_SESSION['new']['notify_note']) . "'\r\n\t    WHERE `id`='" . intval($_SESSION['id']) . "' LIMIT 1");
        /* Process the session variables */
        $_SESSION['new'] = hesk_stripArray($_SESSION['new']);
        /* Update session variables */
        foreach ($_SESSION['new'] as $k => $v) {
            $_SESSION[$k] = $v;
        }
        unset($_SESSION['new']);
        hesk_process_messages($hesklang['profile_updated_success'], 'profile.php', 'SUCCESS');
    }
}
开发者ID:riansopian,项目名称:hesk,代码行数:80,代码来源:profile.php

示例5: define

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');
hesk_checkPermission('can_edit_tickets');
/* A security check */
hesk_token_check();
/* Ticket ID */
$trackingID = hesk_cleanID() or die($hesklang['int_error'] . ': ' . $hesklang['no_trackID']);
/* New archived status */
if (empty($_GET['locked'])) {
    $status = 0;
    $tmp = $hesklang['tunlock'];
    $revision = sprintf($hesklang['thist6'], hesk_date(), $_SESSION['name'] . ' (' . $_SESSION['user'] . ')');
} else {
    $status = 1;
    $tmp = $hesklang['tlock'];
    $revision = sprintf($hesklang['thist5'], hesk_date(), $_SESSION['name'] . ' (' . $_SESSION['user'] . ')');
}
/* Update database */
hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET `status`='3',`locked`='{$status}', `history`=CONCAT(`history`,'" . hesk_dbEscape($revision) . "')  WHERE `trackid`='" . hesk_dbEscape($trackingID) . "' LIMIT 1");
/* Back to ticket page and show a success message */
hesk_process_messages($tmp, 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . rand(10000, 99999), 'SUCCESS');
开发者ID:riansopian,项目名称:hesk,代码行数:31,代码来源:lock.php

示例6: array

// array me vlerat e ticket_id
$params = array();
// array me vlerat e reply_message
$params1[0] = $ticket['id'];
$data = $oeapi->search_helpdeskID($valid_services["PIS"], $ticket['id']);
// gjejme ceshtjen ky helpdesk_id = ticket_id
//Ermedita -  lista e emaileve te staffit qe jan te lidhur me ceshtjen
$issue_id = hesk_dbQuery("SELECT `contract_ticket_id` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` WHERE `id`=" . $ticket['id']);
$i_id = mysqli_fetch_array($issue_id);
$users = hesk_dbQuery("SELECT `userId` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "userforcontract` WHERE `contractId`=" . $i_id[0]);
$u = array();
while ($user = mysqli_fetch_array($users)) {
    $u[] = $user['userId'];
}
$ulist = implode(',', $u);
$u_emails = hesk_dbQuery("SELECT `email` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE `id` IN (" . $ulist . ")");
$array_email = array();
while ($e = mysqli_fetch_array($u_emails)) {
    $array_email[] = $e['email'];
}
$ulist_emails = implode(',', $array_email);
//var_dump($ulist_emails);
//exit();
$params['subject'] = $ticket['subject'];
$params['user_id'] = 11;
// Do krijohet nga ERP nje user default dhe do vendosim ID e tij
$params['body_text'] = stripslashes($message);
$params['date'] = hesk_date($ticket['dt'], true);
$params['res_id'] = $data[0];
$params['model'] = "project.issue";
$params['email_from'] = $ticket['email'];
开发者ID:ermedita-xhafaj,项目名称:support,代码行数:31,代码来源:reply_ticket.php

示例7: 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');
    if (isset($_POST['open_only'])) {
        $hesk_settings['open_only'] = $_POST['open_only'] == 1 ? 1 : 0;
    }
    /* 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 .= "\n{$hesklang['trackID']}: " . $my_ticket['trackid'] . "\n{$hesklang['subject']}: " . hesk_msgToPlain($my_ticket['subject'], 1, 0) . "\n{$hesklang['status']}: " . $my_status[$my_ticket['status']] . "\n{$hesk_settings['hesk_url']}/ticket.php?track={$my_ticket['trackid']}{$email_param}\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 />&nbsp;<br />' . $hesklang['tid_sent2'] . '.';
    $tmp .= '<br />&nbsp;<br />' . $hesklang['check_spambox'];
    hesk_process_messages($tmp, 'ticket.php?e=' . $email, 'SUCCESS');
    exit;
}
开发者ID:abuhannan,项目名称:aduan,代码行数:47,代码来源:index.php

示例8: 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/admin_functions.inc.php';
hesk_load_database_functions();
hesk_session_start();
hesk_dbConnect();
hesk_isLoggedIn();
/* Print XML header */
header('Content-Type: text/html; charset=' . $hesklang['ENCODING']);
/* Get the search query composed of the subject and message */
$query = hesk_REQUEST('q') or die('');
/* Get relevant articles from the database, include private ones */
$res = hesk_dbQuery("SELECT `id`, `subject`, `content` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "kb_articles` WHERE `type` IN ('0','1') AND MATCH(`subject`,`content`,`keywords`) AGAINST ('" . hesk_dbEscape($query) . "') LIMIT " . intval($hesk_settings['kb_search_limit']));
$num = hesk_dbNumRows($res);
/* Solve some spacing issues */
if (hesk_isREQUEST('p')) {
    echo '&nbsp;<br />';
}
/* Return found articles */
?>
<div class="conatiner notice">
<span style="font-size:12px;font-weight:bold"><?php 
echo $hesklang['sc'];
?>
:</span><br />&nbsp;<br />
    <?php 
if (!$num) {
    echo '<i>' . $hesklang['nsfo'] . '</i>';
开发者ID:ermedita-xhafaj,项目名称:support,代码行数:31,代码来源:admin_suggest_articles.php

示例9: hesk_dbEscape

            break;
        case 'subject':
            $sql .= "`subject` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbEscape($hesklang['_COLLATE']) . "' ";
            break;
        case 'message':
            $sql .= " ( `message` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbEscape($hesklang['_COLLATE']) . "'\n            \t\tOR\n                    `id` IN (\n            \t\tSELECT DISTINCT `replyto`\n                \tFROM   `" . hesk_dbEscape($hesk_settings['db_pfix']) . "replies`\n                \tWHERE  `message` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbEscape($hesklang['_COLLATE']) . "' )\n                    )\n                    ";
            break;
        case 'seqid':
            $sql .= "`id` = '" . intval($q) . "' ";
            break;
        case 'notes':
            $sql .= "`id` IN (\n            \t\tSELECT DISTINCT `ticket`\n                \tFROM   `" . hesk_dbEscape($hesk_settings['db_pfix']) . "notes`\n                \tWHERE  `message` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbEscape($hesklang['_COLLATE']) . "' )\n                \t";
            break;
        default:
            if (isset($hesk_settings['custom_fields'][$what]) && $hesk_settings['custom_fields'][$what]['use']) {
                $sql .= "`" . hesk_dbEscape($what) . "` LIKE '%" . hesk_dbEscape($q) . "%' COLLATE '" . hesk_dbEscape($hesklang['_COLLATE']) . "' ";
            } else {
                $hesk_error_buffer .= '<br />' . $hesklang['invalid_search'];
            }
    }
}
// Owner
if ($tmp = intval(hesk_GET('owner', 0))) {
    $sql .= " AND `owner`={$tmp} ";
    $owner_input = $tmp;
    $hesk_error_buffer = str_replace($hesklang['fsq'], '', $hesk_error_buffer);
} else {
    $owner_input = 0;
}
/* Date */
/* -> Check for compatibility with old date format */
开发者ID:ermedita-xhafaj,项目名称:support,代码行数:31,代码来源:find_tickets.php

示例10: 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&amp;';
    }
    $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>&laquo;</b></a> &nbsp; ';
                }
                if ($prev_page) {
                    echo '<a href="' . $href . '?' . $query . $prev_page . '"><b>&lsaquo;</b></a> &nbsp; ';
                }
            }
            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 ' &nbsp; <a href="' . $href . '?' . $query . $next_page . '"><b>&rsaquo;</b></a> ';
                }
                if ($page < $pages - 1) {
                    echo ' &nbsp; <a href="' . $href . '?' . $query . $pages . '"><b>&raquo;</b></a>';
                }
            }
            echo '<br />&nbsp;';
        }
        // 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&amp;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&amp;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
//.........这里部分代码省略.........
开发者ID:ermedita-xhafaj,项目名称:support,代码行数:101,代码来源:mail.php

示例11: toggle_type

function toggle_type()
{
    global $hesk_settings, $hesklang;
    /* A security check */
    hesk_token_check();
    $catid = intval(hesk_GET('catid')) or hesk_error($hesklang['cat_move_id']);
    $_SESSION['selcat2'] = $catid;
    if (intval(hesk_GET('s'))) {
        $type = 1;
        $tmp = $hesklang['cpriv'];
    } else {
        $type = 0;
        $tmp = $hesklang['cpub'];
    }
    /* Update auto-assign settings */
    hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` SET `type`='{$type}' WHERE `id`='" . intval($catid) . "' LIMIT 1");
    if (hesk_dbAffectedRows() != 1) {
        hesk_process_messages($hesklang['int_error'] . ': ' . $hesklang['cat_not_found'], './manage_categories.php');
    }
    hesk_process_messages($tmp, './manage_categories.php', 'SUCCESS');
}
开发者ID:Eximagen,项目名称:helpdesk,代码行数:21,代码来源:manage_categories.php

示例12: hesk_dbQuery

			<input name="submitbutton_tickets" type="submit" class="btn btn-default filter-ticket-btn" value="Search"/>
			<button name="clearbutton_tickets" onclick="deleteticket_admin();return false;" class="btn btn-default filter-ticket-btn" value="">Clear</button>
		</form>
	</div> <!--end div i filtrave -->	
	<?php 
    if (!isset($_SESSION['hide']['ticket_list'])) {
        echo '<br/><br/>
        <div class="container open-new-ticket">
        <div class="form-inline col-sm-10"><img src="../img/open-tickets.png" alt="open-tickets" /><span id="openTicket">' . $hesklang['open_tickets'] . '</span></div>
        <span class="col-sm-2 newTicket"><a href="new_ticket.php"><button type="submit" class="btn btn-default new-ticket-btn">' . $hesklang['nti'] . '</button></a></span>
		</div>
        ';
    }
    /* Reset default settings? */
    if (isset($_GET['reset']) && hesk_token_check()) {
        $res = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` SET `default_list`='' WHERE `id` = '" . intval($_SESSION['id']) . "' LIMIT 1");
        $_SESSION['default_list'] = '';
    } else {
        parse_str($_SESSION['default_list'], $defaults);
        $_GET = isset($_GET) && is_array($_GET) ? array_merge($_GET, $defaults) : $defaults;
    }
    /* Print the list of tickets */
    require HESK_PATH . 'inc/print_tickets.inc.php';
    /* Print forms for listing and searching tickets */
    /*require(HESK_PATH . 'inc/show_search_form.inc.php');*/
} else {
    echo '<p><i>' . $hesklang['na_view_tickets'] . '</i></p>';
}
/* Clean unneeded session variables */
hesk_cleanSessionVars('hide');
require_once HESK_PATH . 'inc/footer.inc.php';
开发者ID:ermedita-xhafaj,项目名称:support,代码行数:31,代码来源:admin_main.php

示例13: hesk_ticketsByDay

function hesk_ticketsByDay()
{
    global $hesk_settings, $hesklang, $date_from, $date_to, $can_run_reports_full;
    $tickets = array();
    $totals = array('all' => 0, 'resolved' => 0, 'worked' => 0);
    $dt = DateArray($date_from, $date_to);
    // Pre-populate date values
    foreach ($dt as $day) {
        $tickets[$day] = array('all' => 0, 'resolved' => 0, 'worked' => '');
    }
    // SQL query for all
    $res = hesk_dbQuery("SELECT DATE(`dt`) AS `mydt`, COUNT(*) AS `cnt`" . ($hesk_settings['time_worked'] ? ", SUM( TIME_TO_SEC(`time_worked`) ) AS `seconds_worked`" : '') . " FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` WHERE " . ($can_run_reports_full ? '1' : "`owner` = '" . intval($_SESSION['id']) . "'") . " AND {$hesk_settings['dt_sql']} GROUP BY `mydt`");
    // Update ticket values
    while ($row = hesk_dbFetchAssoc($res)) {
        if (!$hesk_settings['time_worked']) {
            $row['seconds_worked'] = 0;
        }
        $tickets[$row['mydt']]['all'] += $row['cnt'];
        $tickets[$row['mydt']]['worked'] = $hesk_settings['time_worked'] ? hesk_SecondsToHHMMSS($row['seconds_worked']) : 0;
        $totals['all'] += $row['cnt'];
        $totals['worked'] += $row['seconds_worked'];
    }
    // SQL query for resolved
    $res = hesk_dbQuery("SELECT DATE(`dt`) AS `mydt`, COUNT(*) AS `cnt` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` WHERE " . ($can_run_reports_full ? '1' : "`owner` = '" . intval($_SESSION['id']) . "'") . " AND `status`='3' AND {$hesk_settings['dt_sql']} GROUP BY `mydt`");
    // Update ticket values
    while ($row = hesk_dbFetchAssoc($res)) {
        $tickets[$row['mydt']]['resolved'] += $row['cnt'];
        $totals['resolved'] += $row['cnt'];
    }
    // Convert total seconds worked to HH:MM:SS
    $totals['worked'] = $hesk_settings['time_worked'] ? hesk_SecondsToHHMMSS($totals['worked']) : 0;
    ?>
	    <table width="100%" cellpadding="5" style="text-align:justify;border-collapse:collapse;padding:10px;">
	      <tr style="border-bottom:1px solid #000000;">
	        <td><?php 
    echo $hesklang['date'];
    ?>
</td>
	        <td><?php 
    echo $hesklang['atik'];
    ?>
</td>
	        <td><?php 
    echo $hesklang['topen'];
    ?>
</td>
	        <td><?php 
    echo $hesklang['closed'];
    ?>
</td>
			<?php 
    if ($hesk_settings['time_worked']) {
        echo '<td>' . $hesklang['ts'] . '</td>';
    }
    ?>
	      </tr>

	<?php 
    $num_tickets = count($tickets);
    if ($num_tickets > 10) {
        ?>
	      <tr style="border-bottom:1px solid #000000;">
	        <td><b><?php 
        echo $hesklang['totals'];
        ?>
</b></td>
	        <td><b><?php 
        echo $totals['all'];
        ?>
</b></td>
	        <td><b><?php 
        echo $totals['all'] - $totals['resolved'];
        ?>
</b></td>
	        <td><b><?php 
        echo $totals['resolved'];
        ?>
</b></td>
			<?php 
        if ($hesk_settings['time_worked']) {
            echo '<td><b>' . $totals['worked'] . '</b></td>';
        }
        ?>
	      </tr>
	<?php 
    }
    $cls = '';
    foreach ($tickets as $k => $d) {
        $cls = $cls ? '' : 'style="background:#EEEEE8;"';
        ?>
	      <tr <?php 
        echo $cls;
        ?>
>
	        <td><?php 
        echo hesk_dateToString($k);
        ?>
</td>
	        <td><?php 
        echo $d['all'];
//.........这里部分代码省略.........
开发者ID:Eximagen,项目名称:helpdesk,代码行数:101,代码来源:reports.php

示例14: hesk_dbQuery

<table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td valign="top">
            <form name="showt" action="show_tickets.php" method="get">
                <table class="table" style="border-top: 0 !important" border="0" cellpadding="3" cellspacing="0" width="100%">
                    <tr>
                        <td style="border-top: 0px" width="20%" class="alignTop"><b><?php 
echo $hesklang['status'];
?>
</b>: &nbsp; </td>
                        <td style="border-top: 0px" width="80%">
                            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                <tr>
                                    <?php 
$rowCounter = 1;
$statusRS = hesk_dbQuery('SELECT `ID`, `Key`, `TextColor` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses`');
while ($row = $statusRS->fetch_assoc()) {
    if ($rowCounter > 3) {
        echo '</tr><tr>';
        $rowCounter = 1;
    }
    echo '<td width=';
    if ($rowCounter != 3) {
        echo '"33%"';
    } else {
        echo '"34%"';
    }
    echo '<label><input type="checkbox" name="s' . $row['ID'] . '" value="1"';
    if (isset($status[$row['ID']])) {
        echo 'checked="checked"';
    }
开发者ID:Orgoth,项目名称:Mods-for-HESK,代码行数:31,代码来源:show_search_form.inc.php

示例15: array

$category_options = '';
$my_cat = array();
$res2 = hesk_dbQuery("SELECT `id`, `name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` WHERE " . hesk_myCategories('id') . " ORDER BY `cat_order` ASC");
while ($row = hesk_dbFetchAssoc($res2)) {
    $my_cat[$row['id']] = hesk_msgToPlain($row['name'], 1);
    $row['name'] = strlen($row['name']) > 50 ? substr($row['name'], 0, 50) . '...' : $row['name'];
    $cat_selected = $row['id'] == $category ? 'selected="selected"' : '';
    $category_options .= '<option value="' . $row['id'] . '" ' . $cat_selected . '>' . $row['name'] . '</option>';
}
// Generate export file
if (isset($_GET['w'])) {
    // We'll need HH:MM:SS format for hesk_date() here
    $hesk_settings['timeformat'] = 'H:i:s';
    // Get staff names
    $admins = array();
    $result = hesk_dbQuery("SELECT `id`,`name` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` ORDER BY `id` ASC");
    while ($row = hesk_dbFetchAssoc($result)) {
        $admins[$row['id']] = $row['name'];
    }
    // This will be the export directory
    $export_dir = HESK_PATH . $hesk_settings['attach_dir'] . '/export/';
    // This will be the name of the export and the XML file
    $export_name = 'hesk_export_' . date('Y-m-d_H-i-s') . '_' . mt_rand(10000, 99999);
    $save_to = $export_dir . $export_name . '.xml';
    // Do we have the export directory?
    if (is_dir($export_dir) || @mkdir($export_dir, 0777) && is_writable($export_dir)) {
        // Cleanup old files
        $files = glob($export_dir . '*', GLOB_NOSORT);
        if (is_array($files) && count($files)) {
            foreach ($files as $file) {
                hesk_unlink($file, 86400);
开发者ID:riansopian,项目名称:hesk,代码行数:31,代码来源:export.php


注:本文中的hesk_dbEscape函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。