コード例 #1
1
function testForm($formData)
{
    $objResponse = new xajaxResponse();
    $objResponse->alert("formData: " . print_r($formData, true));
    $objResponse->assign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)));
    return $objResponse;
}
コード例 #2
0
function save_event_type($forms)
{
    global $DB, $SMARTY, $action, $RE;
    $obj = new xajaxResponse();
    $blad = false;
    $form = $forms['eventtype'];
    $obj->script("removeClassid('id_name','alerts');");
    $obj->assign("id_name_alerts", "innerHTML", "");
    if (empty($form['name'])) {
        $blad = true;
        $obj->script("addClassId('id_name','alerts');");
        $obj->assign("id_name_alerts", "innerHTML", "nazwa jest wymagana");
        $obj->script("document.getElementById('id_name').focus();");
    } elseif ($RE->CheckIssetDictionaryEvent($form['name'], $form['id'] ? $form['id'] : NULL)) {
        $blad = true;
        $obj->script("addClassId('id_name','alerts');");
        $obj->assign("id_name_alerts", "innerHTML", "podane zadrzenie już istnieje");
        $obj->script("document.getElementById('id_name').focus();");
    }
    if (!$blad) {
        if (isset($form['id']) && !empty($form['id'])) {
            $RE->updateDictionaryEvent($form);
        } else {
            $RE->addDictionaryEvent($form);
        }
        $obj->script("self.location.href='?m=re_dictionaryevent';");
    }
    return $obj;
}
コード例 #3
0
ファイル: sortdata.php プロジェクト: nbgmaster/happify
function sortdata($table, $column, $direction)
{
    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';
    }
    if ($table == $tbl_goals) {
        //define sort column
        $goals_order = $column . " " . $direction;
        include "lib/functions/fetch_goals.php";
        $tpl->assign('ay_goals', $ay_goals);
        //define direction DESC or ASC
        if ($direction == 'DESC') {
            $tpl->assign("sort_" . $column, 'ASC');
        } else {
            $tpl->assign("sort_" . $column, 'DESC');
        }
        //update template
        $html = $tpl->fetch('modules/improve/goals/sort_' . $column . '.tpl');
        $objResponse->assign("sortdiv_" . $column, "innerHTML", $html);
        $html2 = $tpl->fetch("modules/improve/goals/goal_entries.tpl");
        $objResponse->assign("goal_entries", "innerHTML", $html2);
    }
    return $objResponse;
}
コード例 #4
0
/**
 * set the html for user settings page
 * this function is registered in xajax
 * @return xajaxResponse every xajax registered function needs to return this object
 */
function action_get_user_settings_page()
{
    global $logging;
    global $user;
    global $user_settings_table_configuration;
    global $firstthingsfirst_portal_title;
    global $user_start_time_array;
    $logging->info("USER_ACTION " . __METHOD__ . " (user="******")");
    # store start time
    $user_start_time_array[__METHOD__] = microtime(TRUE);
    # create necessary objects
    $result = new Result();
    $response = new xajaxResponse();
    $html_database_table = new HtmlDatabaseTable($user_settings_table_configuration);
    # create an array with selection of fields that user may change
    $db_fields_array = array(DB_ID_FIELD_NAME, USER_NAME_FIELD_NAME, USER_PW_FIELD_NAME, USER_LANG_FIELD_NAME, USER_DATE_FORMAT_FIELD_NAME, USER_DECIMAL_MARK_FIELD_NAME, USER_LINES_PER_PAGE_FIELD_NAME, USER_THEME_FIELD_NAME);
    $user_record_key_string = DatabaseTable::_get_encoded_key_string(array(DB_ID_FIELD_NAME => $user->get_id()));
    # set page, title, explanation and navigation
    $response->assign("page_title", "innerHTML", translate("LABEL_USER_SETTINGS_TITLE"));
    $response->assign("navigation_container", "innerHTML", get_page_navigation(PAGE_TYPE_USER_SETTINGS));
    $html_database_table->get_page(translate("LABEL_USER_SETTINGS_TITLE"), $result);
    $response->assign("main_body", "innerHTML", $result->get_result_str());
    # get action pane for current user
    $html_database_table->get_record($user, USER_TABLE_NAME, $user_record_key_string, $db_fields_array, $result);
    $response->custom_response->assign_with_effect("action_pane", $result->get_result_str());
    # set footer
    $response->assign("footer_text", "innerHTML", " ");
    # check post conditions
    if (check_postconditions($result, $response) == FALSE) {
        return $response;
    }
    # log total time for this function
    $logging->info(get_function_time_str(__METHOD__));
    return $response;
}
コード例 #5
0
function dictionary_devices_save($forms = NULL)
{
    global $DB, $SMARTY;
    $form = $forms['editdictionarydevices'];
    $obj = new xajaxResponse();
    $obj->script("removeClassId('id_edit_dictionary_devices_type','alerts');");
    $obj->assign("id_alerts", "innerHTML", "");
    $blad = false;
    if (empty($form['type'])) {
        $blad = true;
        $obj->script("addClassId('id_edit_dictionary_devices_type','alerts');");
    }
    if (!$blad && !$form['id']) {
        $tmp = $DB->GetOne('SELECT 1 FROM dictionary_devices_client WHERE type = ? ' . $DB->Limit(1) . ' ;', array(strtoupper($form['type'])));
        if ($tmp) {
            $obj->assign("id_alerts", "innerHTML", "W słowniku już istnieje taki wpis");
        } else {
            $DB->Execute('INSERT INTO dictionary_devices_client (type,description) VALUES (?,?) ;', array(strtoupper($form['type']), $form['description'] ? $form['description'] : NULL));
            $obj->script("self.location.href='?m=dictionarydevices';");
        }
    }
    if (!$blad && $form['id']) {
        $tmp = $DB->GetOne('SELECT 1 FROM dictionary_devices_client WHERE type = ? AND id!=? ' . $DB->Limit(1) . ' ;', array(strtoupper($form['type']), $form['id']));
        if ($tmp) {
            $obj->assign("id_alerts", "innerHTML", "W słowniku już istnieje taki wpis");
        } else {
            $DB->Execute('UPDATE dictionary_devices_client SET type=?, description=? WHERE id=? ;', array(strtoupper($form['type']), $form['description'] ? $form['description'] : NULL, $form['id']));
            $obj->script("self.location.href='?m=dictionarydevices';");
        }
    }
    return $obj;
}
コード例 #6
0
ファイル: ajax.php プロジェクト: jlobaton/inventario
function procesarFormContactanos($form_values)
{
    $respuestaXajax = new xajaxResponse();
    $datos['nombre'] = $form_values['nombre'];
    $datos['empresa'] = $form_values['empresa'];
    $datos['correo'] = $form_values['correo'];
    $datos['telefono'] = $form_values['telefono'];
    $datos['mensaje'] = $form_values['mensaje'];
    $email = '*****@*****.**';
    $to = "*****@*****.**";
    $asunto = "Consulta Web TLI";
    $headers .= "Reply-To: " . $email . " \r\n";
    $headers .= "From: " . $email . " \n";
    //mando el correo...
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-type: text/html; charset=utf-8\r\n";
    if (!empty($email)) {
        mail($to, $asunto, $codhtml, $headers);
        //echo "si";
    }
    //enviarcorreo($datos);
    $cadena = "<div class='mensaje'>Hola {$nombre}, tu correo ha sido enviado.<br/> <br/>Gracias por contactarnos.</div>";
    //$respuestaXajax->assign("formcont","innerHTML", $cadena);
    $respuestaXajax->assign("formcont", "innerHTML", $cadena);
    $respuestaXajax->assign("formcont", "innerHTML", $cadena);
    return $respuestaXajax;
}
コード例 #7
0
/**
 * set the html for user admin page
 * this function is registered in xajax
 * @return xajaxResponse every xajax registered function needs to return this object
 */
function action_get_user_admin_page()
{
    global $logging;
    global $user;
    global $user_admin_table_configuration;
    global $user_start_time_array;
    $logging->info("USER_ACTION " . __METHOD__ . " (user="******")");
    # store start time
    $user_start_time_array[__METHOD__] = microtime(TRUE);
    # create necessary objects
    $result = new Result();
    $response = new xajaxResponse();
    $html_database_table = new HtmlDatabaseTable($user_admin_table_configuration);
    # set page, title, explanation and navigation
    $response->assign("page_title", "innerHTML", translate("LABEL_USER_ADMIN_TITLE"));
    $response->assign("navigation_container", "innerHTML", get_page_navigation(PAGE_TYPE_USER_ADMIN));
    $html_database_table->get_page(translate("LABEL_USER_ADMIN_TITLE"), $result);
    $response->assign("main_body", "innerHTML", $result->get_result_str());
    # set content
    $html_database_table->get_content($user, HTML_NO_LIST_PERMISSION_CHECK, "", DATABASETABLE_UNKWOWN_PAGE, $result);
    $response->custom_response->assign_with_effect(PORTAL_CSS_NAME_PREFIX . "content_pane", $result->get_result_str());
    # set action pane
    $html_str = $html_database_table->get_action_bar(USER_TABLE_NAME, "");
    $response->custom_response->assign_and_show("action_pane", $html_str);
    # set footer
    $response->assign("footer_text", "innerHTML", "&nbsp;");
    # check post conditions
    if (check_postconditions($result, $response) == FALSE) {
        return $response;
    }
    # log total time for this function
    $logging->info(get_function_time_str(__METHOD__));
    return $response;
}
コード例 #8
0
function editorigin_save($forms = NULL)
{
    global $DB;
    $obj = new xajaxResponse();
    $blad = false;
    $form = $forms['editorigin'];
    (int) $form['id'];
    if (!$form['id'] || empty($form['id'])) {
        $form['id'] = 0;
    }
    $obj->script("removeClassId('editorigin_name','alerts');");
    $obj->assign("alert_name", "innerHTML", "");
    if (empty($form['name'])) {
        $blad = true;
        $obj->script("addClassId('editorigin_name','alerts');");
        $obj->assign("alert_name", "innerHTML", "Nazwa jest wymagana");
    } elseif ($DB->GetOne('SELECT 1 FROM customerorigin WHERE UPPER(name) = UPPER(?) AND id != ? LIMIT 1;', array($form['name'], $form['id']))) {
        $blad = true;
        $obj->script("addClassId('editorigin_name','alerts');");
        $obj->assign("alert_name", "innerHTML", "Podana nazwa jest użyta");
    }
    if (!$blad) {
        if ($form['id']) {
            $DB->Execute('UPDATE customerorigin SET name = ?, description = ? WHERE id = ? ;', array($form['name'], $form['description'] ? $form['description'] : NULL, $form['id']));
        } else {
            $DB->Execute('INSERT INTO customerorigin (name,description) VALUES (?,?);', array($form['name'], $form['description'] ? $form['description'] : NULL, $form['id']));
        }
        $obj->script("self.location.href='?m=customeroriginlist';");
    }
    return $obj;
}
コード例 #9
0
ファイル: editcontent_extra.php プロジェクト: rasomu/chuza
function ajaxpreview($params)
{
    global $gCms;
    $urlext = '?' . CMS_SECURE_PARAM_NAME . '=' . $_SESSION[CMS_USER_KEY];
    $config =& $gCms->GetConfig();
    $contentops =& $gCms->GetContentOperations();
    $content_type = $params['content_type'];
    $contentops->LoadContentType($content_type);
    $contentobj = UnserializeObject($params["serialized_content"]);
    if (strtolower(get_class($contentobj)) != strtolower($content_type)) {
        copycontentobj($contentobj, $content_type, $params);
    }
    updatecontentobj($contentobj, true, $params);
    $tmpfname = createtmpfname($contentobj);
    // str_replace is because of stupid windows machines.... when will they die.
    $_SESSION['cms_preview'] = str_replace('\\', '/', $tmpfname);
    $tmpvar = substr(str_shuffle(md5($tmpfname)), -3);
    $url = $config["root_url"] . '/index.php?' . $config['query_var'] . "=__CMS_PREVIEW_PAGE__&r={$tmpvar}";
    // temporary
    $objResponse = new xajaxResponse();
    $objResponse->assign("previewframe", "src", $url);
    $objResponse->assign("serialized_content", "value", SerializeObject($contentobj));
    $count = 0;
    foreach ($contentobj->TabNames() as $tabname) {
        $objResponse->script("Element.removeClassName('editab" . $count . "', 'active');Element.removeClassName('editab" . $count . "_c', 'active');\$('editab" . $count . "_c').style.display = 'none';");
        $count++;
    }
    $objResponse->script("Element.addClassName('edittabpreview', 'active');Element.addClassName('edittabpreview_c', 'active');\$('edittabpreview_c').style.display = '';");
    return $objResponse;
}
コード例 #10
0
function GetCities($country, $city)
{
    require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/city.php';
    $response = new xajaxResponse();
    $cities = city::GetCities(intval($country));
    /*$html = '<option value="0">Все города</option>';
      foreach ($cities as $id=>$val) {
          $html .= '<option value="'.$id.'">'.htmlspecialchars($val).'</option>';
      }*/
    $script = "document.getElementById('cities').options.length = 0; \n";
    $script .= "document.getElementById('cities').options[0] = new Option('Все города', 0); \n";
    $i = 1;
    foreach ($cities as $id => $val) {
        $script .= "document.getElementById('cities').options[{$i}] = new Option('" . htmlspecialchars($val) . "', {$id}); \n";
        ++$i;
    }
    $response->assign('cities', 'innerHTML', $html);
    $response->assign('cities', 'disabled', false);
    $script .= "document.getElementById('btnAddLocation').onclick = function() { locations.add(); return false; }; \n";
    if ($city) {
        $script .= "\n\t\t\tfor (var i=0; i<document.getElementById('cities').options.length; i++) {\n\t\t\t\tif (document.getElementById('cities').options[i].value == {$city}) {\n\t\t\t\t\tdocument.getElementById('cities').selectedIndex = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\t\n\t\t\t} \n\n\t\t";
    }
    $script .= 'if (spam.busy > 1) { spam.busy = 0;	spam.send(); } spam.busy = 0;';
    $response->script($script);
    return $response;
}
コード例 #11
0
function cancelar_borrar_foto($id)
{
    $objResponse = new xajaxResponse();
    $objResponse->assign('links_' . $id, 'style.display', 'inline');
    $objResponse->assign('ampliar_' . $id, 'style.display', 'inline');
    $objResponse->assign('msg_' . $id, 'innerHTML', '');
    return $objResponse;
}
コード例 #12
0
function streamFile($arquivoId, $type, $screenSize)
{
    global $smarty;
    require_once "lib/persistentObj/PersistentObjectFactory.php";
    $objResponse = new xajaxResponse();
    if (!$arquivoId) {
        return $objResponse;
    }
    $arquivo = PersistentObjectFactory::createObject("Publication", (int) $arquivoId);
    $file =& $arquivo->filereferences[0];
    $file->hitStream();
    $screenSize -= 250;
    if ($type == 'Imagem') {
        $smarty->assign('src', $file->baseDir . $file->fileName);
        if ($file->width > $screenSize) {
            $file->height = $screenSize * ($file->height / $file->width);
            $file->width = $screenSize;
            $smarty->assign('note', tra("Imagem redimensionada"));
        } else {
            $smarty->assign('note', '');
        }
        $objResponse->remove('ajax-gPlayerImagem');
        $objResponse->append('ajax-contentBubble', 'innerHTML', $smarty->fetch('el-playerImage.tpl'));
        $objResponse->assign('ajax-gImagem', 'style.maxWidth', $screenSize . "px");
        $objResponse->assign('ajax-gPlayerImagem', 'style.width', $file->width . "px");
        $objResponse->assign('ajax-gPlayerImagem', 'style.height', $file->height . "px");
        $objResponse->script("showLightbox('ajax-gPlayerImagem')");
        return $objResponse;
    }
    $validUrl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    $validUrl = preg_replace('/el-.+\\.php.*$/', '', $validUrl);
    $validUrl .= $file->baseDir . $file->fileName;
    if ($type == 'Video') {
        $width = $file->width;
        $height = $file->height;
        $video = "true";
    } else {
        $width = 200;
        $height = 20;
        $video = "false";
    }
    /*pra quando rolar tutoriais em swf
       * if (preg_match('/.*\.swf$/i', $arquivo.arquivo)) {
      	$smarty->assign('src', 'repo/' . $arquivo['arquivo']);
      	$objResponse->remove('gPlayerSwf');
      	$objResponse->append('ajax-contentBubble', 'innerHTML', $smarty->fetch('el-playerSwf.tpl'));
      	$objResponse->script("showLightbox('gPlayerSwf')");	
      } else {
      */
    $objResponse->remove('ajax-gPlayer');
    $objResponse->append('ajax-contentBubble', 'innerHTML', $smarty->fetch('el-player.tpl'));
    $objResponse->script("loadFile('{$validUrl}', {$width}, {$height}, '{$video}')");
    //}
    return $objResponse;
}
コード例 #13
0
ファイル: newsletter.php プロジェクト: rjdesign/Ilch-1.2
function XAJAX_changeList($select)
{
    $objResponse = new xajaxResponse();
    if ($select == 'Normal') {
        $auswahl = array('u0' => 'an alle User');
        $erg = db_query("SELECT `name`,`id` FROM `prefix_groups` ORDER BY `id`");
        while ($RRrow = db_fetch_object($erg)) {
            $auswahl['g' . $RRrow->id] = $RRrow->name;
        }
        $listeB = '';
        $listeT = '';
        foreach ($auswahl as $k => $v) {
            if (strpos($k, 'u') !== false) {
                $listeB .= '<option value="P' . $k . '">' . $v . ' PrivMsg</option>' . "\n";
                $listeB .= '<option value="E' . $k . '">' . $v . ' eMail</option>' . "\n";
            } elseif (strpos($k, 'g') !== false) {
                $listeT .= '<option value="P' . $k . '">' . $v . ' PrivMsg</option>' . "\n";
                $listeT .= '<option value="E' . $k . '">' . $v . ' eMail</option>' . "\n";
            }
        }
        $content = <<<END
            <select id="nl_auswahl" name="auswahl">
                <option value="Enews" selected="selected">eMail Newsletter</option>
                <optgroup label="Benutzer">
                    {$listeB}
                </optgroup>
                <optgroup label="Gruppen">
                    {$listeT}
                </optgroup>
    \t\t</select>
END;
        $objResponse->assign('cb_html_cont', 'style.display', '');
    } else {
        $erg = db_query("SELECT * FROM `prefix_grundrechte` ORDER BY `id` ASC");
        $listeG = '';
        while ($row = db_fetch_assoc($erg)) {
            $listeG .= '<optgroup label="' . $row['name'] . '">';
            $listeG .= '<option value="Pr' . $row['id'] . '"> PrivMsg</option>';
            $listeG .= '<option value="Er' . $row['id'] . '"> eMail</option>';
            $listeG .= '</optgroup>';
        }
        $content = <<<END
            <select name="auswahl" id="nl_auswahl">
                <option selected="selected" disabled="disabled">Bitte treffen Sie eine Auswahl</option>
                    {$listeG}
            </select>
\t\t\t<input type="checkbox" name="andhigher" id="cb_andhigher" value="1" />
\t\t\t<label for="cb_andhigher">und f&uuml;r alle h&ouml;heren Rechte</label>
END;
    }
    $objResponse->assign('list', 'innerHTML', $content);
    $objResponse->setEvent('nl_auswahl', 'onchange', 'checkEmail();');
    return $objResponse;
}
コード例 #14
0
/**
* Удаление фотографии.
*
* @param    integer $id     ID пользователя
*/
function DeletePhoto($id)
{
    session_start();
    $objResponse = new xajaxResponse();
    if (hasPermissions('users')) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/team.php';
        team::DeletePhoto($id);
        $objResponse->assign('peoplephoto_' . $id, 'src', '/images/team_no_foto.gif');
        $objResponse->assign('pt_photo_file', 'style.display', 'none');
    }
    return $objResponse;
}
コード例 #15
0
function selecttemplates($idtheme, $idfield, $idtemplate)
{
    global $DB;
    $template = $DB->GetRow('SELECT theme, message FROM messagestemplate WHERE id = ? ' . $DB->limit(1) . ' ;', array(intval($idtemplate)));
    if (!$template) {
        $template['theme'] = $template['message'] = "";
    }
    $obj = new xajaxResponse();
    $obj->assign($idtheme, 'value', $template['theme']);
    $obj->assign($idfield, 'value', $template['message']);
    return $obj;
}
コード例 #16
0
ファイル: vote_manager.php プロジェクト: haseok86/millkencode
function add($vF)
{
    $resp = new xajaxResponse();
    $html = '';
    for ($i = 1; $i <= $vF['num']; $i++) {
        $html .= '<tr><td>选项' . $i . '<input type="text" size="25" name="add[]" value=""></td></tr>';
    }
    $resp->assign("set", "style.display", "none");
    $resp->assign("addB", "style.display", "block");
    $resp->assign('hm', 'innerHTML', $html);
    return $resp->getXML();
}
コード例 #17
0
function checkStatic($from, $to)
{
    $objResponse = new xajaxResponse();
    $banners = new banners();
    $stat_bans = $banners->GetBannersByDate($from, $to, true);
    if ($stat_bans) {
        $objResponse->alert("Внимание! На этот период уже есть статические размещения!");
        $objResponse->assign("stat_info", 'innerHTML', "<a href=\"#\" class=\"blue\" onclick=\"window.showModalDialog('actbanners.php?from=" . $from . "&to=" . $to . "&stat=1', null, 'dialogHeight: 300px; dialogWidth: 500px; edge: Raised; center: Yes; help: No; resizable: No; scroll: Vertical; status: No;')\">Статические размещения на этот период</a>");
    } else {
        $objResponse->assign("stat_info", 'innerHTML', "");
    }
    return $objResponse;
}
コード例 #18
0
function mostrarPersona($id)
{
    global $ObjPersona;
    global $cnx;
    $sql = "SELECT IdPersona,CONCAT(apellidos,' ',nombres) as Nombres FROM Persona WHERE 1=1";
    $sql .= " AND IdPersona=" . $id;
    $rs = $cnx->query($sql);
    $reg = $rs->fetchObject();
    $objResp = new xajaxResponse();
    $objResp->assign('txtIdPersona', 'value', $reg->IdPersona);
    $objResp->assign('txtNombres', 'value', utf8_encode($reg->Nombres));
    return $objResp;
}
コード例 #19
0
ファイル: sheets.php プロジェクト: sandrain/hangee
function show_hint($wid)
{
    $hint = get_hint($wid);
    if ($hint) {
        $hint = htmlspecialchars(stripslashes($hint));
    } else {
        $hint = "No hint!";
    }
    $response = new xajaxResponse();
    $response->assign("result", "innerHTML", $hint);
    $response->assign("result", "style.display", "block");
    return $response;
}
コード例 #20
0
ファイル: mod_box.php プロジェクト: haseok86/millkencode
function play($bid)
{
    global $tablepre, $db;
    $obj = new xajaxResponse();
    $bid = intval($bid);
    $query = $db->query("SELECT id,url,type FROM `{$tablepre}ubox` WHERE bid={$bid}") or error('', __FILE__, __LINE__, $db->error());
    if ($value) {
        $obj->assign('player_div', 'innerHTML', flv('http://localhost/mp3/flvplayer.swf'));
    } else {
        $obj->assign('player_div', 'innerHTML', mp3('http://localhost/star.mp3'));
    }
    return $obj;
}
コード例 #21
0
function ssu_update_status($id)
{
    $oResponse = new xajaxResponse();
    global $db;
    $db->Execute('UPDATE ' . TABLE_LINKS_ALIASES . ' SET status=-status+1 WHERE id=\'' . $id . '\' LIMIT 1');
    if (mysql_affected_rows() != 1) {
        $oResponse->assign('message', 'innerHTML', "Failed to update alias id {$id}");
    } else {
        $oResponse->script('location.reload(true)');
        $oResponse->assign('message', 'innerHTML', 'Record status update');
        $oResponse->assign($id, 'innerHTML', '');
    }
    return $oResponse;
}
コード例 #22
0
ファイル: realmdbs.class.php プロジェクト: prodigy/mdmphp
 /**
  * Alle eingetragenen realms laden
  *
  * @access private
  * @author prodigy
  * @since 01.01.2009
  * @version 0.1a
  */
 private function DBLoadAll()
 {
     if (!$this->DBc->DB_Connect('mdm')) {
         $this->objR->assign('SOVerror', 'innerHTML', 'Datenbank zur Zeit nicht verf&uuml;gbar.<br />' . mysqli_connect_error());
         return;
     }
     $res = $this->DBc->DB_Connection['mdm']->query("\n                                             SELECT *\n                                             FROM `realmdbs`;");
     $this->DBc->DB_Close('mdm');
     $this->objR->assign('SOVerror', 'innerHTML', "<pre>\n");
     $this->objR->append('SOVerror', 'innerHTML', $res->num_rows . "\n");
     foreach ($res as $db) {
         $this->objR->append('SOVerror', 'innerHTML', print_r($db, true) . "\n");
     }
     $this->objR->append('SOVerror', 'innerHTML', '</pre>');
 }
コード例 #23
0
function setPubThumbFromFile($i)
{
    global $arquivo, $style;
    $objResponse = new xajaxResponse();
    if (isset($arquivo->filereferences[$i])) {
        $file =& $arquivo->filereferences[$i];
        if ($file->thumbnail) {
            $arquivo->update(array("thumbnail" => $file->thumbnail));
            $objResponse->assign("js-thumbnailM", "src", $file->baseDir . urlencode($file->thumbnail));
        } else {
            $objResponse->assign("js-thumbnailM", "src", 'styles/' . preg_replace('/\\.css/', '', $style) . '/img/iThumb' . $arquivo->type . '.png');
        }
    }
    return $objResponse;
}
コード例 #24
0
function testXajaxResponse()
{
    // Return a xajax response object
    $objResponse = new xajaxResponse();
    $objResponse->assign('DataDiv', 'innerHTML', 'Xajax Response Data');
    return $objResponse;
}
コード例 #25
0
function test()
{
    $objResponse = new xajaxResponse();
    $objResponse->alert("hallo");
    $objResponse->assign('testButton', 'label', 'Success!');
    return $objResponse;
}
コード例 #26
0
ファイル: events.php プロジェクト: asad345100/mis-pos
function toggleButtons()
{
    $objResponse = new xajaxResponse();
    $aArgs = func_get_args();
    if (3 < count($aArgs)) {
        $aDisable = $aArgs[2];
        $aEnable = $aArgs[3];
        foreach ($aDisable as $sDisableId) {
            $objResponse->assign($sDisableId, 'disabled', 'disabled');
        }
        foreach ($aEnable as $sEnableId) {
            $objResponse->assign($sEnableId, 'disabled', '');
        }
    }
    return $objResponse;
}
コード例 #27
0
function get_license($r1, $r2, $r3)
{
    require_once "lib/persistentObj/PersistentObjectController.php";
    $controller = new PersistentObjectController("License");
    $objResponse = new xajaxResponse();
    $answer = $r1 . $r2;
    if ($r3 != '-1') {
        $answer .= $r3;
    }
    $licenca = $controller->noStructureFindAll(array("answer" => $answer));
    $licenca =& $licenca[0];
    $objResponse->assign('ajax-licenseImg', 'src', 'styles/estudiolivre/h_' . $licenca['imageName'] . '?rand=' . rand());
    $objResponse->assign('ajax-licenseDesc', 'innerHTML', $licenca['description']);
    $objResponse->script("show('ajax-licenseCont');");
    return $objResponse;
}
コード例 #28
0
/**
 * Форма обновления адресов пользователя в сером списке IP
 * 
 * @param  int $nNum номер html блока куда подставляется форма.
 * @param  int $nUserId UID пользователя
 * @param  int $nAdminId UID админа
 * @return object xajaxResponse
 */
function getPrimaryIpForm($nNum = 0, $nUserId = 0, $nAdminId = 0)
{
    session_start();
    $objResponse = new xajaxResponse();
    $aIp = gray_ip::getPrimaryIpByUid($nUserId);
    if ($aIp) {
        $aTmp = array();
        foreach ($aIp as $aOne) {
            $aTmp[] = $aOne['ip'];
        }
        $sOut = '<div class="form fs-o">
            <b class="b1"></b>
            <b class="b2"></b>
            <div class="form-in">
                    <input type="hidden" name="uid_edit_' . $nNum . '" id="uid_edit_' . $nNum . '" value="' . $nUserId . '" />
                    <input type="hidden" name="adm_edit_' . $nNum . '" id="adm_edit_' . $nNum . '" value="' . $nAdminId . '" />
                    <input type="hidden" name="log_edit_' . $nNum . '" id="log_edit_' . $nNum . '" value="' . $aIp[0]['user_login'] . '" />
                    <h4>Редактировать список IP-адресов для [' . $aIp[0]['user_login'] . ']</h4>
                    <div class="form-el">
                        <textarea name="txt_edit_' . $nNum . '" id="txt_edit_' . $nNum . '" cols="" rows="">' . implode("\n", $aTmp) . '</textarea>
                    </div>
                    <div class="form-el form-btns">
                        <input name="btn_edit_' . $nNum . '" id="btn_edit_' . $nNum . '" onclick="gray_ip.submitEdit(' . $nNum . ')" type="button" value="Сохранить" />
                        <a href="javascript:void(0);" onclick="gray_ip.clearEdit(' . $nNum . ')" class="lnk-dot-666">Отменить</a>
                    </div>
            </div>
            <b class="b2"></b>
            <b class="b1"></b>
        </div>';
        $objResponse->script('gray_ip.clearEditAll();');
        $objResponse->assign('edit_ip_' . $nNum, 'innerHTML', $sOut);
    }
    return $objResponse;
}
コード例 #29
0
 function assign($sTarget, $sAttribute, $sData, $highlight = false)
 {
     parent::assign($sTarget, $sAttribute, $sData);
     if ($highlight) {
         $this->highlight($sTarget);
     }
 }
コード例 #30
0
ファイル: footer.php プロジェクト: pkkann/enrollment_sys
function load_footer()
{
    $objResponse = new xajaxResponse();
    $text .= gen_footer();
    $objResponse->assign("bottom_nav", "innerHTML", $text);
    return $objResponse;
}