本文整理汇总了PHP中xajaxResponse::setReturnValue方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::setReturnValue方法的具体用法?PHP xajaxResponse::setReturnValue怎么用?PHP xajaxResponse::setReturnValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xajaxResponse
的用法示例。
在下文中一共展示了xajaxResponse::setReturnValue方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: eventHandlerThree
function eventHandlerThree()
{
$objResponse = new xajaxResponse();
$objResponse->append('log', 'innerHTML', 'Message from event handler three.<br />');
$objResponse->setReturnValue('return value from event handler three.');
return $objResponse;
}
示例2: instructions
function instructions()
{
$smarty = new TestSmarty();
$objResponse = new xajaxResponse();
$template = $smarty->fetch('instructions.tpl');
$objResponse->setReturnValue($template);
return $objResponse;
}
示例3: practice
function practice($subject_code, $type_code)
{
$objResponse = new xajaxResponse();
$this->load->model('Angular_online_exam_model');
$duration = $this->Angular_online_exam_model->durationFetch($subject_code, $type_code);
//Seconds Conversion
if (!empty($duration)) {
$duration = $duration * 60;
}
$objResponse->setReturnValue($duration);
return $objResponse;
}
示例4: showOutput
function showOutput()
{
$testResponse = new xajaxResponse();
$testResponse->alert("Hello");
$testResponse2 = new xajaxResponse();
$testResponse2->loadCommands($testResponse);
$testResponse2->replace("this", "is", "a", "replacement]]>");
$testResponseOutput = htmlspecialchars($testResponse2->getOutput());
$objResponse = new xajaxResponse();
$objResponse->assign("submittedDiv", "innerHTML", $testResponseOutput);
$aValues = array();
$aValues[] = "Yippie";
$objResponse->setReturnValue($aValues);
return $objResponse;
}
示例5: questionFetch
function questionFetch($subject_code, $type_code)
{
$objResponse = new xajaxResponse();
$this->load->model('Angular_online_exam_model');
$questions = $this->Angular_online_exam_model->questionFetch($subject_code, $type_code);
$formattedQuestions;
foreach ($questions as $key => $value) {
$formattedQuestions[$key]['id'] = $key + 1;
$formattedQuestions[$key]['question'] = $value['questions'];
$formattedQuestions[$key]['option1'] = $value['option1'];
$formattedQuestions[$key]['option2'] = $value['option2'];
$formattedQuestions[$key]['option3'] = $value['option3'];
$formattedQuestions[$key]['option4'] = $value['option4'];
$formattedQuestions[$key]['answer'] = 'nill';
}
$objResponse->setReturnValue($formattedQuestions);
return $objResponse;
}
示例6: eliminarArchivo
function eliminarArchivo($nombreArchivo)
{
#Instanciamos el objeto para generar la respuesta con ajax.
$output = new xajaxResponse();
$path = "/home/silvia.valdez/public_html/ECG/tmp/";
$archivo = $path . $nombreArchivo;
if (file_exists($archivo)) {
unlink($archivo);
$output->setReturnValue(true);
} else {
$output->setReturnValue(false);
}
return $output;
}
示例7: sync_test
function sync_test()
{
$objResponse = new xajaxResponse();
$objResponse->setReturnValue('hello world');
return $objResponse;
}
示例8: xajaxResponse
function descargarSeñal($anot, $tabla, $indice1, $incremento, $nombreArchivo)
{
#Instanciamos el objeto para generar la respuesta con ajax.
$output = new xajaxResponse();
conectar();
#Parámetros de subsecuencia_arr: (NombreCampo, ValorInicial, NumDeValoresAconsultar)
$result4 = pg_query("SELECT (subsecuencia_arr(signal,{$indice1},{$incremento})).f1,(subsecuencia_arr(signal,{$indice1},{$incremento})).f2 FROM derivacion WHERE id={$tabla}");
if ($anot) {
$result5 = pg_query("SELECT indice, nota FROM anotacion WHERE indice IN (SELECT (subsecuencia_arr(signal,{$indice1},{$incremento})).f1 FROM derivacion WHERE id={$tabla}) AND id_derivacion={$tabla}");
}
desconectar();
#Guardar señal en un array.
$i = 0;
while ($row = pg_fetch_assoc($result4)) {
#Guardar los datos en un array bidimensional.
$s[$i][0] = (int) $row['f1'];
#Índice.
$s[$i][1] = (double) $row['f2'];
#Voltaje.
$i++;
}
if ($anot) {
#Guardar anotaciones.
$i = 0;
while ($row = pg_fetch_assoc($result5)) {
#Guardar los datos en un array bidimensional.
$a[$i][0] = (int) $row['indice'];
$a[$i][1] = $row['nota'];
$i++;
}
#Guarda en un arreglo el resultado de ambas consultas.
for ($i = 0; $i < count($s); $i++) {
for ($k = 0; $k < count($a); $k++) {
#Si el índice actual coincide con el de una anotación:
if ($s[$i][0] == $a[$k][0]) {
$s[$i][2] = obtenerAnotacion($a[$k][1]);
#Nota.
break;
} else {
#En caso de no haber anotación, escribe "-".
$s[$i][2] = "-";
}
}
}
}
escribirArchivo($s, $anot, $nombreArchivo);
#$output->alert("OK!");
#Retornamos la salida XAJAX.
$output->setReturnValue(true);
return $output;
}
示例9: cargaDerivacion
function cargaDerivacion($selectDestino, $opcionSeleccionada)
{
#Instanciamos el objeto para generar la respuesta con ajax.
$output = new xajaxResponse();
if ($output->call('xajax_validaSelect', $selectDestino, $opcionSeleccionada)) {
conectar();
$query = pg_query("SELECT id, posicion FROM derivacion WHERE id_electrocardiografia={$opcionSeleccionada}") or die("Error");
desconectar();
$i = 0;
$j = 0;
while ($row = pg_fetch_assoc($query)) {
#Guardar los datos en un array bidimensional.
$d[$i][$j] = $row['id'];
$j++;
$d[$i][$j] = $row['posicion'];
$j = 0;
$i++;
}
$output->setReturnValue($d);
}
return $output;
}
示例10: updatedata
function updatedata($table, $part, $data, $id = NULL)
{
//global $tpl;
global $memcache;
global $l;
global $tpl;
global $user_data;
global $getmonth;
$objResponse = new xajaxResponse();
//include('settings/template.php');
include 'settings/tables.php';
if ($user_data == '') {
require_once 'lib/functions/get_userdata.php';
}
//update progress state of a goal
if ($table == $tbl_goals && $part == 'progress') {
require_once 'lib/functions/convert_date.php';
$goals = new ModifyEntry();
$goals->table = $table;
switch ($data) {
case 0:
$progress = 0;
break;
case 1:
$progress = 20;
break;
case 2:
$progress = 40;
break;
case 3:
$progress = 50;
break;
case 4:
$progress = 60;
break;
case 5:
$progress = 80;
break;
case 6:
$progress = 100;
break;
}
$achieved_date = date('Y-m-d H:i:s', time());
if ($progress == 100) {
$goals->changes = " progress = '" . $progress . "', achieved = '" . $achieved_date . "' ";
} else {
$goals->changes = " progress = '" . $progress . "', achieved = '' ";
}
$goals->condition = " ID = '{$id}' ";
$goals->update();
unset($goals);
$ay_goals["progress"] = $progress;
$ay_goals["achieved"] = convert_date($achieved_date, 0, $getmonth);
$tpl->assign('goal', $ay_goals);
$html = $tpl->fetch("modules/improve/goals/achieved.tpl");
$objResponse->assign("achieved_" . $id, "innerHTML", $html);
//no refresh necessary as dropdown has latest change
} elseif ($table == $tbl_goals && $part == 'update_entry') {
$goals = new ModifyEntry();
$goals->table = $table;
$ay_entry['entry_org'] = strip_tags($data);
// $diary->changes = " entry = '".$data['edit_entry_inp']."' ";
$goals->changes = " goal = '" . $ay_entry['entry_org'] . "' ";
$goals->condition = " ID = '{$id}' ";
$goals->update();
unset($goals);
$objResponse->setReturnValue($ay_entry);
} elseif ($table == $tbl_distorted_thoughts && $part == 'update_entry') {
$thoughts = new ModifyEntry();
$thoughts->table = $table;
$get_values = explode("%%%!", $data);
$ay_entry['thought'] = strip_tags($get_values[0]);
$ay_entry['response'] = strip_tags($get_values[1]);
$ay_entry['action'] = strip_tags($get_values[2]);
// $diary->changes = " entry = '".$data['edit_entry_inp']."' ";
$thoughts->changes = " thought = '" . $ay_entry['thought'] . "', response = '" . $ay_entry['response'] . "', action = '" . $ay_entry['action'] . "' ";
$thoughts->condition = " ID = '{$id}' ";
$thoughts->update();
unset($thoughts);
$objResponse->setReturnValue($ay_entry);
} elseif ($table == $tbl_distorted_thoughts && $part == 'update_status') {
$thoughts = new ModifyEntry();
$thoughts->table = $table;
// $diary->changes = " entry = '".$data['edit_entry_inp']."' ";
$thoughts->changes = " status = '" . $data . "' ";
$thoughts->condition = " ID = '{$id}' ";
$thoughts->update();
unset($thoughts);
} elseif ($table == $tbl_users && $part == 'update_desc') {
$update_desc = new ModifyEntry();
$update_desc->table = $table;
//$desc_me = mysql_real_escape_string($data['desc_me']);
$update_desc->changes = " description = '" . $data['desc_me'] . "' ";
$update_desc->condition = " ID = '" . $user_data['ID'] . "' ";
$update_desc->update();
unset($update_desc);
//update cached user object
// $mem_key1 = "user_data_".$l["token"];
$user_data['description'] = $data['desc_me'];
if (mod_memcache == 1) {
//.........这里部分代码省略.........