本文整理汇总了PHP中astercrm::FormatSec方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::FormatSec方法的具体用法?PHP astercrm::FormatSec怎么用?PHP astercrm::FormatSec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::FormatSec方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createGrid
//.........这里部分代码省略.........
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","dst","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","didnumber","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","dstchannel","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","username","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","groupname","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","duration","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","billsec","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","disposition","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","billsec_leg_a","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","credit","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","transfertime","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","transfertarget","' . $divName . '","ORDERING","' . $stype . '");return false;\'';
#$eventHeader[]= 'onClick=\'xajax_showGrid(0,'.$limit.',"'.$filter.'","'.$content.'","destination","'.$divName.'","ORDERING","'.$stype.'");return false;\'';
#$eventHeader[]= 'onClick=\'xajax_showGrid(0,'.$limit.',"'.$filter.'","'.$content.'","memo","'.$divName.'","ORDERING","'.$stype.'");return false;\'';
// Select Box: type table.
$typeFromSearch = array();
$typeFromSearch[] = 'like';
$typeFromSearch[] = 'equal';
$typeFromSearch[] = 'more';
$typeFromSearch[] = 'less';
// Selecct Box: Labels showed on searchtype select box.
$typeFromSearchShowAs = array();
$typeFromSearchShowAs[] = $locate->Translate('like');
$typeFromSearchShowAs[] = '=';
$typeFromSearchShowAs[] = '>';
$typeFromSearchShowAs[] = '<';
// Select Box: fields table.
$fieldsFromSearch = array();
$fieldsFromSearch[] = 'src';
$fieldsFromSearch[] = 'calldate';
$fieldsFromSearch[] = 'dst';
$fieldsFromSearch[] = 'didnumber';
$fieldsFromSearch[] = 'username';
$fieldsFromSearch[] = 'groupname';
$fieldsFromSearch[] = 'billsec';
$fieldsFromSearch[] = 'disposition';
$fieldsFromSearch[] = 'credit';
$fieldsFromSearch[] = 'transfertime';
$fieldsFromSearch[] = 'transfertarget';
#$fieldsFromSearch[] = 'destination';
$fieldsFromSearch[] = 'memo';
// Selecct Box: Labels showed on search select box.
$fieldsFromSearchShowAs = array();
$fieldsFromSearchShowAs[] = $locate->Translate("src");
$fieldsFromSearchShowAs[] = $locate->Translate("calldate");
$fieldsFromSearchShowAs[] = $locate->Translate("dst");
$fieldsFromSearchShowAs[] = $locate->Translate("callee id");
$fieldsFromSearchShowAs[] = $locate->Translate("UserName");
$fieldsFromSearchShowAs[] = $locate->Translate("AgentGroup Name");
$fieldsFromSearchShowAs[] = $locate->Translate("billsec");
$fieldsFromSearchShowAs[] = $locate->Translate("disposition");
$fieldsFromSearchShowAs[] = $locate->Translate("credit");
$fieldsFromSearchShowAs[] = $locate->Translate("transfer time");
$fieldsFromSearchShowAs[] = $locate->Translate("transfer target");
#$fieldsFromSearchShowAs[] = $locate->Translate("destination");
$fieldsFromSearchShowAs[] = $locate->Translate("memo");
// Create object whit 5 cols and all data arrays set before.
$table = new ScrollTable(9, $start, $limit, $filter, $numRows, $content, $order, $customerid, $cdrtype);
$table->setHeader('title', $headers, $attribsHeader, $eventHeader, $edit = false, $delete = false, $detail = false);
$table->setAttribsCols($attribsCols);
$table->ordering = $ordering;
$table->exportFlag = '2';
//对导出标记进行赋值
$table->addRowSearchMore("mycdr", $fieldsFromSearch, $fieldsFromSearchShowAs, $filter, $content, $start, $limit, 0, 0, $typeFromSearch, $typeFromSearchShowAs, $stype, $allOrAnswer);
while ($arreglo->fetchInto($row)) {
// Change here by the name of fields of its database table
$rowc = array();
$rowc[] = $row['id'];
$rowc[] = $row['calldate'];
$rowc[] = $row['src'];
$rowc[] = $row['dst'];
$rowc[] = $row['didnumber'];
if (strstr($row['dstchannel'], 'agent')) {
$agent = split('/', $row['dstchannel']);
$rowc[] = $agent['1'];
} else {
$rowc[] = '';
}
$rowc[] = $row['username'];
$rowc[] = $row['groupname'];
$rowc[] = astercrm::FormatSec($row['duration']);
$rowc[] = astercrm::FormatSec($row['billsec']);
$rowc[] = $row['disposition'];
$rowc[] = astercrm::FormatSec($row['billsec_leg_a']);
$rowc[] = $row['credit'];
#$rowc[] = $row['destination'];
$rowc[] = $row['transfertime'];
$rowc[] = $row['transfertarget'];
#$rowc[] = $row['memo'];
if ($row['processed'] == 'yes' && $row['fileformat'] != 'error') {
$rowc['filename'] = $row['filename'] . '.' . $row['fileformat'];
} else {
$rowc['filename'] = '';
}
$table->addRow("mycdr", $rowc, false, false, false, $divName, $fields);
}
// End Editable Zone
$html = $table->render();
return $html;
}
示例2:
if ($peer == $myreceipt['dst']) {
if ($myreceipt['billsec'] == 0) {
$content .= '<td><div><UL id="extenBtnU"><LI><a href="###"><img src="images/noanswer.gif">' . $myreceipt['src'] . '</a><UL><A href="javascript:void(null)" onclick="javascript:xajax_removeReceipt(\'' . $myreceipt['id'] . '\');"> <font size="2px">' . $locate->Translate("Hidden") . '</font></A></UL></LI></UL></div></td>';
} else {
$content .= '<td><UL id="extenBtnU"><LI><a href="###"><img src="images/inbound.gif">' . $myreceipt['src'] . '</a><UL><A href="javascript:void(null)" onclick="javascript:xajax_setFreeCallPage(\'' . $myreceipt['id'] . '\')"> <font size="2px">' . $locate->Translate("Free call") . '</font></A><A href="javascript:void(null)" onclick="javascript:xajax_removeReceipt(\'' . $myreceipt['id'] . '\');"> <font size="2px">' . $locate->Translate("Hidden") . '</font></A></UL></LI></UL></td>';
}
} else {
if ($myreceipt['billsec'] == 0) {
$content .= '<td><UL id="extenBtnU"><LI><a href="###"><img src="images/noanswer.gif">' . $myreceipt['dst'] . '</a><UL><A href="javascript:void(null)" onclick="javascript:xajax_removeReceipt(\'' . $myreceipt['id'] . '\');"> <font size="2px">' . $locate->Translate("Hidden") . '</font></A></UL></LI></UL></td>';
} else {
$content .= '<td><UL id="extenBtnU"><LI><a href="###"><img src="images/outbound.gif">' . $myreceipt['dst'] . '</a><UL><A href="javascript:void(null)" onclick="javascript:xajax_setFreeCallPage(\'' . $myreceipt['id'] . '\')"> <font size="2px">' . $locate->Translate("Free call") . '</font></A><A href="javascript:void(null)" onclick="javascript:xajax_removeReceipt(\'' . $myreceipt['id'] . '\');"> <font size="2px">' . $locate->Translate("Hidden") . '</font></A></UL></LI></UL></td>';
}
}
$content .= '
<td>' . $myreceipt['calldate'] . '</td>
<td align="right">' . astercrm::FormatSec($myreceipt['billsec']) . '</td>
<td align="right">' . $myreceipt['destination'] . '</td>
<td align="right">' . $ratedesc . '</td>
<td id="rprice-' . $myreceipt['id'] . '" align="right">' . astercc::creditDigits($myreceipt['credit']) . '</td>
<td align="right">' . astercc::creditDigits($_REQUEST['discount'], 3) . '</td>
</tr>';
echo $content;
if ($myreceipt['setfreecall'] == 'no') {
$total_price += $myreceipt['credit'];
}
}
$total_price_ori = $total_price;
$total_price = $total_price * (1 - $_REQUEST['discount']);
$total_price = astercc::creditDigits($total_price, 2);
?>
<tr><td><?php
示例3: getCampaignReport
function getCampaignReport($aFormValues)
{
global $db, $locate;
$total_sql = "SELECT COUNT(*) AS total,SUM(campaigndialedlist.billsec) AS billsec,SUM(campaigndialedlist.billsec_leg_a) AS billsec_leg_a,SUM(campaigndialedlist.duration) AS duration,campaign.campaignname,campaigndialedlist.campaignid FROM campaigndialedlist LEFT JOIN campaign ON campaign.id = campaigndialedlist.campaignid WHERE campaigndialedlist.dialedtime BETWEEN '" . $aFormValues['sdate'] . "' AND '" . $aFormValues['edate'] . "' ";
$answer_sql = "SELECT COUNT(*) AS total,SUM(billsec) AS billsec,SUM(billsec_leg_a) AS billsec_leg_a,SUM(duration) AS duration,campaignid FROM campaigndialedlist WHERE dialedtime BETWEEN '" . $aFormValues['sdate'] . "' AND '" . $aFormValues['edate'] . "' AND billsec > 0 ";
$transfer_sql = "SELECT COUNT(transfertarget) AS transferednum,campaignid FROM campaigndialedlist WHERE dialedtime BETWEEN '" . $aFormValues['sdate'] . "' AND '" . $aFormValues['edate'] . "' and transfertarget != '' ";
if ($_SESSION['curuser']['usertype'] != 'admin') {
$total_sql .= " AND campaigndialedlist.groupid = " . $_SESSION['curuser']['groupid'] . " ";
$answer_sql .= " AND campaigndialedlist.groupid = " . $_SESSION['curuser']['groupid'] . " ";
$transfer_sql .= " AND campaigndialedlist.groupid = " . $_SESSION['curuser']['groupid'] . " ";
}
$total_sql .= " GROUP BY campaigndialedlist.campaignid ";
$answer_sql .= " GROUP BY campaignid ";
$transfer_sql .= " GROUP BY campaignid ";
astercrm::events($total);
$total =& $db->getAll($total_sql);
astercrm::events($answer_sql);
$answered =& $db->getAll($answer_sql);
astercrm::events($transfer_sql);
$transfered =& $db->getAll($transfer_sql);
$resultArray = array();
foreach ($total as $tol) {
$resultArray[$tol['campaignid']]['totalnum'] = $tol['total'];
$resultArray[$tol['campaignid']]['tbillsec'] = $tol['billsec'];
$resultArray[$tol['campaignid']]['tbillsec_leg_a'] = $tol['billsec_leg_a'];
$resultArray[$tol['campaignid']]['tduration'] = $tol['duration'];
$resultArray[$tol['campaignid']]['campaignname'] = $tol['campaignname'];
}
foreach ($answered as $ans) {
$resultArray[$ans['campaignid']]['atotalnum'] = $ans['total'];
$resultArray[$ans['campaignid']]['abillsec'] = $ans['billsec'];
$resultArray[$ans['campaignid']]['abillsec_leg_a'] = $ans['billsec_leg_a'];
$resultArray[$ans['campaignid']]['aduration'] = $ans['duration'];
}
foreach ($transfered as $tran) {
$resultArray[$tran['campaignid']]['transferednum'] = $tran['transferednum'];
}
$campaigns =& $db->getAll('select id,campaignname from campaign');
foreach ($campaigns as $row) {
if (array_key_exists($row['id'], $resultArray)) {
$resultArray[$row['id']]['campaignname'] = $row['campaignname'];
}
}
$campiangStr = '<table style="width:95%;"><tr><th>' . $locate->Translate("Campaign Name") . '</th><th>' . $locate->Translate("ToalCallNum") . '</th><th>' . $locate->Translate("ToalAnsweredNum") . '</th><th>' . $locate->Translate("AnsweredRate") . '</th><th>' . $locate->Translate("AvgOfCustomerAnswered") . '</th><th>' . $locate->Translate("AvgOfTalk") . '</th><th>' . $locate->Translate("AvgOfRing") . '</th><th>' . $locate->Translate("AvgOfRingByAnswer") . '</th><th>' . $locate->Translate("TransferedNum") . '</th><th>' . $locate->Translate("TransferedRate") . '</th></tr>';
foreach ($resultArray as $key => $val) {
$ToalCallNum = $val['totalnum'];
//总通话数
$ToalAnsweredNum = $val['atotalnum'];
//接通总数
$AnsweredRate = round($val['atotalnum'] / $val['totalnum'], 4) * 100 . '%';
//接通率
$tmpAnswered = intval($val['abillsec'] / $val['atotalnum']);
$AvgOfCustomerAnswered = astercrm::FormatSec($tmpAnswered) . " (" . $tmpAnswered . " " . $locate->Translate("sec") . ")";
//平均通话时长
$tmpTalk = intval($val['tbillsec_leg_a'] / $val['totalnum']);
$AvgOfTalk = astercrm::FormatSec($tmpTalk) . " (" . $tmpTalk . " " . $locate->Translate("sec") . ")";
//平均客户接听时长
$tmpRing = intval(($val['tduration'] - $val['tbillsec_leg_a']) / $val['totalnum']);
$AvgOfRing = astercrm::FormatSec($tmpRing) . " (" . $tmpRing . " " . $locate->Translate("sec") . ")";
//平均振铃时长
$tmpRingByAnswer = intval(($val['aduration'] - $val['abillsec_leg_a']) / $val['atotalnum']);
$AvgOfRingByAnswer = astercrm::FormatSec($tmpRingByAnswer) . " (" . $tmpRingByAnswer . " " . $locate->Translate("sec") . ")";
//平均接听振铃时长
$AvgOfTransferedNum = round($val['transferednum'] / $ToalAnsweredNum * 100, 2) . '%';
//转接比率
if ($ToalAnsweredNum == '') {
$ToalAnsweredNum = 0;
}
$campiangStr .= '<tr><td>' . $val['campaignname'] . '</td><td>' . $ToalCallNum . '</td><td>' . $ToalAnsweredNum . '</td><td>' . $AnsweredRate . '</td><td>' . $AvgOfCustomerAnswered . '</td><td>' . $AvgOfTalk . '</td><td>' . $AvgOfRing . '</td><td>' . $AvgOfRingByAnswer . '</td><td>' . $val['transferednum'] . '</td><td>' . $AvgOfTransferedNum . '</td></tr>';
}
$campiangStr .= '</table>';
return $campiangStr;
}
示例4: listCDR
//.........这里部分代码省略.........
<td width="70">' . $locate->Translate("Callshop Cost") . '</td>
<td width="90">' . $locate->Translate("Reseller Cost") . '</td>
<td width="90">' . $locate->Translate("Markup") . '</td>
</tr>';
} else {
if ($_SESSION['curuser']['usertype'] == 'groupadmin') {
$html .= '<tr>
<td width="60"></td>
<td width="160">' . $locate->Translate("Destination") . '</td>
<td width="120">' . $locate->Translate("Calls") . '</td>
<td width="120">' . $locate->Translate("Billsec") . '</td>
<td width="120">' . $locate->Translate("Sells") . '</td>
<td width="70">' . $locate->Translate("Callshop Cost") . '</td>
<td width="90">' . $locate->Translate("Markup") . '</td>
</tr>';
} else {
if ($_SESSION['curuser']['usertype'] == 'operator') {
$html .= '<tr>
<td width="60"></td>
<td width="160">' . $locate->Translate("Destination") . '</td>
<td width="120">' . $locate->Translate("Calls") . '</td>
<td width="120">' . $locate->Translate("Billsec") . '</td>
<td width="120">' . $locate->Translate("Sells") . '</td>
</tr>';
}
}
}
while ($res->fetchInto($row)) {
if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
$html .= '<tr>
<td width="60"></td>
<td width="160">' . $row['destination'] . '</td>
<td width="120">' . $row['recordNum'] . '</td>
<td width="120">' . astercrm::FormatSec($row['seconds']) . '</td>
<td width="120">' . $row['credit'] . '</td>
<td width="120">' . $row['callshopcredit'] . '</td>
<td width="120">' . $row['resellercredit'] . '</td>
<td width="120">' . ($row['callshopcredit'] - $row['resellercredit']) . '</td>
</tr>';
} else {
if ($_SESSION['curuser']['usertype'] == 'groupadmin') {
$html .= '<tr>
<td width="60"></td>
<td width="160">' . $row['destination'] . '</td>
<td width="120">' . $row['recordNum'] . '</td>
<td width="120">' . astercrm::FormatSec($row['seconds']) . '</td>
<td width="120">' . $row['credit'] . '</td>
<td width="120">' . $row['callshopcredit'] . '</td>
<td width="120">' . ($row['credit'] - $row['callshopcredit']) . '</td>
</tr>';
} else {
if ($_SESSION['curuser']['usertype'] == 'operator') {
$html .= '<tr>
<td width="60"></td>
<td width="160">' . $row['destination'] . '</td>
<td width="120">' . $row['recordNum'] . '</td>
<td width="120">' . astercrm::FormatSec($row['seconds']) . '</td>
<td width="120">' . $row['credit'] . '</td>
</tr>';
}
}
}
}
$html .= '</table>';
$html .= '</form>';
if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
示例5: createGrid
//.........这里部分代码省略.........
}
foreach ($stype as $value) {
if (trim($value) != "") {
//搜索方式有值
$flag3 = "1";
break;
}
}
if ($flag != "1" || $flag2 != "1") {
//无值
if (is_array($order) || $order == '') {
$order = null;
}
$numRows =& Customer::getNumRows();
$arreglo =& Customer::getAllRecords($start, $limit, $order);
} elseif ($flag3 != 1) {
$order = "id";
$numRows =& Customer::getNumRowsMore($filter, $content, "astercrm_accout");
$arreglo =& Customer::getRecordsFilteredMore($start, $limit, $filter, $content, $order, "astercrm_accout");
} else {
$order = "id";
$numRows =& Customer::getNumRowsMorewithstype($filter, $content, $stype, $table);
$arreglo =& Customer::getRecordsFilteredMorewithstype($start, $limit, $filter, $content, $stype, $order, $table);
}
}
// Select Box: type table.
$typeFromSearch = array();
$typeFromSearch[] = 'like';
$typeFromSearch[] = 'equal';
$typeFromSearch[] = 'more';
$typeFromSearch[] = 'less';
// 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[] = 'username';
$fields[] = 'login_time';
$fields[] = 'online_time';
// HTML table: Headers showed
$headers = array();
$headers[] = $locate->Translate("ALL") . "<input type='checkbox' onclick=\"ckbAllOnClick(this);\">";
//"select all for delete";
$headers[] = $locate->Translate("username");
$headers[] = $locate->Translate("login time");
$headers[] = $locate->Translate("online time");
//"Customer Name";
// HTML table: hearders attributes
$attribsHeader = array();
$attribsHeader[] = 'width="5%"';
$attribsHeader[] = 'width="30%"';
$attribsHeader[] = 'width="30%"';
$attribsHeader[] = 'width="30%"';
// HTML Table: columns attributes
$attribsCols = array();
$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[] = '';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","username","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = '';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","last_login_time","' . $divName . '","ORDERING");return false;\'';
// Select Box: fields table.
$fieldsFromSearch = array();
$fieldsFromSearch[] = 'username';
$fieldsFromSearch[] = 'last_login_time';
// Selecct Box: Labels showed on search select box.
$fieldsFromSearchShowAs = array();
$fieldsFromSearchShowAs[] = $locate->Translate("username");
$fieldsFromSearchShowAs[] = $locate->Translate("login time");
// Create object whit 5 cols and all data arrays set before.
$table = new ScrollTable(6, $start, $limit, $filter, $numRows, $content, $order);
$table->setHeader('title', $headers, $attribsHeader, $eventHeader, 0, 0, 0);
$table->setAttribsCols($attribsCols);
$table->exportFlag = '2';
//对导出标记进行赋值
//$table->deleteFlag = '1';
$table->ordering = $ordering;
//$table->addRowSearchMore("note",$fieldsFromSearch,$fieldsFromSearchShowAs,$filter,$content);
$table->addRowSearchMore("astercrm_accout", $fieldsFromSearch, $fieldsFromSearchShowAs, $filter, $content, $start, $limit, 0, 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['select_id'] = $row['id'];
$rowc[] = $row['username'];
$rowc[] = astercrm::FormatSec(strtotime(date("Y-m-d H:i:s")) - strtotime($row['last_login_time']));
$rowc[] = $row['last_login_time'];
$table->addRow("astercrm_accout", $rowc, 0, 0, 0, $divName, $fields);
}
// End Editable Zone
$html = $table->render('delGrid');
return $html;
}
示例6: readReport
function readReport($groupid, $agent_username, $sdate, $edate)
{
global $db;
$sql = "SELECT username,SUM(`onlinetime`) AS onlinetime FROM agent_online_time WHERE login_time > '" . $sdate . "' AND logout_time < '" . $edate . "' ";
if ($groupid == 0 && $agent_username == '') {
} else {
if ($groupid != 0 && $agent_username == '') {
$sql .= " AND username IN (SELECT username FROM astercrm_account WHERE groupid = {$groupid}) ";
} else {
$sql .= " AND username = '" . $agent_username . "' ";
}
}
$sql .= " GROUP BY username";
astercrm::events($sql);
$result =& $db->query($sql);
$minVal = 0;
$maxVal = 0;
$resultArray = array();
while ($result->fetchInto($row)) {
if ($minVal == 0) {
$maxVal = $row['onlinetime'];
$minVal = $row['onlinetime'];
}
if ($row['onlinetime'] > $maxVal) {
$maxVal = $row['onlinetime'];
}
if ($row['onlinetime'] < $minVal) {
$minVal = $row['onlinetime'];
}
$resultArray[] = $row;
}
$multiple = round($maxVal / $minVal);
$html = '';
$i = 0;
$curlength = 10;
if ($multiple >= 10) {
$curlength = intval(100 / $multiple);
}
foreach ($resultArray as $tmp) {
if ($i == 0) {
$html .= '<tr class="row1">';
} else {
$html .= '<tr class="row0">';
}
$html .= '
<td>' . $tmp['username'] . '</td>
<td>' . astercrm::FormatSec($tmp['onlinetime']) . '</td>
<td><div style="width:300px;"><div style="width:' . $curlength * round($tmp['onlinetime'] / $minVal) . '%;background-color:red"> </div></div></td>
</tr>';
$i++;
}
return $html;
}
示例7: createGrid
//.........这里部分代码省略.........
$fieldsFromSearch[] = 'duration';
$fieldsFromSearch[] = 'campaigndialedlist.billsec';
$fieldsFromSearch[] = 'campaigndialedlist.billsec_leg_a';
$fieldsFromSearch[] = 'callresult';
$fieldsFromSearch[] = 'customer';
$fieldsFromSearch[] = 'customername';
$fieldsFromSearch[] = 'uniqueid';
$fieldsFromSearch[] = 'response';
$fieldsFromSearch[] = 'detect';
$fieldsFromSearch[] = 'campaignresult';
$fieldsFromSearch[] = 'transfertarget';
$fieldsFromSearch[] = 'resultby';
$fieldsFromSearch[] = 'dialedby';
$fieldsFromSearch[] = 'trytime';
$fieldsFromSearch[] = 'dialedtime';
$fieldsFromSearch[] = 'groupname';
$fieldsFromSearch[] = 'campaignname';
$fieldsFromSearch[] = 'recycles';
// Selecct Box: Labels showed on search select box.
$fieldsFromSearchShowAs = array();
$fieldsFromSearchShowAs[] = $locate->Translate("Dialed Number");
//$fieldsFromSearchShowAs[] = $locate->Translate("Answer Time");
$fieldsFromSearchShowAs[] = $locate->Translate("Duration");
$fieldsFromSearchShowAs[] = $locate->Translate("Billsec");
$fieldsFromSearchShowAs[] = $locate->Translate("Total Billsec");
$fieldsFromSearchShowAs[] = $locate->Translate("Call Result");
$fieldsFromSearchShowAs[] = $locate->Translate("Customer");
$fieldsFromSearchShowAs[] = $locate->Translate("Name");
$fieldsFromSearchShowAs[] = $locate->Translate("Uniqueid");
$fieldsFromSearchShowAs[] = $locate->Translate("Response");
$fieldsFromSearchShowAs[] = $locate->Translate("Detect");
$fieldsFromSearchShowAs[] = $locate->Translate("Campaign Result");
$fieldsFromSearchShowAs[] = $locate->Translate("Transfertarget");
$fieldsFromSearchShowAs[] = $locate->Translate("Result By");
$fieldsFromSearchShowAs[] = $locate->Translate("Dialed By");
$fieldsFromSearchShowAs[] = $locate->Translate("Tried");
$fieldsFromSearchShowAs[] = $locate->Translate("Dialed time");
$fieldsFromSearchShowAs[] = $locate->Translate("Group");
$fieldsFromSearchShowAs[] = $locate->Translate("Campaign");
$fieldsFromSearchShowAs[] = $locate->Translate("Recycles");
// Create object whit 5 cols and all data arrays set before.
$table = new ScrollTable(6, $start, $limit, $filter, $numRows, $content, $order);
$table->exportFlag = '2';
//对导出标记进行赋值
$table->deleteFlag = '1';
//对删除标记进行赋值
$table->ordering = $ordering;
$editFlag = 1;
$deleteFlag = 1;
$deleteBtnFlag = 1;
if ($_SESSION['curuser']['usertype'] != 'admin' && $_SESSION['curuser']['usertype'] != 'groupadmin') {
if ($_SESSION['curuser']['privileges']['dialedlist']['delete']) {
$deleteFlag = 1;
$table->deleteFlag = '1';
$deleteBtnFlag = 1;
} else {
$deleteFlag = 0;
$table->deleteFlag = '0';
$deleteBtnFlag = 0;
}
if ($_SESSION['curuser']['privileges']['dialedlist']['edit']) {
$editFlag = 1;
} else {
$editFlag = 0;
}
}
$table->setHeader('title', $headers, $attribsHeader, $eventHeader, 0, $deleteFlag, 0);
$table->setAttribsCols($attribsCols);
$table->addRowSearchMore("campaigndialedlist", $fieldsFromSearch, $fieldsFromSearchShowAs, $filter, $content, $start, $limit, 0, $deleteBtnFlag, $typeFromSearch, $typeFromSearchShowAs, $stype);
while ($arreglo->fetchInto($row)) {
// Change here by the name of fields of its database table
$rowc = array();
$rowc[] = $row['id'];
$rowc['select_id'] = $row['id'];
$rowc[] = $row['dialednumber'];
// $rowc[] = $row['answertime'];
$rowc[] = astercrm::FormatSec($row['duration']);
$rowc[] = astercrm::FormatSec($row['billsec']);
$rowc[] = astercrm::FormatSec($row['billsec_leg_a']);
$rowc[] = $row['callresult'];
$rowc[] = $row['customer'];
$rowc[] = $row['customername'];
// $rowc[] = $row['uniqueid'];
$rowc[] = $row['campaignresult'];
$rowc[] = $row['response'];
$rowc[] = $row['detect'];
$rowc[] = $row['transfertime'];
$rowc[] = $row['transfertarget'];
$rowc[] = $row['resultby'];
$rowc[] = $row['trytime'];
$rowc[] = $row['dialedtime'];
// $rowc[] = $row['groupname'];
$rowc[] = $row['campaignname'];
$rowc[] = $row['recycles'];
$table->addRow("campaigndialedlist", $rowc, 0, $deleteFlag, 0, $divName, $fields);
}
// End Editable Zone
$html = $table->render('delGrid');
return $html;
}
示例8: readReport
function readReport($groupid, $agent_username, $sdate, $edate)
{
global $db;
$sql = "SELECT * FROM agent_queue_log WHERE cretime > '" . $sdate . "' AND cretime < '" . $edate . "' ";
if ($groupid == 0 && $agent_username == '') {
} else {
if ($groupid != 0 && $agent_username == '') {
$sql .= " AND account IN (SELECT username FROM astercrm_account WHERE groupid = {$groupid}) ";
} else {
$sql .= " AND account = '" . $agent_username . "' ";
}
}
$sql .= " AND action='pause' ";
astercrm::events($sql);
$result =& $db->query($sql);
$resultArray = array();
while ($result->fetchInto($row)) {
if (!isset($resultArray[$row['account'] . '-' . $row['queue']])) {
$resultArray[$row['account'] . '-' . $row['queue']] = array();
}
$resultArray[$row['account'] . '-' . $row['queue']]['pauseNums']++;
$resultArray[$row['account'] . '-' . $row['queue']]['pauseTime'] += $row['pausetime'];
}
$html = '';
$i = 0;
foreach ($resultArray as $key => $val) {
if ($i == 0) {
$html .= '<tr class="row1">';
} else {
$html .= '<tr class="row0">';
}
$kArray = explode('-', $key);
$html .= '
<td>' . $kArray[0] . '</td>
<td>' . $kArray[1] . '</td>
<td>' . $val['pauseNums'] . '</td>
<td>' . astercrm::FormatSec($val['pauseTime']) . '</td>
</tr>';
$i++;
}
return $html;
}