本文整理汇总了PHP中astercrm::getDigitsInStr方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::getDigitsInStr方法的具体用法?PHP astercrm::getDigitsInStr怎么用?PHP astercrm::getDigitsInStr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::getDigitsInStr方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
function save($f)
{
global $locate;
$objResponse = new xajaxResponse();
if (trim(astercrm::getDigitsInStr($f['dialnumber'])) == '') {
$objResponse->addAlert($locate->Translate("dial number must be digits"));
return $objResponse->getXML();
}
if (trim(astercrm::getDigitsInStr($f['dialnumber'])) == '' || trim($f['groupid']) == '' || trim($f['campaignid']) == '') {
$objResponse->addAlert($locate->Translate("obligatory_fields"));
return $objResponse->getXML();
}
if ($f['campaignid'] == '') {
$objResponse->addAlert($locate->Translate("Must select a campaign"));
return $objResponse->getXML();
}
// check if the assign number belong to this group
if ($_SESSION['curuser']['usertype'] != 'admin' && $f['assign'] != "") {
$flag = false;
foreach ($_SESSION['curuser']['memberExtens'] as $extension) {
if ($extension == $f['assign']) {
$flag = true;
break;
}
}
if (!$flag) {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("Cant insert, please confirm the assign number is in your group"));
return $objResponse;
}
}
$id = Customer::insertNewDiallist($f);
$html = createGrid(0, ROWSXPAGE);
$objResponse->addAssign("grid", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("diallist_added"));
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
$objResponse->addClear("formDiv", "innerHTML");
return $objResponse->getXML();
}
示例2: updateDNCRecord
function updateDNCRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
$query = "UPDATE dnc_list SET " . "number='" . astercrm::getDigitsInStr($f['number']) . "', " . "groupid='" . $f['groupid'] . "', " . "campaignid= '" . $f['campaignid'] . "' " . "WHERE id='" . $f['id'] . "'";
astercrm::events($query);
$res =& $db->query($query);
return $res;
}
示例3: updateDiallistRecord
function updateDiallistRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
if ($f['callOrder'] == 0 || $f['callOrder'] == '') {
$f['callOrder'] = 1;
}
$query = "UPDATE diallist SET " . "dialnumber='" . astercrm::getDigitsInStr($f['dialnumber']) . "', " . "customername='" . $f['customername'] . "', " . "groupid='" . $f['groupid'] . "', " . "dialtime='" . $f['dialtime'] . "', " . "callOrder='" . $f['callOrder'] . "', " . "campaignid= " . $f['campaignid'] . ", " . "assign='" . $f['assign'] . "'," . "memo='" . $f['memo'] . "'" . "WHERE id='" . $f['id'] . "'";
astercrm::events($query);
$res =& $db->query($query);
return $res;
}
示例4: updateContactRecord
/**
* update contact table
*
* @param $f (array) array contain contact fields.
* @return $res (object) object
*/
function updateContactRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
$query = "UPDATE contact SET " . "contact='" . $f['contact'] . "', " . "gender='" . $f['contactGender'] . "', " . "position='" . $f['position'] . "', " . "phone='" . astercrm::getDigitsInStr($f['phone']) . "', " . "ext='" . astercrm::getDigitsInStr($f['ext']) . "', " . "phone1='" . astercrm::getDigitsInStr($f['phone1']) . "', " . "ext1='" . astercrm::getDigitsInStr($f['ext1']) . "', " . "phone2='" . astercrm::getDigitsInStr($f['phone2']) . "', " . "ext2='" . astercrm::getDigitsInStr($f['ext2']) . "', " . "mobile='" . astercrm::getDigitsInStr($f['mobile']) . "', " . "fax='" . astercrm::getDigitsInStr($f['fax']) . "', " . "fax_ext='" . astercrm::getDigitsInStr($f['fax_ext']) . "', " . "email='" . $f['email'] . "' " . "WHERE id='" . $f['contactid'] . "'";
astercrm::events($query);
$res =& $db->query($query);
return $res;
}
示例5: parseRowToSql
function parseRowToSql($arrRow, $order, $dialListField, $dialListTime, $tableStructure, $tableName, $date, $groupid, $assignNum, $arryAssign, $campaignid, $assignKey)
{
$fieldName = '';
$strData = '';
//echo $dialListField.'111';exit;
$phone_field = array(0 => 'phone', 1 => 'phone_ext', 2 => 'fax', 3 => 'fax_ext', 4 => 'mobile', 5 => 'ext', 6 => 'phone1', 7 => 'ext1', 8 => 'phone2', 9 => 'ext2');
//判断customer传过来的名字是不是空,如果是空就用 first name 和 last name 组合下赋给 customer的名
$customerFieldExist = false;
//判断导入选择的字段里是否有customer字段
$customername = '';
$hasCheckflag = false;
$customerKey = '';
//导入的时候选择的字段里有没有customer
$firstnameKey = '';
//导入的时候选择的字段里有没有customer
$lastnameKey = '';
//导入的时候选择的字段里有没有customer
if ($tableName == 'customer') {
foreach ($order as $key => $tmp) {
if ($tableStructure[trim($tmp)]['name'] == 'customer') {
$customerFieldExist = true;
$customerKey = $key;
} else {
if ($tableStructure[trim($tmp)]['name'] == 'first_name') {
$firstnameKey = $key;
} else {
if ($tableStructure[trim($tmp)]['name'] == 'last_name') {
$lastnameKey = $key;
}
}
}
}
}
for ($j = 0; $j < count($arrRow); $j++) {
$arrRow[$j] = trim($arrRow[$j]);
// if ($arrRow[$j] != mb_convert_encoding($arrRow[$j],"UTF-8","UTF-8"))
//echo "ok";exit;
// $arrRow[$j]=mb_convert_encoding($arrRow[$j],"UTF-8","GB2312");
$fieldOrder = trim($order[$j]);
//得到字段顺序号
if ($fieldOrder != '' && $arrRow[$j] != '') {
$fieldName .= $tableStructure[$fieldOrder]['name'] . ',';
if (in_array($tableStructure[$fieldOrder]['name'], $phone_field)) {
$arrRow[$j] = astercrm::getDigitsInStr($arrRow[$j]);
}
//如果导入里有customer字段并且值为空
if ($tableStructure[$fieldOrder]['name'] == 'customer' && $arrRow[$j] == '') {
$tmpNameStr = '';
if ($firstnameKey !== '') {
$tmpNameStr .= $arrRow[$firstnameKey] . ' ';
}
if ($lastnameKey !== '') {
$tmpNameStr .= $arrRow[$lastnameKey];
}
$arrRow[$j] = trim($tmpNameStr);
}
//如果导入里没有customer字段
if (!$customerFieldExist && !$hasCheckflag && $tableName == 'customer') {
$tmpNameStr = '';
if ($firstnameKey !== '') {
$tmpNameStr .= $arrRow[$firstnameKey] . ' ';
}
if ($lastnameKey !== '') {
$tmpNameStr .= $arrRow[$lastnameKey];
}
$customername = addslashes(trim($tmpNameStr));
$hasCheckflag = true;
}
$strData .= '"' . addslashes($arrRow[$j]) . '"' . ',';
}
if (isset($dialListField) && $dialListField != '' && $arrRow[$j] != '') {
if ($dialListField == $j) {
if ($tableName == 'diallist') {
if ($assignNum > 0) {
// while ($arryAssign[$x] == ''){
// if($x >$assignNum){
// $x = 0;
// }else{
// $x ++;
// }
// }
$fieldName .= 'assign,';
$strData .= '"' . addslashes($arryAssign[$assignKey]) . '"' . ',';
}
} else {
$dialNum = astercrm::getDigitsInStr($arrRow[$j]);
}
}
}
if (isset($dialListTime) && $dialListTime != '') {
if ($dialListTime == $j) {
$dialTime = trim($arrRow[$j]);
}
}
}
if (!$customerFieldExist && $tableName == 'customer') {
$fieldName = 'customer,' . substr($fieldName, 0, strlen($fieldName) - 1);
$strData = '"' . $customername . '",' . substr($strData, 0, strlen($strData) - 1);
} else {
$fieldName = substr($fieldName, 0, strlen($fieldName) - 1);
//.........这里部分代码省略.........
示例6: saveSchedulerDial
function saveSchedulerDial($dialnumber = '', $campaignid = '', $dialtime = '')
{
global $locate, $db;
$objResponse = new xajaxResponse();
if ($dialnumber == '') {
$objResponse->addAlert($locate->Translate("Number can not be blank"));
return $objResponse->getXML();
}
if ($campaignid == '') {
$objResponse->addAlert($locate->Translate("Campaign can not be blank"));
return $objResponse->getXML();
}
if ($dialtime == '') {
$objResponse->addAlert($locate->Translate("Dial time can not be blank"));
return $objResponse->getXML();
}
$sql = "INSERT INTO diallist SET " . "dialnumber='" . astercrm::getDigitsInStr($dialnumber) . "', " . "groupid='" . $_SESSION['curuser']['groupid'] . "', " . "dialtime='" . $dialtime . "', " . "creby='" . $_SESSION['curuser']['username'] . "', " . "cretime= now(), " . "campaignid= " . $campaignid . " ";
$res =& $db->query($sql);
if ($res) {
$objResponse->addAlert($locate->Translate("Add scheduler dial success"));
$objResponse->addAssign("trAddSchedulerDial", "style.display", "none");
} else {
$objResponse->addAlert($locate->Translate("Add scheduler dial failed"));
}
return $objResponse->getXML();
}
示例7: save
function save($f)
{
global $locate;
$objResponse = new xajaxResponse();
if (trim(astercrm::getDigitsInStr($f['number'])) == '') {
$objResponse->addAlert($locate->Translate("dial number must be digits"));
return $objResponse->getXML();
}
// check if the assign number belong to this group
$id = Customer::insertNewDNClist($f);
$html = createGrid(0, ROWSXPAGE);
$objResponse->addAssign("grid", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("DNClist_added"));
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
$objResponse->addClear("formDiv", "innerHTML");
return $objResponse->getXML();
}
示例8: updateCustomerLeadRecord
/**
* update customer_leads table
*
* @param $f (array) array contain customer fields.
* @return $res (object) object
*/
function updateCustomerLeadRecord($f)
{
global $db;
$f = astercrm::variableFiler($f);
$query = "UPDATE customer_leads SET " . "customer='" . $f['customer'] . "', " . "customertitle='" . $f['customertitle'] . "', " . "website='" . $f['website'] . "', " . "country='" . $f['country'] . "', " . "address='" . $f['address'] . "', " . "zipcode='" . $f['zipcode'] . "', " . "phone='" . astercrm::getDigitsInStr($f['customerPhone']) . "', " . "phone_ext='" . astercrm::getDigitsInStr($f['customerPhone_ext']) . "', " . "contact='" . $f['customerContact'] . "', " . "contactgender='" . $f['customerContactGender'] . "', " . "state='" . $f['state'] . "', " . "city='" . $f['city'] . "', " . "category='" . $f['category'] . "', " . "bankname='" . $f['bankname'] . "', " . "bankzip='" . $f['bankzip'] . "', " . "fax='" . astercrm::getDigitsInStr($f['mainFax']) . "', " . "fax_ext='" . astercrm::getDigitsInStr($f['mainFax_ext']) . "', " . "mobile='" . astercrm::getDigitsInStr($f['mainMobile']) . "', " . "email='" . $f['mainEmail'] . "', " . "bankaccount='" . $f['bankaccount'] . "', " . "bankaccountname='" . $f['bankaccountname'] . "' " . "WHERE id='" . $f['customerid'] . "'";
astercrm::events($query);
$res =& $db->query($query);
return $res;
}