當前位置: 首頁>>代碼示例>>PHP>>正文


PHP astercrm::getCountByField方法代碼示例

本文整理匯總了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;
}
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:101,代碼來源:campaign.server.php

示例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'] . '&nbsp;</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>';
//.........這裏部分代碼省略.........
開發者ID:ljhcj,項目名稱:IRISCC,代碼行數:101,代碼來源:survey.grid.inc.php


注:本文中的astercrm::getCountByField方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。