本文整理汇总了PHP中astercrm::events方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::events方法的具体用法?PHP astercrm::events怎么用?PHP astercrm::events使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::events方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateRateRecord
function updateRateRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
$sql = "UPDATE myrate SET " . "dialprefix = '" . $f['dialprefix'] . "', " . "numlen = '" . $f['numlen'] . "', " . "destination = '" . $f['destination'] . "', " . "rateinitial = '" . $f['rateinitial'] . "', " . "initblock = '" . $f['initblock'] . "', " . "billingblock = '" . $f['billingblock'] . "', " . "connectcharge= '" . $f['connectcharge'] . "', " . "groupid = '" . $f['groupid'] . "', " . "resellerid = '" . $f['resellerid'] . "', " . "addtime= now() " . "WHERE id = " . $f['id'];
astercrm::events($sql);
$res =& $db->query($sql);
return $res;
}
示例2: updateWorktimeRecord
function updateWorktimeRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
$query = "UPDATE worktimes SET " . "starttime='" . $f['starttime'] . "', " . "endtime='" . $f['endtime'] . "', " . "startweek='" . $f['startweek'] . "', " . "endweek='" . $f['endweek'] . "', " . "groupid='" . $f['groupid'] . "' " . "WHERE id=" . $f['id'];
astercrm::events($query);
$res =& $db->query($query);
return $res;
}
示例3: updateWorktimepackage
function updateWorktimepackage($f)
{
global $db;
$f = astercrm::variableFiler($f);
$query = "UPDATE worktimepackages SET " . "worktimepackage_name=" . $db->quote($f['worktimepackage_name']) . ", " . "worktimepackage_note=" . $db->quote($f['worktimepackage_note']) . ", " . "worktimepackage_status='" . $f['worktimepackage_status'] . "', " . "groupid='" . $f['groupid'] . "' " . "WHERE id=" . $f['id'];
$wp_res = Customer::deleteRecords("worktimepackage_id", $f['id'], 'worktimepackage_worktimes');
$sltedWorktimes = split(',', rtrim($f['sltedWorktimes'], ','));
foreach ($sltedWorktimes as $worktimeid) {
$sql = "INSERT INTO worktimepackage_worktimes SET " . "worktimepackage_id='" . $f['id'] . "', " . "worktime_id='" . $worktimeid . "', " . "creby = '" . $_SESSION['curuser']['username'] . "'," . "cretime = now()";
$wp_res =& $db->query($sql);
}
astercrm::events($query);
$res =& $db->query($query);
return $res;
}
示例4: getSrcnameByCurid
function getSrcnameByCurid($curid)
{
global $db;
$sql = "SELECT srcname FROM curcdr WHERE id='" . $curid . "'";
astercrm::events($sql);
$srcname =& $db->getOne($sql);
return $srcname;
}
示例5: updateCampaignRecord
function updateCampaignRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
$bindqueue = 0;
if ($f['bindqueue'] == "on") {
$bindqueue = 1;
}
if ($f['dialtwoparty'] == "on") {
$dialtwoparty = "yes";
} else {
$dialtwoparty = "no";
}
if ($f['use_ext_chan'] == "on") {
$useExtChan = "yes";
} else {
$useExtChan = "no";
}
$limit_type = '';
if ($f['queuename'] == "") {
$limit_type = 'channel';
}
$query = "UPDATE campaign SET " . "campaignname='" . $f['campaignname'] . "', " . "campaignnote='" . $f['campaignnote'] . "', " . "enable='" . $f['enable'] . "', " . "serverid='" . $f['serverid'] . "', " . "worktime_package_id='" . $f['worktime_package_id'] . "', " . "waittime='" . $f['waittime'] . "', " . "outcontext='" . $f['outcontext'] . "', " . "incontext='" . $f['incontext'] . "', " . "nextcontext='" . $f['nextcontext'] . "', " . "firstcontext='" . $f['firstcontext'] . "', " . "inexten='" . $f['inexten'] . "', " . "queuename='" . $f['queuename'] . "', " . "bindqueue='" . $bindqueue . "', " . "max_dialing='" . $f['max_dialing'] . "', " . "maxtrytime='" . $f['maxtrytime'] . "', " . "recyletime='" . $f['recyletime'] . "', " . "enablerecyle='" . $f['enablerecyle'] . "', " . "minduration='" . $f['minduration'] . "', " . "minduration_billsec='" . $f['minduration_billsec'] . "', " . "minduration_leg_a='" . $f['minduration_leg_a'] . "', " . "callerid='" . $f['callerid'] . "', " . "use_ext_chan='" . $useExtChan . "', " . "dialtwoparty='" . $dialtwoparty . "', " . "queue_context='" . $f['queue_context'] . "', " . "sms_number='" . $f['sms_number'] . "', " . "balance = '" . $f['balance'] . "'," . "init_billing = '" . $f['init_billing'] . "'," . "billing_block = '" . $f['billing_block'] . "'," . "enablebalance = '" . $f['enablebalance'] . "'," . "groupid='" . $f['groupid'] . "' ";
if ($limit_type != '') {
$query .= ",limit_type='{$limit_type}' ";
}
$query .= "WHERE id=" . $f['id'];
astercrm::events($query);
$res =& $db->query($query);
return $res;
}
示例6: updateServerRecord
function updateServerRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
$query = "UPDATE servers SET " . "name='" . $f['name'] . "', " . "ip='" . $f['ip'] . "', " . "port='" . $f['port'] . "', " . "username= '" . $f['username'] . "', " . "secret='" . $f['secret'] . "', " . "note='" . $f['note'] . "' " . "WHERE id='" . $f['id'] . "'";
astercrm::events($query);
$res =& $db->query($query);
return $res;
}
示例7: insertIntoDnc
function insertIntoDnc($callerid, $campaignid)
{
global $db, $locate;
$objResponse = new xajaxResponse();
if ($callerid == '') {
$objResponse->addScript("alert(\"" . $locate->Translate('Save failed phone number is empty') . "\");");
return $objResponse;
}
$sql = "INSERT INTO dnc_list SET \n\t\t number='" . $callerid . "',\n\t\t campaignid=" . $campaignid . ",\n\t\t groupid=" . $_SESSION['curuser']['groupid'] . ",\n\t\t status='enable',\n\t\t creby='" . $_SESSION['curuser']['username'] . "',\n\t\t cretime=now()";
astercrm::events($query);
$res =& $db->query($sql);
if ($res) {
$objResponse->addScript("alert(\"" . $locate->Translate('Save successful') . "\");");
} else {
$objResponse->addScript("alert(\"" . $locate->Translate('Save failed') . "\");");
}
return $objResponse;
}
示例8: updateTrunkinfoRecord
function updateTrunkinfoRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
$query = "UPDATE trunkinfo SET " . "trunkname='" . $f['trunkname'] . "', " . "trunkchannel='" . $f['trunkchannel'] . "', " . "didnumber='" . $f['didnumber'] . "', " . "trunk_number='" . $f['trunk_number'] . "', " . "trunknote='" . $f['trunknote'] . "', " . "cretime= now() " . "WHERE id= " . $f['id'] . " ";
astercrm::events($query);
$res =& $db->query($query);
return $res;
}
示例9: insertNewAccountForBilling
function insertNewAccountForBilling($f)
{
global $db;
$f = astercrm::variableFiler($f);
$sql = "INSERT INTO clid SET " . "clid='" . $f['extension'] . "', " . "pin='" . $f['password'] . "', " . "display='" . $f['username'] . "', " . "groupid = " . $f['groupid'] . ", " . "resellerid = " . $f['resellerid'] . ", " . "creditlimit = '" . $f['creditlimit'] . "'," . "limittype = '" . $f['limittype'] . "'," . "addtime = now() ";
astercrm::events($sql);
$res =& $db->query($sql);
return $res;
}
示例10: 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;
}
示例11: updateRemindercallsRecord
function updateRemindercallsRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
$query = "UPDATE remindercalls SET " . "customerid='" . $f['customerid'] . "', " . "contactid='" . $f['contactid'] . "', " . "phonenumber= '" . $f['phonenumber'] . "', " . "asteriskcallsid= '" . $f['asteriskcallsid'] . "', " . "note= '" . $f['note'] . "', " . "dialtime= '" . $f['dialtime'] . "', " . "groupid = " . $f['groupid'] . ", " . "cretime = now() " . "WHERE id= " . $f['id'] . " ";
astercrm::events($query);
$res =& $db->query($query);
return $res;
}
示例12: update
/**
* update account record
* @param f array account record
* @return objResponse object xajax response object
*/
function update($f)
{
global $locate, $db;
$objResponse = new xajaxResponse();
$f['extension'] = strtolower($f['extension']);
$f['agent'] = strtolower($f['agent']);
$f['channel'] = strtolower($f['channel']);
if (trim($f['username']) == '' || trim($f['password']) == '' || trim($f['extension']) == '' || trim($f['usertype']) == '' || trim($f['firstname']) == '' || trim($f['lastname']) == '') {
$objResponse->addAlert($locate->Translate("obligatory_fields"));
return $objResponse->getXML();
}
if (trim($f['usertype']) != 'admin' && trim($f['groupid']) == '') {
$objResponse->addAlert($locate->Translate("please add group first"));
return $objResponse->getXML();
}
$username = $f['username'];
$userid = astercrm::checkValues("astercrm_account", "username", $username);
if ($userid != '' && $userid != $f['id']) {
$objResponse->addAlert($locate->Translate("username_repeat"));
return $objResponse->getXML();
}
if ($f['extensions'] == $locate->translate('extensions_input_tip')) {
$f['extensions'] = '';
}
if ($f['extensions'] != "") {
$f['extensions'] = astercrm::dbcToSbc($f['extensions']);
$myExtensions = split(",", $f['extensions']);
if ($f['extensType'] != "username") {
foreach ($myExtensions as $exten) {
$sqlStr .= "OR extension = '{$exten}'";
}
$sqlStr = ltrim($sqlStr, "OR");
$query = "SELECT username From astercrm_account WHERE {$sqlStr}";
astercrm::events($query);
$res =& $db->query($query);
$myExtensions = array();
while ($res->fetchInto($row)) {
$myExtensions[] = $row['username'];
$newextensions .= "," . $row['username'];
}
$f['extensions'] = ltrim($newextensions, ',');
}
// check the assign username if belong to this group
if ($_SESSION['curuser']['usertype'] != 'admin') {
$myusernames = $myExtensions;
$newextensions = "";
$groupList = astercrm::getGroupMemberListByID($_SESSION['curuser']['groupid']);
while ($groupList->fetchInto($groupRow)) {
$memberNames[] = $groupRow['username'];
}
foreach ($myusernames as $myusername) {
if (in_array($myusername, $memberNames)) {
$newextensions .= ",{$myusername}";
}
}
$f['extensions'] = ltrim($newextensions, ',');
}
}
if ($f['usertype'] == 'admin') {
$f['groupid'] = 0;
}
// check over
$respOk = Customer::updateAccountRecord($f);
if ($respOk) {
$html = createGrid(0, ROWSXPAGE);
$objResponse->addAssign("grid", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("update_rec"));
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_update"));
}
return $objResponse->getXML();
}
示例13: updateOptionRecord
function updateOptionRecord($f, $optionid)
{
global $db;
$sql = "UPDATE surveyoptions SET " . "surveyoption= " . $db->quote($f['surveyoption']) . ", " . "optionnote= " . $db->quote($f['optionnote']) . ", " . "optiontype= " . $db->quote($f['optiontype']) . " " . "WHERE id = {$optionid}";
astercrm::events($sql);
$res =& $db->query($sql);
return $res;
}
示例14: updateAddedSchedulerDial
function updateAddedSchedulerDial($customerid, $diallistId)
{
global $db;
$sql = "SELECT * FROM customer WHERE id='" . $customerid . "' ";
astercrm::events($sql);
$result =& $db->getRow($sql);
$updateSql = "UPDATE diallist SET customerid='" . $customerid . "',customername='" . $result['customer'] . "' WHERE id='" . $diallistId . "' ";
astercrm::events($updateSql);
$res =& $db->query($updateSql);
return $res;
}
示例15: unlock
function unlock($ip, $s)
{
global $db;
//print_r($s);exit;
$objResponse = new xajaxResponse();
$sql = "UPDATE account_log SET failedtimes='0' WHERE ip='" . $ip . "'";
astercrm::events($sql);
$res =& $db->query($sql);
$searchField = array();
$searchContent = array();
$searchContent = $s['searchContent'];
//搜索内容 数组
$searchField = $s['searchField'];
//搜索条件 数组
$searchType = $s['searchType'];
//搜索方式 数组
$html = createGrid(0, 25, $searchField, $searchContent, $searchField, 'grid', "", $searchType);
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign('grid', "innerHTML", $html);
return $objResponse;
}