本文整理汇总了PHP中xajaxResponse::addRemove方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::addRemove方法的具体用法?PHP xajaxResponse::addRemove怎么用?PHP xajaxResponse::addRemove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xajaxResponse
的用法示例。
在下文中一共展示了xajaxResponse::addRemove方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeInput
function removeInput($aInputData)
{
$sId = $aInputData['inputId'];
$objResponse = new xajaxResponse();
$objResponse->addRemove($sId);
return $objResponse->getXML();
}
示例2: skill_study
/**
* 技能学习
*/
function skill_study($skill, $buildid)
{
global $db, $phpEx, $phpbb_root_path, $user;
$objResponse = new xajaxResponse();
if (!$user->data['is_registered']) {
$objResponse->addScript("location.reload();");
} else {
$sql = 'SELECT * FROM ' . BUILD_INFO . ' WHERE build_id=' . $buildid;
$result = $db->sql_query($sql);
$buildinfo = array();
if ($row = $db->sql_fetchrow($result)) {
$buildinfo = $row;
} else {
return $objResponse->getXML();
}
$db->sql_freeresult($result);
$sql = 'SELECT skills.*,sys_skills.*,user_skills.* FROM ' . CONFRATERNITY_SKILLS . ' skills
LEFT JOIN ' . SYSTEM_SKILLS . ' sys_skills ON(skills.skillid=sys_skills.skill_id)
LEFT JOIN ' . USERS_SKILLS . ' user_skills ON(skills.skillid=user_skills.skill_id AND user_id=' . $user->data['user_id'] . ')
WHERE skills.skillid=' . $skill . ' AND skills.buildid=' . $buildinfo['build_id'] . ' AND sys_skills.sysbuild =' . $buildinfo['system_type'];
$result = $db->sql_query($sql);
if ($row = $db->sql_fetchrow($result)) {
//如果已经拥有了技能,不用学习
if ($row['skill_lv'] > 0) {
return $objResponse->getXML();
}
if ($user->data['u_copper_coin'] < $row['price_c'] && $user->data['u_silver_coin'] < $row['price_s'] && $user->data['u_gold_coin'] < $row['price_g']) {
$objResponse->addScript("msg(\"" . $user->lang['NO_CCOIN'] . "\")");
return $objResponse->getXML();
}
$db->sql_transaction('begin');
//符合要求,处理技能学习
//扣用户的钱
$sql = 'UPDATE ' . USER_EXINFO . ' SET u_copper_coin=u_copper_coin-' . $row['price_c'] . ',u_silver_coin=u_silver_coin-' . $row['price_s'] . ' ,u_gold_coin=u_gold_coin-' . $row['price_g'] . ' WHERE user_id=' . $user->data['user_id'];
$db->sql_query($sql);
//添加技能到用户表
$sql = 'INSERT INTO ' . USERS_SKILLS . '(skill_id,user_id,skill_lv,sys_build)
VALUES(' . $row['skillid'] . ',' . $user->data['user_id'] . ',1,' . $row['sysbuild'] . ')';
$db->sql_query($sql);
$db->sql_transaction('commit');
$objResponse->addScript("msg(\"" . $user->lang['STUDY_SKILL_SUCESS'] . "\")");
$objResponse->addRemove("skillli" . $row['skillid']);
} else {
//不符合要求,提示错误信息
return $objResponse->getXML();
}
$db->sql_freeresult($result);
}
return $objResponse->getXML();
}
示例3: getPrivateDialListNumber
/**
* show phone numbers and dial button if there are phone numbers assigned to this agent
* in diallist table
* @param extension string extension
* @return object xajax response object
*/
function getPrivateDialListNumber($extension = null)
{
global $locate, $db;
$objResponse = new xajaxResponse();
$count = astercrm::getDialNumCountByAgent($extension);
if ($count == 0) {
$objResponse->addAssign("spanDialList", "innerHTML", $locate->Translate("no_dial_list"));
$objResponse->addAssign("divWork", "innerHTML", '');
$objResponse->addAssign("btnWorkStatus", "value", "");
$objResponse->addAssign("btnWork", "value", $locate->Translate("Start work"));
$objResponse->addAssign("btnWork", "disabled", true);
$_SESSION['curuser']['WorkStatus'] = '';
} else {
// add div
$objResponse->addRemove("spanDialListRecords");
$objResponse->addRemove("btnGetAPhoneNumber");
$objResponse->addCreate("spanDialList", "div", "spanDialListRecords");
$objResponse->addAssign("spanDialListRecords", "innerHTML", $locate->Translate("records_in_dial_list_table") . $count);
// add start campaign button
$objResponse->addCreateInput("spanDialList", "button", "btnGetAPhoneNumber", "btnGetAPhoneNumber");
$objResponse->addAssign("btnGetAPhoneNumber", "value", $locate->Translate("get_a_phone_number"));
$objResponse->addEvent("btnGetAPhoneNumber", "onclick", "btnGetAPhoneNumberOnClick();");
if ($_SESSION['curuser']['WorkStatus'] == '') {
$objResponse->addAssign("btnWorkStatus", "value", "");
$objResponse->addAssign("btnWork", "value", $locate->Translate("Start work"));
$objResponse->addAssign("btnWork", "disabled", false);
}
}
return $objResponse;
}
示例4: step1_selectGroup
function step1_selectGroup($group_id)
{
$_SESSION['group_id'] = $group_id;
$objResponse = new xajaxResponse(CHARSET);
if (empty($_SESSION['group_id'])) {
$objResponse->loadXML(reload('step2'));
} else {
$objResponse->loadXML(step1_HideGroups($group_id));
$objResponse->loadXML(step1_ShowProducts($group_id));
$objResponse->addRemove("group_id" . $group_id);
}
return $objResponse;
}
示例5: setFreeCall
function setFreeCall($id, $hiddenrecord, $note, $total, $discount)
{
global $db;
//$discount = 0.5;
$objResponse = new xajaxResponse();
$query = "SELECT * FROM mycdr WHERE id = {$id}";
$row = $db->getRow($query);
//print_r($row);exit;
if ($row['credit'] > 0 && $row['setfreecall'] != 'yes') {
$total = $total - $row['credit'];
}
$query = "UPDATE mycdr SET note = '" . $note . "', setfreecall = 'yes' WHERE id = {$id}";
if ($db->query($query)) {
if ($hiddenrecord == 'true') {
$objResponse->addRemove('rcdr-' . $id);
} else {
$objResponse->addAssign("rprice-" . $id, "innerHTML", '0.00');
$objResponse->addAssign("rcdr-" . $id, "style.background", '#d5c59f');
}
}
$total_price = $total * (1 - $discount);
$total_price = astercc::creditDigits($total_price, 2);
$objResponse->addAssign("total_price", "innerHTML", $total_price);
$objResponse->addAssign("total_price_ori", "value", $total);
$objResponse->addAssign("formDiv", "style.visibility", "hidden");
$objResponse->addAssign("formDiv", "innerHTML", '');
return $objResponse;
}
示例6: reloadSip
function reloadSip()
{
global $locate;
$objResponse = new xajaxResponse();
if ($_SESSION['curuser']['usertype'] == 'reseller' || $_SESSION['curuser']['usertype'] == 'admin') {
$myAsterisk = new Asterisk();
$myAsterisk->execute("sip reload");
$objResponse->addAlert($locate->Translate("sip conf reloaded"));
$objResponse->addAssign('msgZone', 'innerHTML', ' ');
$objResponse->addRemove('reload');
}
return $objResponse;
}