本文整理汇总了PHP中Customer::events方法的典型用法代码示例。如果您正苦于以下问题:PHP Customer::events方法的具体用法?PHP Customer::events怎么用?PHP Customer::events使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Customer
的用法示例。
在下文中一共展示了Customer::events方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
function &getRecordsFilteredMorewithstype($start, $limit, $filter, $content, $stype = null, $order, $table, $ordering = "")
{
global $db;
$joinstr = astercrm::createSqlWithStype($filter, $content, $stype);
if ($_SESSION['curuser']['usertype'] == 'admin') {
$sql = "SELECT * FROM credithistory WHERE ";
} elseif ($_SESSION['curuser']['usertype'] == 'groupadmin') {
$sql = "SELECT * FROM credithistory WHERE groupid = '" . $_SESSION['curuser']['groupid'] . "'";
} elseif ($_SESSION['curuser']['usertype'] == 'reseller') {
$sql = "SELECT * FROM credithistory WHERE resellerid = '" . $_SESSION['curuser']['resellerid'] . "'";
} elseif ($_SESSION['curuser']['usertype'] == 'clid') {
$sql = "SELECT * FROM credithistory WHERE clidid = '" . $_SESSION['curuser']['clidid'] . "'";
}
if ($joinstr != '') {
if ($_SESSION['curuser']['usertype'] == 'admin') {
$joinstr = ltrim($joinstr, 'AND');
//去掉最左边的AND
$sql .= $joinstr . " ";
} else {
$sql .= $joinstr . " ";
}
}
$sql .= " ORDER BY " . $order . " " . $_SESSION['ordering'] . " LIMIT {$start}, {$limit} {$ordering}";
Customer::events($sql);
$res =& $db->query($sql);
return $res;
}
示例2: getCountAnswered
function getCountAnswered($campaignid)
{
global $db;
$query = "SELECT COUNT(*) FROM campaigndialedlist WHERE campaignid = {$campaignid} AND answertime > '0000-00-00 00:00:00'";
Customer::events($query);
$res =& $db->getOne($query);
return $res;
}
示例3: COUNT
function &getNumRowsMorewithstype($filter, $content, $stype, $table)
{
global $db;
$joinstr = astercrm::createSqlWithStype($filter, $content, $stype);
$sql = "SELECT COUNT(*) AS numRows FROM myrate LEFT JOIN accountgroup ON accountgroup.id = myrate.groupid LEFT JOIN resellergroup ON resellergroup.id = myrate.resellerid WHERE";
if ($_SESSION['curuser']['usertype'] == 'admin') {
$sql .= " 1 ";
} elseif ($_SESSION['curuser']['usertype'] == 'reseller') {
$sql .= " (myrate.resellerid = " . $_SESSION['curuser']['resellerid'] . " OR myrate.resellerid = 0) ";
} else {
$sql .= " ( (myrate.groupid = " . $_SESSION['curuser']['groupid'] . " OR myrate.groupid = 0) AND (myrate.resellerid = " . $_SESSION['curuser']['resellerid'] . " OR myrate.resellerid = 0) )";
}
if ($joinstr != '') {
$joinstr = ltrim($joinstr, 'AND');
//去掉最左边的AND
$sql .= " AND " . $joinstr . " ";
} else {
$sql .= " 1 ";
}
Customer::events($sql);
$res =& $db->getOne($sql);
return $res;
}
示例4: ltrim
function &getRecordsFilteredMorewithstype($start, $limit, $filter, $content, $stype, $order, $table)
{
global $db;
$joinstr = astercrm::createSqlWithStype($filter, $content, $stype);
//<---- change by your function
$sql = "SELECT * FROM sms_sents WHERE 1 ";
if ($joinstr != '') {
$joinstr = ltrim($joinstr, 'AND');
//去掉最左边的AND
$sql .= " AND " . $joinstr . " " . " ORDER BY " . $order . " " . $_SESSION['ordering'] . " LIMIT {$start}, {$limit} {$ordering}";
}
Customer::events($sql);
$res =& $db->query($sql);
return $res;
}
示例5: COUNT
function &getNumRowsMorewithstype($filter, $content, $stype, $table)
{
global $db;
$joinstr = astercrm::createSqlWithStype($filter, $content, $stype);
$sql = "SELECT COUNT(*) FROM account_log WHERE ";
if ($joinstr != '') {
$joinstr = ltrim($joinstr, 'AND');
//去掉最左边的AND
$sql .= " " . $joinstr;
} else {
$sql .= " 1";
}
Customer::events($sql);
$res =& $db->getOne($sql);
return $res;
}
示例6: ltrim
function &getRecordsFilteredMorewithstype($start, $limit, $filter, $content, $stype, $order, $table)
{
global $db;
$joinstr = astercrm::createSqlWithStype($filter, $content, $stype, 'astercrm_account');
$sql = "SELECT astercrm_account.*, groupname FROM astercrm_account LEFT JOIN astercrm_accountgroup ON astercrm_accountgroup.id = astercrm_account.groupid WHERE ";
if ($_SESSION['curuser']['usertype'] == 'admin') {
$sql .= " 1 ";
} else {
$sql .= " astercrm_account.groupid = " . $_SESSION['curuser']['groupid'] . " ";
}
if ($joinstr != '') {
$joinstr = ltrim($joinstr, 'AND');
//去掉最左边的AND
$sql .= " AND " . $joinstr . " " . " ORDER BY " . $order . " " . $_SESSION['ordering'] . " LIMIT {$start}, {$limit} {$ordering}";
}
Customer::events($sql);
$res =& $db->query($sql);
return $res;
}
示例7: COUNT
function &getNumRowsMorewithstype($filter, $content, $stype, $table)
{
global $db;
$joinstr = astercrm::createSqlWithStype($filter, $content, $stype);
$sql = "SELECT COUNT(*) FROM note LEFT JOIN customer ON customer.id = note.customerid LEFT JOIN contact ON contact.id = note.contactid WHERE ";
if ($_SESSION['curuser']['usertype'] == 'admin') {
$sql .= " ";
} else {
$sql .= " note.groupid = " . $_SESSION['curuser']['groupid'] . " AND ";
}
if ($joinstr != '') {
$joinstr = ltrim($joinstr, 'AND');
//去掉最左边的AND
$sql .= " " . $joinstr;
} else {
$sql .= " 1";
}
Customer::events($sql);
$res =& $db->getOne($sql);
return $res;
}
示例8: COUNT
function &getNumRowsMorewithstype($filter, $content, $stype, $table)
{
global $db, $config;
$updateTimeInterval = $config['system']['update_online_interval'] * 60;
$joinstr = astercrm::createSqlWithStype($filter, $content, $stype, "diallist");
$sql = "SELECT COUNT(*) FROM astercrm_account WHERE (UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(last_update_time)) < {$updateTimeInterval} ";
if ($_SESSION['curuser']['usertype'] == 'admin') {
$sql .= " ";
} else {
$sql .= " AND groupid = " . $_SESSION['curuser']['groupid'] . " AND ";
}
if ($joinstr != '') {
$joinstr = ltrim($joinstr, 'AND');
//去掉最左边的AND
$sql .= " AND " . $joinstr;
} else {
$sql .= " 1";
}
Customer::events($sql);
$res =& $db->getOne($sql);
return $res;
}
示例9: formDiallist
function formDiallist($dialedlistid)
{
global $locate, $db;
$sql = "SELECT dialednumber, customername,memo,campaignid FROM dialedlist WHERE id = {$dialedlistid}";
Customer::events($sql);
$row =& $db->getRow($sql);
$html = '';
if ($row) {
$html = Table::Top($locate->Translate("Customer from Diallist"), "formDiallistPopup");
// <-- Set the title for your form.
$html .= '<table border="1" width="100%" class="adminlist" id="d" name="d">
<tr><td width="45%"> ' . $locate->Translate("Customer Name") . ': </td><td>' . $row['customername'] . '</td></tr>
<tr><td> ' . $locate->Translate("Pone Number") . ': </td><td>' . $row['dialednumber'] . '</td></tr>
<tr><td> ' . $locate->Translate("Memo") . ': </td><td>' . $row['memo'] . '</td></tr>';
if ($row['campaignid'] != 0 && $row['campaignid'] != '') {
//获取拨号计划的备注
$CampaignNote = Customer::getCampaignNote($row['campaignid']);
$html .= '<tr><td> ' . $locate->Translate("Campaign Memo") . ': </td><td>' . $CampaignNote . '</td></tr>';
}
$html .= '
</table>';
// <-- Change by your method
$html .= Table::Footer();
}
return $html;
}
示例10: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
global $locate, $db, $config;
$objResponse = new xajaxResponse();
$searchField = array();
$searchContent = array();
$optionFlag = $searchFormValue['optionFlag'];
$searchContent = $searchFormValue['searchContent'];
//搜索内容 数组
$searchField = $searchFormValue['searchField'];
//搜索条件 数组
$searchType = $searchFormValue['searchType'];
$ordering = $searchFormValue['ordering'];
$order = $searchFormValue['order'];
// print_r($searchFormValue);exit;
$divName = "grid";
if ($optionFlag == "export" || $optionFlag == "exportcsv") {
if ($config['system']['enable_code']) {
$sql = Customer::specialGetSql($searchContent, $searchField, $searchType, 'customer', array('customer.*', 'note.note' => 'note', 'note.codes' => 'codes', 'note.creby' => 'last_note_created_by', 'note.cretime' => 'noteCretime'), array('note' => array('note.id', 'customer.last_note_id')));
//得到要导出的sql语句
} else {
$sql = Customer::specialGetSql($searchContent, $searchField, $searchType, 'customer');
//得到要导出的sql语句
}
$_SESSION['export_sql'] = $sql;
$objResponse->addAssign("hidSql", "value", $sql);
//赋值隐含域
$objResponse->addAssign("maintable", "value", 'customer');
//赋值隐含域
$objResponse->addAssign("exporttype", "value", $optionFlag);
$objResponse->addScript("document.getElementById('exportForm').submit();");
}
if ($optionFlag == "delete") {
$customer_ref =& Customer::getRecordsFilteredMorewithstype('', '', $searchField, $searchContent, $searchType, '', 'customer', 'delete');
while ($customer_ref->fetchInto($row)) {
Customer::deleteRecord($row['id'], 'customer');
Customer::deleteRecords("customerid", $row['id'], 'note');
Customer::deleteRecords("customerid", $row['id'], 'contact');
}
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} else {
if ($optionFlag == "move_to_customerleads" || $optionFlag == "copy_to_customerleads") {
$lead_sql = Customer::specialGetSql($searchContent, $searchField, $searchType, 'customer');
Customer::events($lead_sql);
$customer_lead =& $db->query($lead_sql);
$i = 0;
while ($customer_lead->fetchInto($row)) {
$res = astercrm::insertNewCustomerLead($row['id'], $config['system']['customer_leads'], true);
if ($res) {
$i++;
}
}
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
//$objResponse->addClear("msgZone", "innerHTML");
$showHtml = '';
if ($config['system']['customer_leads'] == 'move' || $config['system']['customer_leads'] == 'default_move') {
$showHtml = $i . $locate->Translate(" customer was moved to customer_leads");
} else {
if ($config['system']['customer_leads'] == 'copy' || $config['system']['customer_leads'] == 'default_copy') {
$showHtml = $i . $locate->Translate(" customer was copied to customer_leads");
}
}
$objResponse->addAssign($divName, "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $showHtml);
} else {
if ($type == "delete") {
$res = Customer::deleteRecord($id, 'customer');
if ($res) {
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, 1, $searchType);
$objResponse = new xajaxResponse();
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
}
} else {
$html = createGrid($numRows, $limit, $searchField, $searchContent, $order, $divName, $ordering, 1, $searchType);
}
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
}
}
return $objResponse->getXML();
}
示例11: deleteRate
function deleteRate($deleteSql, $historySql)
{
global $locate, $db, $config;
$objResponse = new xajaxResponse();
if (empty($deleteSql)) {
$objResponse->addAlert($locate->Translate("Can not delete this rate"));
return $objResponse;
}
//if enable the synchronizatioin
if ($config['synchronize']['delete_by_use_history']) {
Customer::events($historySql);
$insertResult = $db->query($historySql);
if ($insertResult <= 0) {
$objResponse->addAlert($locate->Translate("delete failed synchronization"));
return $objResponse;
}
}
Customer::events($deleteSql);
$result = $db->query($deleteSql);
if ($result) {
$objResponse->addAlert($locate->Translate("Delete success") . ',' . $locate->Translate("please remember to restart asterrc"));
$objResponse->addAssign("searchRateList", "innerHTML", $locate->Translate("page_rate_tips") . ' <input type="button" value="' . $locate->Translate("restart asterrc") . '" onclick="restartAsterrc();return false;" />');
} else {
$objResponse->addAlert($locate->Translate("Delete failed"));
}
return $objResponse;
}
示例12: COUNT
function &getNumRowsByCustomerid($table = 'mycdr', $customerid)
{
global $db;
$sql .= " SELECT COUNT(*) FROM " . $table . " WHERE customerid = {$customerid} AND (groupid > 0 OR resellerid > '0')";
//echo $sql;exit;
Customer::events($sql);
$res =& $db->getOne($sql);
return $res;
}
示例13: COUNT
function &getNumRowsMorewithstype($filter, $content, $stype, $table)
{
global $customers_db, $config;
$joinstr = astercrm::createSqlWithStype($filter, $content, $stype);
$sql = "SELECT COUNT(*) FROM " . $config['customers']['customertable'] . " WHERE ";
//if ($_SESSION['curuser']['usertype'] == 'admin'){
$sql .= " 1 ";
//}
if ($joinstr != '') {
$joinstr = ltrim($joinstr, 'AND');
//去掉最左边的AND
$sql .= " AND " . $joinstr;
}
Customer::events($sql);
$res =& $customers_db->getOne($sql);
return $res;
}
示例14: deletefromsearch
function deletefromsearch($searchContent, $searchField, $searchType = "", $table)
{
global $db;
if (empty($_SESSION['curuser']['usertype'])) {
return;
}
$joinstr = astercrm::createSqlWithStype($searchField, $searchContent, $searchType, $table, 'delete');
if ($joinstr != '') {
$joinstr = ltrim($joinstr, 'AND');
if ($_SESSION['curuser']['usertype'] == 'admin') {
$sql = 'DELETE FROM ' . $table . ' WHERE ' . $joinstr;
} else {
$sql = 'DELETE FROM ' . $table . ' WHERE ' . $joinstr . " AND " . $table . ".groupid = '" . $_SESSION['curuser']['groupid'] . "'";
}
} else {
if ($_SESSION['curuser']['usertype'] == 'admin') {
$sql = 'TRUNCATE table ' . $table;
} else {
$sql = "DELETE FROM " . $table . " WHERE " . $table . ".groupid = '" . $_SESSION['curuser']['groupid'] . "'";
}
}
Customer::events($sql);
$res =& $db->query($sql);
return $res;
}
示例15: foreach
function &getNumRowsMore($filter = null, $content = null, $table)
{
global $db;
$i = 0;
$joinstr = '';
foreach ($content as $value) {
$value = trim($value);
if (strlen($value) != 0 && strlen($filter[$i]) != 0) {
$joinstr .= "AND {$filter[$i]} like '%" . $value . "%' ";
}
$i++;
}
$sql = "SELECT COUNT(*) FROM remindercalls LEFT JOIN astercrm_accountgroup ON astercrm_accountgroup.id = remindercalls.groupid LEFT JOIN asteriskcalls ON asteriskcalls.id = remindercalls.asteriskcallsid WHERE ";
if ($_SESSION['curuser']['usertype'] == 'admin') {
$sql .= " ";
} else {
$sql .= " remindercalls.groupid = " . $_SESSION['curuser']['groupid'] . " AND ";
}
if ($joinstr != '') {
$joinstr = ltrim($joinstr, 'AND');
//去掉最左边的AND
$sql .= " " . $joinstr;
} else {
$sql .= " 1";
}
Customer::events($sql);
$res =& $db->getOne($sql);
return $res;
}