本文整理汇总了PHP中astercrm::getCountByField方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::getCountByField方法的具体用法?PHP astercrm::getCountByField怎么用?PHP astercrm::getCountByField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::getCountByField方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createGrid
//.........这里部分代码省略.........
$attribsHeader[] = 'width=""';
$attribsHeader[] = 'width=""';
$attribsHeader[] = 'width=""';
$attribsHeader[] = 'width=""';
$attribsHeader[] = 'width=""';
$attribsHeader[] = 'width=""';
$attribsHeader[] = 'width=""';
// HTML Table: columns attributes
$attribsCols = array();
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
$attribsCols[] = 'style="text-align: left"';
// HTML Table: If you want ascendent and descendent ordering, set the Header Events.
$eventHeader = array();
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","campaignname","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","campaignnote","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","groupname","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","servers.name","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","balance","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","creby","' . $divName . '","ORDERING");return false;\'';
$eventHeader[] = 'onClick=\'xajax_showGrid(0,' . $limit . ',"' . $filter . '","' . $content . '","cretime","' . $divName . '","ORDERING");return false;\'';
// Select Box: fields table.
$fieldsFromSearch = array();
$fieldsFromSearch[] = 'campaignname';
$fieldsFromSearch[] = 'campaignnote';
$fieldsFromSearch[] = 'groupname';
$fieldsFromSearch[] = 'servers.name';
$fieldsFromSearch[] = 'balance';
$fieldsFromSearch[] = 'campaign.creby';
$fieldsFromSearch[] = 'campaign.cretime';
// Selecct Box: Labels showed on search select box.
$fieldsFromSearchShowAs = array();
$fieldsFromSearchShowAs[] = $locate->Translate("Campaign Name");
$fieldsFromSearchShowAs[] = $locate->Translate("Campaign Note");
$fieldsFromSearchShowAs[] = $locate->Translate("Group Name");
$fieldsFromSearchShowAs[] = $locate->Translate("Server Name");
$fieldsFromSearchShowAs[] = $locate->Translate("Balance");
$fieldsFromSearchShowAs[] = $locate->Translate("Creby");
$fieldsFromSearchShowAs[] = $locate->Translate("Cretime");
//echo 'dddddddddddddd';
// Create object whit 5 cols and all data arrays set before.
$table = new ScrollTable(6, $start, $limit, $filter, $numRows, $content, $order);
$table->exportFlag = '2';
//对导出标记进行赋值
$table->ordering = $ordering;
$editFlag = 1;
$deleteFlag = 1;
$addFlag = 1;
if ($_SESSION['curuser']['usertype'] != 'admin' && $_SESSION['curuser']['usertype'] != 'groupadmin') {
if ($_SESSION['curuser']['privileges']['campaign']['delete']) {
$deleteFlag = 1;
} else {
$deleteFlag = 0;
}
if ($_SESSION['curuser']['privileges']['campaign']['edit']) {
$editFlag = 1;
} else {
$editFlag = 0;
}
}
//如果是groupoperator 就没有添加 编辑和删除的功能
if ($_SESSION['curuser']['usertype'] == 'groupoperator') {
$addFlag = 0;
$editFlag = 0;
$deleteFlag = 0;
}
$table->setHeader('title', $headers, $attribsHeader, $eventHeader, $editFlag, $deleteFlag, 0);
$table->setAttribsCols($attribsCols);
$table->addRowSearchMore("campaign", $fieldsFromSearch, $fieldsFromSearchShowAs, $filter, $content, $start, $limit, $addFlag, 0, $typeFromSearch, $typeFromSearchShowAs, $stype);
while ($arreglo->fetchInto($row)) {
// Change here by the name of fields of its database table
$rowc = array();
$rowc[] = $row['id'];
$rowc[] = "<a href=? onclick=\"xajax_showDetail('" . $row['id'] . "');return false;\">" . $row['campaignname'] . "</a>";
$rowc[] = $row['campaignnote'];
$rowc[] = $row['groupname'];
if ($row['serverid'] != 0) {
$rowc[] = $row['servername'];
} else {
$rowc[] = $locate->Translate("Default server");
}
$total = astercrm::getCountByField('campaignid', $row['id'], 'diallist');
#$dialed = $row['dialed'];
#$answered = customer::getCountAnswered($row['id']);
$rowc[] = $total . '/' . $row['dialed'] . '/' . $row['answered'];
$rowc[] = $row['balance'];
$rowc[] = $row['creby'];
$rowc[] = $row['cretime'];
$table->addRow("campaign", $rowc, $editFlag, $deleteFlag, 0, $divName, $fields);
}
// End Editable Zone
$html = $table->render();
return $html;
}
示例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>';
//.........这里部分代码省略.........