• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP get_variable函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中get_variable函数的典型用法代码示例。如果您正苦于以下问题:PHP get_variable函数的具体用法?PHP get_variable怎么用?PHP get_variable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_variable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: page_contact

 function page_contact()
 {
     // Add departments
     global $_CLASS;
     $_CLASS['core_user']->user_setup();
     $_CLASS['core_user']->add_lang();
     $this->error = '';
     $this->preview = !empty($_POST['preview']);
     if ($this->preview || !empty($_POST['contact'])) {
         $this->data['MESSAGE'] = trim(get_variable('message', 'POST', ''));
         $this->data['NAME'] = get_variable('sender_name', 'POST', '');
         $this->data['EMAIL'] = get_variable('sender_email', 'POST', '');
         foreach ($this->data as $field => $value) {
             if (!$value) {
                 $this->error .= $_CLASS['core_user']->lang['ERROR_' . $field] . '<br />';
                 unset($field, $value, $lang);
             } elseif ($field == 'EMAIL' && !check_email($value)) {
                 $this->error .= $_CLASS['core_user']->lang['BAD_EMAIL'] . '<br />';
             }
         }
         if (!$this->error) {
             $this->send_feedback();
         }
     } else {
         $this->data['NAME'] = $_CLASS['core_user']->is_user ? $_CLASS['core_user']->data['username'] : '';
         $this->data['EMAIL'] = $_CLASS['core_user']->is_user ? $_CLASS['core_user']->data['user_email'] : '';
         $this->data['MESSAGE'] = '';
     }
     $_CLASS['core_template']->assign_array(array('ERROR' => $this->error, 'MESSAGE' => $this->data['MESSAGE'], 'ACTION' => generate_link($_CLASS['core_display']->page['page_name']), 'SENDER_EMAIL' => $this->data['EMAIL'], 'SENDER_NAME' => $this->data['NAME']));
     $_CLASS['core_template']->display('modules/contact/index.html');
 }
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:index.php


示例2: add_event

function add_event()
{
    global $_CLASS;
    $data_array = array('calender_title' => mb_strtolower(htmlentities(get_variable('title', 'POST', ''), ENT_QUOTES, 'UTF-8')), 'calender_text' => strip_tags(get_variable('description', 'POST', false)), 'calender_notes' => strip_tags(get_variable('note', 'POST', false)), 'calender_starts' => get_variable('start', 'POST', false), 'calender_expires' => get_variable('end', 'POST', false));
    $error = array();
    if (empty($data_array['calender_title'])) {
        $error[] = $_CLASS['core_user']->get_lang('NO_TITLE');
    }
    $start_time = strtotime($data_array['calender_starts']);
    if (!$start_time || $start_time === -1) {
        $error[] = $_CLASS['core_user']->get_lang('ERROR_START_TIME');
    }
    $end_time = strtotime($data_array['calender_expires']);
    if (!$end_time || $end_time === -1) {
        $error[] = $_CLASS['core_user']->get_lang('ERROR_END_TIME');
    }
    if (empty($error) && $start_time > $end_time) {
        $error[] = $_CLASS['core_user']->get_lang('ERROR_');
    }
    if (!empty($error)) {
        return false;
    }
    //$duration = $start_time - $end_time;
    //$start_time = $date = implode(''. explode(':', date('H:i', $start_time)));;
    $data_array['calender_starts'] = $_CLASS['core_user']->time_convert($start_time, 'gmt');
    $data_array['calender_expires'] = $_CLASS['core_user']->time_convert($end_time, 'gmt');
    $_CLASS['core_db']->query('INSERT INTO ' . CALENDER_TABLE . ' ' . $_CLASS['core_db']->sql_build_array('INSERT', $data_array));
    $data_array['calender_id'] = $_CLASS['core_db']->insert_id(CALENDER_TABLE, 'calender_id');
    return $data_array;
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:30,代码来源:ucp_calender.php


示例3: merge

function merge($width, $height)
{
    $array_variable = get_variable();
    $bg = $array_variable[0];
    $over = $array_variable[1];
    $outputFile = $array_variable[2];
    $result = $array_variable[3];
    $path_to_save = $array_variable[4];
    $n = $array_variable[5];
    $tmp_img = $path_to_save . "/tmp_" . $n . ".png";
    // $result_jpg_compressed = $path_to_save.'/'.$n.'.JPG';
    // $base_image = imagecreatefrompng($bg);
    jpg2png($bg, $outputFile);
    $base_image = imagecreatefrompng($outputFile);
    $top_image = imagecreatefrompng($over);
    // $merged_image = $result;
    imagesavealpha($top_image, true);
    imagealphablending($top_image, true);
    imagecopy($base_image, $top_image, 0, 0, 0, 0, $width, $height);
    imagepng($base_image, $result);
    // rename to temp for compression
    rename($result, $path_to_save . "/tmp_" . $n . ".png");
    // compress IMG
    $img = imagecreatefrompng($tmp_img);
    // imagejpeg($img,$result_jpg_compressed,75);
    imagejpeg($img, $result, 75);
    unlink($tmp_img);
    unlink($tmp_img);
    // if necessery !!!!!!!!!!!!!!!!!!!
    unlink($outputFile);
    unlink($over);
}
开发者ID:vincseize,项目名称:GDC,代码行数:32,代码来源:saveCanvas_OLD1.php


示例4: get_userdata

function get_userdata($data)
{
    if (isset($_SESSION[get_variable("prfx") . "_" . $data])) {
        return $_SESSION[get_variable("prfx") . "_" . $data];
    }
    return "No user";
}
开发者ID:eliascantoral,项目名称:cerebro,代码行数:7,代码来源:logic_login.php


示例5: switchserver_main

function switchserver_main()
{
    global $argc, $argv;
    global $gbl, $sgbl, $login, $ghtml;
    //sleep(60);
    initProgram("admin");
    if ($argc === 1) {
        print "Usage: {$argv['0']} --class= --name= --v-syncserver= \n";
        exit;
    }
    try {
        $opt = parse_opt($argv);
        $param = get_variable($opt);
        dprintr($param);
        $class = $opt['class'];
        $name = $opt['name'];
        if (lx_core_lock("{$class}-{$name}.switchserver")) {
            exit;
        }
        $object = new $class(null, 'localhost', $name);
        $object->get();
        if ($object->dbaction === 'add') {
            throw new lxException("no_object", '', '');
            exit;
        }
        if (!$object->syncserver) {
            print "No_synserver...\n";
            throw new lxException("no_syncserver", '', '');
            exit;
        }
        if ($param['syncserver'] === $object->syncserver) {
            print "No Change...\n";
            throw new lxException("no_change", '', '');
            exit;
        }
        $driverapp_old = $gbl->getSyncClass('localhost', $object->syncserver, $object->get__table());
        $driverapp_new = $gbl->getSyncClass('localhost', $param['syncserver'], $object->get__table());
        if ($driverapp_new !== $driverapp_old) {
            //throw new lxException ("the_drivers_are_different_in_two_servers", '', '');
        }
        $object->doupdateSwitchserver($param);
    } catch (exception $e) {
        print $e->getMessage();
        /// hcak ahck... Chnage only the olddelete variable which is the mutex used for locking in the process of switch. The problem is we want to totally bail out if the switchserver fails. The corect way would be save after reverting the syncserve to the old value, but that's a bit risky. So we just use a hack to change only the olddeleteflag; Not a real hack.. This is the better way.
        $message = "{$e->getMessage()}";
        write_to_object($object, $message, $param['syncserver']);
        $fullmesage = "Switch of {$object->get__table()}:{$object->nname} to {$object->syncserver} failed due to {$e->getMessage()}";
        log_switch($fullmesage);
        mail($login->contactemail, "Switch Failed:", "{$fullmesage}\n");
        print "\n";
        exit;
    }
    mail($login->contactemail, "Switch Succeeded", "Switch Succeeded {$object->get__table()}:{$object->nname} to {$param['syncserver']}\n");
}
开发者ID:lonelywoolf,项目名称:hypervm,代码行数:54,代码来源:switchserver.php


示例6: do_print

function do_print($row_in)
{
    global $today, $today_ref, $line_ctr, $units_str, $severities;
    if (empty($today)) {
        $today_ref = date("z", $row_in['problemstart']);
        $today = substr(format_date($row_in['problemstart']), 0, 5);
    } else {
        if (!($today_ref == date("z", $row_in['problemstart']))) {
            // date change?
            $today_ref = date("z", $row_in['problemstart']);
            $today = substr(format_date($row_in['problemstart']), 0, 5);
        }
    }
    $def_city = get_variable('def_city');
    $def_st = get_variable('def_st');
    print "<TR CLASS= ''>\n";
    print "<TD>{$today}</TD>\n";
    //		Date -
    $problemstart = format_date($row_in['problemstart']);
    $problemstart_sh = short_ts($problemstart);
    print "<TD onMouseover=\"Tip('{$problemstart}');\" onmouseout='UnTip();'>{$problemstart_sh}</TD>\n";
    //		start
    $problemend = format_date($row_in['problemend']);
    $problemend_sh = short_ts($problemend);
    print "<TD onMouseover=\"Tip('{$problemend}');\" onmouseout='UnTip();'>{$problemend_sh}</TD>\n";
    //		end
    $elapsed = my_date_diff($row_in['problemstart'], $row_in['problemend']);
    print "<TD>{$elapsed}</TD>\n";
    //		Ending time
    print "<TD ALIGN='center'>{$severities[$row_in['severity']]}</TD>\n";
    $scope = $row_in['tick_scope'];
    $scope_sh = shorten($row_in['tick_scope'], 20);
    print "<TD onMouseover=\"Tip('{$scope}');\" onmouseout='UnTip();'>{$scope_sh}</TD>\n";
    //		Call type
    $comment = $row_in['comments'];
    $short_comment = shorten($row_in['comments'], 50);
    print "<TD onMouseover=\"Tip('{$comment}');\" onMouseout='UnTip();'>{$short_comment}</TD>\n";
    //		Comments/Disposition
    $facility = $row_in['facy_name'];
    $facility_sh = shorten($row_in['facy_name'], 16);
    print "<TD onMouseover=\"Tip('{$facility}');\" onmouseout='UnTip();'>{$facility_sh}</TD>\n";
    //		Facility
    $city = $row_in['tick_city'] == $def_city ? "" : ", {$row_in['tick_city']}";
    $st = $row_in['tick_state'] == $def_st ? "" : ", {$row_in['tick_state']}";
    $addr = "{$row_in['tick_street']}{$city}{$st}";
    $addr_sh = shorten($row_in['tick_street'] . $city . $st, 20);
    print "<TD onMouseover=\"Tip('{$addr}');\" onMouseout='UnTip();'>{$addr_sh}</TD>\n";
    //		Street addr
    print "<TD>{$units_str}</TD>\n";
    //		Units responding
    print "</TR>\n\n";
    $line_ctr++;
}
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:53,代码来源:daily_rpt.php


示例7: admin_save

function admin_save($data)
{
    global $_CLASS, $_CORE_CONFIG;
    foreach ($data as $section => $option) {
        foreach ($option as $db_name => $data_op) {
            $value = get_variable($data_op['post_name'], 'POST', false);
            if ($value != $_CORE_CONFIG[$section][$db_name]) {
                set_core_config($section, $db_name, $value, false);
            }
        }
    }
    $_CLASS['core_cache']->destroy('core_config');
}
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:13,代码来源:system.php


示例8: get_current_test

function get_current_test()
{
    // 3/16/09, 7/25/09
    $delay = 1;
    // minimum time in minutes between  queries - 7/25/09
    $when = get_variable('_aprs_time');
    // misnomer acknowledged
    if (time() < $when) {
        return;
    } else {
        $next = time() + $delay * 60;
        $query = "UPDATE `{$GLOBALS['mysql_prefix']}settings` SET `value`='{$next}' WHERE `name`='_aprs_time'";
        $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
    }
    $aprs = $instam = $locatea = $gtrack = $glat = FALSE;
    // 3/22/09
    $query = "SELECT `id`, `aprs`, `instam`, `locatea`, `gtrack`, `glat` FROM `{$GLOBALS['mysql_prefix']}responder`WHERE ((`aprs` = 1) OR (`instam` = 1) OR (`locatea` = 1) OR (`gtrack` = 1) OR (`glat` = 1))";
    $result = mysql_query($query) or do_error($query, ' mysql error=', mysql_error(), basename(__FILE__), __LINE__);
    while ($row = stripslashes_deep(mysql_fetch_assoc($result))) {
        if ($row['aprs'] == 1) {
            $aprs = TRUE;
        }
        if ($row['instam'] == 1) {
            $instam = TRUE;
        }
        if ($row['locatea'] == 1) {
            $locatea = TRUE;
        }
        //7/29/09
        if ($row['gtrack'] == 1) {
            $gtrack = TRUE;
        }
        //7/29/09
        if ($row['glat'] == 1) {
            $glat = TRUE;
        }
        //7/29/09
    }
    // end while ()
    unset($result);
    if ($glat) {
        $glat_func = do_glat_test();
    }
    print $glat_func;
    $result_code = "Get Current Successful";
    return $result_code;
}
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:47,代码来源:test_get_current.php


示例9: get_butts

function get_butts($ticket_id, $unit_id)
{
    global $patient;
    $win_height = get_variable('map_height') + 120;
    $win_width = get_variable('map_width') + 10;
    if ($_SESSION['internet']) {
        print "<INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'Map' onClick  = \"var popWindow = window.open('map_popup.php?id={$ticket_id}', 'PopWindow', 'resizable=1, scrollbars, height={$win_height}, width={$win_width}, left=250,top=50,screenX=250,screenY=50'); popWindow.focus();\" />\n";
        // 7/3/10
    }
    if (can_edit()) {
        // 5/23/11
        print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'New' onClick = \"var newWindow = window.open('add.php?mode=1', 'addWindow', 'resizable=1, scrollbars, height=640, width=800, left=100,top=100,screenX=100,screenY=100'); newWindow.focus();\" />\n";
        // 8/9/10
        print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'Edit' onClick = \"var newWindow = window.open('edit_nm.php?mode=1&id={$ticket_id}', 'editWindow', 'resizable=1, scrollbars, height=600, width=600, left=100,top=100,screenX=100,screenY=100'); newWindow.focus();\" />\n";
        // 2/1/10
        if (!is_closed($ticket_id)) {
            // 10/5/09
            print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'Close' onClick = \"var mailWindow = window.open('close_in.php?ticket_id={$ticket_id}', 'mailWindow', 'resizable=1, scrollbars, height=480, width=700, left=100,top=100,screenX=100,screenY=100'); mailWindow.focus();\" />\n";
            // 8/20/09
        }
    }
    // end if ($can_edit())
    if (is_administrator() || is_super() || is_unit()) {
        if (!is_closed($ticket_id)) {
            print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'Action' onClick  = \"var actWindow = window.open('action_w.php?mode=1&ticket_id={$ticket_id}', 'ActWindow', 'resizable=1, scrollbars, height=480, width=900, left=250,top=50,screenX=250,screenY=50'); ActWindow.focus();\" />\n";
            // 7/3/10
            print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = '{$patient}' onClick  = \"var patWindow = window.open('patient_w.php?mode=1&ticket_id={$ticket_id}', 'patWindow', 'resizable=1, scrollbars, height=480,width=720, left=250,top=50,screenX=250,screenY=50'); patWindow.focus();\" />\n";
            // 7/3/10
        }
        print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'Notify' onClick  = \"var notWindow = window.open('config.php?mode=1&func=notify&id={$ticket_id}', 'NotWindow', 'resizable=1, scrollbars, height=400, width=600, left=250,top=50,screenX=250,screenY=50'); notWindow.focus();\" />\n";
        // 7/3/10
    }
    print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'Note' onClick = \"var noteWindow = window.open('add_note.php?ticket_id={$ticket_id}', 'mailWindow', 'resizable=1, scrollbars, height=240, width=600, left=100,top=100,screenX=100,screenY=100'); noteWindow.focus();\" />\n";
    // 10/8/08
    //	print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'Print' onClick='main.php?print=true&id=$ticket_id;'>\n ";
    print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'E-mail' onClick = \"var mailWindow = window.open('mail.php?ticket_id={$ticket_id}', 'mailWindow', 'resizable=1, scrollbars, height=600, width=600, left=100,top=100,screenX=100,screenY=100'); mailWindow.focus();\" />\n";
    // 2/1/10
    print "<BR /><INPUT TYPE='button' CLASS = 'btn_smaller' VALUE = 'Dispatch' onClick = \"var dispWindow = window.open('routes_nm.php?frm_mode=1&ticket_id={$ticket_id}', 'dispWindow', 'resizable=1, scrollbars, height=480, width=" . round(0.8 * $_SESSION['scr_width']) . ", left=100,top=100,screenX=100,screenY=100'); dispWindow.focus();\" />\n";
    // 2/1/10
}
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:40,代码来源:mobile.php


示例10: add_event

 function add_event()
 {
     global $_CLASS;
     $data_array = array('title' => get_variable('title', 'POST', false), 'description' => get_variable('description', 'POST', false), 'note' => get_variable('note', 'POST', false), 'start_time' => get_variable('start', 'POST', false), 'end_time' => get_variable('end', 'POST', false), 'recur' => false);
     $error = '';
     if (($start_time = strtotime($data_array['start_time'])) === -1) {
         $error .= $_CLASS['core_user']->get_lang('ERROR_START_TIME') . '<br />';
     }
     if (($end_time = strtotime($data_array['end_time'])) === -1) {
         $error .= $_CLASS['core_user']->get_lang('ERROR_END_TIME') . '<br />';
     }
     if (!$error && $start_time > $end_time) {
         $error .= $_CLASS['core_user']->get_lang('ERROR_') . '<br />';
     }
     if (!$error) {
         //$duration = $start_time - $end_time;
         //$start_time = $date = implode(''. explode(':', date('H:i', $start_time)));;
         $data_array['start_time'] = $data_array['start_date'] = $start_time;
         $data_array['end_time'] = $data_array['end_date'] = $end_time;
         $_CLASS['core_db']->sql_query('INSERT INTO cms_calender ' . $_CLASS['core_db']->sql_build_array('INSERT', $data_array));
     }
 }
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:22,代码来源:ucp_calender.php


示例11: do_login

 function do_login($login_options, $template)
 {
     global $_CLASS, $_CORE_CONFIG;
     $user_name = !empty($_SERVER['PHP_AUTH_USER']) ? $_SERVER['PHP_AUTH_USER'] : getenv('PHP_AUTH_USER');
     $user_password = !empty($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : getenv('PHP_AUTH_PW');
     //list($user_name, $user_password) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
     $error = '';
     $login_array = array('redirect' => false, 'explain' => false, 'success' => '', 'admin_login' => false, 'full_login' => true, 'full_screen' => false);
     if (is_array($login_options)) {
         $login_array = array_merge($login_array, $login_options);
     }
     if ($user_name || $user_password) {
         if (!$user_name || !$user_password) {
             $error = 'INCOMPLETE_LOGIN_INFO';
         }
         if (!$error) {
             $result = $this->user_auth($user_name, $user_password);
             if (is_numeric($result)) {
                 $_CLASS['core_user']->login($result, $login_array['admin_login'], false);
                 $login_array['redirect'] = generate_link(get_variable('redirect', 'POST', $login_array['redirect']), array('admin' => $data['admin_login']));
                 $_CLASS['core_display']->meta_refresh(5, $login_array['redirect']);
                 $message = ($login_array['success'] ? $_CLASS['core_user']->get_lang($login_array['success']) : $_CLASS['core_user']->lang['LOGIN_REDIRECT']) . '<br /><br />' . sprintf($_CLASS['core_user']->lang['RETURN_PAGE'], '<a href="' . $login_array['redirect'] . '">', '</a> ');
                 trigger_error($message);
             }
             $error = is_string($result) ? $result : 'LOGIN_ERROR';
         }
     }
     if (!$login_array['redirect']) {
         $login_array['redirect'] = htmlspecialchars($_CLASS['core_user']->url);
     }
     // better realm needed, logout support needed
     // Random realm for spoofers ?
     header('WWW-Authenticate: Basic realm="Site Login"');
     header('HTTP/1.0 401 Unauthorized');
     //echo $error
 }
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:36,代码来源:auth_http.php


示例12: strtolower

// -------------------------------------------------------------
if (!defined('VIPERAL') || VIPERAL != 'Admin') {
    die;
}
// Some often used variables
$safe_mode = @ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on' ? true : false;
$file_uploads = @ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on' ? true : false;
$data = array('block_title' => 'Forum Administration', 'block_position' => BLOCK_LEFT, 'block_file' => 'block-Admin_Forums.php');
$_CLASS['core_blocks']->add_block($data);
load_class($site_file_root . 'includes/forums/auth.php', 'auth');
require_once $site_file_root . 'includes/forums/functions.php';
require_once $site_file_root . 'includes/forums/functions_admin.php';
$_CLASS['core_user']->add_lang('admin', 'Forums');
//$_CLASS['core_user']->add_img(false, 'Forums');
$_CLASS['auth']->acl($_CLASS['core_user']->data);
$file = get_variable('file', 'REQUEST', 'main');
if (file_exists($site_file_root . 'includes/forums/admin/' . $file . '.php')) {
    require $site_file_root . 'includes/forums/admin/' . $file . '.php';
} else {
    require $site_file_root . 'includes/forums/admin/main.php';
}
// -----------------------------
// Functions
function adm_page_header($sub_title, $meta = '', $table_html = true)
{
    global $config, $db, $_CLASS;
    $_CLASS['core_display']->display_header();
    echo $_CLASS['core_display']->theme->table_open;
    if ($table_html) {
        ?>
<a name="top"></a>
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:index.php


示例13: start

    function start()
    {
        global $_CLASS, $_CORE_CONFIG, $SID, $mod;
        $session_id = get_variable($_CORE_CONFIG['server']['cookie_name'] . '_sid', 'COOKIE');
        $session_id_url = get_variable('sid', 'GET');
        if ($session_id_url && (!$session_id || $session_id !== $session_id_url)) {
            $session_id = $session_id_url;
        } elseif (!defined('NEED_SID')) {
            $this->need_sid = false;
        }
        if ($session_id) {
            $sql = 'SELECT u.*, s.*
				FROM ' . CORE_SESSIONS_TABLE . ' s, ' . CORE_USERS_TABLE . " u\n\t\t\t\tWHERE s.session_id = '" . $_CLASS['core_db']->escape($session_id) . "'\n\t\t\t\t\tAND u.user_id = s.session_user_id";
            $result = $_CLASS['core_db']->query($sql);
            $this->data = $_CLASS['core_db']->fetch_row_assoc($result);
            $_CLASS['core_db']->free_result($result);
            if (isset($this->data['user_id']) && ($this->data['user_id'] == ANONYMOUS || $this->data['user_status'] == STATUS_ACTIVE)) {
                $valid = true;
                if ($this->data['session_browser'] !== $this->browser) {
                    $valid = false;
                }
                if ($valid && $_CORE_CONFIG['server']['ip_check']) {
                    $check_ip = implode('.', explode('.', $this->data['session_ip'], $_CORE_CONFIG['server']['ip_check']));
                    if ($check_ip !== substr($this->ip, 0, strlen($check_ip))) {
                        $valid = false;
                    }
                }
                if ($valid) {
                    // Set session update a minute or so after last update or if page changes
                    if ($this->time - $this->data['session_time'] > 60 || $this->data['session_url'] !== $this->url) {
                        $this->save_session = true;
                    }
                    $this->data['session_data'] = $this->data['session_data'] ? unserialize($this->data['session_data']) : array();
                    $this->data['user_data'] = $this->data['user_data'] ? unserialize($this->data['user_data']) : array();
                    load_class(false, 'core_auth', 'auth_db');
                    $this->is_user = $this->data['user_type'] == USER_NORMAL;
                    $this->is_bot = $this->data['user_type'] == USER_BOT;
                    $this->is_admin = $this->data['session_admin'] == ADMIN_IS_ADMIN;
                    check_maintance_status();
                    if ($this->is_bot) {
                        $this->need_sid = false;
                    }
                    $this->autologin_code = $this->data['session_autologin'];
                    $this->load = check_load_status();
                    $this->sid_link = 'sid=' . $this->data['session_id'];
                    return true;
                }
            }
            $this->data = array();
        }
        $user_id = ANONYMOUS;
        $ali = get_variable($_CORE_CONFIG['server']['cookie_name'] . '_ali', 'COOKIE', false, 'int');
        $alc = get_variable($_CORE_CONFIG['server']['cookie_name'] . '_alc', 'COOKIE');
        if ($ali && $alc) {
            if ($id = $this->autologin_retrieve($ali, $alc)) {
                $user_id = $id;
            }
        }
        check_maintance_status();
        $this->load = check_load_status();
        return $this->login($user_id);
    }
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:62,代码来源:session.php


示例14: str_replace

            if (substr($path, -1) != '/') {
                $path .= '/';
            }
            $path = str_replace('install/', '', $path);
            $domain = empty($_SERVER['SERVER_NAME']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME'];
            $_CLASS['core_template']->assign_array(array('site_name' => 'New CMS Site', 'site_domain' => $domain, 'site_path' => $path, 'site_port' => $_SERVER['SERVER_PORT'] == 80 ? '' : $_SERVER['SERVER_PORT'], 'cookie_domain' => $domain, 'cookie_path' => $path, 'cookie_name' => 'cms', 'username' => '', 'password' => '', 'password_confirm' => '', 'email' => '', 'email_confirm' => '', 'error' => empty($error) ? false : implode('<br/>', $error), 'config_content' => $config_data));
            $_CLASS['core_template']->display('installer/stage3.html');
            script_close();
        }
    }
}
if ($stage === 2) {
    if (isset($_POST['test']) && empty($error)) {
        $error[] = 'Database Setting Perfect :-)';
    }
    $_CLASS['core_template']->assign_array(array('database_options' => $database_options, 'error' => empty($error) ? false : implode('<br/>', $error), 'server' => isset($site_db['server']) ? $site_db['server'] : 'localhost', 'port' => isset($site_db['port']) ? $site_db['port'] : '', 'database' => isset($site_db['database']) ? $site_db['database'] : '', 'username' => isset($site_db['username']) ? $site_db['username'] : '', 'password' => isset($site_db['password']) ? $site_db['password'] : '', 'file' => isset($site_db['file']) ? $site_db['file'] : '', 'table_prefix' => get_variable('table_prefix', 'POST', 'cms_'), 'user_prefix' => get_variable('user_prefix', 'POST', 'cms_')));
    $_CLASS['core_template']->display('installer/stage2.html');
    script_close();
}
if ($stage === 1) {
    $gd_info = gd_info();
    $continue = true;
    if (!($compatible = version_compare(PHP_VERSION, '4.2.0', '>='))) {
        $continue = false;
    }
    $_CLASS['core_template']->assign_array(array('error' => false, 'magic_quotes_gpc' => (bool) ini_get('magic_quotes_gpc') === false, 'output_buffering' => (int) ini_get('output_buffering') === 0, 'register_globals' => (bool) ini_get('register_globals') === false, 'safe_mode' => (bool) ini_get('safe_mode') === false, 'php_version' => PHP_VERSION, 'workable_Version' => $compatible, 'recommended_Version' => version_compare(PHP_VERSION, '4.3.0', '>='), 'mbstring' => extension_loaded('mbstring'), 'zlib' => extension_loaded('zlib'), 'gd' => extension_loaded('gd'), 'gd_version' => $gd_info['GD Version'], 'continue' => $continue));
    $_CLASS['core_template']->display('installer/stage1.html');
    script_close();
}
if (!$stage) {
    $_CLASS['core_template']->display('installer/agreement.html');
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:installer.php


示例15: get_header

and open the template in the editor.
-->
<?php 
include_once 'function.php';
get_header();
if (isset($_GET["logout"])) {
    logout();
}
?>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title><?php 
out(get_variable("sitename"));
?>
</title>    
        <meta name="viewport" content="width=device-width" />

        <link rel="stylesheet" href="style/bootstrap/css/bootstrap.min.css">
        <link rel="stylesheet" href="style/ihover.css">
        <link rel="stylesheet" href="style/bootstrap/css/bootstrap-theme.min.css">
        <link rel="stylesheet" href="style/style.css">

        <script src="js/jquery.min.js"></script>
        <script src="js/jquery-ui/jquery-ui.js"></script>
        <script src="style/bootstrap/js/bootstrap.min.js"></script>

        <link rel="apple-touch-icon" sizes="57x57" href="image/apple-icon-57x57.png">
        <link rel="apple-touch-icon" sizes="60x60" href="image/apple-icon-60x60.png">
开发者ID:eliascantoral,项目名称:gauss_quimica,代码行数:31,代码来源:header.php


示例16: error_reporting

<?php

/*
3/18/09 added direcs
3/22/09 remove terrain, add version settings update
7/28/10 Added inclusion of startup.inc.php for checking of network status and setting of file name variables to support no-maps versions of scripts.
3/15/11 changed stylesheet.php to stylesheet.php
*/
error_reporting(E_ALL);
// 10/1/08
@session_start();
require_once $_SESSION['fip'];
//7/28/10
$old_version = get_variable('_version');
$from_version = "2.10 D beta";
//$from_version = "2.10 D betaZ";
$this_version = "2.10 E beta";
if (!(trim($old_version) == trim($from_version))) {
    die("This script upgrades *only* version '{$from_version}' - but has detected version '{$old_version}' in database '{$mysql_db}'.\n<br />\n<br />Please correct.");
}
// 3/18/09
$query = "ALTER TABLE `{$GLOBALS['mysql_prefix']}responder` ADD `direcs` TINYINT( 2 ) NOT NULL DEFAULT '1' COMMENT '0=>no directions, 1=> yes' AFTER `mobile` ;";
$result = mysql_query($query) or do_error($query, 'mysql_query() failed', mysql_error(), basename(__FILE__), __LINE__);
$query = "ALTER TABLE `{$GLOBALS['mysql_prefix']}responder` ADD `instam` TINYINT( 2 ) NOT NULL DEFAULT '0' COMMENT 'instamapper' AFTER `aprs` ;";
$result = mysql_query($query) or do_error($query, 'mysql_query() failed', mysql_error(), basename(__FILE__), __LINE__);
$query = "UPDATE `{$GLOBALS['mysql_prefix']}settings` SET `name` = 'auto_poll' WHERE `settings`.`name` ='aprs_poll' LIMIT 1 ;";
$result = mysql_query($query) or do_error($query, 'mysql_query() failed', mysql_error(), basename(__FILE__), __LINE__);
$query = "UPDATE `{$GLOBALS['mysql_prefix']}settings` SET `value` = '{$this_version}' WHERE `settings`.`name` ='_version' LIMIT 1 ;";
// 3/22/09
$result = mysql_query($query) or do_error($query, 'mysql_query() failed', mysql_error(), basename(__FILE__), __LINE__);
$query = "ALTER TABLE `{$GLOBALS['mysql_prefix']}tracks_hh` ADD `utc_stamp` BIGINT( 12 ) NOT NULL DEFAULT '0' COMMENT 'Position timestamp in UTC' AFTER `altitude` ;";
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:31,代码来源:upgrade.php


示例17: get_variable

            $cur_folder_id = get_variable('cur_folder_id', 'POST', PRIVMSGS_INBOX, 'int');
            switch ($mark_option) {
                case 'mark_read':
                case 'mark_unread':
                    $read_status = $mark_option === 'mark_read';
                    set_read_status($read_status, $msg_ids, $_CLASS['core_user']->data['user_id'], $cur_folder_id);
                    break;
                default:
                    handle_mark_actions($_CLASS['core_user']->data['user_id'], $mark_option, $msg_ids, $cur_folder_id);
                    break;
            }
        }
        // If new messages arrived, place them into the appropiate folder
        $num_not_moved = 0;
        if ($_CLASS['core_user']->data['user_new_privmsg'] && $action == 'view_folder') {
            place_pm_into_folder($global_privmsgs_rules, get_variable('release', 'POST', 0));
            $num_not_moved = $_CLASS['core_user']->data['user_new_privmsg'];
            // Make sure num_not_moved is valid.
            if ($num_not_moved < 0) {
                $sql = 'UPDATE ' . CORE_USERS_TABLE . '
					SET user_new_privmsg = 0, user_unread_privmsg = 0
					WHERE user_id = ' . $_CLASS['core_user']->data['user_id'];
                $_CLASS['core_db']->query($sql);
                $num_not_moved = $_CLASS['core_user']->data['user_new_privmsg'] = $_CLASS['core_user']->data['user_unread_privmsg'] = 0;
            }
        }
        if (!$msg_id && $folder_id == PRIVMSGS_NO_BOX) {
            $folder_id = PRIVMSGS_INBOX;
        } else {
            if ($msg_id && $folder_id == PRIVMSGS_NO_BOX) {
                $sql = 'SELECT folder_id
开发者ID:BackupTheBerlios,项目名称:viperals-svn,代码行数:31,代码来源:ucp_pm.php


示例18: mysql_query

$severities[$GLOBALS['SEVERITY_MEDIUM']] = "#00FF00";
$severities[$GLOBALS['SEVERITY_HIGH']] = "#F80000";
$colors[$GLOBALS['SEVERITY_NORMAL']] = "black";
$colors[$GLOBALS['SEVERITY_MEDIUM']] = "black";
$colors[$GLOBALS['SEVERITY_HIGH']] = "yellow";
echo "<BODY style='background-color:{$severities[$row['severity']]}; text-color: {$colors[$row['severity']]};' onload = 'ck_frames();' >";
/* Creates statistics header and details of responding and en-route units 7/29/09 */
$result_dispatched = mysql_query("SELECT * FROM `{$GLOBALS['mysql_prefix']}assigns` WHERE ticket_id='{$id}'\n\tAND `dispatched` IS NOT NULL AND `responding` IS NULL AND `on_scene` IS NULL AND `clear` IS NULL");
$num_rows_dispatched = mysql_num_rows($result_dispatched);
$result_responding = mysql_query("SELECT * FROM `{$GLOBALS['mysql_prefix']}assigns` WHERE ticket_id='{$id}'\n\tAND `responding` IS NOT NULL AND `on_scene` IS NULL AND `clear` IS NULL");
$num_rows_responding = mysql_num_rows($result_responding);
$result_on_scene = mysql_query("SELECT * FROM `{$GLOBALS['mysql_prefix']}assigns` WHERE ticket_id='{$id}' \n\tAND `on_scene` IS NOT NULL AND `clear` IS NULL");
$num_rows_on_scene = mysql_num_rows($result_on_scene);
$result_cleared = mysql_query("SELECT * FROM `{$GLOBALS['mysql_prefix']}assigns` WHERE ticket_id='{$id}' \n\tAND `clear` IS NOT NULL");
$num_rows_cleared = mysql_num_rows($result_cleared);
$end_date = is_date($row['problemend']) ? totime($row['problemend']) : time() - get_variable('delta_mins') * 60;
$elapsed = my_date_diff($end_date, totime($row['problemstart']));
// integer values req'd - 3/12/10
$stats = "<B>Severity:&nbsp;{$ticket_severity}, <SPAN STYLE='background-color:white; color:black;'>&nbsp;age: {$elapsed}&nbsp;</SPAN>";
echo $stats;
echo "<BR>Units dispatched:&nbsp;({$num_rows_dispatched})&nbsp;";
while ($row_base = mysql_fetch_array($result_dispatched, MYSQL_ASSOC)) {
    $result = mysql_query("SELECT * FROM `{$GLOBALS['mysql_prefix']}responder` WHERE id='{$row_base['responder_id']}'");
    $row = mysql_fetch_assoc($result);
    echo "{$row['name']}:&nbsp;{$row['handle']}&nbsp;&nbsp;";
}
echo "<BR>Units responding: ({$num_rows_responding})&nbsp;";
while ($row_base = mysql_fetch_array($result_responding, MYSQL_ASSOC)) {
    $result = mysql_query("SELECT * FROM `{$GLOBALS['mysql_prefix']}responder` WHERE id='{$row_base['responder_id']}'");
    $row = mysql_fetch_assoc($result);
    echo "{$row['name']}:&nbsp;{$row['handle']}&nbsp;&nbsp;";
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:31,代码来源:incident_popup_nm.php


示例19: get_variable

<?php

$hide_dispatched = 1;
// 0 is standard, disallows hiding of deployed units. 1 allows deployed units to be hidden.
$hide_status_groups = get_variable('group_or_dispatch');
/*
12/03/10 new file to support hide / show functions for facilities and units.
2/04/11 Revised SQL query in function get_category_butts() to IS NULL rather than <> NULL
2/12/11 Revised SQL in function get_category($unit) to correct error with show / hide when using setting group_or_dispatch = 0
*/
function get_category_butts()
{
    global $hide_status_groups, $hide_dispatched;
    $category_butts = array();
    $query = "SELECT * FROM `{$GLOBALS['mysql_prefix']}assigns` WHERE `clear` IS NULL OR DATE_FORMAT(`clear`,'%y') = '00' ";
    $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
    $num_disp = mysql_num_rows($result);
    //
    if ($num_disp > 0 && $hide_dispatched == 1) {
        $category_butts[0] = "Dispatched";
        $i = 1;
    } else {
        $i = 0;
    }
    if ($hide_status_groups == 1) {
        $query = "SELECT DISTINCT `group` FROM `{$GLOBALS['mysql_prefix']}un_status` ORDER BY `group` ASC";
        $result = mysql_query($query) or do_error($query, 'mysql query failed', mysql_error(), basename(__FILE__), __LINE__);
        while ($row = stripslashes_deep(mysql_fetch_assoc($result))) {
            if ($row['group'] == "" || $row['group'] == NULL || $row['group'] == "NULL") {
                $category_name = "?";
            } else {
开发者ID:sharedgeo,项目名称:TicketsCAD-SharedGeo-Dev,代码行数:31,代码来源:status_cats.inc.php


示例20: popup_ticket


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP get_vars函数代码示例发布时间:2022-05-15
下一篇:
PHP get_var函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap