本文整理汇总了PHP中astercrm::deleteToHistoryFromSearch方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::deleteToHistoryFromSearch方法的具体用法?PHP astercrm::deleteToHistoryFromSearch怎么用?PHP astercrm::deleteToHistoryFromSearch使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::deleteToHistoryFromSearch方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows, $limit, $id, $type)
{
global $locate, $db, $config;
$objResponse = new xajaxResponse();
$searchField = array();
$searchContent = array();
$optionFlag = $searchFormValue['optionFlag'];
$searchContent = $searchFormValue['searchContent'];
//搜索内容 数组
$searchField = $searchFormValue['searchField'];
//搜索条件 数组
$searchType = $searchFormValue['searchType'];
//搜索方式 数组
$divName = "grid";
if ($optionFlag == "export") {
$sql = astercrm::getSql($searchContent, $searchField, $searchType, 'clid');
//得到要导出的sql语句
$_SESSION['export_sql'] = $sql;
$objResponse->addAssign("hidSql", "value", $sql);
//赋值隐含域
$objResponse->addScript("document.getElementById('exportForm').submit();");
} elseif ($optionFlag == "delete") {
if (empty($_SESSION['curuser']['usertype'])) {
$objResponse->addAlert($locate->Translate("Session time out,please try again"));
return $objResponse->getXML();
}
if ($_SESSION['curuser']['usertype'] == 'groupadmin') {
$searchContent[] = $_SESSION['curuser']['groupid'];
$searchField[] = 'groupid';
$searchType[] = 'equal';
} elseif ($_SESSION['curuser']['usertype'] == 'reseller') {
$searchContent[] = $_SESSION['curuser']['resellerid'];
$searchField[] = 'resellerid';
$searchType[] = 'equal';
}
if ($config['synchronize']['delete_by_use_history']) {
astercrm::deleteToHistoryFromSearch($searchContent, $searchField, $searchType, 'clid');
} else {
astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'clid');
}
$html = createGrid($numRows, $limit, '', '', '', $divName, "", $searchType);
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} elseif ($type == "delete") {
if (empty($_SESSION['curuser']['usertype'])) {
$objResponse->addAlert($locate->Translate("Session time out,please try again"));
return $objResponse->getXML();
}
if ($config['synchronize']['delete_by_use_history']) {
$res = Customer::deleteRecordToHistory('id', $id, 'clid');
} else {
$res = Customer::deleteRecord($id, 'clid');
}
if ($res) {
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $searchField, $divName, "", $searchType);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record deleted"));
$objResponse->addAssign($divName, "innerHTML", $html);
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record cannot be deleted"));
}
} else {
$html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, $divName, "", $searchType);
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
}
return $objResponse->getXML();
}
示例2: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows, $limit, $id, $type)
{
global $locate, $db, $config;
$objResponse = new xajaxResponse();
$searchField = array();
$searchContent = array();
$optionFlag = $searchFormValue['optionFlag'];
$deleteFlag = $searchFormValue['deleteFlag'];
$exportFlag = $searchFormValue['exportFlag'];
$searchContent = $searchFormValue['searchContent'];
//搜索内容 数组
$searchField = $searchFormValue['searchField'];
//搜索条件 数组
$searchType = $searchFormValue['searchType'];
//搜索方式 数组
$divName = "grid";
if ($exportFlag == "1" || $optionFlag == "export") {
$sql = astercrm::getSql($searchContent, $searchField, $searchType, 'resellerrate');
//得到要导出的sql语句
$_SESSION['export_sql'] = $sql;
$objResponse->addAssign("hidSql", "value", $sql);
//赋值隐含域
$objResponse->addScript("document.getElementById('exportForm').submit();");
} elseif ($deleteFlag == "1" || $optionFlag == "delete") {
if (empty($_SESSION['curuser']['usertype'])) {
$objResponse->addAlert($locate->Translate("Session time out,please try again"));
return $objResponse->getXML();
}
if ($config['synchronize']['delete_by_use_history']) {
astercrm::deleteToHistoryFromSearch($searchContent, $searchField, $searchType, 'resellerrate');
} else {
astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'resellerrate');
}
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', '', $divName, "", 1, $searchType);
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} elseif ($optionFlag == "multiEdit") {
$html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, $divName, "", 1, 1, $searchType);
$showMutiEdit = Table::Top($locate->Translate("Multi Edit"), "formDiv");
$showMutiEdit .= astercrm::formMutiEdit($searchContent, $searchField, $searchType, 'resellerrate');
$showMutiEdit .= Table::Footer();
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
$objResponse->addAssign('formDiv', "innerHTML", $showMutiEdit);
$objResponse->addAssign('formDiv', "style.visibility", 'visible');
} else {
if ($type == "delete") {
if (empty($_SESSION['curuser']['usertype'])) {
$objResponse->addAlert($locate->Translate("Session time out,please try again"));
return $objResponse->getXML();
}
if ($config['synchronize']['delete_by_use_history']) {
$res = Customer::deleteRecordToHistory('id', $id, 'resellerrate');
} else {
$res = Customer::deleteRecord($id, 'resellerrate');
}
if ($res) {
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $searchField, $divName, "", 1, $searchType);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record deleted"));
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("record cannot be deleted"));
}
} else {
$html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, $divName, "", 1, $searchType);
}
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
}
return $objResponse->getXML();
}