本文整理汇总了PHP中AjaxResponse::addtext方法的典型用法代码示例。如果您正苦于以下问题:PHP AjaxResponse::addtext方法的具体用法?PHP AjaxResponse::addtext怎么用?PHP AjaxResponse::addtext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AjaxResponse
的用法示例。
在下文中一共展示了AjaxResponse::addtext方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: saveOrder
function saveOrder($xmlsd)
{
global $reporterOrderTable, $readerOrderTable, $editorOrderTable;
$response = new AjaxResponse();
$response->setContentType('text/plain');
$xmlstr = '' . html_entity_decode($xmlsd);
$dbr =& wfGetDB(DB_WRITE);
$xml = new SimpleXMLElement($xmlstr);
//delete all in table
$result = $dbr->delete($editorOrderTable, "*");
$result = $dbr->delete($readerOrderTable, "*");
$result = $dbr->delete($reporterOrderTable, "*");
foreach ($xml->children() as $child) {
if ($child->getName() == 'Editor') {
$sql = 'INSERT INTO ' . $editorOrderTable . ' (id, rank) VALUES (' . $child['id'] . ',' . $child['rank'] . ')';
$result = $dbr->query($sql);
} elseif ($child->getName() == 'Reader') {
$sql = 'INSERT INTO ' . $readerOrderTable . ' (id, rank) VALUES (' . $child['id'] . ',' . $child['rank'] . ')';
$result = $dbr->query($sql);
} elseif ($child->getName() == 'Reporter') {
$sql = 'INSERT INTO ' . $reporterOrderTable . ' (id, rank) VALUES (' . $child['id'] . ',' . $child['rank'] . ')';
$result = $dbr->query($sql);
}
}
$response->addtext("Changes Saved");
return $response;
}
示例2: wfGetDB
function get_assigned($sitting_id)
{
global $reportersTable, $sitting_reporter;
$dbr =& wfGetDB(DB_SLAVE);
//$sql = 'SELECT * FROM '.$reportersTable.' WHERE id IN ( SELECT reporter_id FROM '.$sitting_reporter.' WHERE sitting_id='.$sitting_id.')';
$sql = 'SELECT ug_user FROM user_groups WHERE ug_user IN (SELECT user_id FROM sitting_assignment WHERE sitting_id=' . $sitting_id . ') and ug_group="reporter"';
$reporters = $dbr->query($sql);
$xml = new AjaxResponse();
$xml->setContentType('text/xml');
$xml->addtext('<' . '?xml version="1.0" encoding="utf-8" ?' . ">");
$xml->addtext('<Response>' . "");
while ($rowReporters = $dbr->fetchobject($reporters)) {
$user = User::newFromId($rowReporters->ug_user);
$name = $user->getRealName();
$xml->addtext('<Reporter id="' . $rowReporters->ug_user . '" name="' . $name . '">');
$xml->addtext('</Reporter>');
}
$xml->addtext('</Response>');
return $xml;
}
示例3: save
function save($xmlstr)
{
global $reportersAssignmentTable;
$response = new AjaxResponse();
$response->setContentType('text/plain');
$xmlsd = "" . html_entity_decode($xmlstr);
$dbr =& wfGetDB(DB_WRITE);
$xml = new SimpleXMLElement($xmlsd);
$result = $dbr->delete($reportersAssignmentTable, "*");
foreach ($xml->children() as $reader) {
$reader_id = $reader['id'];
foreach ($ed->children() as $reporter) {
$reporter_id = $reporter['id'];
$sql2 = 'INSERT INTO ' . $reportersAssignmentTable . ' (reader_id, reporter_id) VALUES (' . $reader_id . ',' . $reporter_id . ')';
$result = $dbr->query($sql2);
}
}
$response->addtext("Changes Saved");
return $response;
}
示例4: wfGetDB
function get_workload($id)
{
global $sitting_editor, $mvSittingsTable;
$dbr =& wfGetDB(DB_SLAVE);
$sittings = $dbr->select($dbr->tablename(sitting_assignment), '*', array('user_id' => $id));
$xml = new AjaxResponse();
$xml->setContentType('text/xml');
$xml->addtext('<' . '?xml version="1.0" encoding="utf-8" ?' . ">");
$xml->addtext('<Response>' . "");
while ($row = $dbr->fetchobject($sittings)) {
$sit = $dbr->select($mvSittingsTable, '*', array('id' => $row->sitting_id));
$row2 = $dbr->fetchobject($sit);
$xml->addtext('<Sitting id="' . $row2->id . '" name="' . $row2->name . '">');
$xml->addtext('</Sitting>');
}
$xml->addtext('</Response>');
return $xml;
}
示例5: AjaxResponse
function save_staff($xmldata, $sitting_id)
{
global $sitting_reader, $sitting_editor, $sitting_reporter;
$response = new AjaxResponse();
$response->setContentType('text/plain');
$xmlsd = "" . html_entity_decode($xmldata);
$dbr =& wfGetDB(DB_WRITE);
$xml = new SimpleXMLElement($xmlsd);
$result = $dbr->delete($dbr->tableName(sitting_assignment), array('sitting_id' => $sitting_id));
foreach ($xml->children() as $child) {
$name = $child->getName();
if ($name == 'AssignedEditors') {
foreach ($child->children() as $editor) {
$editor_id = $editor['id'];
$sql2 = 'INSERT INTO sitting_assignment (user_id, sitting_id) VALUES (' . $editor_id . ',' . $sitting_id . ')';
$result = $dbr->query($sql2);
}
} else {
if ($name == 'AssignedReaders') {
foreach ($child->children() as $reader) {
$reader_id = $reader['id'];
$sql2 = 'INSERT INTO sitting_assignment (user_id, sitting_id) VALUES (' . $reader_id . ',' . $sitting_id . ')';
$result = $dbr->query($sql2);
}
} else {
if ($name == 'AssignedReporters') {
foreach ($child->children() as $reporter) {
$reporter_id = $reporter['id'];
$sql2 = 'INSERT INTO sitting_assignment (user_id, sitting_id) VALUES (' . $reporter_id . ',' . $sitting_id . ')';
$result = $dbr->query($sql2);
}
}
}
}
}
$response->addtext("Changes Saved");
return $response;
}