本文整理汇总了PHP中astercrm::deletefromsearch方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::deletefromsearch方法的具体用法?PHP astercrm::deletefromsearch怎么用?PHP astercrm::deletefromsearch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::deletefromsearch方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
global $locate, $db;
$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'];
$divName = "grid";
if ($optionFlag == "export") {
$sql = astercrm::getSql($searchContent, $searchField, $searchType, 'astercrm_account');
//得到要导出的sql语句
$_SESSION['export_sql'] = $sql;
$objResponse->addAssign("hidSql", "value", $sql);
//赋值隐含域
$objResponse->addScript("document.getElementById('exportForm').submit();");
} elseif ($optionFlag == "delete") {
astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'astercrm_account');
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} elseif ($type == "delete") {
$arreglo =& Customer::getAllRecords($start, $limit, $order, $_SESSION['curuser']['groupid']);
$content = '';
foreach ($arreglo as $agents) {
if ($agents['agent'] == $id) {
continue;
} else {
$addstr = "\nagent => " . trim($agents['agent']) . ',' . trim($agents['password']) . ',' . trim($agents['name']);
}
$content .= $addstr;
}
$agentsfile = '/etc/asterisk/agents_astercc.conf';
if ($fhandle = fopen($agentsfile, 'w')) {
fwrite($fhandle, $content);
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, $searchType);
$objResponse = new xajaxResponse();
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
$objResponse->addAssign($divName, "innerHTML", $html);
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
}
} else {
$html = createGrid($numRows, $limit, $searchField, $searchContent, $order, $divName, $ordering, $searchType);
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
}
return $objResponse->getXML();
}
示例2: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
global $locate, $db;
$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'];
$divName = "grid";
if ($optionFlag == "export" || $optionFlag == "exportcsv") {
$sql = astercrm::getSql($searchContent, $searchField, $searchType, 'sms_sents');
//得到要导出的sql语句
$_SESSION['export_sql'] = $sql;
$objResponse->addAssign("hidSql", "value", $sql);
//赋值隐含域
$objResponse->addAssign("maintable", "value", 'sms_sents');
//赋值隐含域
$objResponse->addAssign("exporttype", "value", $optionFlag);
$objResponse->addScript("document.getElementById('exportForm').submit();");
} elseif ($optionFlag == "delete") {
astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'sms_sents');
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} elseif ($type == "delete") {
$res = Customer::deleteRecord($id, 'sms_templates');
if ($res) {
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, $searchType);
$objResponse = new xajaxResponse();
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
$objResponse->addAssign($divName, "innerHTML", $html);
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
}
} else {
$html = createGrid($numRows, $limit, $searchField, $searchContent, $order, $divName, $ordering, $searchType);
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
}
return $objResponse->getXML();
}
示例3: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
global $locate, $db;
$objResponse = new xajaxResponse();
$searchField = array();
$searchContent = array();
$optionFlag = $searchFormValue['optionFlag'];
$exportFlag = $searchFormValue['exportFlag'];
$searchContent = $searchFormValue['searchContent'];
//搜索内容 数组
$searchField = $searchFormValue['searchField'];
//搜索条件 数组
$searchType = $searchFormValue['searchType'];
$ordering = $searchFormValue['ordering'];
$order = $searchFormValue['order'];
$divName = "grid";
if ($optionFlag == "export" || $optionFlag == "exportcsv") {
$sql = astercrm::getSql($searchContent, $searchField, $searchType, 'diallist');
//得到要导出的sql语句
$joinstr = astercrm::createSqlWithStype($searchField, $searchContent, $searchType, 'diallist');
$joinstr = ltrim($joinstr, 'AND');
$sql = "SELECT diallist.dialnumber, customer.customer,diallist.customername,diallist.dialtime, diallist.assign,diallist.status,groupname,campaignname,diallist.cretime,diallist.creby,diallist.memo FROM diallist LEFT JOIN astercrm_accountgroup ON astercrm_accountgroup.groupid = diallist.groupid LEFT JOIN campaign ON campaign.id = diallist.campaignid LEFT JOIN customer ON customer.id = diallist.customerid";
if ($joinstr != '') {
$sql .= " WHERE " . $joinstr;
}
$_SESSION['export_sql'] = $sql;
$objResponse->addAssign("hidSql", "value", $sql);
//赋值隐含域
$objResponse->addAssign("maintable", "value", 'diallist');
//赋值隐含域
$objResponse->addAssign("exporttype", "value", $optionFlag);
$objResponse->addScript("document.getElementById('exportForm').submit();");
} elseif ($optionFlag == "delete") {
astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'diallist');
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} else {
if ($type == "delete") {
$res = Customer::deleteRecord($id, 'diallist');
if ($res) {
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, $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, $searchType);
}
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
}
return $objResponse->getXML();
}
示例4: 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();
}
示例5: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows, $limit, $id, $type)
{
global $locate, $db, $config;
$objResponse = new xajaxResponse();
$searchField = array();
$searchContent = array();
$searchType = array();
$optionFlag = $searchFormValue['optionFlag'];
$exportFlag = $searchFormValue['exportFlag'];
$searchContent = $searchFormValue['searchContent'];
//搜索内容 数组
$searchField = $searchFormValue['searchField'];
//搜索条件 数组
$searchType = $searchFormValue['searchType'];
//搜索方式 数组
$divName = "grid";
$allOrAnswer = $searchFormValue['allOrAnswer'];
#选中的radio值
if ($exportFlag == "1" || $optionFlag == "export") {
if ($config['system']['useHistoryCdr'] == 1) {
$table = 'historycdr';
} else {
$table = 'mycdr';
}
if ($searchFormValue['allOrAnswer'] == 'answered') {
$searchContent[] = '0';
$searchField[] = 'billsec';
$searchType[] = 'more';
}
if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
$fieldArray = array('id', 'calldate', 'src', 'dst', 'srcname', 'channel', 'dstchannel', 'didnumber', 'duration', 'billsec', 'billsec_leg_a', 'disposition', 'accountcode', 'userfield', 'srcuid', 'dstuid', 'queue', 'calltype', 'credit', 'callshopcredit', 'resellercredit', 'groupid', 'resellerid', 'userid', 'accountid', 'destination', 'monitored', 'memo', 'dialstring', 'dialstatus', 'children', 'ischild', 'processed', 'customerid', 'crm_customerid', 'contactid', 'discount', 'payment', 'note', 'setfreecall', 'astercrm_groupid', 'hangupcause', 'hangupcausetxt');
} else {
if ($_SESSION['curuser']['usertype'] == 'groupadmin') {
$fieldArray = array('id', 'calldate', 'src', 'dst', 'srcname', 'channel', 'dstchannel', 'didnumber', 'duration', 'billsec', 'billsec_leg_a', 'disposition', 'accountcode', 'userfield', 'srcuid', 'dstuid', 'queue', 'calltype', 'credit', 'callshopcredit', 'groupid', 'resellerid', 'userid', 'accountid', 'destination', 'monitored', 'memo', 'dialstring', 'dialstatus', 'children', 'ischild', 'processed', 'customerid', 'crm_customerid', 'contactid', 'discount', 'payment', 'note', 'setfreecall', 'astercrm_groupid', 'hangupcause', 'hangupcausetxt');
} else {
if ($_SESSION['curuser']['usertype'] == 'operator' && $_SESSION['curuser']['usertype'] == 'clid') {
$fieldArray = array('id', 'calldate', 'src', 'dst', 'srcname', 'channel', 'dstchannel', 'didnumber', 'duration', 'billsec', 'billsec_leg_a', 'disposition', 'accountcode', 'userfield', 'srcuid', 'dstuid', 'queue', 'calltype', 'credit', 'groupid', 'resellerid', 'userid', 'accountid', 'destination', 'monitored', 'memo', 'dialstring', 'dialstatus', 'children', 'ischild', 'processed', 'customerid', 'crm_customerid', 'contactid', 'discount', 'payment', 'note', 'setfreecall', 'astercrm_groupid', 'hangupcause', 'hangupcausetxt');
}
}
}
$sql = astercrm::getSql($searchContent, $searchField, $searchType, $table, implode(',', $fieldArray));
//得到要导出的sql语句
$_SESSION['export_sql'] = $sql;
$objResponse->addAssign("hidSql", "value", $sql);
//赋值隐含域
$objResponse->addScript("document.getElementById('exportForm').submit();");
return $objResponse->getXML();
} elseif ($optionFlag == "delete") {
if ($config['system']['useHistoryCdr'] == 1) {
$table = 'historycdr';
} else {
$table = 'mycdr';
}
if ($searchFormValue['allOrAnswer'] == 'answered') {
$searchContent[] = '0';
$searchField[] = 'billsec';
$searchType[] = 'more';
}
astercrm::deletefromsearch($searchContent, $searchField, $searchType, $table);
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', '', $divName, "", $searchType, '', $allOrAnswer);
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} elseif ($type == "delete") {
$res = '';
if ($res) {
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $searchField, $divName, "", $searchType, '', $allOrAnswer);
$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, $searchField[count($searchField) - 1], $divName, "", $searchType, '', $allOrAnswer);
}
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
return $objResponse->getXML();
}
示例6: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows, $limit, $id, $type)
{
global $locate, $db;
$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") {
astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'clid');
$html = createGrid($numRows, $limit, '', '', '', $divName, "", $searchType);
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} elseif ($type == "delete") {
$res = Customer::deleteDiscount($id);
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();
}
示例7: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
global $locate, $db;
$objResponse = new xajaxResponse();
$searchField = array();
$searchContent = array();
$optionFlag = $searchFormValue['optionFlag'];
$exportFlag = $searchFormValue['exportFlag'];
$searchContent = $searchFormValue['searchContent'];
//搜索内容 数组
$searchField = $searchFormValue['searchField'];
//搜索条件 数组
$divName = "grid";
$searchType = $searchFormValue['searchType'];
$ordering = $searchFormValue['ordering'];
$order = $searchFormValue['order'];
if ($exportFlag == "1" || $optionFlag == "export") {
// 需要特殊处理
// $sql = astercrm::getSql($searchContent,$searchField,$searchType,'surveyresult'); //得到要导出的sql语句
$joinstr = astercrm::createSqlWithStype($searchField, $searchContent, $searchType, 'surveyresult');
$objResponse->addAssign("hidSql", "value", $joinstr);
//赋值隐含域
$objResponse->addScript("document.getElementById('exportForm').submit();");
} elseif ($optionFlag == "delete") {
astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'surveyresult');
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, 1, 1, '');
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} else {
if ($type == "delete") {
$res = Customer::deleteRecord($id, 'surveyresult');
if ($res) {
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, "", $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, "", $searchType);
}
$objResponse = new xajaxResponse();
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
}
return $objResponse->getXML();
}
示例8: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
global $locate, $db;
$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'];
$divName = "grid";
if ($optionFlag == "export" || $optionFlag == "exportcsv") {
$joinstr = Customer::createSqlWithStype($searchField, $searchContent, $searchType, 'ticket_details');
//得到要导出的sql语句
$joinstr = ltrim($joinstr, 'AND');
$sql = "SELECT ticketcategory.ticketname as ticketcategoryname,tickets.ticketname as ticketname, customer,ticket_details.status,customer.customer,ticket_details.id,ticket_details.memo,ticket_details.cretime,ticket_details.creby FROM ticket_details LEFT JOIN tickets AS ticketcategory ON ticketcategory.id = ticket_details.ticketcategoryid LEFT JOIN tickets AS tickets ON tickets.id = ticket_details.ticketid LEFT JOIN customer ON customer.id = ticket_details.customerid LEFT JOIN astercrm_account ON astercrm_account.id = ticket_details.assignto";
if ($joinstr != '') {
$sql .= " WHERE " . $joinstr;
}
$_SESSION['export_sql'] = $sql . '';
$objResponse->addAssign("hidSql", "value", $sql);
//赋值隐含域
$objResponse->addAssign("maintable", "value", 'ticket_details');
//赋值隐含域
$objResponse->addAssign("exporttype", "value", $optionFlag);
$objResponse->addScript("document.getElementById('exportForm').submit();");
} elseif ($optionFlag == "delete") {
astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'ticket_details');
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} elseif ($type == "delete") {
/*$myrow = astercrm::getRecordByField('ticketname',$_SESSION['curuser']['ticketname'],'ticket_details');
$myid = $myrow['id'];
//echo $myid;exit;
if ($myid == $id ) {
$objResponse->addAlert($locate->Translate("Can not delete this ticket_detail"));
return $objResponse->getXML();
}*/
$res = Customer::deleteRecord($id, 'ticket_details');
if ($res) {
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, $searchType);
$objResponse = new xajaxResponse();
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("delete_rec"));
$objResponse->addAssign($divName, "innerHTML", $html);
} else {
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("rec_cannot_delete"));
}
} else {
$html = createGrid($numRows, $limit, $searchField, $searchContent, $order, $divName, $ordering, $searchType);
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
}
return $objResponse->getXML();
}
示例9: 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();
}
示例10: searchFormSubmit
function searchFormSubmit($searchFormValue, $numRows = null, $limit = null, $id = null, $type = null)
{
global $locate, $db, $config;
//根据后台设置导出的customer字段,来导出diallist关联的customer数据
$customerField = '';
if ($config['system']['export_customer_fields_in_dialedlist'] != '') {
$relateCustomerFieldArr = explode(',', $config['system']['export_customer_fields_in_dialedlist']);
foreach ($relateCustomerFieldArr as $tmp) {
$customerField .= 'customer.' . $tmp . ',';
}
}
$objResponse = new xajaxResponse();
$searchField = array();
$searchContent = array();
$optionFlag = $searchFormValue['optionFlag'];
$exportFlag = $searchFormValue['exportFlag'];
$searchContent = $searchFormValue['searchContent'];
//搜索内容 数组
$searchField = $searchFormValue['searchField'];
//搜索条件 数组
$searchType = $searchFormValue['searchType'];
$ordering = $searchFormValue['ordering'];
$order = $searchFormValue['order'];
$divName = "grid";
if ($optionFlag == "export" || $optionFlag == "exportcsv") {
$joinstr = astercrm::createSqlWithStype($searchField, $searchContent, $searchType, 'campaigndialedlist');
$joinstr = ltrim($joinstr, 'AND');
if ($customerField != '') {
$sql = "SELECT campaigndialedlist.dialednumber,customer.customer,campaigndialedlist.customername,campaigndialedlist.dialtime,campaigndialedlist.answertime,campaigndialedlist.duration,campaigndialedlist.billsec,campaigndialedlist.billsec_leg_a as total_billsec,campaigndialedlist.campaignresult,campaigndialedlist.response,campaigndialedlist.detect,campaigndialedlist.transfertime,campaigndialedlist.transfertarget,campaigndialedlist.resultby,campaigndialedlist.dialedby, groupname, campaignname,campaigndialedlist.dialedtime," . rtrim($customerField, ',') . " FROM campaigndialedlist LEFT JOIN astercrm_accountgroup ON astercrm_accountgroup.groupid = campaigndialedlist.groupid LEFT JOIN campaign ON campaign.id = campaigndialedlist.campaignid LEFT JOIN customer ON customer.id = campaigndialedlist.customerid ";
} else {
$sql = "SELECT campaigndialedlist.dialednumber,customer.customer,campaigndialedlist.customername,campaigndialedlist.dialtime,campaigndialedlist.answertime,campaigndialedlist.duration,campaigndialedlist.billsec,campaigndialedlist.billsec_leg_a as total_billsec,campaigndialedlist.campaignresult,campaigndialedlist.response,campaigndialedlist.detect,campaigndialedlist.transfertime,campaigndialedlist.transfertarget,campaigndialedlist.resultby,campaigndialedlist.dialedby, groupname, campaignname,campaigndialedlist.dialedtime FROM campaigndialedlist LEFT JOIN astercrm_accountgroup ON astercrm_accountgroup.groupid = campaigndialedlist.groupid LEFT JOIN campaign ON campaign.id = campaigndialedlist.campaignid LEFT JOIN customer ON customer.id = campaigndialedlist.customerid ";
}
if ($joinstr != '') {
$sql .= " WHERE " . $joinstr;
}
$_SESSION['export_sql'] = $sql;
$objResponse->addAssign("hidSql", "value", $sql);
//赋值隐含域
$objResponse->addAssign("maintable", "value", 'campaigndialedlist');
//赋值隐含域
$objResponse->addAssign("exporttype", "value", $optionFlag);
$objResponse->addScript("document.getElementById('exportForm').submit();");
} elseif ($optionFlag == "delete") {
astercrm::deletefromsearch($searchContent, $searchField, $searchType, 'campaigndialedlist');
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', '', $divName, "", '');
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
} elseif ($optionFlag == "recycle") {
$num = Customer::recyclefromsearch($searchContent, $searchField, $searchType, 'campaigndialedlist');
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], '', '', $order, $divName, $ordering, '');
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addALert($num . " " . $locate->Translate("number have been recycled"));
$objResponse->addAssign($divName, "innerHTML", $html);
$noanswer = Customer::getNoanswerCallsNumber();
$objResponse->addAssign("spanRecycleUp", "innerHTML", "No answer calls and never recycle: {$noanswer}");
$objResponse->addAssign("spanRecycleDown", "innerHTML", "No answer calls and never recycle: {$noanswer}");
} else {
if ($type == "delete") {
$res = Customer::deleteRecord($id, 'campaigndialedlist');
if ($res) {
$html = createGrid($searchFormValue['numRows'], $searchFormValue['limit'], $searchField, $searchContent, $order, $divName, $ordering, $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, $searchType);
}
$objResponse->addClear("msgZone", "innerHTML");
$objResponse->addAssign($divName, "innerHTML", $html);
}
return $objResponse->getXML();
}