本文整理汇总了PHP中mswGetTableData函数的典型用法代码示例。如果您正苦于以下问题:PHP mswGetTableData函数的具体用法?PHP mswGetTableData怎么用?PHP mswGetTableData使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mswGetTableData函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: department
public function department($id, $msg, $object = false)
{
$DEPT = mswGetTableData('departments', 'id', $id);
if ($object) {
return $DEPT;
}
return isset($DEPT->name) ? mswCleanData($DEPT->name) : $msg;
}
示例2: getLastReply
public function getLastReply($id)
{
$q = mysql_query("SELECT `ts`,`staffID` FROM `" . DB_PREFIX . "mailreplies`\n WHERE `mailID` = '{$id}'\n\t\tORDER BY `id` DESC\n\t\t") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__));
$R = mysql_fetch_object($q);
if (isset($R->ts)) {
$A = mswGetTableData('users', 'id', $R->staffID);
$info = array(isset($A->name) ? $A->name : 'N/A', $R->ts);
return $info;
}
return array('0', '0');
}
示例3: str_replace
if ($T->ticketStatus == 'close' && isset($_GET['lk'])) {
$rows = $MSTICKET->openclose($T->id);
// History if affected rows..
if ($rows > 0) {
$MSTICKET->historyLog($T->id, str_replace('{user}', mswSpecialChars($LI_ACC->name), $msg_ticket_history['vis-ticket-open']));
$T = mswGetTableData('tickets', 'id', $T->id);
$ticketSystemMsg = $msg_public_ticket14;
}
}
// Close..
if ($T->ticketStatus != 'close' && isset($_GET['cl'])) {
$rows = $MSTICKET->openclose($T->id, 'close');
// History if affected rows..
if ($rows > 0) {
$MSTICKET->historyLog($T->id, str_replace('{user}', mswSpecialChars($LI_ACC->name), $msg_ticket_history['vis-ticket-close']));
$T = mswGetTableData('tickets', 'id', $T->id);
$ticketSystemMsg = $msg_public_ticket13;
}
}
// Add reply..
if (isset($_POST['process'])) {
define('T_PERMS', 't');
include PATH . 'control/system/accounts/account-ticket-reply.php';
}
// Is IP blank?
if ($T->ipAddresses == '' && $T->visitorID == $LI_ACC->id) {
$MSTICKET->updateIP($T->id);
$T->ipAddresses = mswIPAddresses();
}
// Variables..
$title = str_replace('{ticket}', mswTicketNumber($_GET['t']), $msg_showticket4);
示例4: mswGetTableData
<?php
if (!defined('PARENT')) {
exit;
}
if (isset($_GET['edit'])) {
$_GET['edit'] = (int) $_GET['edit'];
$EDIT = mswGetTableData('responses', 'id', $_GET['edit']);
checkIsValid($EDIT);
$deptArr = $EDIT->departments != '0' ? explode(',', $EDIT->departments) : array();
}
?>
<div class="content">
<div class="header">
<h1 class="page-title"><?php
echo isset($_GET['edit']) ? $msg_response13 : $msg_adheader53;
?>
</h1>
<span class="clearfix"></span>
</div>
<ul class="breadcrumb">
<li><?php
echo $msg_adheader13;
?>
<span class="divider">/</span></li>
<li class="active"><?php
示例5: mswGetTableData
// Add users..
if (isset($_POST['add']) && isset($_GET['disputeUsers'])) {
$count = 0;
$tickID = (int) $_GET['disputeUsers'];
$TICKET = mswGetTableData('tickets', 'id', $tickID);
$USER = mswGetTableData('portal', 'id', $TICKET->visitorID);
$new = array();
if (!empty($_POST['name']) && $tickID > 0 && isset($TICKET->id) && isset($USER->id)) {
// Batch loop visitors to be added..nuke duplicate emails..
foreach (array_keys($_POST['email']) as $k) {
$name = $_POST['name'][$k];
$email = $_POST['email'][$k];
$send = isset($_POST['send'][$k]) ? 'yes' : 'no';
$priv = isset($_POST['priv'][$k]) ? 'yes' : 'no';
if ($name && mswIsValidEmail($email)) {
$PORTAL = mswGetTableData('portal', 'email', $email);
// Does visitor exists? If not, add account..
if (isset($PORTAL->id)) {
$pass = '';
if ($PORTAL->language && file_exists(LANG_BASE_PATH . $PORTAL->language . '/mail-templates/admin-dispute-user-current.txt')) {
$mailT = LANG_BASE_PATH . $PORTAL->language . '/mail-templates/admin-dispute-user-current.txt';
$pLang = $PORTAL->language;
} else {
$mailT = LANG_PATH . 'admin-dispute-user-current.txt';
}
$userID = $PORTAL->id;
} else {
$pass = $MSPORTAL->ms_generate();
$mailT = LANG_PATH . 'admin-dispute-user-new.txt';
$userID = $MSACC->add(array('name' => $name, 'email' => $email, 'userPass' => $pass, 'enabled' => 'yes', 'timezone' => '', 'ip' => '', 'notes' => ''));
$PORTAL = new stdclass();
示例6: mswCheckDigit
}
// Check digit..
mswCheckDigit($_GET['id'], true);
// Add ticket..
if (isset($_POST['process'])) {
$MSTICKET->updateTicketReply($msg_ticket_history['reply-edit']);
$OK = true;
}
// Get reply..
$REPLY = mswGetTableData('replies', 'id', $_GET['id']);
// Checks..
if (!isset($REPLY->id)) {
$HEADERS->err404(true);
}
// Get ticket data..
$SUPTICK = mswGetTableData('tickets', 'id', $REPLY->ticketID);
// Checks..
if (!isset($SUPTICK->id)) {
$HEADERS->err403(true);
}
// Department check..
if (mswDeptPerms($MSTEAM->id, $SUPTICK->department, $userDeptAccess) == 'fail') {
$HEADERS->err403(true);
}
$title = $msg_viewticket36;
$loadJQAPI = true;
$loadBBCSS = true;
$loadJQAlertify = true;
include PATH . 'templates/header.php';
include PATH . 'templates/system/tickets/tickets-edit-reply.php';
include PATH . 'templates/footer.php';
示例7: mysql_query
include PATH . 'templates/system/tickets/view/attachments.php';
}
// Replies..
$reps = 0;
$q_replies = mysql_query("SELECT * FROM `" . DB_PREFIX . "replies`\n WHERE `ticketID` = '{$_GET['id']}'\n ORDER BY `id`\n ") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__));
while ($REPLIES = mysql_fetch_object($q_replies)) {
switch ($REPLIES->replyType) {
case 'admin':
$USER = mswGetTableData('users', 'id', $REPLIES->replyUser);
$replyName = isset($USER->name) ? mswSpecialChars($USER->name) : 'N/A';
$label = ' label-important';
$icon = '<i class="icon-user"></i> ';
break;
case 'visitor':
if ($REPLIES->disputeUser > 0) {
$DU = mswGetTableData('portal', 'id', $REPLIES->disputeUser, '', '`name`');
$replyName = isset($DU->name) ? mswSpecialChars($DU->name) : 'N/A';
} else {
$replyName = mswSpecialChars($SUPTICK->name);
}
$label = ' label-info';
$icon = '';
break;
}
?>
<div class="block reptype<?php
echo $REPLIES->replyType;
?>
" id="reply-<?php
echo $REPLIES->id;
?>
示例8: mswCheckDigit
}
// Check digit..
mswCheckDigit($_GET['id'], true);
// Get ticket data..
$SUPTICK = mswGetTableData('tickets', 'id', $_GET['id']);
// Checks..
if (!isset($SUPTICK->id)) {
$HEADERS->err404(true);
exit;
}
// Department check..
if (mswDeptPerms($MSTEAM->id, $SUPTICK->department, $userDeptAccess) == 'fail') {
$HEADERS->err403(true);
}
// Edit..
if (isset($_POST['process'])) {
$rows = $MSTICKET->updateTicket();
// Log if affected rows..
if ($rows > 0) {
$MSTICKET->historyLog($_GET['id'], str_replace(array('{user}'), array($MSTEAM->name), $msg_ticket_history['edit-ticket']));
}
$SUPTICK = mswGetTableData('tickets', 'id', $_GET['id']);
$OK = true;
}
$title = str_replace('{ticket}', mswTicketNumber($SUPTICK->id), $msg_viewticket20);
$loadJQAPI = true;
$loadBBCSS = true;
$loadJQAlertify = true;
include PATH . 'templates/header.php';
include PATH . 'templates/system/tickets/tickets-edit.php';
include PATH . 'templates/footer.php';
示例9: mswGetTableData
<?php
if (!defined('PARENT')) {
exit;
}
if (isset($_GET['edit'])) {
$_GET['edit'] = (int) $_GET['edit'];
$EDIT = mswGetTableData('categories', 'id', $_GET['edit']);
checkIsValid($EDIT);
}
?>
<div class="content">
<div class="header">
<h1 class="page-title"><?php
echo isset($EDIT->id) ? $msg_kbasecats5 : $msg_kbase16;
?>
</h1>
<span class="clearfix"></span>
</div>
<ul class="breadcrumb">
<li><?php
echo $msg_adheader17;
?>
<span class="divider">/</span></li>
<li class="active"><?php
echo isset($EDIT->id) ? $msg_kbasecats5 : $msg_kbase16;
示例10: implode
$MSMAIL->addTag('{ATTACHMENTS}', !empty($attString) ? implode(mswDefineNewline(), $attString) : 'N/A');
$MSMAIL->addTag('{NAME}', $PORTAL->name);
$MSMAIL->addTag('{MERGED_TICKET}', $ret[0] == 'yes' ? mswTicketNumber($_GET['id']) : '');
$MSMAIL->addTag('{TICKET}', mswTicketNumber($TICKET->id));
$MSMAIL->addTag('{SUBJECT}', $TICKET->subject);
$MSMAIL->addTag('{DEPT}', $MSYS->department($TICKET->department, $msg_script30));
$MSMAIL->addTag('{PRIORITY}', $MSYS->levels($TICKET->priority));
$MSMAIL->addTag('{STATUS}', $MSYS->status($TICKET->ticketStatus));
$MSMAIL->addTag('{USER}', $MSTEAM->nameFrom ? $MSTEAM->nameFrom : $MSTEAM->name);
$MSMAIL->addTag('{CUSTOM}', $MSCFMAN->email($ret[1], $ret[3]));
$MSMAIL->addTag('{ID}', $TICKET->id);
// Pass ticket number as custom mail header..
$MSMAIL->xheaders['X-TicketNo'] = mswTicketNumber($TICKET->id);
// If this ticket was opened by imap, the return address should be the imap address..
if ($TICKET->source == 'imap') {
$IDEPT = mswGetTableData('imap', 'im_dept', $TICKET->department, '', '`im_email`');
if (isset($IDEPT->im_email) && $IDEPT->im_email) {
$replyToAddr = $IDEPT->im_email;
}
}
// What mail templates are we using..
switch ($isDispute) {
case 'yes':
if ($PORTAL->language && file_exists(LANG_BASE_PATH . $PORTAL->language . '/mail-templates/admin-dispute-reply.txt')) {
$mailT = LANG_BASE_PATH . $PORTAL->language . '/mail-templates/admin-dispute-reply.txt';
$pLang = $PORTAL->language;
} else {
$mailT = LANG_PATH . 'admin-dispute-reply.txt';
}
break;
default:
示例11: mswCheckDigit
if (!defined('PARENT') || !isset($_GET['a']) || !defined('MS_PERMISSIONS') || $SETTINGS->kbase == 'no') {
$HEADERS->err403();
}
// Security check..
mswCheckDigit($_GET['a']);
$QUE = mswGetTableData('faq', 'id', (int) $_GET['a'], 'AND `enFaq` = \'yes\'', '*');
if (!isset($QUE->question)) {
$HEADERS->err404();
}
// Variables..
$title = $QUE->question . ' - ' . $msg_adheader17;
$subt = $msg_header8;
$cky = array();
// Check for category/search params..
if (isset($_GET['c']) && (int) $_GET['c'] > 0) {
$CAT = mswGetTableData('categories', 'id', (int) $_GET['c'], 'AND `enCat` = \'yes\'', '`name`,`subcat`');
if (isset($CAT->name)) {
if (isset($CAT->subcat) && $CAT->subcat > 0) {
define('IS_SUB', $CAT->subcat);
}
$subt = $msg_header8 . ': ' . $CAT->name;
}
} else {
if (isset($_GET['q'])) {
$subt = $msg_header8 . ': ' . $msg_pkbase3;
}
}
// Header..
include PATH . 'control/header.php';
// Cookie set..
if (isset($_COOKIE[md5(SECRET_KEY) . COOKIE_NAME])) {
示例12: str_replace
if ($A->verified == 'yes') {
$message = $msg_public_create9;
} else {
// Load mail params
include PATH . 'control/mail-data.php';
// Activate..
$pass = $MSACC->ms_generate();
$rows = $MSACC->activate(array('id' => $A->id, 'pass' => $pass));
if ($rows > 0) {
$MSMAIL->addTag('{NAME}', $A->name);
$MSMAIL->addTag('{EMAIL}', $A->email);
$MSMAIL->addTag('{PASS}', $pass);
$MSMAIL->addTag('{LOGIN_URL}', $SETTINGS->scriptpath);
$MSMAIL->sendMSMail(array('from_email' => $SETTINGS->email, 'from_name' => $SETTINGS->website, 'to_email' => $A->email, 'to_name' => $A->name, 'subject' => str_replace(array('{website}'), array($SETTINGS->website), $emailSubjects['acc-verified']), 'replyto' => array('name' => $SETTINGS->website, 'email' => $SETTINGS->replyto ? $SETTINGS->replyto : $SETTINGS->email), 'template' => PATH . 'content/language/' . $SETTINGS->language . '/mail-templates/account-verified.txt', 'language' => $SETTINGS->language));
// Admin notification..
$ADMIN = mswGetTableData('users', 'id', 1);
if ($SETTINGS->newAccNotify == 'yes' && $ADMIN->notify == 'yes') {
$MSMAIL->addTag('{IP}', mswIPAddresses());
$MSMAIL->sendMSMail(array('from_email' => $SETTINGS->email, 'from_name' => $SETTINGS->website, 'to_email' => $SETTINGS->email, 'to_name' => $SETTINGS->website, 'subject' => str_replace(array('{website}'), array($SETTINGS->website), $emailSubjects['new-acc-notify']), 'replyto' => array('name' => $A->name, 'email' => $A->email), 'template' => PATH . 'content/language/' . $SETTINGS->language . '/mail-templates/new-account-notification.txt', 'language' => $SETTINGS->language, 'add-emails' => $ADMIN->email2));
}
}
$message = str_replace('{email}', $A->email, $msg_public_create10);
}
}
// Show message..
$title = $msg_public_create7;
include PATH . 'control/header.php';
$tpl = new Savant3();
$tpl->assign('TXT', array($msg_public_create7, $msg_public_create, $message));
// Global vars..
include PATH . 'control/lib/global.php';
示例13: strtoupper
// Send message to support staff if manual assign is off for department..
// This doesn`t include the global user..
if ($DP->manual_assign == 'no') {
$MSAPI->log('[' . strtoupper($MSAPI->handler) . '] Preparing to send emails to staff..');
$qU = mysql_query("SELECT `" . DB_PREFIX . "users`.`name` AS `teamName`,`email`,`email2` FROM `" . DB_PREFIX . "userdepts`\n LEFT JOIN `" . DB_PREFIX . "departments`\n ON `" . DB_PREFIX . "userdepts`.`deptID` = `" . DB_PREFIX . "departments`.`id`\n LEFT JOIN `" . DB_PREFIX . "users`\n ON `" . DB_PREFIX . "userdepts`.`userID` = `" . DB_PREFIX . "users`.`id`\n WHERE `deptID` = '{$deptID}'\n AND `userID` != '1'\n AND `notify` = 'yes'\n GROUP BY `email`\n\t\t\t\t ORDER BY `" . DB_PREFIX . "users`.`name`\n ") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__));
while ($STAFF = mysql_fetch_object($qU)) {
$MSMAIL->addTag('{NAME}', $STAFF->teamName);
$MSMAIL->sendMSMail(array('from_email' => $SETTINGS->email, 'from_name' => $SETTINGS->website, 'to_email' => $STAFF->email, 'to_name' => $STAFF->teamName, 'subject' => str_replace(array('{website}', '{ticket}'), array($SETTINGS->website, mswTicketNumber($ID)), $emailSubjects['new-ticket']), 'replyto' => array('name' => $SETTINGS->website, 'email' => $SETTINGS->replyto ? $SETTINGS->replyto : $SETTINGS->email), 'template' => PATH . 'content/language/' . $SETTINGS->language . '/mail-templates/new-ticket-staff.txt', 'language' => $SETTINGS->language, 'alive' => 'yes', 'add-emails' => $STAFF->email2));
$MSAPI->log('[' . strtoupper($MSAPI->handler) . '] Email sent to ' . $STAFF->teamName . ' <' . $STAFF->email . '>');
}
} else {
$MSAPI->log('[' . strtoupper($MSAPI->handler) . '] No emails sent to staff as ticket is awaiting assignment');
}
// Now send to global user..
$MSAPI->log('[' . strtoupper($MSAPI->handler) . '] Preparing to send to global admin staff member..');
$GLOBAL = mswGetTableData('users', 'id', 1, 'AND `notify` = \'yes\'', '`name`,`email`,`email2`');
if (isset($GLOBAL->name)) {
$MSMAIL->addTag('{NAME}', $GLOBAL->name);
$MSMAIL->sendMSMail(array('from_email' => $SETTINGS->email, 'from_name' => $SETTINGS->website, 'to_email' => $GLOBAL->email, 'to_name' => $GLOBAL->name, 'subject' => str_replace(array('{website}', '{ticket}'), array($SETTINGS->website, mswTicketNumber($ID)), $emailSubjects['new-ticket']), 'replyto' => array('name' => $SETTINGS->website, 'email' => $SETTINGS->replyto ? $SETTINGS->replyto : $SETTINGS->email), 'template' => PATH . 'content/language/' . $SETTINGS->language . '/mail-templates/new-ticket-admin.txt', 'language' => $SETTINGS->language, 'alive' => 'yes', 'add-emails' => $GLOBAL->email2));
$MSAPI->log('[' . strtoupper($MSAPI->handler) . '] Email sent to ' . $GLOBAL->name . ' <' . $GLOBAL->email . '>');
} else {
$MSAPI->log('[' . strtoupper($MSAPI->handler) . '] Not sent, notifications are disabled. Enable in settings');
}
// Send email to visitor..
$MSAPI->log('[' . strtoupper($MSAPI->handler) . '] Preparing to send new ticket confirmation to visitor..');
$MSMAIL->addTag('{NAME}', $name);
$MSMAIL->sendMSMail(array('from_email' => $SETTINGS->email, 'from_name' => $SETTINGS->website, 'to_email' => $email, 'to_name' => $name, 'subject' => str_replace(array('{website}', '{ticket}'), array($SETTINGS->website, mswTicketNumber($ID)), $emailSubjects['new-ticket-vis']), 'replyto' => array('name' => $SETTINGS->website, 'email' => $SETTINGS->replyto ? $SETTINGS->replyto : $SETTINGS->email), 'template' => $mailR, 'language' => $pLang ? $pLang : $SETTINGS->language));
$MSAPI->log('[' . strtoupper($MSAPI->handler) . '] Email sent to ' . $name . ' <' . $email . '>');
} else {
$MSAPI->log('[' . strtoupper($MSAPI->handler) . '] Fatal error: Ticket could not be created: ' . mysql_error());
}
示例14: str_replace
if (isset($USR->name) && $USR->notify == 'yes') {
$MSMAIL->addTag('{NAME}', $USR->name);
$MSMAIL->addTag('{SENDER}', $MSTEAM->name);
// Send mail..
$MSMAIL->sendMSMail(array('from_email' => $SETTINGS->email, 'from_name' => $SETTINGS->website, 'to_email' => $USR->email, 'to_name' => $USR->name, 'subject' => str_replace(array('{website}', '{user}'), array($SETTINGS->website, $MSTEAM->name), $emailSubjects['mailbox-notify']), 'replyto' => array('name' => $SETTINGS->website, 'email' => $SETTINGS->replyto ? $SETTINGS->replyto : $SETTINGS->email), 'template' => LANG_PATH . 'mailbox-notification.txt', 'language' => $SETTINGS->language, 'add-emails' => $USR->email2));
}
}
}
$OK = true;
}
// Add reply..
if (isset($_POST['add-reply']) && $_POST['message'] && $MID > 0) {
// Get other person in message..
$OT = mswGetTableData('mailassoc', 'mailID', $MID, 'AND `staffID` != \'' . $MSTEAM->id . '\'');
if (isset($OT->staffID)) {
$id = $MSMB->reply(array('staff' => $MSTEAM->id, 'to' => $OT->staffID, 'id' => $MID, 'message' => $_POST['message']));
// Proceed if added ok..
// Are we sending notification to staff mailbox?
if ($id > 0 && $MSTEAM->mailCopy == 'yes') {
$USR = mswGetTableData('users', 'id', $OT->staffID, '', '`name`,`email`,`email2`,`notify`');
if (isset($USR->name) && $USR->notify == 'yes') {
$MSMAIL->addTag('{NAME}', $USR->name);
$MSMAIL->addTag('{SENDER}', $MSTEAM->name);
$MSMAIL->addTag('{TOPIC}', $_POST['subject']);
// Send mail..
$MSMAIL->sendMSMail(array('from_email' => $SETTINGS->email, 'from_name' => $SETTINGS->website, 'to_email' => $USR->email, 'to_name' => $USR->name, 'subject' => str_replace(array('{website}', '{user}'), array($SETTINGS->website, $MSTEAM->name), $emailSubjects['mailbox-notify']), 'replyto' => array('name' => $SETTINGS->website, 'email' => $SETTINGS->replyto ? $SETTINGS->replyto : $SETTINGS->email), 'template' => LANG_PATH . 'mailbox-notification-reply.txt', 'language' => $SETTINGS->language, 'add-emails' => $USR->email2));
}
}
}
$OK2 = true;
}
示例15: getLastReply
public function getLastReply($id)
{
$q = mysql_query("SELECT `ts`,`replyType`,`replyUser`,`disputeUser` FROM `" . DB_PREFIX . "replies`\n WHERE `ticketID` = '{$id}'\n\t\tORDER BY `id` DESC\n\t\tLIMIT 1\n\t\t") or die(mswMysqlErrMsg(mysql_errno(), mysql_error(), __LINE__, __FILE__));
$R = mysql_fetch_object($q);
if (isset($R->ts)) {
switch ($R->replyType) {
case 'admin':
$A = mswGetTableData('users', 'id', $R->replyUser);
$info = array(isset($A->name) ? mswSpecialChars($A->name) : 'N/A', $R->ts, $R->replyType);
break;
case 'visitor':
if ($R->disputeUser > 0) {
$U = mswGetTableData('portal', 'id', $R->disputeUser, '', '`name`');
$info = array(isset($U->name) ? mswSpecialChars($U->name) : 'N/A', $R->ts, $R->replyType);
} else {
$U = mswGetTableData('portal', 'id', $R->replyUser, '', '`name`');
$info = array(isset($U->name) ? mswSpecialChars($U->name) : 'N/A', $R->ts, $R->replyType);
}
break;
}
return $info;
}
return array('0', '0', '');
}