function connect_stats($start_time, $end_time) { $parameter = array('act' => 'connect_stats', 'start_time' => $start_time, 'end_time' => $end_time); $res = data_from_jinlun('missCall.php', $parameter); $admin = return_admin(); $result = array(); if ($res) { foreach ($admin as &$val) { foreach ($res['call_list'] as $r) { if ($val['ext'] == $r['clid']) { if ($r['disposition']) { $val['answered'] = $r['total']; } else { $val['noanswered'] = $r['total']; } } } $result[$val['admin_id']] = $val; } foreach ($result as &$v) { $v['call_num'] = $v['answered'] + $v['noanswered']; if ($v['call_num'] > 0) { $v['call_rate'] = sprintf('%.2f', $v['answered'] / $v['call_num'] * 100) . '%'; } } } return $result; }
$res['main'] = $smarty->fetch('sys_msg.htm'); die($json->encode($res)); } elseif ('mark_msg_status' == $_REQUEST['act']) { $notice_id = intval($_REQUEST['notice_id']); $sql = 'UPDATE ' . $GLOBALS['ecs']->table('public_notice') . " SET status=1 WHERE notice_id={$notice_id}"; $code = $GLOBALS['db']->query($sql); if ($code) { $res = crm_msg('标记已读', $code); } else { $res = crm_msg(); } die($json->encode($res)); } elseif ('call_history' == $_REQUEST['act']) { if ($_SESSION['ext']) { $parameter = array('ext' => $_SESSION['ext']); $list = data_from_jinlun('missCall.php?act=call_history', $parameter); } $smarty->assign('call_history', $list); $res['main'] = $smarty->fetch('call_history.htm'); die($json->encode($res)); } elseif ($_REQUEST['act'] == 'del_service') { $service_id = intval($_REQUEST['service_id']); if ($service_id) { $sql = 'UPDATE ' . $GLOBALS['ecs']->table('service') . ' SET show_sev=0 WHERE service_id=' . $service_id; $code = $GLOBALS['db']->query($sql); $res = $code ? crm_msg('删除成功') : crm_msg('删除失败'); } else { $res = crm_msg('删除失败'); } die($json->encode($res)); } elseif ($_REQUEST['act'] == 'knowlage_list') {