本文整理汇总了PHP中astercrm::getLocalLastId方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::getLocalLastId方法的具体用法?PHP astercrm::getLocalLastId怎么用?PHP astercrm::getLocalLastId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::getLocalLastId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: save
/**
* save group record
* @param f array group record
* @return objResponse object xajax response object
*/
function save($f)
{
global $locate, $db, $config;
$objResponse = new xajaxResponse();
if (trim($f['groupname']) == '' || trim($f['resellerid']) == 0) {
$objResponse->addAlert('*' . $locate->Translate("obligatory fields"));
return $objResponse;
}
if ($config['synchronize']['id_autocrement_byset']) {
$local_lastid = astercrm::getLocalLastId('accountgroup');
$f['id'] = intval($local_lastid + 1);
}
$f['creditlimit'] = trim($f['creditlimit']);
if ($f['creditlimit'] == '' or !is_numeric($f['creditlimit'])) {
$f['creditlimit'] = 0;
}
$id = astercrm::checkValues("accountgroup", "groupname", $f['groupname']);
if ($id != '') {
$objResponse->addAlert($locate->Translate("Groupname Duplicate"));
return $objResponse->getXML();
}
$respOk = Customer::insertNewAccountgroup($f);
// add a new group
if ($respOk) {
$html = createGrid(0, ROWSXPAGE);
$objResponse->addAssign("grid", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("add_group"));
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
$objResponse->addClear("formDiv", "innerHTML");
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_insert"));
}
return $objResponse->getXML();
}
示例2: save
/**
* save account record
* @param f array account record
* @return objResponse object xajax response object
*/
function save($f)
{
global $locate, $db, $config;
$objResponse = new xajaxResponse();
//check clid could only be numuric
if (!is_numeric($f['clid'])) {
$objResponse->addAlert("clid must be numeric");
return $objResponse;
}
if (trim($f['pin']) == '') {
$objResponse->addAlert("pin field cant be null");
return $objResponse;
}
if ($f['groupid'] == 0 || $f['resellerid'] == 0) {
$objResponse->addAlert($locate->Translate("Please choose reseller and group"));
return $objResponse->getXML();
}
if ($config['synchronize']['id_autocrement_byset']) {
$local_lastid = astercrm::getLocalLastId('clid');
$f['id'] = intval($local_lastid + 1);
}
// check if clid duplicate
$res = astercrm::checkValues("clid", "clid", $f['clid']);
if ($res != '') {
$objResponse->addAlert($locate->Translate("clid duplicate"));
return $objResponse->getXML();
}
if ($f['display'] == '') {
$f['display'] = $f['clid'];
}
// check if pin duplicate
$res = astercrm::checkValues("clid", "pin", $f['pin']);
if ($res != '') {
$objResponse->addAlert($locate->Translate("pin duplicate"));
return $objResponse->getXML();
}
$respOk = Customer::insertNewClid($f);
// add a new account
if ($respOk) {
$html = createGrid(0, ROWSXPAGE);
$objResponse->addAssign("grid", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("add_clid"));
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
$objResponse->addClear("formDiv", "innerHTML");
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_insert"));
}
return $objResponse->getXML();
}
示例3: importResource
function importResource($filePath, $order, $tableName, $tableStructure, $dialListField, $date, $groupid, $resellerid)
{
global $db, $config;
$arrData = getSourceData($filePath);
if ($config['synchronize']['id_autocrement_byset']) {
$local_lastid = astercrm::getLocalLastId($tableName);
if (empty($local_lastid)) {
$local_lastid = $config['local_host']['minId'];
}
}
$tableAffectRows = 0;
foreach ($arrData as $arrRow) {
if ($config['synchronize']['id_autocrement_byset']) {
$local_lastid++;
array_unshift($arrRow, $local_lastid);
}
$arrRes = parseRowToSql($arrRow, $order, $dialListField, $tableStructure, $tableName, $date, $groupid, $resellerid);
$strSql = $arrRes['strSql'];
//得到插入选择表的sql语句
if ($tableName != '' && $strSql != '') {
$res = $db->query($strSql);
$tableAffectRows += $db->affectedRows();
//得到影响的数据条数
}
}
return $tableAffectRows;
}
示例4: save
/**
* save account record
* @param f array account record
* @return objResponse object xajax response object
*/
function save($f)
{
global $locate, $db, $config;
$objResponse = new xajaxResponse();
if ($config['synchronize']['id_autocrement_byset']) {
$local_lastid = astercrm::getLocalLastId('account');
$f['id'] = intval($local_lastid + 1);
}
$f['username'] = trim($f['username']);
$f['password'] = trim($f['password']);
if ($f['username'] == '' || $f['password'] == '') {
$objResponse->addAlert($locate->Translate("Please enter the username and password"));
return $objResponse->getXML();
}
if ($f['usertype'] == '') {
$objResponse->addAlert($locate->Translate("Please select usertype"));
return $objResponse->getXML();
}
if ($f['resellerid'] == 0 && $f['usertype'] == 'reseller') {
$objResponse->addAlert($locate->Translate("Please choose a reseller"));
return $objResponse->getXML();
}
if (($f['groupid'] == 0 || $f['resellerid'] == 0) && ($f['usertype'] == 'groupadmin' || $f['usertype'] == 'operator')) {
$objResponse->addAlert($locate->Translate("Please choose reseller and group"));
return $objResponse->getXML();
}
$id = astercrm::checkValues("account", "username", $f['username']);
if ($id != '') {
$objResponse->addAlert($locate->Translate("Username Duplicate"));
return $objResponse->getXML();
}
$respOk = Customer::insertNewAccount($f);
// add a new account
if ($respOk) {
$html = createGrid(0, ROWSXPAGE);
$objResponse->addAssign("grid", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("add_account"));
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
$objResponse->addClear("formDiv", "innerHTML");
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_insert"));
}
return $objResponse->getXML();
}
示例5: save
/**
* save account record
* @param f array account record
* @return objResponse object xajax response object
*/
function save($f)
{
global $locate, $config;
$objResponse = new xajaxResponse();
// check if clid duplicate
$res = astercrm::checkRateDuplicate("callshoprate", $f, "insert");
if ($res != '') {
$objResponse->addAlert("rate duplicate");
return $objResponse->getXML();
}
if ($config['synchronize']['id_autocrement_byset']) {
$local_lastid = astercrm::getLocalLastId('callshoprate');
$f['id'] = intval($local_lastid + 1);
}
$respOk = Customer::insertNewRate($f);
// add a new account
if ($respOk) {
$html = createGrid(0, ROWSXPAGE);
$objResponse->addAssign("grid", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("Rate Added"));
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
$objResponse->addClear("formDiv", "innerHTML");
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("can not insert rate"));
}
return $objResponse->getXML();
}
示例6: save
/**
* save group record
* @param f array group record
* @return objResponse object xajax response object
*/
function save($f)
{
global $locate, $db, $config;
$objResponse = new xajaxResponse();
//print_r($f);exit;
if (trim($f['resellername']) == '') {
$objResponse->addAlert($locate->Translate("please enter the resellername"));
return $objResponse;
}
$f['creditlimit'] = trim($f['creditlimit']);
if ($f['creditlimit'] == '' or !is_numeric($f['creditlimit'])) {
$f['creditlimit'] = 0;
}
//print_r($f);exit;
// if($f['routetype'] == 'customize') {
// $f['trunkname'] = trim($f['trunkname']);
// if($f['trunkname'] == '') {
// $objResponse->addAlert($locate->Translate("please enter the trunkname"));
// return $objResponse;
// }
// $f['detail'] = trim($f['detail']);
// if($f['detail'] == '') {
// $objResponse->addAlert($locate->Translate("please enter the detail"));
// return $objResponse;
// }
// if(trim($f['timeout']) == '') {
// $f['timeout'] = 0;
// }
// $pin = Customer::generateUniquePin(10);
// $n = array('trunkname'=>$f['trunkname'],'trunkprotocol'=>$f['protocoltype'],'registrystring'=>$f['registrystring'],'detail'=>$f['detail'],'timeout'=>$f['timeout'],'trunkprefix'=>$f['trunkprefix'],'removeprefix'=>$f['removeprefix'],'trunkidentity'=>$pin);
// $resTrunk = Customer::insertNewTrunk($n);
// $f['trunk_id'] = $resTrunk;
// } else if($f['routetype'] == 'default') {
//$f['trunk_id'] = -1;
// } else if($f['routetype'] == 'auto'){
//$f['trunk_id'] = 0;
// }
if ($f['trunk1_id'] != $f['tmptrunk1id'] && $f['tmptrunk1id'] > 0) {
Customer::deleteRecord($f['tmptrunk1id'], 'trunks');
}
if ($f['trunk2_id'] != $f['tmptrunk2id'] && $f['tmptrunk2id'] > 0) {
Customer::deleteRecord($f['tmptrunk2id'], 'trunks');
}
if ($config['synchronize']['id_autocrement_byset']) {
$local_lastid = astercrm::getLocalLastId('resellergroup');
$f['id'] = intval($local_lastid + 1);
}
$respOk = Customer::insertNewResellergroup($f);
// add a new group
if ($respOk) {
$html = createGrid(0, ROWSXPAGE);
$objResponse->addAssign("grid", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("Add Reseller"));
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
$objResponse->addClear("formDiv", "innerHTML");
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_insert"));
}
//generate include file
if ($_SESSION['curuser']['usertype'] == 'admin') {
astercc::generateResellerFile();
}
return $objResponse->getXML();
}