本文整理汇总了PHP中astercrm::deleteRecords方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::deleteRecords方法的具体用法?PHP astercrm::deleteRecords怎么用?PHP astercrm::deleteRecords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::deleteRecords方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteByButton
function deleteByButton($f, $searchFormValue)
{
$objResponse = new xajaxResponse();
if (is_array($f['ckb'])) {
foreach ($f['ckb'] as $vaule) {
$res_note = astercrm::deleteRecords('contactid', $vaule, 'note');
$res_customer = astercrm::deleteRecord($vaule, 'contact');
}
}
$searchContent = $searchFormValue['searchContent'];
//搜索内容 数组
$searchField = $searchFormValue['searchField'];
//搜索条件 数组
$numRows = $searchFormValue['numRows'];
$limit = $searchFormValue['limit'];
$html = createGrid($numRows, $limit, $searchField, $searchContent, $searchField, 'grid');
$objResponse->addAssign('grid', "innerHTML", $html);
return $objResponse->getXML();
}
示例2: insertNewCustomerLead
/**
* insert a record to customer_leads table
*
* @param $customerID (int) customer id fields.
* @param $customerLead (varchar) customer_leads
* @param $saveNote boolean if save note
* @return $customerid (object) id number for the record just inserted.
*/
function insertNewCustomerLead($customerID, $customerLead, $saveNote)
{
global $db, $config;
$sql = "SELECT * FROM customer WHERE id={$customerID}";
$f =& $db->getRow($sql);
$query = "INSERT INTO customer_leads SET " . "customer='" . addslashes($f['customer']) . "', " . "customertitle='" . addslashes($f['customertitle']) . "', " . "website='" . addslashes($f['website']) . "', " . "country='" . addslashes($f['country']) . "', " . "address='" . addslashes($f['address']) . "', " . "zipcode='" . addslashes($f['zipcode']) . "', " . "city='" . addslashes($f['city']) . "', " . "state='" . addslashes($f['state']) . "', " . "contact='" . addslashes($f['contact']) . "', " . "contactgender='" . addslashes($f['contactgender']) . "', " . "phone='" . $f['phone'] . "', " . "phone_ext='" . addslashes($f['phone_ext']) . "', " . "category='" . $f['category'] . "', " . "bankname='" . addslashes($f['bankname']) . "', " . "bankzip='" . addslashes($f['bankzip']) . "', " . "bankaccount='" . addslashes($f['bankaccount']) . "', " . "bankaccountname='" . addslashes($f['bankaccountname']) . "', " . "fax='" . addslashes($f['fax']) . "', " . "fax_ext='" . addslashes($f['fax_ext']) . "', " . "mobile='" . $f['mobile'] . "', " . "email='" . addslashes($f['email']) . "', " . "cretime=now(), " . "groupid = " . $f['groupid'] . ", " . "last_note_id = 0, " . "creby='" . $f['creby'] . "'";
$res =& $db->query($query);
$customerid = mysql_insert_id();
if ($customerid) {
if ($saveNote) {
$note_sql = "SELECT * FROM note WHERE id=" . $f['last_note_id'] . " ";
$noteResult =& $db->getRow($note_sql);
if (!empty($noteResult)) {
$noteSql = "INSERT INTO note_leads SET `note`='" . addslashes($noteResult['note']) . "',`callerid`='" . addslashes($noteResult['callerid']) . "',`priority`=" . $noteResult['priority'] . ",`attitude`=" . $noteResult['attitude'] . ",`cretime`=now(),`creby`='" . $noteResult['creby'] . "',`customerid`=" . $customerid . ",`contactid`=0,`groupid`=" . $noteResult['groupid'] . ",`codes`='" . addslashes($noteResult['codes']) . "',`private`=" . $noteResult['private'] . " ";
$note =& $db->query($noteSql);
$last_note_id = mysql_insert_id();
//更新customer_leads对应数据的last_note_id值
$update_sql = "UPDATE customer_leads SET last_note_id={$last_note_id} WHERE id={$customerid} ";
$res =& $db->query($update_sql);
}
}
}
if ($customerLead == 'move' || $customerLead == 'default_move') {
astercrm::deleteRecord($customerID, 'customer');
astercrm::deleteRecords("customerid", $customerID, 'note');
//astercrm::deleteRecords("customerid",$customerID,'contact');
//$deleteSql = "DELETE FROM customer WHERE id=$customerID";
//astercrm::events($deleteSql);
//$res =& $db->query($deleteSql);
}
return $customerID;
}