本文整理汇总了PHP中astercrm::getSynchronDisplay方法的典型用法代码示例。如果您正苦于以下问题:PHP astercrm::getSynchronDisplay方法的具体用法?PHP astercrm::getSynchronDisplay怎么用?PHP astercrm::getSynchronDisplay使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类astercrm
的用法示例。
在下文中一共展示了astercrm::getSynchronDisplay方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: formEdit
/**
* Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
*
* @param $id (int) Identificador del registro a ser editado.
* @return $html (string) Devuelve una cadena de caracteres que contiene la forma con los datos
* a extraidos de la base de datos para ser editados
*/
function formEdit($id)
{
global $locate, $config;
$rate =& Customer::getRecordByID($id, 'myrate');
/*
$group = astercrm::getAll('accountgroup');
if ($_SESSION['curuser']['usertype'] == 'admin'){
$groupoptions .= '<select id="groupid" name="groupid">';
while ($group->fetchInto($row)){
if ($row['id'] == $rate['groupid']){
$groupoptions .= "<OPTION value='".$row['id']."' selected>".$row['groupname']."</OPTION>";
}else{
$groupoptions .= "<OPTION value='".$row['id']."'>".$row['groupname']."</OPTION>";
}
}
$groupoptions .= '</select>';
}else{
while ($group->fetchInto($row)){
if ($row['id'] == $_SESSION['curuser']['groupid']){
$groupoptions .= $row['groupname'].'<input type="hidden" value="'.$row['id'].'" name="groupid" id="groupid">';
break;
}
}
}
*/
$reselleroptions = '';
$reseller = astercrm::getAll('resellergroup');
if ($_SESSION['curuser']['usertype'] == 'admin') {
$reselleroptions .= '<select id="resellerid" name="resellerid" onchange="setGroup();">';
$reselleroptions .= '<option value="0"></option>';
while ($reseller->fetchInto($row)) {
if ($config['synchronize']['display_synchron_server']) {
$row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
}
if ($row['id'] == $rate['resellerid']) {
$reselleroptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['resellername'] . "</OPTION>";
} else {
$reselleroptions .= "<OPTION value='" . $row['id'] . "' >" . $row['resellername'] . "</OPTION>";
}
}
$reselleroptions .= '</select>';
} else {
while ($reseller->fetchInto($row)) {
if ($row['id'] == $rate['resellerid']) {
if ($config['synchronize']['display_synchron_server']) {
$row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
}
$reselleroptions .= $row['resellername'] . '<input type="hidden" value="' . $row['id'] . '" name="resellerid" id="resellerid">';
break;
}
}
}
$group = astercrm::getAll('accountgroup', 'resellerid', $rate['resellerid']);
if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
$groupoptions .= '<select id="groupid" name="groupid">';
$groupoptions .= "<OPTION value='0'></OPTION>";
while ($group->fetchInto($row)) {
if ($config['synchronize']['display_synchron_server']) {
$row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
}
if ($row['id'] == $rate['groupid']) {
$groupoptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['groupname'] . "</OPTION>";
} else {
$groupoptions .= "<OPTION value='" . $row['id'] . "' >" . $row['groupname'] . "</OPTION>";
}
}
$groupoptions .= '</select>';
} else {
while ($group->fetchInto($row)) {
if ($row['id'] == $rate['groupid']) {
if ($config['synchronize']['display_synchron_server']) {
$row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
}
$groupoptions .= $row['groupname'] . '<input type="hidden" value="' . $row['id'] . '" name="groupid" id="groupid">';
break;
}
}
}
$html = '
<!-- No edit the next line -->
<form method="post" name="f" id="f">
<table border="1" width="100%" class="adminlist">
<tr>
<td nowrap align="left">' . $locate->Translate("prefix") . '</td>
<td align="left"><input type="hidden" id="id" name="id" value="' . $rate['id'] . '"><input type="text" id="dialprefix" name="dialprefix" size="25" maxlength="30" value="' . $rate['dialprefix'] . '" onKeyUp="xajax_showBuyRate(this.value);" onclick="xajax_showBuyRate(this.value);"> <span id="spanShowBuyRate" name="spanShowBuyRate"></span></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("length") . '</td>
<td align="left"><input type="text" id="numlen" name="numlen" size="10" maxlength="10" value="' . $rate['numlen'] . '"></td>
</tr>
<tr>
//.........这里部分代码省略.........
示例2: formEdit
/**
* Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
*
* @param $id (int) Identificador del registro a ser editado.
* @return $html (string) Devuelve una cadena de caracteres que contiene la forma con los datos
* a extraidos de la base de datos para ser editados
*/
function formEdit($id)
{
global $locate, $config;
$clid =& Customer::getRecordByID($id, 'clid');
if ($clid['isshow'] == 'yes') {
$selecty = "selected";
$selectn = "";
} else {
if ($clid['isshow'] == 'no') {
$selecty = "";
$selectn = "selected";
}
}
$reselleroptions = '';
$reseller = astercrm::getAll('resellergroup');
if ($_SESSION['curuser']['usertype'] == 'admin') {
$reselleroptions .= '<select id="resellerid" name="resellerid" onchange="setGroup();">';
$reselleroptions .= '<option value="0"></option>';
while ($reseller->fetchInto($row)) {
if ($config['synchronize']['display_synchron_server']) {
$row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
}
if ($row['id'] == $clid['resellerid']) {
$reselleroptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['resellername'] . "</OPTION>";
} else {
$reselleroptions .= "<OPTION value='" . $row['id'] . "' >" . $row['resellername'] . "</OPTION>";
}
}
$reselleroptions .= '</select>';
} else {
while ($reseller->fetchInto($row)) {
if ($row['id'] == $clid['resellerid']) {
if ($config['synchronize']['display_synchron_server']) {
$row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
}
$reselleroptions .= $row['resellername'] . '<input type="hidden" value="' . $row['id'] . '" name="resellerid" id="resellerid">';
break;
}
}
}
$group = astercrm::getAll('accountgroup', 'resellerid', $clid['resellerid']);
if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
$groupoptions .= '<select id="groupid" name="groupid">';
$groupoptions .= "<OPTION value='0'></OPTION>";
while ($group->fetchInto($row)) {
if ($config['synchronize']['display_synchron_server']) {
$row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
}
if ($row['id'] == $clid['groupid']) {
$groupoptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['groupname'] . "</OPTION>";
} else {
$groupoptions .= "<OPTION value='" . $row['id'] . "' >" . $row['groupname'] . "</OPTION>";
}
}
$groupoptions .= '</select>';
} else {
while ($group->fetchInto($row)) {
if ($row['id'] == $clid['groupid']) {
if ($config['synchronize']['display_synchron_server']) {
$row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
}
$groupoptions .= $row['groupname'] . '<input type="hidden" value="' . $row['id'] . '" name="groupid" id="groupid">';
break;
}
}
}
if ($clid['status'] == 1) {
$statusoptions = '
<option value="1" selected>' . $locate->Translate("Avaiable") . '</option>
<option value="-1">' . $locate->Translate("Lock") . '</option>
';
} else {
$statusoptions = '
<option value="1">' . $locate->Translate("Avaiable") . '</option>
<option value="-1" selected>' . $locate->Translate("Lock") . '</option>
';
}
$configstatus = common::read_ini_file($config['system']['astercc_path'] . '/astercc.conf', $asterccConfig);
if ($configstatus == -2) {
$html = "(fail to read " . $config['system']['astercc_path'] . "/astercc.conf)";
return $html;
} else {
$billingfield = trim($asterccConfig['system']['billingfield']);
}
if ($_SESSION['curuser']['usertype'] == 'clid') {
$readonly = "readonly";
}
$html = '
<!-- No edit the next line -->
<form method="post" name="f" id="f">
<table border="1" width="100%" class="adminlist">
<tr>
//.........这里部分代码省略.........
示例3: setGroup
function setGroup($resellerid)
{
global $locate, $config;
$objResponse = new xajaxResponse();
$res = astercrm::getAll("accountgroup", 'resellerid', $resellerid);
//添加option
while ($res->fetchInto($row)) {
if ($config['synchronize']['display_synchron_server']) {
$row['groupname'] = astercrm::getSynchronDisplay($row['id'], $row['groupname']);
}
$objResponse->addScript("addOption('groupid','" . $row['id'] . "','" . $row['groupname'] . "');");
}
return $objResponse;
}
示例4: formEdit
/**
* Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
*
* @param $id (int) Identificador del registro a ser editado.
* @return $html (string) Devuelve una cadena de caracteres que contiene la forma con los datos
* a extraidos de la base de datos para ser editados
*/
function formEdit($id)
{
global $locate, $config;
$account =& Customer::getRecordByID($id, 'account');
/*
$group = astercrm::getAll('accountgroup');
if ($_SESSION['curuser']['usertype'] == 'admin'){
$groupoptions .= '<select id="groupid" name="groupid">';
while ($group->fetchInto($row)){
if ($row['id'] == $account['groupid']){
$groupoptions .= "<OPTION value='".$row['id']."' selected>".$row['groupname']."</OPTION>";
}else{
$groupoptions .= "<OPTION value='".$row['id']."'>".$row['groupname']."</OPTION>";
}
}
if ($account['groupid'] == 0 ){
$groupoptions .= "<OPTION value='0' selected></OPTION>";
}else{
$groupoptions .= "<OPTION value='0'></OPTION>";
}
$groupoptions .= '</select>';
}else{
while ($group->fetchInto($row)){
if ($row['id'] == $account['groupid']){
$groupoptions .= $row['groupname'].'<input type="hidden" value="'.$row['id'].'" name="groupid" id="groupid">';
break;
}
}
}
*/
$fixedValueFlag = false;
$groupSelectTrStyle = '';
if ($_SESSION['curuser']['usertype'] == 'reseller' && ($_SESSION['curuser']['userid'] == $account['id'] || $account['usertype'] == 'reseller')) {
$fixedValueFlag = true;
$groupSelectTrStyle = " style='display:none;' ";
} else {
if ($_SESSION['curuser']['usertype'] == 'groupadmin' && ($_SESSION['curuser']['userid'] == $account['id'] || $account['usertype'] == 'groupadmin')) {
$fixedValueFlag = true;
}
}
if ($fixedValueFlag) {
if ($_SESSION['curuser']['usertype'] == 'reseller') {
$usertypeoptions = $locate->Translate("Reseller") . '<input type="hidden" value="reseller" name="usertype" id="usertype" />';
} else {
$usertypeoptions = $locate->Translate("Group Admin") . '<input type="hidden" value="groupadmin" name="usertype" id="usertype" />';
}
} else {
$usertypeoptions = '<select id="usertype" name="usertype">';
$usertypeoptions .= '<option value="" ';
if ($account['usertype'] == '') {
$html .= ' selected ';
}
$usertypeoptions .= '></option>';
if ($_SESSION['curuser']['usertype'] == 'admin') {
$usertypeoptions .= '<option value="admin"';
if ($account['usertype'] == 'admin') {
$usertypeoptions .= ' selected ';
}
$usertypeoptions .= ' >' . $locate->Translate("Admin") . '</option>';
$usertypeoptions .= '<option value="reseller"';
if ($account['usertype'] == 'reseller') {
$usertypeoptions .= ' selected ';
}
$usertypeoptions .= ' >' . $locate->Translate("Reseller") . '</option>';
}
if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['usertype'] == 'reseller') {
$usertypeoptions .= '<option value="groupadmin"';
if ($account['usertype'] == 'groupadmin') {
$usertypeoptions .= ' selected ';
}
$usertypeoptions .= ' >' . $locate->Translate("Group Admin") . '</option>';
}
$usertypeoptions .= ' <option value="operator"';
if ($account['usertype'] == 'operator') {
$usertypeoptions .= ' selected ';
}
$usertypeoptions .= '>' . $locate->Translate("Operator") . '</option>';
$usertypeoptions .= '</select>';
}
$reselleroptions = '';
$reseller = astercrm::getAll('resellergroup');
if ($_SESSION['curuser']['usertype'] == 'admin') {
$reselleroptions .= '<select id="resellerid" name="resellerid" onchange="setGroup();">';
$reselleroptions .= '<option value="0"></option>';
while ($reseller->fetchInto($row)) {
if ($config['synchronize']['display_synchron_server']) {
$row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
}
if ($row['id'] == $account['resellerid']) {
$reselleroptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['resellername'] . "</OPTION>";
} else {
$reselleroptions .= "<OPTION value='" . $row['id'] . "' >" . $row['resellername'] . "</OPTION>";
//.........这里部分代码省略.........
示例5: setClid
function setClid($groupid)
{
global $locate, $config;
$objResponse = new xajaxResponse();
$res = astercrm::getAll("clid", 'groupid', $groupid);
//添加option
$objResponse->addScript("addOption('sltBooth','" . "0" . "','" . $locate->Translate("All") . "');");
while ($res->fetchInto($row)) {
if ($config['synchronize']['display_synchron_server']) {
$clidDisplay = astercrm::getSynchronDisplay($row['id'], $row['clid']);
}
$objResponse->addScript("addOption('sltBooth','" . $row['clid'] . "','" . $clidDisplay . "');");
}
$objResponse->addScript("addOption('sltBooth','-1','" . $locate->Translate("Callback") . "');");
return $objResponse;
}
示例6: formEdit
/**
* Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
*
* @param $id (int) Identificador del registro a ser editado.
* @return $html (string) Devuelve una cadena de caracteres que contiene la forma con los datos
* a extraidos de la base de datos para ser editados
*/
function formEdit($id)
{
global $locate, $config;
$group =& Customer::getRecordByID($id, 'accountgroup');
$reselleroptions = '';
$reseller = astercrm::getAll('resellergroup');
if ($_SESSION['curuser']['usertype'] == 'admin') {
$reselleroptions .= '<select id="resellerid" name="resellerid">';
$reselleroptions .= '<option value="0"></option>';
while ($reseller->fetchInto($row)) {
if ($config['synchronize']['display_synchron_server']) {
$row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
}
if ($row['id'] == $group['resellerid']) {
$reselleroptions .= "<OPTION value='" . $row['id'] . "' selected>" . $row['resellername'] . "</OPTION>";
} else {
$reselleroptions .= "<OPTION value='" . $row['id'] . "'>" . $row['resellername'] . "</OPTION>";
}
}
$reselleroptions .= '</select>';
//the admin has the reset group button
$resetBtnStr = '<input type="button" onclick="if(confirm("' . $locate->Translate("Make Sure To Reset The Relate Data By Group") . '?")) xajax_resetGroup("' . $group['id'] . '");return false;" value="' . $locate->Translate("Reset Group") . '">';
} else {
while ($reseller->fetchInto($row)) {
if ($row['id'] == $_SESSION['curuser']['resellerid']) {
if ($config['synchronize']['display_synchron_server']) {
$row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
}
$reselleroptions .= $row['resellername'] . '<input type="hidden" value="' . $row['id'] . '" name="resellerid" id="resellerid">';
break;
}
}
//except the admin,other don't have the reset group button
$resetBtnStr = '';
}
$html = '
<!-- No edit the next line -->
<form method="post" name="f" id="f">
<input type="hidden" id="groupid" name="groupid" value=' . $group['id'] . '>
<table border="1" width="100%" class="adminlist">
<tr>
<td nowrap align="left">' . $locate->Translate("Reseller") . '*</td>
<td align="left">' . $reselleroptions . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Group Name") . '*</td>
<td align="left"><input type="text" id="groupname" name="groupname" size="25" maxlength="30" value="' . $group['groupname'] . '"> ' . $resetBtnStr . '</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Title") . '</td>
<td align="left"><input type="text" id="grouptitle" name="grouptitle" size="25" maxlength="50" value="' . $group['grouptitle'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Tagline") . '</td>
<td align="left"><input type="text" id="grouptagline" name="grouptagline" size="25" maxlength="80" value="' . $group['grouptagline'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Account Code") . '</td>
<td align="left"><input type="text" id="accountcode" name="accountcode" size="25" maxlength="30" value="' . $group['accountcode'] . '">' . "(" . $locate->Translate("might be useful for callback") . ")" . '</td>
</tr>
<!--<tr>
<td nowrap align="left">' . $locate->Translate("Allow Callback") . '</td>
<td align="left">
<select id="allowcallback" name="allowcallback">';
if ($_SESSION['curuser']['usertype'] == 'admin' || $_SESSION['curuser']['allowcallback'] == 'yes') {
if ($group['allowcallback'] == "yes") {
$html .= '<option value="yes" selected>' . $locate->Translate("Yes") . '</option>';
$html .= '<option value="no">' . $locate->Translate("No") . '</option>';
} else {
$html .= '<option value="yes">' . $locate->Translate("Yes") . '</option>';
$html .= '<option value="no" selected>' . $locate->Translate("No") . '</option>';
}
} else {
$html .= '<option value="no">' . $locate->Translate("No") . '</option>';
}
$html .= '
</select>
</td>
</tr>-->
<tr>
<td nowrap align="left">' . $locate->Translate("Credit Limit") . '*</td>
<td align="left"><input type="text" id="creditlimit" name="creditlimit" size="25" maxlength="30" value="' . $group['creditlimit'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Cur Credit") . '</td>
<td align="left">
<input type="text" id="curcreditshow" name="curcreditshow" size="25" maxlength="100" value="' . $group['curcredit'] . '" readonly>
<input type="hidden" id="curcredit" name="curcredit" value="' . $group['curcredit'] . '">
</td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Operate") . '</td>
<td align="left" id="tdOperate">
//.........这里部分代码省略.........
示例7: searchRateHtml
function searchRateHtml($table, $type, $object)
{
global $db, $locate, $config;
if ($table == 'resellerrate') {
$sql = "SELECT {$table}.*,resellergroup.resellername FROM {$table} LEFT JOIN resellergroup ON resellergroup.id = {$table}.resellerid WHERE 1";
} else {
$sql = "SELECT {$table}.*,resellergroup.resellername,accountgroup.groupname FROM {$table} LEFT JOIN resellergroup ON resellergroup.id = {$table}.resellerid LEFT JOIN accountgroup ON accountgroup.id = {$table}.groupid WHERE 1";
}
$totalSql = "SELECT count(*) FROM {$table} WHERE 1 ";
$insertSql = "INSERT INTO {$table}_history SELECT * FROM {$table} WHERE 1 ";
$deleteSql = "DELETE FROM {$table} WHERE 1 ";
$tmpSql = '';
if ($type == 'all') {
$tmpSql .= " ";
} else {
if ($type == 'system') {
$tmpSql .= " AND {$table}.resellerid = 0 ";
} else {
if ($type == 'reseller') {
$tmpSql .= " AND {$table}.resellerid = '{$object}' ";
} else {
if ($type == 'group') {
if ($object == 'default') {
$tmpSql .= " AND {$table}.groupid = 0 ";
} else {
$tmpSql .= " AND {$table}.groupid = '{$object}' ";
}
}
}
}
}
$insertSql .= $tmpSql;
//search total rate by this conditions
Customer::events($totalSql . $tmpSql);
$totalRes =& $db->query($totalSql . $tmpSql);
$totalRes->fetchInto($totalResult, DB_FETCHMODE_ORDERED);
$deleteSql = $deleteSql . $tmpSql;
//delete sql
$sql = $sql . $tmpSql . " limit 20 ; ";
//show 20 data on the page
Customer::events($sql);
$result =& $db->query($sql);
// <input type="button" value="'.$locate->Translate("delete").'" onclick="if (confirm(\''.$locate->Translate("Are you sure you want to delete this rate").'?\')) xajax_deleteRate(document.getElementById(\'deleteSql\').value);return false;" />
$dataHtml = '<div>' . $locate->Translate('Rate Amount is') . ' ' . $totalResult[0] . ',' . $locate->Translate('default show 20 data') . '</div>
<table border="1" class="adminlist">
<tr>
<th width="" class="title">' . $locate->Translate('id') . '</th>
<th width="" class="title">' . $locate->Translate('prefix') . '</th>
<th width="" class="title">' . $locate->Translate('length') . '</th>
<th width="" class="title">' . $locate->Translate('destination') . '</th>
<th width="" class="title">' . $locate->Translate('connect_charge') . '</th>
<th width="" class="title">' . $locate->Translate('init_block') . '</th>
<th width="" class="title">' . $locate->Translate('rate') . '</th>
<th width="" class="title">' . $locate->Translate('billing_block') . '</th>
<th width="" class="title">' . $locate->Translate('group') . '</th>
<th width="" class="title">' . $locate->Translate('reseller') . '</th>
<th width="" class="title">' . $locate->Translate('addtime') . '</th>
</tr>';
$i = 0;
while ($result->fetchInto($row)) {
$j = 0;
if ($i % 2 == 0) {
$j = 1;
}
if ($config['synchronize']['display_synchron_server']) {
$html .= astercrm::getSynchronDisplay($row['id'], $row['id']);
}
$dataHtml .= '<tr class="row' . $j . '" id="gridRow' . $i . '">
<td style="cursor: pointer;" id="gridRow1Col1">' . $row['id'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col2">' . $row['dialprefix'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col3">' . $row['numlen'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col4">' . $row['destination'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col5">' . $row['connectcharge'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col6">' . $row['initblock'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col7">' . $row['rateinitial'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col8">' . $row['billingblock'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col9">' . $row['groupname'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col10">' . $row['resellername'] . '</td>
<td style="cursor: pointer;" id="gridRow1Col11">' . $row['addtime'] . '</td>
</tr>';
}
$dataHtml .= '</table><input type="hidden" id="deleteSql" value="' . $deleteSql . '" /><input type="hidden" id="historySql" value="' . $insertSql . '" />';
return $dataHtml;
}
示例8: formEdit
/**
* Imprime la forma para editar un nuevo registro sobre el DIV identificado por "formDiv".
*
* @param $id (int) Identificador del registro a ser editado.
* @return $html (string) Devuelve una cadena de caracteres que contiene la forma con los datos
* a extraidos de la base de datos para ser editados
*/
function formEdit($id)
{
global $locate, $config;
$rate =& Customer::getRecordByID($id, 'resellerrate');
$reseller = astercrm::getAll('resellergroup');
$options .= '<select id="resellerid" name="resellerid">';
$flag = false;
while ($reseller->fetchInto($row)) {
if ($config['synchronize']['display_synchron_server']) {
$row['resellername'] = astercrm::getSynchronDisplay($row['id'], $row['resellername']);
}
if ($row['id'] == $rate['resellerid']) {
$options .= "<OPTION value='" . $row['id'] . "' selected>" . $row['resellername'] . "</OPTION>";
$flag = true;
} else {
$options .= "<OPTION value='" . $row['id'] . "'>" . $row['resellername'] . "</OPTION>";
}
}
if ($flag == true) {
$options .= "<OPTION value='0'>" . $locate->Translate("All") . "</OPTION>";
} else {
$options .= "<OPTION value='0' selected>" . $locate->Translate("All") . "</OPTION>";
}
$options .= '</select>';
$html = '
<!-- No edit the next line -->
<form method="post" name="f" id="f">
<table border="1" width="100%" class="adminlist">
<tr>
<td nowrap align="left">' . $locate->Translate("Prefix") . '</td>
<td align="left"><input type="hidden" id="id" name="id" value="' . $rate['id'] . '"><input type="text" id="dialprefix" name="dialprefix" size="25" maxlength="30" value="' . $rate['dialprefix'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Length") . '</td>
<td align="left"><input type="text" id="numlen" name="numlen" size="10" maxlength="10" value="' . $rate['numlen'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Dest") . '</td>
<td align="left"><input type="text" id="destination" name="destination" size="25" maxlength="30" value="' . $rate['destination'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Connect Charge") . '</td>
<td align="left"><input type="text" id="connectcharge" name="connectcharge" size="20" maxlength="20" value="' . $rate['connectcharge'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Init Block") . '</td>
<td align="left"><input type="text" id="initblock" name="initblock" size="25" maxlength="100" value="' . $rate['initblock'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Rate") . '</td>
<td align="left"><input type="text" id="rateinitial" name="rateinitial" size="25" maxlength="30" value="' . $rate['rateinitial'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Billing Block") . '</td>
<td align="left"><input type="text" id="billingblock" name="billingblock" size="25" maxlength="30" value="' . $rate['billingblock'] . '"></td>
</tr>
<tr>
<td nowrap align="left">' . $locate->Translate("Reseller") . '</td>
<td align="left">
' . $options . '
</td>
</tr>
<tr>
<td colspan="2" align="center"><button id="submitButton" onClick=\'xajax_update(xajax.getFormValues("f"));return false;\'>' . $locate->Translate("Continue") . '</button></td>
</tr>
</table>
';
$html .= '
</form>
*' . $locate->Translate("obligatory_fields") . '
';
return $html;
}