本文整理汇总了PHP中astercrm::getRecordById方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::getRecordById方法的具体用法?PHP astercrm::getRecordById怎么用?PHP astercrm::getRecordById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::getRecordById方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* initialize page elements
*
*/
function init()
{
global $locate;
$objResponse = new xajaxResponse();
$objResponse->addAssign("divNav", "innerHTML", common::generateManageNav($skin));
$objResponse->addAssign("divCopyright", "innerHTML", common::generateCopyright($skin));
$objResponse->addScript("xajax_showGrid(0," . ROWSXPAGE . ",'','','')");
if ($_SESSION['curuser']['usertype'] == "groupadmin") {
$row = astercrm::getRecordById($_SESSION['curuser']['groupid'], "accountgroup");
$objResponse->addAssign("customer_multiple", "value", $row['customer_multiple']);
$objResponse->addAssign("spnShortcutUpdate", "innerHTML", '<input type="button" value="' . $locate->Translate("Shortcut update rate") . '" onclick="xajax_shortcutUpdate();">');
$objResponse->addAssign("spnShortcutMsg", "innerHTML", '');
}
return $objResponse;
}
示例2: formAdd
function formAdd($surveyid = 0, $optionid = 0)
{
global $locate;
$html = '
<!-- No edit the next line -->
<form method="post" name="f" id="f">
<table border="1" width="100%" class="adminlist" id="tblSurvey">
';
$html .= '<tr><td colspan=2>
' . $locate->Translate("survey_title") . '*
</td></tr>';
if ($surveyid == 0) {
$html .= '<tr><td colspan=2>
<input type="text" size="50" maxlangth="100" id="surveyname" name="surveyname"/>
</td></tr>';
$html .= '<tr><td colspan=2>
' . $locate->Translate("Survey Note") . '
</td></tr>';
$html .= '<tr><td colspan=2>
<input type="text" size="50" maxlangth="254" id="surveynote" name="surveynote"/>
</td></tr>';
$enable_html = '<tr>
<td colspan=2>
<input type="radio" value="1" id="radEnable" name="radEnable" checked>' . $locate->Translate("enable") . '
<input type="radio" value="0" id="radEnable" name="radEnable">' . $locate->Translate("disable") . '
</td>
</tr>';
} else {
$survey = Customer::getRecord($surveyid, 'survey');
$nameCell = "TitleCol";
$html .= '<tr><td colspan="2" id="' . $nameCell . '" style="cursor: pointer;" onDblClick="xajax_editField(\'survey\',\'surveyname\',\'' . $nameCell . '\',\'' . $survey['surveyname'] . '\',\'' . $survey['id'] . '\');return false">' . $survey['surveyname'] . '<input type="hidden" id="surveyid" name="surveyid" value="' . $surveyid . '"/></td></tr>';
$nameCell = "NoteCol";
$html .= '<tr><td colspan=2>
' . $locate->Translate("Survey Note") . '
</td></tr>';
$html .= '<tr><td colspan="2" id="' . $nameCell . '" style="cursor: pointer;" onDblClick="xajax_editField(\'survey\',\'surveynote\',\'' . $nameCell . '\',\'' . $survey['surveynote'] . '\',\'' . $survey['id'] . '\');return false">' . $survey['surveynote'] . ' </td></tr>';
if ($survey['enable'] == 1) {
$enable_html = '<tr>
<td colspan=2>
<input type="radio" value="1" id="radEnable" name="radEnable" checked>' . $locate->Translate("enable") . '
<input type="radio" value="0" id="radEnable" name="radEnable">' . $locate->Translate("disable");
} else {
$enable_html = '<tr>
<td colspan=2>
<input type="radio" value="1" id="radEnable" name="radEnable" >' . $locate->Translate("enable") . '
<input type="radio" value="0" id="radEnable" name="radEnable" checked>' . $locate->Translate("disable");
}
$enable_html .= '<input type="button" onclick="xajax_setSurvey(xajax.getFormValues(\'f\'));return false;" value="' . $locate->Translate("update") . '">
</td>
</tr>';
}
$options = Customer::getOptions($surveyid);
if ($options) {
$ind = 0;
while ($options->fetchInto($row)) {
$nameRow = "formDivRow" . $row['id'];
$nameCell = $nameRow . "Col" . $ind;
$html .= '<tr id="' . $nameRow . '" >' . "\n";
$item_html = "";
if ($row['optiontype'] == "text") {
} else {
$item_html = '(<a href=? onclick="showItem(\'' . $row['id'] . '\');return false;">' . $locate->Translate("Item") . '</a>)';
}
$option_item_number = astercrm::getCountByField("optionid", $row['id'], "surveyoptionitems");
$html .= '
<td align="left" width="25%">' . $locate->Translate("option") . '(<a href="?" onclick="xajax_edit(\'' . $surveyid . '\',\'' . $row['id'] . '\');return false;"><img src="skin/default/images/edit.png"></a><a href="?" onclick="deleteOption(\'' . $row['id'] . '\',\'' . $nameRow . '\');return false;"><img src="skin/default/images/trash.png"></a>)' . $item_html . '
</td><td id="' . $nameCell . '" >' . $row['surveyoption'] . "(" . $locate->Translate($row['optiontype']) . ", {$option_item_number} " . $locate->Translate('items') . ")" . '</td></tr>
<tr>
<td align="left" width="25%">' . $locate->Translate("Option Note") . '</td>
<td id="' . $nameCell . '_note">' . $row['optionnote'] . '</td>
</tr>
<tr><td colspan="2" height="1" bgcolor="#ccc"></td></tr>
';
$ind++;
}
}
$html .= '<tr><td colspan=2>
' . $locate->Translate("option") . '
</td></tr>';
if ($optionid == 0) {
$button_value = $locate->Translate("Add Option");
$optionid = 0;
} else {
$button_value = $locate->Translate("Update Option");
$option = astercrm::getRecordById($optionid, "surveyoptions");
$optiontype[$option['optiontype']] = "selected";
}
$html .= '<tr><td colspan=2>' . $locate->Translate("Title") . ':
<input type="text" size="50" maxlength="50" id="surveyoption" name="surveyoption" value="' . $option['surveyoption'] . '"/>
<SELECT id="optiontype" name="optiontype">
<option value="radio" ' . $optiontype['radio'] . '>' . $locate->Translate("Radio") . '</option>
<option value="checkbox" ' . $optiontype['checkbox'] . '>' . $locate->Translate("Checkbox") . '</option>
<option value="text" ' . $optiontype['text'] . '>' . $locate->Translate("Text") . '</option>
</SELECT>
</td></tr>';
$html .= '<tr><td colspan=2>' . $locate->Translate("Note") . ':
<input type="text" size="50" maxlength="254" id="optionnote" name="optionnote" value="' . $option['optionnote'] . '"/>
<input type="button" value="' . $button_value . '" onclick="addOption(\'f\',\'' . $optionid . '\');return false;">
</td></tr>';
//.........这里部分代码省略.........
示例3: saveDiallist
function saveDiallist($f, $userexten = '', $customerid = '')
{
global $locate;
$objResponse = new xajaxResponse();
if ($f['campaignid'] == '') {
$objResponse->addAlert($locate->Translate("Must select a campaign"));
return $objResponse->getXML();
}
if ($customerid > 0) {
$res_customer = astercrm::getRecordById($customerid, 'customer');
$f['customerid'] = $customerid;
$f['customername'] = $res_customer['customer'];
}
//print_r($f);exit;
// check if the assign number belong to this group
if ($_SESSION['curuser']['usertype'] != 'admin') {
$flag = false;
if ($_SESSION['curuser']['usertype'] == 'groupadmin') {
if ($f['assign'] == '') {
$flag = true;
} else {
foreach ($_SESSION['curuser']['memberExtens'] as $extension) {
if ($extension == $f['assign']) {
$flag = true;
break;
}
}
}
} else {
if ($_SESSION['curuser']['extension'] == $f['assign']) {
$flag = true;
}
}
if (!$flag) {
$objResponse->addAlert('"' . $locate->Translate("Cant insert, please confirm the assign number is in your group") . '"');
}
}
if ($userexten != '') {
$id = Customer::insertNewDiallist($f);
$html = Table::Top($locate->Translate("diallist"), "formDiallist");
$html .= Customer::createDiallistGrid($userexten, $customerid, 0, ROWSXPAGE);
$html .= Table::Footer();
$objResponse->addAssign("formDiallist", "innerHTML", $html);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("diallist_added"));
$objResponse->addAssign("formaddDiallistInfo", "style.visibility", "hidden");
$objResponse->addClear("formaddDiallistInfo", "innerHTML");
} else {
$id = Customer::updateDiallistRecord($f);
$objResponse->addAssign("msgZone", "innerHTML", $locate->Translate("diallist_updated"));
$objResponse->addAssign("formeditDiallistInfo", "style.visibility", "hidden");
$objResponse->addClear("formeditDiallistInfo", "innerHTML");
}
$objResponse->addScript("xajax_showDiallist('" . $_SESSION['curuser']['extension'] . "',0,0,5,'','','','formDiallistPannel','','');");
return $objResponse->getXML();
}
示例4: array
function &readReportAgent($groupid, $accountid, $sdate, $edate)
{
global $db;
$return_arr = array();
if ($_SESSION['curuser']['usertype'] == "admin") {
if (($groupid == '' || $groupid == 0) && ($accountid == '' || $accountid == 0)) {
$query = "SELECT COUNT(*) as recordNum, mycdr.astercrm_groupid,groupname FROM mycdr LEFT JOIN astercrm_accountgroup ON mycdr.astercrm_groupid = astercrm_accountgroup.id WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' AND mycdr.astercrm_groupid > 0 ";
$query_a = "SELECT COUNT(*) as arecordNum, SUM(billsec) as seconds ,mycdr.astercrm_groupid FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' AND mycdr.astercrm_groupid > 0 AND billsec > 0";
$query .= " GROUP BY mycdr.astercrm_groupid ";
$query_a .= " GROUP BY mycdr.astercrm_groupid ";
$all_res =& $db->query($query);
$return_arr['type'] = 'grouplist';
while ($all_res->fetchinto($row)) {
$return_arr[$row['astercrm_groupid']]['recordNum'] = $row['recordNum'];
$return_arr[$row['astercrm_groupid']]['groupname'] = $row['groupname'];
$return_arr[$row['astercrm_groupid']]['arecordNum'] = 0;
$return_arr[$row['astercrm_groupid']]['seconds'] = 0;
}
$answer_res =& $db->query($query_a);
while ($answer_res->fetchinto($arow)) {
$return_arr[$arow['astercrm_groupid']]['arecordNum'] = $arow['arecordNum'];
$return_arr[$arow['astercrm_groupid']]['seconds'] = $arow['seconds'];
}
return $return_arr;
}
}
if (($groupid == '' || $groupid == 0) && ($accountid == '' || $accountid == 0) && $_SESSION['curuser']['usertype'] != "admin") {
$groupid = $_SESSION['curuser']['groupid'];
}
if (is_numeric($accountid) && $accountid > 0) {
$return_arr['type'] = 'agentlist';
$query = "SELECT COUNT(*) as recordNum FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' ";
$query_a = "SELECT COUNT(*) as arecordNum, SUM(billsec) as seconds FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' AND billsec > 0";
$query .= " AND mycdr.astercrm_groupid = " . $groupid . " ";
$query_a .= " AND mycdr.astercrm_groupid = " . $groupid . " ";
$query .= " AND accountid=" . $accountid;
$query_a .= " AND accountid=" . $accountid;
$all_count =& $db->getone($query);
$answer_row =& $db->getRow($query_a);
$account = astercrm::getRecordById($accountid, 'astercrm_account');
$return_arr[$accountid]['recordNum'] = $all_count;
$return_arr[$accountid]['username'] = $account['extension'];
$return_arr[$accountid]['name'] = $account['username'];
$return_arr[$accountid]['arecordNum'] = $answer_row['arecordNum'];
$return_arr[$accountid]['seconds'] = $answer_row['seconds'];
} else {
if (is_numeric($groupid)) {
if ($groupid > 0) {
$return_arr['type'] = 'agentlist';
$member = astercrm::getGroupMemberListByID($groupid);
while ($member->fetchinto($row)) {
$extens = '';
$channels = '';
$agents = '';
$query = "SELECT COUNT(*) as recordNum FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' ";
$query_a = "SELECT COUNT(*) as arecordNum, SUM(billsec) as seconds FROM mycdr WHERE calldate >= '{$sdate}' AND calldate <= '{$edate}' AND billsec > 0";
$query .= " AND mycdr.astercrm_groupid = " . $groupid . " ";
$query_a .= " AND mycdr.astercrm_groupid = " . $groupid . " ";
$query .= " AND accountid=" . $row['id'];
$query_a .= " AND accountid=" . $row['id'];
$all_count =& $db->getone($query);
$answer_row =& $db->getRow($query_a);
$return_arr[$row['id']]['recordNum'] = $all_count;
$return_arr[$row['id']]['username'] = $row['extension'];
$return_arr[$row['id']]['name'] = $row['username'];
$return_arr[$row['id']]['arecordNum'] = $answer_row['arecordNum'];
$return_arr[$row['id']]['seconds'] = $answer_row['seconds'];
}
}
}
}
return $return_arr;
}
示例5: formCustomrLeadEdit
function formCustomrLeadEdit($id)
{
global $locate, $db;
$customer =& astercrm::getRecordById($id, 'customer_leads');
if ($customer['contactgender'] == 'male') {
$customerMaleSelected = 'selected';
} elseif ($customer['contactgender'] == 'female') {
$customerFemaleSelected = 'selected';
} else {
$customerUnknownSelected = 'selected';
}
$html = '
<form method="post" name="frmCustomerEdit" id="frmCustomerEdit">
<table border="0" width="100%">
<tr id="customerTR" name="customerTR">
<td nowrap align="left">' . $locate->Translate("customer_name") . '</td>
<td align="left">';
if ($customer['customertitle'] == 'Mr') {
$slt['Mr'] = 'selected';
} elseif ($customer['customertitle'] == 'Miss') {
$slt['Miss'] = 'selected';
} elseif ($customer['customertitle'] == 'Ms') {
$slt['Ms'] = 'selected';
} elseif ($customer['customertitle'] == 'Mrs') {
$slt['Mrs'] = 'selected';
} elseif ($customer['customertitle'] == 'other') {
$slt['other'] = 'selected';
}
$customertile = '<select id="customertitle" name="customertitle">
<option value="Mr" ' . $slt['Mr'] . '>' . $locate->Translate("Mr") . '</option>
<option value="Miss" ' . $slt['Miss'] . '>' . $locate->Translate("Miss") . '</option>
<option value="Ms" ' . $slt['Ms'] . '>' . $locate->Translate("Ms") . '</option>
<option value="Mrs" ' . $slt['Mrs'] . '>' . $locate->Translate("Mrs") . '</option>
<option value="other" ' . $slt['other'] . '>' . $locate->Translate("Other") . '</option>
</select>';
if ($_SESSION['curuser']['language'] != 'ZH' && $_SESSION['curuser']['country'] != 'cn') {
$html .= $customertile . ' <input type="text" id="customer" name="customer" size="35" maxlength="100" value="' . $customer['customer'] . '">';
} else {
$html .= '<input type="text" id="customer" name="customer" size="35" maxlength="100" value="' . $customer['customer'] . '"> ' . $customertile;
}
$html .= '<input type="hidden" id="customerid" name="customerid" value="' . $customer['id'] . '"><BR />
<input type="hidden" id="hidEditCustomerDetails" name="hidEditCustomerDetails" value="ON">
<input type="hidden" id="hidEditBankDetails" name="hidEditBankDetails" value="ON">
[<a href=? onclick="
if (xajax.$(\'hidEditCustomerDetails\').value == \'OFF\'){
showObj(\'trEditCustomerDetails\');
xajax.$(\'hidEditCustomerDetails\').value = \'ON\';
}else{
hideObj(\'trEditCustomerDetails\');
xajax.$(\'hidEditCustomerDetails\').value = \'OFF\';
};
return false;">
' . $locate->Translate("detail") . '
</a>] [<a href=? onclick="
if (xajax.$(\'hidEditBankDetails\').value == \'OFF\'){
showObj(\'trEditBankDetails\');
xajax.$(\'hidEditBankDetails\').value = \'ON\';
}else{
hideObj(\'trEditBankDetails\');
xajax.$(\'hidEditBankDetails\').value = \'OFF\';
}
return false;">' . $locate->Translate("bank") . '</a>]
</td>
</tr>
<tr id="trEditCustomerDetails" name="trEditCustomerDetails">
<td nowrap align="left">' . $locate->Translate("customer_contact") . '</td>
<td align="left"><input type="text" id="customerContact" name="customerContact" size="35" maxlength="35" value="' . $customer['contact'] . '"><BR />
<select id="customerContactGender" name="customerContactGender">
<option value="male" ' . $customerMaleSelected . '>' . $locate->Translate("male") . '</option>
<option value="female" ' . $customerFemaleSelected . '>' . $locate->Translate("female") . '</option>
<option value="unknown" ' . $customerUnknownSelected . '>' . $locate->Translate("unknown") . '</option>
</select>
</td>
</tr>
<tr id="trEditCustomerDetails" name="trEditCustomerDetails">
<td nowrap align="left">' . $locate->Translate("address") . '</td>
<td align="left"><input type="text" id="address" name="address" size="35" maxlength="200" value="' . $customer['address'] . '"></td>
</tr>
<tr id="trEditCustomerDetails" name="trEditCustomerDetails">
<td nowrap align="left">' . $locate->Translate("zipcode") . '/' . $locate->Translate("city") . '</td>
<td align="left"><input type="text" id="zipcode" name="zipcode" size="10" maxlength="10" value="' . $customer['zipcode'] . '">/<input type="text" id="city" name="city" size="17" maxlength="50" value="' . $customer['city'] . '"></td>
</tr>
<tr id="trEditCustomerDetails" name="trEditCustomerDetails">
<td nowrap align="left">' . $locate->Translate("state") . '</td>
<td align="left"><input type="text" id="state" name="state" size="35" maxlength="50" value="' . $customer['state'] . '"></td>
</tr>
<tr id="trEditCustomerDetails" name="trEditCustomerDetails">
<td nowrap align="left">' . $locate->Translate("country") . '</td>
<td align="left"><input type="text" id="country" name="country" size="35" maxlength="50" value="' . $customer['country'] . '"></td>
</tr>
<tr id="trEditCustomerDetails" name="trEditCustomerDetails">
<td nowrap align="left">' . $locate->Translate("customer_phone") . '</td>
<td align="left"><input type="text" id="customerPhone" name="customerPhone" size="35" maxlength="50" value="' . $customer['phone'] . '">-<input type="text" id="customerPhone_ext" name="customerPhone_ext" size="8" maxlength="8" value="' . $customer['phone_ext'] . '"></td>
</tr>
<tr name="trEditCustomerDetails" id="trEditCustomerDetails">
<td nowrap align="left">' . $locate->Translate("mobile") . '</td>
<td align="left"><input type="text" id="mainMobile" name="mainMobile" size="35" value="' . $customer['mobile'] . '"></td>
</tr>
//.........这里部分代码省略.........
示例6: createGrid
function createGrid($start = 0, $limit = 1, $filter = null, $content = null, $order = null, $divName = "grid", $ordering = "", $stype = array(), $action = '', $campaign_id = 0)
{
if ($action == 'abandoned' && $campaign_id > 0) {
$campaignrow = astercrm::getRecordById($campaign_id, 'campaign');
$filter = array('campaigndialedlist.billsec_leg_a', 'campaigndialedlist.billsec', 'campaignname');
$content = array(0, 0, $campaignrow['campaignname']);
$stype = array('more', 'equal', 'equal');
}
global $locate;
$_SESSION['ordering'] = $ordering;
if ($filter == null or $content == null or $content == 'Array' or $filter == 'Array') {
$numRows =& Customer::getNumRows();
$arreglo =& Customer::getAllRecords($start, $limit, $order);
$content = null;
$filter = null;
} else {
foreach ($content as $value) {
if (trim($value) != "") {
//搜索内容有值
$flag = "1";
break;
}
}
foreach ($filter as $value) {
if (trim($value) != "") {
//搜索条件有值
$flag2 = "1";
break;
}
}
foreach ($stype as $value) {
if (trim($value) != "") {
//搜索方式有值
$flag3 = "1";
break;
}
}
if ($flag != "1" || $flag2 != "1") {
//无值
if (is_array($order) || $order == '') {
$order = null;
}
$numRows =& Customer::getNumRows($_SESSION['curuser']['groupid']);
$arreglo =& Customer::getAllRecords($start, $limit, $order, $_SESSION['curuser']['groupid']);
} elseif ($flag3 != 1) {
$order = "id";
$numRows =& Customer::getNumRowsMore($filter, $content, "campaigndialedlist");
$arreglo =& Customer::getRecordsFilteredMore($start, $limit, $filter, $content, $order, "campaigndialedlist");
} else {
$order = "id";
$numRows =& Customer::getNumRowsMorewithstype($filter, $content, $stype, $table);
$arreglo =& Customer::getRecordsFilteredMorewithstype($start, $limit, $filter, $content, $stype, $order, $table);
}
}
// Select Box: type table.
$typeFromSearch = array();
$typeFromSearch[] = 'like';
$typeFromSearch[] = 'equal';
$typeFromSearch[] = 'more';
$typeFromSearch[] = 'less';
// Selecct Box: Labels showed on searchtype select box.
$typeFromSearchShowAs = array();
$typeFromSearchShowAs[] = $locate->Translate("like");
$typeFromSearchShowAs[] = '=';
$typeFromSearchShowAs[] = '>';
$typeFromSearchShowAs[] = '<';
// Editable zone
// Databse Table: fields
$fields = array();
$fields[] = 'dialednumber';
$fields[] = 'answertime';
$fields[] = 'duration';
$fields[] = 'callresult';
$fields[] = 'billsec';
$fields[] = 'billsec_leg_a';
$fields[] = 'customer';
$fields[] = 'customername';
// $fields[] = 'uniqueid';
$fields[] = 'campaignresult';
$fields[] = 'response';
$fields[] = 'detect';
$fields[] = 'transfertime';
$fields[] = 'transfertarget';
$fields[] = 'resultby';
$fields[] = 'dialedby';
// $fields[] = 'groupname';
$fields[] = 'recycles';
// HTML table: Headers showed
$headers = array();
$headers[] = $locate->Translate("ALL") . "<input type='checkbox' onclick=\"ckbAllOnClick(this);\"><BR \\>";
$headers[] = $locate->Translate("Dialed Number");
// $headers[] = $locate->Translate("Answer Time");
$headers[] = $locate->Translate("Duration");
$headers[] = $locate->Translate("Billsec");
$headers[] = $locate->Translate("Total Billsec");
$headers[] = $locate->Translate("Call Result");
$headers[] = $locate->Translate("Customer");
$headers[] = $locate->Translate("Name");
// $headers[] = $locate->Translate("Uniqueid");
$headers[] = $locate->Translate("Campaign Result");
//.........这里部分代码省略.........
示例7: showClidCredit
function showClidCredit()
{
$objResponse = new xajaxResponse();
$objResponse->addAssign("divClid", "style.visibility", "visible");
$clid = astercrm::getRecordById($_SESSION['curuser']['clidid'], 'clid');
if ($clid['limittype'] == '') {
$limit = 'no limit';
} else {
$limit = $clid['creditlimit'];
}
$objResponse->addAssign('spanCost', "innerHTML", $clid['credit_clid']);
$objResponse->addAssign("spanLimit", "innerHTML", $limit);
$objResponse->addAssign("spancurcredit", "innerHTML", $clid['curcredit']);
return $objResponse;
}