当前位置: 首页>>代码示例>>PHP>>正文


PHP get_var函数代码示例

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


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

示例1: buy_basic

function buy_basic($item_sql, $item_max_sql, $item_str, $cost)
{
    global $amount, $user, $user_ship, $db_name, $st, $cw;
    settype($amount, "int");
    //security check
    $ret_str = "";
    if ($user_ship[$item_sql] >= $user_ship[$item_max_sql]) {
        $ret_str .= sprintf($st[1052], $item_str);
    } elseif ($amount < 1) {
        $amount_can_buy = floor($user['cash'] / $cost);
        if ($amount_can_buy > $user_ship[$item_max_sql] - $user_ship[$item_sql]) {
            $amount_can_buy = $user_ship[$item_max_sql] - $user_ship[$item_sql];
        }
        get_var($cw['buy'] . " {$item_str}", 'equip_shop.php', sprintf($st[759], $item_str), 'amount', $amount_can_buy);
    } else {
        $total_cost = $amount * $cost;
        if ($user['cash'] < $total_cost) {
            $ret_str .= $st[1054] . "<b class='b1'>{$item_str}</b>.<p />";
        } elseif ($user_ship[$item_sql] + $amount > $user_ship[$item_max_sql]) {
            $ret_str .= $st[1055] . " <b class='b1'>{$item_str}</b>.<p />";
        } else {
            $ret_str .= "<b>{$amount}</b> <b class='b1'>{$item_str}</b> " . $cw['purchased_for'] . " <b>{$total_cost}</b> " . $cw['credits.'] . "<p />";
            take_cash($total_cost);
            dbn("update {$db_name}_ships set {$item_sql} = {$item_sql} + '{$amount}' where ship_id = '{$user_ship['ship_id']}'");
            $user_ship[$item_sql] += $amount;
        }
    }
    return $ret_str;
}
开发者ID:nilsine,项目名称:Astra-Vires,代码行数:29,代码来源:equip_shop.php

示例2: nextmatchs

 function nextmatchs($website = False)
 {
     if (!$website) {
         $this->template = createobject('phpgwapi.Template', PHPGW_TEMPLATE_DIR);
         $this->template->set_file(array('_nextmatchs' => 'nextmatchs.tpl'));
         $this->template->set_block('_nextmatchs', 'nextmatchs');
         $this->template->set_block('_nextmatchs', 'filter');
         $this->template->set_block('_nextmatchs', 'form');
         $this->template->set_block('_nextmatchs', 'icon');
         $this->template->set_block('_nextmatchs', 'link');
         $this->template->set_block('_nextmatchs', 'search');
         $this->template->set_block('_nextmatchs', 'cats');
         $this->template->set_block('_nextmatchs', 'search_filter');
         $this->template->set_block('_nextmatchs', 'cats_search_filter');
     }
     if (isset($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']) && (int) $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0) {
         $this->maxmatches = (int) $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
     } else {
         $this->maxmatches = 15;
     }
     $this->_start = (int) get_var('start', array('GLOBAL', 'POST', 'GET'));
     foreach (array('menuaction', 'filter', 'qfield', 'order', 'sort') as $name) {
         $var = '_' . $name;
         $this->{$var} = get_var($name, array('GLOBAL', 'POST', 'GET'));
         if (!preg_match('/^[a-z0-9_. -]*$/i', $this->{$var})) {
             $this->{$var} = '';
         }
     }
     if (!is_object($GLOBALS['phpgw']->html)) {
         $GLOBALS['phpgw']->html = CreateObject('phpgwapi.html');
     }
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:32,代码来源:class.nextmatchs.inc.php

示例3: ds

 function ds()
 {
     $data['title'] = "Danh sách sản phẩm";
     $data['add'] = 'product/add';
     $cat_id = get_var('cat_id', 'int');
     $key_word = get_var('key');
     $field = get_var('f') ? get_var('f') : 't.id';
     $order = get_var('o') ? get_var('o') : 'desc';
     $get = $this->request->get;
     $str = '';
     foreach ($get as $val => $keys) {
         $str .= '&' . $val . '=' . $keys;
     }
     $str = trim($str, '&');
     $str_get = count($get) ? '?' . $str : '';
     $data['cat_id'] = $cat_id;
     $data['keyword'] = $key_word;
     $data['dscat'] = $this->product->get_all_cat();
     $config['base_url'] = base_url() . 'product/ds';
     $config['suffix'] = '.html' . $str_get;
     $config['total_rows'] = $this->product->get_num_product($key_word, $cat_id);
     $data['num'] = $config['total_rows'];
     $config['per_page'] = 10;
     $config['uri_segment'] = 3;
     $this->load->library('pagination');
     $this->pagination->initialize($config);
     $data['list'] = $this->product->get_all_product($config['per_page'], segment(3, 'int'), $key_word, $cat_id, $field, $order);
     $data['pagination'] = $this->pagination->create_links();
     $this->load->templates('product/ds', $data, 'file');
 }
开发者ID:VoDongMy,项目名称:VoDongMy,代码行数:30,代码来源:product.php

示例4: generate_header

 function generate_header()
 {
     $GLOBALS['header_template']->set_file(array('header' => 'header.inc.php.template'));
     $GLOBALS['header_template']->set_block('header', 'domain', 'domain');
     $var = array();
     $deletedomain = get_var('deletedomain', array('POST'));
     $domains = get_var('domains', array('POST'));
     @reset($domains);
     while ($domains && (list($k, $v) = @each($domains))) {
         if (isset($deletedomain[$k])) {
             continue;
         }
         //$dom = get_var('setting_'.$k,Array('POST'));
         $dom = $_POST['settings'][$k];
         $GLOBALS['header_template']->set_var('DB_DOMAIN', $v);
         while (list($x, $y) = @each($dom)) {
             $GLOBALS['header_template']->set_var(strtoupper($x), $y);
         }
         $GLOBALS['header_template']->parse('domains', 'domain', True);
     }
     $GLOBALS['header_template']->set_var('domain', '');
     $setting = get_var('setting', array('POST'));
     if (!empty($setting) && is_array($setting)) {
         foreach ($setting as $k => $v) {
             $var[strtoupper($k)] = $v;
         }
     }
     $GLOBALS['header_template']->set_var($var);
     return $GLOBALS['header_template']->parse('out', 'header');
 }
开发者ID:helenadeus,项目名称:s3db.map,代码行数:30,代码来源:class.setup_html.inc.php

示例5: index

 function index()
 {
     $data['title'] = "Quản lý Danh Bạ";
     $data['delete'] = true;
     $data['add'] = 'contacts/add';
     $field = get_var('field') ? get_var('field') : 'id';
     $order = get_var('order') ? get_var('order') : 'desc';
     $key_word = $_GET['key'];
     $id_office = get_var('id', 'int');
     $data['key'] = $key_word;
     $data['id_office'] = $id_office;
     $data['field'] = $field;
     $data['order'] = $order;
     $data['page'] = get_var('page', 'int');
     $get = $this->request->get;
     $str = '';
     foreach ($get as $val => $keys) {
         $str .= '&' . $val . '=' . $keys;
     }
     $str = trim($str, '&');
     $str_get = count($get) ? '?' . $str : '';
     $data['listoffice'] = $this->contacts->get_all_office();
     $config['base_url'] = base_url() . 'contacts/' . $this->uri->segment(2) . '/';
     $config['suffix'] = '.html' . $str_get;
     $config['total_rows'] = $this->contacts->get_num_contacts($key_word, $id_office);
     $data['num'] = $config['total_rows'];
     $config['per_page'] = 20;
     $config['uri_segment'] = 3;
     $this->load->library('pagination');
     $this->pagination->initialize($config);
     $data['list'] = $this->contacts->get_all_contacts($config['per_page'], segment(3, 'int'), $field, $order, $key_word, $id_office);
     //var_dump($data['list']);
     $data['pagination'] = $this->pagination->create_links();
     $this->load->templates('index', $data);
 }
开发者ID:VoDongMy,项目名称:VoDongMy,代码行数:35,代码来源:contacts.php

示例6: execute

 function execute()
 {
     ob_start();
     $act = get_var($this->rg->get('act'));
     $det = get_var($this->rg->get('det'));
     $api = $this->rg->get('api');
     if ($api) {
         $action = BASEPATH . 'api/' . $api . '/controllers/' . $act . EXT;
         if (file_exists($action)) {
             include_once $action;
             if (class_exists($act)) {
                 $exec = new $act();
                 if ($det) {
                     if (method_exists($exec, $det)) {
                         $exec->{$det}();
                     }
                 } else {
                     if (method_exists($exec, 'execute')) {
                         $exec->execute();
                     }
                 }
             } else {
                 include BASEPATH . 'errors/503' . EXT;
             }
         } else {
             include BASEPATH . 'errors/503' . EXT;
         }
     }
     ob_end_flush();
 }
开发者ID:ovarz,项目名称:cobablue,代码行数:30,代码来源:views.php

示例7: showLinks

 function showLinks($name, $app, $id, $only_app = '', $show_unlink = True)
 {
     $value = get_var($name, array('POST'));
     if (!is_array($value)) {
         $value = array();
     }
     list($unlink) = @each($value['unlink']);
     if ($this->debug) {
         echo "<p>uilink.showLinks: app='{$app}',id='{$id}', unlink={$unlink}, {$name} = ";
         _debug_array($value);
     }
     if ($unlink) {
         $this->unlink($unlink, $app, $id);
         //echo "<p>$unlink unlinked</p>\n";
     }
     $etemplate = CreateObject('etemplate.etemplate', 'infolog.linklist_widget');
     $links = $this->get_links($app, $id, $only_app);
     $value = array();
     for ($row = $etemplate->rows - 1; list(, $link) = each($links); ++$row) {
         $value[$row] = $link;
         $value[$row]['title'] = $this->title($link['app'], $link['id']);
     }
     $value['app'] = $app;
     $value['id'] = $id;
     $value['title'] = $this->title($app, $id);
     $out = $etemplate->show($value, '', '', $name);
     $out = str_replace('[]', '', $out);
     return eregi_replace('[</]*table[^>]*>', '', $out);
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:29,代码来源:class.uilink.inc.php

示例8: check_form_values

function check_form_values()
{
    // PHP will automatically replace any dots in incoming
    // variable names with underscores.
    $errors = '';
    $domains = get_var('domains', array('POST'));
    @reset($domains);
    while (list($k, $v) = @each($domains)) {
        $variableName = str_replace('.', '_', $k);
        $deletedomain = get_var('deletedomain', array('POST'));
        if (isset($deletedomain[$variableName])) {
            continue;
        }
        $dom = get_var('setting_' . $variableName, array('POST'));
        if (!$dom['config_pass'] && !$dom['config_password']) {
            $errors .= '<br>' . lang("You didn't enter a config password for domain %1", $v);
        }
        if (!$dom['config_user']) {
            $errors .= '<br>' . lang("You didn't enter a config username for domain %1", $v);
        }
    }
    $setting = get_var('setting', array('POST'));
    if (!$setting['HEADER_ADMIN_PASSWORD'] && !$setting['HEADER_ADMIN_PASS']) {
        $errors .= '<br>' . lang("You didn't enter a header admin password");
    }
    if (!$setting['HEADER_ADMIN_USER']) {
        $errors .= '<br>' . lang("You didn't enter a header admin username");
    }
    if ($errors) {
        $GLOBALS['phpgw_setup']->html->show_header('Error', True);
        echo $errors;
        echo '<p><input type="submit" value="' . lang('Back to the previous screen') . '" onClick="history.back()"></p>';
        exit;
    }
}
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:35,代码来源:manageheader.php

示例9: get_filecatname

function get_filecatname($catid)
{
    $sql_pre = "SELECT `catname` FROM `yxy_filecat` WHERE `id` = ?i";
    $array = array($catid);
    $sql = prepare($sql_pre, $array);
    return get_var($sql);
}
开发者ID:doumaomao,项目名称:Lazy-lawyer,代码行数:7,代码来源:default.function.php

示例10: editdatabase

 function editdatabase()
 {
     $GLOBALS['phpgw_info']['flags']['app_header'] = 'SyncML synchronization: Edit database';
     $database_id = get_var('database_id', array('POST', 'GET'));
     $submit = get_var('submit', array('POST'));
     $values = get_var('values', array('POST'));
     if (is_array($values)) {
         if (isset($submit['add']) && $submit['add']) {
             /*
             $this->sodatabases->insert_database(
             	$values['uri'],
             	$values['app'],
             	base64_encode(md5(
             		$account_lid . ':' . $password, true
             	))
             );
             */
         }
         $GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 'syncml.uisyncml.listdatabases'));
     } else {
         if ($database_id) {
             // todo: get database data from database.
             $GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('edit_database' => array('action_url' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'syncml.uisyncml.editdatabase')), 'database_id' => $database_id)));
         }
     }
 }
开发者ID:HaakonME,项目名称:porticoestate,代码行数:26,代码来源:class.uisyncml.inc.php

示例11: display_section

 function display_section($_menuData)
 {
     $i = 0;
     // reset the value of all_rows
     $this->t->set_var('all_rows', '');
     while (list($key, $value) = each($_menuData)) {
         if (!empty($value['extradata'])) {
             $link = $GLOBALS['phpgw']->link($value['url'], 'account_id=' . get_var('account_id', array('GET', 'POST')) . '&' . $value['extradata']);
         } else {
             $link = $GLOBALS['phpgw']->link($value['url'], 'account_id=' . get_var('account_id', array('GET', 'POST')));
         }
         $this->section_item($link, lang($value['description']), $this->rowColor[$i % 2]);
         $i++;
     }
     $this->t->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']);
     if (strpos($_menuData[0]['extradata'], 'user')) {
         $destination = 'users';
     } else {
         $destination = 'groups';
     }
     $this->t->set_var('link_done', $GLOBALS['phpgw']->link('/index.php', 'menuaction=admin.uiaccounts.list_' . $destination));
     $this->t->set_var('lang_done', lang('Back'));
     $this->t->set_var('row_on', $this->rowColor[0]);
     $this->t->parse('out', 'menu_links');
     return $this->t->get('out', 'menu_links');
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:26,代码来源:class.uimenuclass.inc.php

示例12: is_single

/**
 * Checks if current page is a single view page
 */
function is_single()
{
    $action = get_var('action');
    if ($action == 'view' || $action == 'add') {
        return true;
    } else {
        return false;
    }
}
开发者ID:Hackmastr,项目名称:apps-base,代码行数:12,代码来源:functions-core.php

示例13: __construct

 final function __construct($id)
 {
     parent::__construct($id);
     $this->_ancho = get_var($this->_info_firma['ancho'], '500px');
     $this->_alto = get_var($this->_info_firma['alto'], '120px');
     if (isset($this->_memoria['dir_actual'])) {
         $this->_multiple = $this->_memoria['multiple'];
     }
 }
开发者ID:emma5021,项目名称:toba,代码行数:9,代码来源:toba_ei_firma.php

示例14: generate_header

 function generate_header()
 {
     // PHP will automatically replace any dots in incoming
     // variable names with underscores.
     $GLOBALS['header_template']->set_file(array('header' => 'header.inc.php.template'));
     $GLOBALS['header_template']->set_block('header', 'domain', 'domain');
     $var = array();
     $deletedomain = get_var('deletedomain', array('POST'));
     $domains = get_var('domains', array('POST'));
     @reset($domains);
     while ($domains && (list($k, $v) = @each($domains))) {
         if (isset($deletedomain[$k])) {
             continue;
         }
         $variableName = str_replace('.', '_', $k);
         $dom = get_var('setting_' . $variableName, array('POST'));
         $GLOBALS['header_template']->set_var('DB_DOMAIN', $v);
         while (list($x, $y) = @each($dom)) {
             if (strtoupper($x) == 'CONFIG_PASS') {
                 $GLOBALS['header_template']->set_var(strtoupper($x), md5($y));
             } else {
                 $GLOBALS['header_template']->set_var(strtoupper($x), $y);
             }
         }
         /* Admin did not type a new password, so use the old one from the hidden field,
          * which is already md5 encoded.
          */
         if ($dom['config_password'] && !$dom['config_pass']) {
             /* Real == hidden */
             $GLOBALS['header_template']->set_var('CONFIG_PASS', $dom['config_password']);
         }
         /* If the admin didn't select a db_port, set to the default */
         if (!$dom['db_port']) {
             $GLOBALS['header_template']->set_var('DB_PORT', $GLOBALS['default_db_ports'][$dom['db_type']]);
         }
         $GLOBALS['header_template']->parse('domains', 'domain', True);
     }
     $GLOBALS['header_template']->set_var('domain', '');
     $setting = get_var('setting', array('POST'));
     while ($setting && (list($k, $v) = @each($setting))) {
         if (strtoupper($k) == 'HEADER_ADMIN_PASSWORD') {
             $var[strtoupper($k)] = md5($v);
         } else {
             $var[strtoupper($k)] = $v;
         }
     }
     /* Admin did not type a new header password, so use the old one from the hidden field,
      * which is already md5 encoded.
      */
     if ($var['HEADER_ADMIN_PASS'] && empty($setting['HEADER_ADMIN_PASSWORD'])) {
         /* Real == hidden */
         $var['HEADER_ADMIN_PASSWORD'] = $var['HEADER_ADMIN_PASS'];
     }
     $GLOBALS['header_template']->set_var($var);
     return $GLOBALS['header_template']->parse('out', 'header');
 }
开发者ID:BackupTheBerlios,项目名称:milaninegw-svn,代码行数:56,代码来源:class.setup_html.inc.php

示例15: getIdByMark

 /**
  * 通过标记名获取ID
  *
  * @author boxcore
  * @date   2014-09-17
  * @param  string     $mark 标记
  * @return int        task_id
  */
 public function getIdByMark($mark = '')
 {
     $id = 0;
     $mark = trim($mark);
     if (!empty($mark)) {
         $sql = prepare('SELECT `id` FROM `task_list` WHERE `mark` = ?s LIMIT 1', array($mark));
         $id = get_var($sql);
     }
     return $id;
 }
开发者ID:boxcore,项目名称:xspider,代码行数:18,代码来源:TaskModel.php


注:本文中的get_var函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。