本文整理汇总了PHP中astercrm::db2html方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::db2html方法的具体用法?PHP astercrm::db2html怎么用?PHP astercrm::db2html使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::db2html方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: waitingCalls
function waitingCalls($myValue)
{
global $db, $config;
$locate = new Localization($_SESSION['curuser']['country'], $_SESSION['curuser']['language'], 'portal');
$objResponse = new xajaxResponse();
$curid = trim($myValue['curid']);
// to improve system efficiency
/**************************
**************************/
// modified 2007/10/30 by solo
// start
//print_r($_SESSION);exit;
//if ($_SESSION['curuser']['channel'] == '')
$call = asterEvent::checkNewCall($curid, $_SESSION['curuser']['extension'], $_SESSION['curuser']['channel'], $_SESSION['curuser']['agent']);
//else
// $call = asterEvent::checkNewCall($curid,$_SESSION['curuser']['channel']);
// end
if ($call['status'] == '') {
$title = $locate->Translate("waiting");
$status = 'idle';
//$call['curid'] = $curid;
$direction = '';
$info = $locate->Translate("extension") . $_SESSION['curuser']['extension'] . "-" . $locate->Translate("stand_by");
} elseif ($call['status'] == 'incoming') {
//incoming calls here
$title = $call['callerid'];
$stauts = 'ringing';
$direction = 'in';
$info = $locate->Translate("incoming") . ' ' . $call['callerid'];
$trunk = split("-", $call['callerChannel']);
//print_r($trunk);exit;
$trunk_name = split('@', $trunk[0]);
$info = $info . ' channel: ' . $trunk_name[0];
// get trunk info
$mytrunk = astercrm::getTrunkinfo($trunk[0], $call['didnumber']);
if ($mytrunk) {
$infomsg = "<strong>" . $mytrunk['trunkname'] . "</strong><br>";
$infomsg .= mb_substr(astercrm::db2html($mytrunk['trunknote']), 0, 10, "UTF-8") . '...';
if ($call['didnumber'] != '') {
$infomsg .= " |" . $locate->Translate("Callee id") . " : <b>" . $call['didnumber'] . "</b>";
}
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
} else {
$trunk_name = split('@', $trunk[0]);
$infomsg = $locate->Translate("no information get for trunk") . ": " . $trunk_name[0];
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
}
$objResponse->addAssign("iptSrcNumber", "value", $call['callerid']);
$objResponse->addAssign("iptCallerid", "value", $call['callerid']);
$objResponse->addAssign("btnHangup", "disabled", false);
if ($config['system']['pop_up_when_dial_in']) {
if (strlen($call['callerid']) > $config['system']['phone_number_length'] && $call['callerid'] != '<unknown>') {
if ($myValue['popup'] == 'yes') {
if ($config['system']['enable_external_crm'] == false) {
$objResponse->loadXML(getContact($call['callerid']));
if ($config['system']['browser_maximize_when_pop_up'] == true) {
$objResponse->addScript('maximizeWin();');
}
} else {
//use external link
$myurl = $config['system']['external_crm_url'];
$myurl = preg_replace("/\\%method/", "dial_in", $myurl);
$myurl = preg_replace("/\\%callerid/", $call['callerid'], $myurl);
$myurl = preg_replace("/\\%calleeid/", $_SESSION['curuser']['extension'], $myurl);
if ($config['system']['open_new_window'] == false) {
$mycrm = '<iframe id="mycrm" name="mycrm" src="' . $myurl . '" width="100%" frameBorder=0 scrolling=auto height="100%"></iframe>';
$objResponse->addAssign("divCrm", "innerHTML", $mycrm);
} else {
$javascript = "openwindow('" . $myurl . "')";
$objResponse->addScript($javascript);
}
}
}
} else {
}
}
} elseif ($call['status'] == 'dialout') {
//dailing out here
$title = $call['callerid'];
$status = 'dialing';
$direction = 'out';
$info = $locate->Translate("dial_out") . ' ' . $call['callerid'];
$objResponse->addAssign("iptCallerid", "value", $call['callerid']);
$objResponse->addAssign("btnHangup", "disabled", false);
if ($call['didnumber'] != '') {
$didinfo = $locate->Translate("Callee id") . " : " . $call['didnumber'];
$objResponse->addAssign('divDIDinfo', 'innerHTML', $didinfo);
}
if ($config['system']['pop_up_when_dial_out']) {
if (strlen($call['callerid']) > $config['system']['phone_number_length']) {
if ($myValue['popup'] == 'yes') {
if ($config['system']['enable_external_crm'] == false) {
$objResponse->loadXML(getContact($call['callerid']));
if ($config['system']['browser_maximize_when_pop_up'] == true) {
$objResponse->addScript('maximizeWin();');
}
} else {
//use external link
$myurl = $config['system']['external_crm_url'];
$myurl = preg_replace("/\\%method/", "dial_out", $myurl);
//.........这里部分代码省略.........
示例2: incomingCalls
function incomingCalls($myValue)
{
global $db, $locate, $config;
$objResponse = new xajaxResponse();
//print_r($myValue);exit;
if ($myValue['direction'] != '') {
$call = asterEvent::checkCallStatus($myValue['curid'], $myValue['uniqueid']);
#print_r($call);exit;
if ($call['status'] == '') {
if ($call['hold']['number'] != '') {
//print_r($myValue);exit;
$curcallerid = $call['hold']['number'];
$objResponse->addAssign("divHolding", "innerHTML", '<a href="###" onclick="getContact(' . $call['hold']['number'] . ');">[' . $call['hold']['number'] . ']</a> <a onclick="xajax_turnback(\'' . $call['hold']['channel'] . '\',\'' . $myValue['callerChannel'] . '\');return false;" href="###"><font size="2px">' . $locate->Translate("Turn back") . '</font></a> ');
//<a onclick="xajax_holdhangup(\''.$call['hold']['channel'].'\');return false;" href="###"><font size="2px">'.$locate->Translate("Hangup").'</font></a>
} else {
$curcallerid = $myValue['callerid'];
$objResponse->addAssign("divHolding", "innerHTML", '');
}
return $objResponse;
} elseif ($call['status'] == 'link') {
$objResponse->addAssign("btnDial", "disabled", true);
$objResponse->addScript("clearSettimePopup();");
if ($myValue['direction'] == 'in' && $myValue['trunkinfoStatus'] == 0) {
if ($call['didnumber'] != '') {
$didinfo = $locate->Translate("Callee id") . " : <b>" . $call['didnumber'] . "</b>";
$objResponse->addAssign('divDIDinfo', 'innerHTML', $didinfo);
}
$trunk = split("-", $call['callerChannel']);
//print_r($trunk);exit;
$info = $info . ' channel: ' . $trunk[0];
// get trunk info
$mytrunk = astercrm::getTrunkinfo($trunk[0], $call['didnumber']);
if ($mytrunk) {
$infomsg = "<strong>" . $mytrunk['trunkname'] . "</strong><br>";
$infomsg .= astercrm::db2html($mytrunk['trunknote']);
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
$objResponse->addAssign('trunkinfo_number', "innerHTML", $mytrunk['trunk_number']);
} else {
$infomsg = $locate->Translate("no information get for trunk") . ": " . $trunk[0];
$objResponse->addAssign('divTrunkinfo', "innerHTML", $infomsg);
$objResponse->addAssign('trunkinfo_number', "innerHTML");
}
$objResponse->addAssign('trunkinfoStatus', "value", '1');
if ($config['system']['enable_sms'] == 'callerid' && $myValue['callerid'] != '') {
$objResponse->addScript('xajax_SendSmsForm("callerid",' . $myValue['callerid'] . ')');
} else {
if ($config['system']['enable_sms'] == 'trunk_number' && $mytrunk['trunk_number'] != '') {
$objResponse->addScript('xajax_SendSmsForm("trunk_number",' . $mytrunk['trunk_number'] . ')');
} else {
if ($config['system']['enable_sms'] == 'campaign_number' && $result['campaignid'] != '') {
$objResponse->addScript('xajax_SendSmsForm("campaign_number",' . $result['campaignid'] . ')');
}
}
}
}
if ($myValue['callResultStatus'] != '2') {
$result = asterCrm::checkDialedlistCall($myValue['callerid']);
//print_r($result);exit;
$dialedlistid = $result['id'];
//$dialedlistid =
$campaign_id = $result['campaignid'];
if ($campaign_id != '') {
$objResponse->addAssign("dndlist_campaignid", "value", $campaign_id);
} else {
$objResponse->addAssign("dndlist_campaignid", "value", "0");
}
if ($dialedlistid) {
$divCallresult = Customer::getCampaignResultHtml($dialedlistid, 'ANSWERED');
//echo $divCallresult;exit;
$objResponse->addAssign("divCallresult", "style.display", "");
$objResponse->addAssign("divCallresult", "innerHTML", $divCallresult);
$objResponse->addAssign("dialedlistid", "value", $dialedlistid);
} else {
$objResponse->addAssign("dialedlistid", "value", 0);
}
$objResponse->addAssign("callResultStatus", "value", '2');
}
if ($myValue['extensionStatus'] == 'link') {
//already get link event
return $objResponse;
}
// if ($call['callerChannel'] == '' or $call['calleeChannel'] == '')
// return $objResponse;
$status = "link";
if ($call['hold']['number'] != '') {
//print_r($myValue);exit;
$curcallerid = $call['consultnum'];
$objResponse->addAssign("divHolding", "innerHTML", '<a href="###" onclick="getContact(' . $call['hold']['number'] . ');">[' . $call['hold']['number'] . ']</a> <a onclick="xajax_turnback(\'' . $call['hold']['channel'] . '\',\'' . $myValue['callerChannel'] . '\');return false;" href="###"><font size="2px">' . $locate->Translate("Turn back") . '</font></a> <a onclick="xajax_attendtransfer(\'' . $call['hold']['channel'] . '\',\'' . $myValue['calleeChannel'] . '\');return false;" href="###"><font size="2px">' . $locate->Translate("Transfer") . '</font></a> ');
//<a onclick="xajax_holdhangup(\''.$call['hold']['channel'].'\');return false;" href="###"><font size="2px">'.$locate->Translate("Hangup").'</font></a>
} else {
$curcallerid = $myValue['callerid'];
$objResponse->addAssign("divHolding", "innerHTML", '');
}
#print_r($myValue);exit;
if (!empty($call['srcname']) && $call['srcname'] != 'unknown' && $call['srcname'] != '<unknown>') {
$info = $locate->Translate("talking_to") . $curcallerid . ' (' . $call['srcname'] . ') ';
} else {
$info = $locate->Translate("talking_to") . $curcallerid;
}
if ($call['queue'] != '') {
//.........这里部分代码省略.........
示例3: createGrid
//.........这里部分代码省略.........
// Selecct Box: Labels showed on searchtype select box.
$typeFromSearchShowAs = array();
$typeFromSearchShowAs[] = $locate->Translate("like");
$typeFromSearchShowAs[] = '=';
$typeFromSearchShowAs[] = '>';
$typeFromSearchShowAs[] = '<';
// Editable zone
// Databse Table: fields
$fields = array();
$fields[] = 'trunkname';
$fields[] = 'trunkchannel';
$fields[] = 'didnumber';
$fields[] = 'trunknote';
$fields[] = 'creby';
$fields[] = 'cretime';
// HTML table: Headers showed
$headers = array();
$headers[] = $locate->Translate("Trunk Name");
$headers[] = $locate->Translate("Trunk Channel");
$headers[] = $locate->Translate("DID Number");
$headers[] = $locate->Translate("Trunk Note");
$headers[] = $locate->Translate("Create by");
$headers[] = $locate->Translate("Create time");
// HTML table: hearders attributes
$attribsHeader = array();
$attribsHeader[] = 'width="15%"';
$attribsHeader[] = 'width="15%"';
$attribsHeader[] = 'width="15%"';
$attribsHeader[] = 'width="30%"';
$attribsHeader[] = 'width="10%"';
$attribsHeader[] = 'width="10%"';
// HTML Table: columns attributes
$attribsCols = array();
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
// HTML Table: If you want ascendent and descendent ordering, set the Header Events.
$eventHeader = array();
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","trunkname","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","trunkchannel","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","didnumber","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","trunknote","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","creby","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","cretime","' . $divName . '","ORDERING");return false;\'';
// Select Box: fields table.
$fieldsFromSearch = array();
$fieldsFromSearch[] = 'trunkname';
$fieldsFromSearch[] = 'trunkchannel';
$fieldsFromSearch[] = 'didnumber';
$fieldsFromSearch[] = 'trunknote';
$fieldsFromSearch[] = 'creby';
$fieldsFromSearch[] = 'cretime';
// Selecct Box: Labels showed on search select box.
$fieldsFromSearchShowAs = array();
$fieldsFromSearchShowAs[] = $locate->Translate("Trunk Name");
$fieldsFromSearchShowAs[] = $locate->Translate("Trunk Channel");
$fieldsFromSearchShowAs[] = $locate->Translate("DID Number");
$fieldsFromSearchShowAs[] = $locate->Translate("Trunk Note");
$fieldsFromSearchShowAs[] = $locate->Translate("Create by");
$fieldsFromSearchShowAs[] = $locate->Translate("Create time");
// Create object whit 5 cols and all data arrays set before.
$table = new ScrollTable(7, $start, $limit, $filter, $numRows, $content, $order);
//$table->exportFlag = '1';//对导出标记进行赋值
$table->ordering = $ordering;
$editFlag = 1;
$deleteFlag = 1;
if ($_SESSION['curuser']['usertype'] != 'admin' && $_SESSION['curuser']['usertype'] != 'groupadmin') {
if ($_SESSION['curuser']['privileges']['trunkinfo']['delete']) {
$deleteFlag = 1;
} else {
$deleteFlag = 0;
}
if ($_SESSION['curuser']['privileges']['trunkinfo']['edit']) {
$editFlag = 1;
} else {
$editFlag = 0;
}
}
$table->setHeader('title', $headers, $attribsHeader, $eventHeader, $editFlag, $deleteFlag, 0);
$table->setAttribsCols($attribsCols);
$table->addRowSearchMore("trunkinfo", $fieldsFromSearch, $fieldsFromSearchShowAs, $filter, $content, $start, $limit, 1, 0, $typeFromSearch, $typeFromSearchShowAs, $stype);
while ($arreglo->fetchInto($row)) {
// Change here by the name of fields of its database table
$rowc = array();
$rowc[] = $row['id'];
$rowc[] = $row['trunkname'];
$rowc[] = $row['trunkchannel'];
$rowc[] = $row['didnumber'];
$rowc[] = astercrm::db2html($row['trunknote']);
$rowc[] = $row['creby'];
$rowc[] = $row['cretime'];
$table->addRow("trunkinfo", $rowc, $editFlag, $deleteFlag, 0, $divName, $fields);
}
// End Editable Zone
$html = $table->render();
return $html;
}