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

PHP form_select函数代码示例

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

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



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

示例1: display_html

function display_html($formname, $textarea, $html = TRUE, $colors = FALSE, $images = FALSE, $folder = "")
{
    global $locale;
    $res = "";
    if ($html) {
        $res .= "<div class='btn-group m-b-10'>\n";
        $res .= "<button type='button' value='b' class='btn btn-sm btn-default button' style='font-weight:bold;' onclick=\"addText('" . $textarea . "', '&lt;strong&gt;', '&lt;/strong&gt;', '" . $formname . "');\">b</button>\n";
        $res .= "<button type='button' value='i' class='btn btn-sm btn-default button' style='font-style:italic;' onclick=\"addText('" . $textarea . "', '&lt;i&gt;', '&lt;/i&gt;', '" . $formname . "');\">i</button>\n";
        $res .= "<button type='button' value='u' class='btn btn-sm btn-default button' style='text-decoration:underline;' onclick=\"addText('" . $textarea . "', '&lt;u&gt;', '&lt;/u&gt;', '" . $formname . "');\">u</button>\n";
        $res .= "<button type='button' value='link' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;a href=\\'', '\\' target=\\'_blank\\'>Link&lt;/a&gt;', '" . $formname . "');\">link</button>\n";
        $res .= "<button type='button' value='img' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;img src=\\'" . str_replace("../", "", $folder) . "', '\\' style=\\'margin:5px\\' alt=\\'\\' align=\\'left\\' /&gt;', '" . $formname . "');\">img</button>\n";
        $res .= "<button type='button' value='center' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;center&gt;', '&lt;/center&gt;', '" . $formname . "');\">center</button>\n";
        $res .= "<button type='button' value='small' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;span class=\\'small\\'&gt;', '&lt;/span&gt;', '" . $formname . "');\">small</button>\n";
        $res .= "<button type='button' value='small2' class='btn btn-sm  btn-default button' onclick=\"addText('" . $textarea . "', '&lt;span class=\\'small2\\'&gt;', '&lt;/span&gt;', '" . $formname . "');\">small2</button>\n";
        $res .= "<button type='button' value='alt' class='btn btn-sm btn-default button' onclick=\"addText('" . $textarea . "', '&lt;span class=\\'alt\\'&gt;', '&lt;/span&gt;', '" . $formname . "');\">alt</button>\n";
        $res .= "</div>\n";
    }
    if ($colors) {
        $color_array = array('maroon' => $locale['html402'], 'red' => $locale['html403'], 'orange' => $locale['html404'], 'brown' => $locale['html405'], 'yellow' => $locale['html406'], 'green' => $locale['html407'], 'lime' => $locale['html408'], 'olive' => $locale['html409'], 'cyan' => $locale['html410'], 'blue' => $locale['html411'], 'navy' => $locale['html412'], 'purple' => $locale['html413'], 'violet' => $locale['html414'], 'black' => $locale['html415'], 'gray' => $locale['html416'], 'silver' => $locale['html417'], 'white' => $locale['html418']);
        $placeholder = $locale['html400'];
        $res .= form_select('', "setcolor-{$formname}", "setcolor-{$formname}", $color_array, '', array('placeholder' => $placeholder, 'class' => 'pull-left m-r-10', 'allowclear' => 1));
        add_to_jquery("\r\n                function color(item) {\r\n                if(!item.id) {return item.text;}\r\n                var color = item.text;\r\n                return '<table><tr><td><label style=\\'display: inline-block; width: 18px; height:18px; margin:3px; margin-right:5px; padding: 0px 8px; background:'+item.text+'\\'></label>'+item.text+'</td></tr></table>';\r\n                }\r\n                \$('#setcolor-{$formname}').select2({\r\n                formatSelection: color,\r\n                escapeMarkup: function(m) { return m; },\r\n                formatResult: color,\r\n                placeholder:'{$placeholder}',\r\n                allowClear:true,\r\n                });\r\n            \$('#setcolor-{$formname}').on('change', function(e){\r\n            addText('" . $textarea . "', '<span style=\\'color:' + this.options[this.selectedIndex].value + '\\'>', '</span>', '" . $formname . "');this.selectedIndex=0;\r\n            \$(this).select2({\r\n                formatSelection: color,\r\n                escapeMarkup: function(m) { return m; },\r\n                formatResult: color,\r\n                placeholder:'{$placeholder}',\r\n                allowClear:true}).val('');\r\n            });\r\n        ");
    }
    if ($images && $folder) {
        $image_files = makefilelist($folder, ".|..|index.php", TRUE);
        $image_list = makefileopts($image_files);
        $res .= "<select name='insertimage' class='form-control textbox' style='margin-top:5px' onchange=\"insertText('" . $textarea . "', '&lt;img src=\\'" . str_replace("../", "", $folder) . "' + this.options[this.selectedIndex].value + '\\' alt=\\'\\' style=\\'margin:5px\\' align=\\'left\\' /&gt;', '" . $formname . "');this.selectedIndex=0;\">\n";
        $res .= "<option value=''>" . $locale['html401'] . "</option>\n" . $image_list . "</select>\n";
    }
    return $res;
}
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:html_buttons_include.php


示例2: generateForm

 function generateForm()
 {
     $output = form_hidden('edit[step]', 'confirm');
     $player = $this->registration->user();
     if (!$player) {
         return false;
     }
     $noneditable = array();
     $noneditable[] = array('Name', l($player->fullname, url("person/view/{$player->id}")));
     $noneditable[] = array('Member&nbsp;ID', $player->member_id);
     $noneditable[] = array('Event', l($this->event->name, url("event/view/{$this->event->registration_id}")));
     $noneditable[] = array('Registered Price', $this->registration->total_amount);
     $form = '<div class="pairtable">' . table(NULL, $noneditable) . '</div>';
     $pay_opts = getOptionsFromEnum('registrations', 'payment');
     array_shift($pay_opts);
     $form .= form_select('Registration Status', 'edit[payment]', $this->registration->payment, $pay_opts);
     $form .= form_textarea('Notes', 'edit[notes]', $this->registration->notes, 45, 5);
     $output .= form_group('Registration details', $form);
     if ($this->formbuilder) {
         $this->formbuilder->bulk_set_answers_sql('SELECT qkey, akey FROM registration_answers WHERE order_id = ?', array($this->registration->order_id));
         if (count($this->formbuilder->_answers) > 0) {
             $output .= form_group('Registration answers', $this->formbuilder->render_editable(true));
         } else {
             $output .= form_group('Registration answers', $this->formbuilder->render_editable(false));
         }
     }
     $output .= form_submit('Submit') . form_reset('Reset');
     return form($output);
 }
开发者ID:roboshed,项目名称:leaguerunner,代码行数:29,代码来源:edit.php


示例3: selectDate

 function selectDate()
 {
     global $dbh;
     if (!$this->league->load_teams()) {
         error_exit("Error loading teams for league {$league->fullname}");
     }
     $output .= "<p>Games for " . strftime("%A %B %d %Y", $this->day_id) . " should be moved to: </p>";
     $sth = $dbh->prepare("SELECT COUNT(*) from schedule s, gameslot g WHERE s.game_id = g.game_id AND s.league_id = ? AND UNIX_TIMESTAMP(g.game_date) = ?");
     $sth->execute(array($this->league->league_id, $this->day_id));
     $need_slots = $sth->fetchColumn();
     $sth = $dbh->prepare("SELECT\n\t\t\t\tUNIX_TIMESTAMP(s.game_date) AS datestamp,\n\t\t\t\tCOUNT(*) AS num_avail\n\t\t\t FROM\n\t\t\t \tleague_gameslot_availability a, gameslot s\n\t\t\t WHERE (a.slot_id = s.slot_id)\n\t\t\t \tAND isnull(s.game_id)\n\t\t\t\tAND a.league_id = ?\n\t\t\t\tAND UNIX_TIMESTAMP(s.game_date) != ?\n\t\t\t GROUP BY s.game_date\n\t\t\t ORDER BY s.game_date");
     $sth->execute(array($this->league->league_id, $this->day_id));
     $possible_dates = array();
     while ($date = $sth->fetch(PDO::FETCH_OBJ)) {
         $possible_dates[$date->datestamp] = strftime("%A %B %d %Y", $date->datestamp);
     }
     if (count($possible_dates) == 0) {
         error_exit("Sorry, there are no future fields available for your league.  Check that fields have been allocated before attempting to proceed.");
     }
     $output .= form_hidden('edit[step]', 'confirm');
     $output .= form_hidden('edit[type]', $type);
     $output .= form_hidden('edit[olddate]', $this->day_id);
     $output .= form_select('Start date', 'edit[newdate]', null, $possible_dates);
     $output .= form_submit('Next step');
     return form($output);
 }
开发者ID:roboshed,项目名称:leaguerunner,代码行数:26,代码来源:reschedule.php


示例4: global_settings

function global_settings()
{
    $group = form_textfield('Organization name', 'edit[app_org_name]', variable_get('app_org_name', ''), 60, 120, 'Your organization\'s full name.');
    $group .= form_textfield('Organization short name', 'edit[app_org_short_name]', variable_get('app_org_short_name', ''), 60, 120, 'Your organization\'s abbreviated name or acronym.');
    $group .= form_textfield('Address', 'edit[app_org_address]', variable_get('app_org_address', ''), 60, 120, 'Your organization\'s street address.');
    $group .= form_textfield('Unit', 'edit[app_org_address2]', variable_get('app_org_address2', ''), 60, 120, 'Your organization\'s unit number, if any.');
    $group .= form_textfield('City', 'edit[app_org_city]', variable_get('app_org_city', ''), 60, 120, 'Your organization\'s city.');
    $group .= form_select('Province/State', 'edit[app_org_province]', variable_get('app_org_province', ''), getProvinceNames(), 'Your organization\'s province or state.');
    $group .= form_textfield('Postal code', 'edit[app_org_postal]', variable_get('app_org_postal', ''), 60, 120, 'Your organization\'s postal code.');
    $group .= form_textfield('Phone', 'edit[app_org_phone]', variable_get('app_org_phone', ''), 60, 120, 'Your organization\'s phone number.');
    $group .= form_textfield('Administrator name', 'edit[app_admin_name]', variable_get('app_admin_name', 'Leaguerunner Administrator'), 60, 120, 'The name (or descriptive role) of the system administrator. Mail from Leaguerunner will come from this name.');
    $group .= form_textfield('Administrator e-mail address', 'edit[app_admin_email]', variable_get('app_admin_email', $_SERVER['SERVER_ADMIN']), 60, 120, 'The e-mail address of the system administrator.  Mail from Leaguerunner will come from this address.');
    $output = form_group('Organization Details', $group);
    $group = form_textfield('Latitude', 'edit[location_latitude]', variable_get('location_latitude', ''), 10, 10, 'Latitude in decimal degrees for game location (center of city).  Used for calculating sunset times.');
    $group .= form_textfield('Longitude', 'edit[location_longitude]', variable_get('location_longitude', ''), 10, 10, 'Longitude in decimal degrees for game location (center of city).  Used for calculating sunset times.');
    $output .= form_group('Location Details', $group);
    $group = form_textfield('Name of application', 'edit[app_name]', variable_get('app_name', 'Leaguerunner'), 60, 120, 'The name this application will be known as to your users.');
    $group .= form_textfield('Items per page', 'edit[items_per_page]', variable_get('items_per_page', 25), 10, 10, 'The number of items that will be shown per page on long reports, 0 for no limit (not recommended).');
    $group .= form_textfield('Base location of static league files (filesystem)', 'edit[league_file_base]', variable_get('league_file_base', '/opt/websites/www.ocua.ca/static-content/leagues'), 60, 120, 'The filesystem location where files for permits, exported standings, etc, shall live.');
    $group .= form_textfield('Base location of static league files (URL)', 'edit[league_url_base]', variable_get('league_url_base', 'http://www.ocua.ca/leagues'), 60, 120, 'The web-accessible URL where files for permits, exported standings, etc, shall live.');
    $group .= form_textfield('Location of privacy policy (URL)', 'edit[privacy_policy]', variable_get('privacy_policy', "{$_SERVER['SERVER_NAME']}/privacy"), 60, 120, 'The web-accessible URL where the organization\'s privacy policy is located. Leave blank if you don\'t have an online privacy policy.');
    $group .= form_textfield('Location of password reset (URL)', 'edit[password_reset]', variable_get('password_reset', url('person/forgotpassword')), 60, 120, 'The web-accessible URL where the password reset page is located.');
    $group .= form_textfield('Google Maps API Key', 'edit[gmaps_key]', variable_get('gmaps_key', ''), 60, 120, 'An API key for the <a href="http://www.google.com/apis/maps/signup.html">Google Maps API</a>. Required for rendering custom Google Maps');
    $output .= form_group('Site configuration', $group);
    $group = form_select('Current Season', 'edit[current_season]', variable_get('current_season', 'Summer'), getOptionsFromQuery("SELECT id AS theKey, display_name AS theValue FROM season ORDER BY year, id"), 'Season of play currently in effect');
    $output .= form_group('Season Information', $group);
    $group = form_textfield('Spirit penalty for not entering score', 'edit[missing_score_spirit_penalty]', variable_get('missing_score_spirit_penalty', 3), 10, 10);
    $group .= form_textfield('Winning score to record for defaults', 'edit[default_winning_score]', variable_get('default_winning_score', 6), 10, 10);
    $group .= form_textfield('Losing score to record for defaults', 'edit[default_losing_score]', variable_get('default_losing_score', 0), 10, 10);
    $group .= form_radios('Transfer ratings points for defaults', 'edit[default_transfer_ratings]', variable_get('default_transfer_ratings', 0), array('Disabled', 'Enabled'));
    $group .= form_select('Spirit Questions', 'edit[spirit_questions]', variable_get('spirit_questions', 'team_spirit'), array('team_spirit' => 'team_spirit', 'ocua_team_spirit' => 'ocua_team_spirit'), 'Type of spirit questions to use.');
    $output .= form_group('Game Finalization', $group);
    return $output;
}
开发者ID:roboshed,项目名称:leaguerunner,代码行数:34,代码来源:settings.php


示例5: showratings

function showratings($rating_type, $rating_item_id, $rating_link)
{
    global $locale, $userdata;
    $settings = \fusion_get_settings();
    if ($settings['ratings_enabled'] == "1") {
        if (iMEMBER) {
            $d_rating = dbarray(dbquery("SELECT rating_vote,rating_datestamp FROM " . DB_RATINGS . " WHERE rating_item_id='" . $rating_item_id . "' AND rating_type='" . $rating_type . "' AND rating_user='" . $userdata['user_id'] . "'"));
            if (isset($_POST['post_rating'])) {
                // Rate
                if (isnum($_POST['rating']) && $_POST['rating'] > 0 && $_POST['rating'] < 6 && !isset($d_rating['rating_vote'])) {
                    $result = dbquery("INSERT INTO " . DB_RATINGS . " (rating_item_id, rating_type, rating_user, rating_vote, rating_datestamp, rating_ip, rating_ip_type) VALUES ('{$rating_item_id}', '{$rating_type}', '" . $userdata['user_id'] . "', '" . $_POST['rating'] . "', '" . time() . "', '" . USER_IP . "', '" . USER_IP_TYPE . "')");
                    if ($result) {
                        defender::unset_field_session();
                    }
                }
                redirect($rating_link);
            } elseif (isset($_POST['remove_rating'])) {
                // Unrate
                $result = dbquery("DELETE FROM " . DB_RATINGS . " WHERE rating_item_id='{$rating_item_id}' AND rating_type='{$rating_type}' AND rating_user='" . $userdata['user_id'] . "'");
                if ($result) {
                    defender::unset_field_session();
                }
                redirect($rating_link);
            }
        }
        $ratings = array(5 => $locale['r120'], 4 => $locale['r121'], 3 => $locale['r122'], 2 => $locale['r123'], 1 => $locale['r124']);
        if (!iMEMBER) {
            $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a>", $locale['r104']);
            if (fusion_get_settings("enable_registration") == TRUE) {
                $message = str_replace("[RATING_ACTION]", "<a href='" . BASEDIR . "login.php'>" . $locale['login'] . "</a> " . $locale['or'] . " <a href='" . BASEDIR . "register.php'>" . $locale['register'] . "</a>", $locale['r104']);
            }
            echo "<div class='text-center'>" . $message . "</div>\n";
        } elseif (isset($d_rating['rating_vote'])) {
            echo "<div class='display-block'>\n";
            echo openform('removerating', 'post', $rating_link, array('class' => 'display-block text-center'));
            echo sprintf($locale['r105'], $ratings[$d_rating['rating_vote']], showdate("longdate", $d_rating['rating_datestamp'])) . "<br /><br />\n";
            echo form_button('remove_rating', $locale['r102'], $locale['r102'], array('class' => 'btn-default', 'icon' => 'fa fa-times m-r-10'));
            echo closeform();
            echo "</div>\n";
        } else {
            echo "<div class='display-block'>\n";
            echo openform('postrating', 'post', $rating_link, array('max_tokens' => 1, 'notice' => 0, 'class' => 'm-b-20 text-center'));
            echo form_select('rating', $locale['r106'], '', array('options' => $ratings, 'class' => 'display-block text-center'));
            echo form_button('post_rating', $locale['r103'], $locale['r103'], array('class' => 'btn-primary btn-sm', 'icon' => 'fa fa-thumbs-up m-r-10'));
            echo closeform();
            echo "</div>\n";
        }
        $rating_votes = dbarray(dbquery("\n\t\tSELECT\n\t\tSUM(IF(rating_vote='5', 1, 0)) as r120,\n\t\tSUM(IF(rating_vote='4', 1, 0)) as r121,\n\t\tSUM(IF(rating_vote='3', 1, 0)) as r122,\n\t\tSUM(IF(rating_vote='2', 1, 0)) as r123,\n\t\tSUM(IF(rating_vote='1', 1, 0)) as r124\n\t\tFROM " . DB_RATINGS . " WHERE rating_type='" . $rating_type . "' and rating_item_id='" . intval($rating_item_id) . "'\n\t\t"));
        if (!empty($rating_votes)) {
            echo "<div id='ratings' class='rating_container'>\n";
            foreach ($rating_votes as $key => $num) {
                echo progress_bar($num, $locale[$key], FALSE, '10px', TRUE, FALSE);
            }
            echo "</div>\n";
        } else {
            echo "<div class='text-center'>" . $locale['r101'] . "</div>\n";
        }
    }
}
开发者ID:knapnet,项目名称:PHP-Fusion,代码行数:59,代码来源:ratings_include.php


示例6: UserAngelType_add_view

function UserAngelType_add_view($angeltype, $users_source, $user_id)
{
    $users = array();
    foreach ($users_source as $user_source) {
        $users[$user_source['UID']] = User_Nick_render($user_source);
    }
    return page_with_title(_("Add user to angeltype"), array(msg(), buttons(array(button(page_link_to('angeltypes') . '&action=view&angeltype_id=' . $angeltype['id'], _("back"), 'back'))), form(array(form_info(_("Angeltype"), $angeltype['name']), form_select('user_id', _("User"), $users, $user_id), form_submit('submit', _("Add"))))));
}
开发者ID:max-weller,项目名称:engelsystem,代码行数:8,代码来源:UserAngelTypes_view.php


示例7: ShiftType_edit_view

function ShiftType_edit_view($name, $angeltype_id, $angeltypes, $description, $shifttype_id)
{
    $angeltypes_select = ['' => _('All')];
    foreach ($angeltypes as $angeltype) {
        $angeltypes_select[$angeltype['id']] = $angeltype['name'];
    }
    return page_with_title($shifttype_id ? _('Edit shifttype') : _('Create shifttype'), [msg(), buttons([button(page_link_to('shifttypes'), shifttypes_title(), 'back')]), form([form_text('name', _('Name'), $name), form_select('angeltype_id', _('Angeltype'), $angeltypes_select, $angeltype_id), form_textarea('description', _('Description'), $description), form_info('', _('Please use markdown for the description.')), form_submit('submit', _('Save'))])]);
}
开发者ID:max-weller,项目名称:engelsystem,代码行数:8,代码来源:ShiftTypes_view.php


示例8: admin_free

function admin_free()
{
    global $privileges;
    $search = "";
    if (isset($_REQUEST['search'])) {
        $search = strip_request_item('search');
    }
    $angeltypesearch = "";
    if (empty($_REQUEST['angeltype'])) {
        $_REQUEST['angeltype'] = '';
    } else {
        $angeltypesearch = " INNER JOIN `UserAngelTypes` ON (`UserAngelTypes`.`angeltype_id` = '" . sql_escape($_REQUEST['angeltype']) . "' AND `UserAngelTypes`.`user_id` = `User`.`UID`";
        if (isset($_REQUEST['confirmed_only'])) {
            $angeltypesearch .= " AND `UserAngelTypes`.`confirm_user_id`";
        }
        $angeltypesearch .= ") ";
    }
    $angel_types_source = sql_select("SELECT `id`, `name` FROM `AngelTypes` ORDER BY `name`");
    $angel_types = array('' => 'alle Typen');
    foreach ($angel_types_source as $angel_type) {
        $angel_types[$angel_type['id']] = $angel_type['name'];
    }
    $users = sql_select("\n      SELECT `User`.* \n      FROM `User` \n      {$angeltypesearch} \n      LEFT JOIN `ShiftEntry` ON `User`.`UID` = `ShiftEntry`.`UID` \n      LEFT JOIN `Shifts` ON (`ShiftEntry`.`SID` = `Shifts`.`SID` AND `Shifts`.`start` < '" . sql_escape(time()) . "' AND `Shifts`.`end` > '" . sql_escape(time()) . "') \n      WHERE `User`.`Gekommen` = 1 AND `Shifts`.`SID` IS NULL \n      GROUP BY `User`.`UID` \n      ORDER BY `Nick`");
    $free_users_table = array();
    if ($search == "") {
        $tokens = array();
    } else {
        $tokens = explode(" ", $search);
    }
    foreach ($users as $usr) {
        if (count($tokens) > 0) {
            $match = false;
            $index = join("", $usr);
            foreach ($tokens as $t) {
                if (stristr($index, trim($t))) {
                    $match = true;
                    break;
                }
            }
            if (!$match) {
                continue;
            }
        }
        $free_users_table[] = array('name' => User_Nick_render($usr), 'shift_state' => User_shift_state_render($usr), 'handy' => $usr['Handy'], 'telefon' => $usr['Telefon'], 'email' => $usr['email'], 'kommentar' => $usr['kommentar'], 'actions' => in_array('admin_user', $privileges) ? button(page_link_to('admin_user') . '&amp;id=' . $usr['UID'], _("edit"), 'btn-xs') : '');
    }
    return page_with_title(admin_free_title(), array(form(array(div('row', array(div('col-md-4', array(form_text('search', _("Search"), $search))), div('col-md-4', array(form_select('angeltype', _("Angeltype"), $angel_types, $_REQUEST['angeltype']))), div('col-md-2', array(form_checkbox('confirmed_only', _("Only confirmed"), isset($_REQUEST['confirmed_only'])))), div('col-md-2', array(form_submit('submit', _("Search")))))))), table(array('name' => _("Nick"), 'shift_state' => '', 'handy' => _("Mobile"), 'telefon' => _("Phone"), 'email' => _("E-Mail"), 'kommentar' => _("add. Info"), 'actions' => ''), $free_users_table)));
}
开发者ID:kekru,项目名称:engelsystem,代码行数:47,代码来源:admin_free.php


示例9: location_upgrade_page

function location_upgrade_page()
{
    global $user, $sql_updates;
    if (isset($_POST['edit'])) {
        $edit = $_POST['edit'];
    }
    if (isset($_POST['op'])) {
        $op = $_POST['op'];
    }
    switch ($op) {
        case "Update":
            $edit = $_POST['edit'];
            if (!isset($edit['location_update_version']) || $edit['location_update_version'] == 0) {
                //*****************************
                $form = form_select('Select the update after your most recent update', 'location_update_version', '', $sql_updates, 'Please select what you think was the last update for this module.  If you\'re not sure of what your last update was, it is better to select one that is older than what you think than to select one that is newer.  Updates that are too old for you will fail while the newer ones will still execute.');
                $form .= form_submit('Update');
                $form = form($form);
                print location_upgrade_page_header('location.module database update');
                print location_upgrade_info();
                print '<font color="#FF0000">You need to select your last update first!</font>' . "<br/>\n";
                print $form;
                print location_upgrade_page_footer();
                break;
                //*****************************
            } else {
                // make sure we have updates to run.
                print location_upgrade_page_header("location.module database update");
                $links[] = "<a href=\"index.php\">main page</a>";
                $links[] = "<a href=\"index.php?q=admin\">administration pages</a>";
                print theme("item_list", $links);
                location_upgrade($edit['location_update_version']);
                print location_upgrade_page_footer();
            }
            break;
        default:
            $form = form_select('Select the update after your most recent update.', 'location_update_version', '', array_merge(array('' => ''), $sql_updates), 'Please select what you think was the last update for this module.  If you\'re not sure of what your last update was, it is better to select one that is older than what you think than to select one that is newer.  Updates that are too old for you will fail while the newer ones will still execute.');
            $form .= form_submit('Update');
            $form = form($form);
            print location_upgrade_page_header('location.module database update');
            print location_upgrade_info();
            print $form;
            print location_upgrade_page_footer();
            break;
    }
}
开发者ID:bhirsch,项目名称:voipdrupal-4.7-1.0,代码行数:45,代码来源:location_upgrade.php


示例10: enforce_authentication

<?php

require '../../include/mellivora.inc.php';
enforce_authentication(CONST_USER_CLASS_MODERATOR);
head('Site management');
menu_management();
section_subhead('Search');
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/search');
form_input_text('Search for');
$opts[] = array('id' => 'users', 'name' => 'Users');
$opts[] = array('id' => 'ip_log', 'name' => 'IP log');
form_select($opts, 'Search in', 'id', 'users', 'name');
form_button_submit('Search');
form_xsrf_token();
form_end();
foot();
开发者ID:dirvuk,项目名称:mellivora,代码行数:16,代码来源:search.php


示例11: redirect

    if (dbcount("(user_id)", DB_USERS, "user_groups REGEXP('^\\\\.{$_GET['group_id']}\$|\\\\.{$_GET['group_id']}\\\\.|\\\\.{$_GET['group_id']}\$')")) {
        redirect(FUSION_SELF . $aidlink . "&status=deln");
    } else {
        $result = dbquery("DELETE FROM " . DB_USER_GROUPS . " WHERE group_id='" . $_GET['group_id'] . "'");
        redirect(FUSION_SELF . $aidlink . "&status=dely");
    }
}
$result = dbquery("SELECT group_id, group_name FROM " . DB_USER_GROUPS . " ORDER BY group_name");
if (dbrows($result)) {
    opentable($locale['420']);
    echo openform('selectform', 'selectform', 'post', FUSION_SELF . $aidlink, array('downtime' => 0, 'notice' => 0));
    $sel_opts = array();
    while ($data = dbarray($result)) {
        $sel_opts[$data['group_id']] = "ID: " . $data['group_id'] . " - " . $data['group_name'];
    }
    echo form_select('', 'group_id', 'group_id', $sel_opts, '', array('placeholder' => $locale['choose'], 'class' => 'pull-left'));
    echo form_button($locale['421'], 'edit', 'edit', $locale['421'], array('class' => 'btn-primary m-l-10 pull-left'));
    echo form_button($locale['422'], 'delete', 'delete', $locale['422'], array('class' => 'btn-primary m-l-10 pull-left'));
    echo closeform();
    closetable();
}
if (isset($_GET['group_id']) && isnum($_GET['group_id'])) {
    $result = dbquery("SELECT group_name, group_description FROM " . DB_USER_GROUPS . " WHERE group_id='" . $_GET['group_id'] . "'");
    if (dbrows($result)) {
        $data = dbarray($result);
        $group_name = $data['group_name'];
        $group_description = $data['group_description'];
        $form_action = FUSION_SELF . $aidlink . "&amp;group_id=" . $_GET['group_id'];
        opentable($locale['430']);
    } else {
        redirect(FUSION_SELF . $aidlink);
开发者ID:WuChEn,项目名称:PHP-Fusion,代码行数:31,代码来源:user_groups.php


示例12: enforce_authentication

<?php

require '../../include/ctf.inc.php';
enforce_authentication(CONST_USER_CLASS_MODERATOR);
head('Site management');
menu_management();
section_subhead('New hint');
form_start(CONFIG_SITE_ADMIN_RELPATH . 'actions/new_hint');
form_textarea('Body');
$opts = db_query_fetch_all('
    SELECT
       ch.id,
       ch.title,
       ca.title AS category
    FROM challenges AS ch
    LEFT JOIN categories AS ca ON ca.id = ch.category
    ORDER BY ca.title, ch.title');
form_select($opts, 'Challenge', 'id', array_get($_GET, 'id', 0), 'title', 'category');
form_input_checkbox('Visible');
form_hidden('action', 'new');
form_button_submit('Create hint');
form_end();
foot();
开发者ID:azizjonm,项目名称:ctf-engine,代码行数:23,代码来源:new_hint.php


示例13: afficher_form_prefs

function afficher_form_prefs($erreurs = '')
{
    afficher_html_head($GLOBALS['lang']['preferences']);
    echo '<div id="top">';
    afficher_msg();
    afficher_topnav(basename($_SERVER['PHP_SELF']), $GLOBALS['lang']['preferences']);
    echo '</div>';
    echo '<div id="axe">' . "\n";
    echo '<div id="page">' . "\n";
    echo erreurs($erreurs);
    echo '<form id="preferences" class="bordered-formbloc" method="post" action="' . basename($_SERVER['PHP_SELF']) . '" >';
    $fld_user = '<div role="group" class="pref">';
    /* no fieldset because browset can’t style them correctly */
    $fld_user .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_utilisateur'], 'legend-user') . '</div>' . "\n";
    $fld_user .= '<div class="form-lines">' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="auteur">' . $GLOBALS['lang']['pref_auteur'] . '</label>' . "\n";
    $fld_user .= "\t" . '<input type="text" id="auteur" name="auteur" size="30" value="' . (empty($GLOBALS['auteur']) ? $GLOBALS['identifiant'] : $GLOBALS['auteur']) . '" class="text" />' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="email">' . $GLOBALS['lang']['pref_email'] . '</label>' . "\n";
    $fld_user .= "\t" . '<input type="text" id="email" name="email" size="30" value="' . $GLOBALS['email'] . '" class="text" />' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="nomsite">' . $GLOBALS['lang']['pref_nom_site'] . '</label>' . "\n";
    $fld_user .= "\t" . '<input type="text" id="nomsite" name="nomsite" size="30" value="' . $GLOBALS['nom_du_site'] . '" class="text" />' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="racine">' . $GLOBALS['lang']['pref_racine'] . '</label>' . "\n";
    $fld_user .= "\t" . '<input type="text" id="racine" name="racine" size="30" value="' . $GLOBALS['racine'] . '" class="text" />' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="description">' . $GLOBALS['lang']['label_dp_description'] . '</label>' . "\n";
    $fld_user .= "\t" . '<textarea id="description" name="description" cols="35" rows="2" class="text" >' . $GLOBALS['description'] . '</textarea>' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '<p>' . "\n";
    $fld_user .= "\t" . '<label for="keywords">' . $GLOBALS['lang']['pref_keywords'] . '</label>';
    $fld_user .= "\t" . '<textarea id="keywords" name="keywords" cols="35" rows="2" class="text" >' . $GLOBALS['keywords'] . '</textarea>' . "\n";
    $fld_user .= '</p>' . "\n";
    $fld_user .= '</div>' . "\n";
    $fld_user .= '</div>';
    echo $fld_user;
    $fld_securite = '<div role="group" class="pref">';
    $fld_securite .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_securite'], 'legend-securite') . '</div>' . "\n";
    $fld_securite .= '<div class="form-lines">' . "\n";
    $fld_securite .= '<p>' . "\n";
    $fld_securite .= "\t" . '<label for="identifiant">' . $GLOBALS['lang']['pref_identifiant'] . '</label>' . "\n";
    $fld_securite .= "\t" . '<input type="text" id="identifiant" name="identifiant" size="30" value="' . $GLOBALS['identifiant'] . '" class="text" />' . "\n";
    $fld_securite .= '</p>' . "\n";
    $fld_securite .= '<p>' . "\n";
    $fld_securite .= "\t" . '<label for="mdp">' . $GLOBALS['lang']['pref_mdp'] . '</label>';
    $fld_securite .= "\t" . '<input type="password" id="mdp" name="mdp" size="30" value="" class="text" autocomplete="off" />' . "\n";
    $fld_securite .= '</p>' . "\n";
    $fld_securite .= '<p>' . "\n";
    $fld_securite .= "\t" . '<label for="mdp_rep">' . $GLOBALS['lang']['pref_mdp_nouv'] . '</label>';
    $fld_securite .= "\t" . '<input type="password" id="mdp_rep" name="mdp_rep" size="30" value="" class="text" autocomplete="off" />' . "\n";
    $fld_securite .= '</p>' . "\n";
    if (in_array('gd', get_loaded_extensions())) {
        // captcha only possible if GD library is installed.
        $fld_securite .= '<p>' . "\n";
        $fld_securite .= select_yes_no('connexion_captcha', $GLOBALS['connexion_captcha'], $GLOBALS['lang']['pref_connexion_captcha']);
        $fld_securite .= '</p>' . "\n";
    } else {
        $fld_securite .= hidden_input('connexion_captcha', '0');
    }
    $fld_securite .= '</div>';
    $fld_securite .= '</div>';
    echo $fld_securite;
    $fld_apparence = '<div role="group" class="pref">';
    $fld_apparence .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_apparence'], 'legend-apparence') . '</div>' . "\n";
    $fld_apparence .= '<div class="form-lines">' . "\n";
    $fld_apparence .= '<p>' . "\n";
    $fld_apparence .= form_select('theme', liste_themes($GLOBALS['BT_ROOT_PATH'] . $GLOBALS['dossier_themes']), $GLOBALS['theme_choisi'], $GLOBALS['lang']['pref_theme']);
    $fld_apparence .= '</p>' . "\n";
    $fld_apparence .= '<p>' . "\n";
    $fld_apparence .= form_select('nb_maxi', array('5' => '5', '10' => '10', '15' => '15', '20' => '20', '25' => '25', '50' => '50'), $GLOBALS['max_bill_acceuil'], $GLOBALS['lang']['pref_nb_maxi']);
    $fld_apparence .= '</p>' . "\n";
    $fld_apparence .= '<p>' . "\n";
    $fld_apparence .= select_yes_no('aff_onglet_rss', $GLOBALS['onglet_rss'], $GLOBALS['lang']['pref_afficher_rss']);
    $fld_apparence .= '</p>' . "\n";
    $fld_apparence .= '<p>' . "\n";
    $fld_apparence .= select_yes_no('aff_onglet_liens', $GLOBALS['onglet_liens'], $GLOBALS['lang']['pref_afficher_liens']);
    $fld_apparence .= '</p>' . "\n";
    $fld_apparence .= '</div>' . "\n";
    $fld_apparence .= '</div>';
    echo $fld_apparence;
    $fld_dateheure = '<div role="group" class="pref">';
    $fld_dateheure .= '<div class="form-legend">' . legend($GLOBALS['lang']['prefs_legend_langdateheure'], 'legend-dateheure') . '</div>' . "\n";
    $fld_dateheure .= '<div class="form-lines">' . "\n";
    $fld_dateheure .= '<p>' . "\n";
    $fld_dateheure .= form_langue($GLOBALS['lang']['id']);
    $fld_dateheure .= '</p>' . "\n";
    $fld_dateheure .= '<p>' . "\n";
    $fld_dateheure .= form_format_date($GLOBALS['format_date']);
    $fld_dateheure .= '</p>' . "\n";
    $fld_dateheure .= '<p>' . "\n";
    $fld_dateheure .= form_format_heure($GLOBALS['format_heure']);
    $fld_dateheure .= '</p>' . "\n";
    $fld_dateheure .= '<p>' . "\n";
    $fld_dateheure .= form_fuseau_horaire($GLOBALS['fuseau_horaire']);
//.........这里部分代码省略.........
开发者ID:CamTosh,项目名称:blogotext,代码行数:101,代码来源:preferences.php


示例14: foreach

?>

<?php 
foreach ($profiles as $profile) {
    $optional_public_flag = array();
    if ($profile->is_edit_public_flag) {
        $value = isset($member_profile_public_flags[$profile->id]) ? $member_profile_public_flags[$profile->id] : $profile->default_public_flag;
        $optional_public_flag = array('name' => sprintf('member_profile_public_flag[%s]', $profile->id), 'value' => $value);
    }
    if ($profile->form_type == 'input') {
        ?>
	<?php 
        echo form_input($val, $profile->name, '', 7, $label_size, $profile->information, $optional_public_flag);
    } elseif ($profile->form_type == 'textarea') {
        ?>
	<?php 
        echo form_textarea($val, $profile->name, '', $label_size, true, $profile->information, $optional_public_flag);
    } elseif ($profile->form_type == 'select') {
        ?>
	<?php 
        echo form_select($val, $profile->name, 0, 7, $label_size, false, false, $profile->information, $optional_public_flag);
    } elseif ($profile->form_type == 'radio') {
        ?>
	<?php 
        echo form_radio($val, $profile->name, 0, $label_size, 'grid', $profile->information, $optional_public_flag);
    } elseif ($profile->form_type == 'checkbox') {
        ?>
	<?php 
        echo form_checkbox($val, $profile->name, array(), $label_size, 'grid', $profile->information, $optional_public_flag);
    }
}
开发者ID:uzura8,项目名称:flockbird,代码行数:31,代码来源:edit_items.php


示例15: viewSettingsAdmin

 public function viewSettingsAdmin()
 {
     global $aidlink;
     pageAccess('F');
     $forum_settings = $this->get_forum_settings();
     add_breadcrumb(array('link' => ADMIN . 'settings_forum.php' . $aidlink, 'title' => self::$locale['forum_settings']));
     if (isset($_POST['recount_user_post'])) {
         $result = dbquery("SELECT post_author, COUNT(post_id) as num_posts FROM " . DB_FORUM_POSTS . " GROUP BY post_author");
         if (dbrows($result)) {
             while ($data = dbarray($result)) {
                 $result2 = dbquery("UPDATE " . DB_USERS . " SET user_posts='" . $data['num_posts'] . "' WHERE user_id='" . $data['post_author'] . "'");
             }
             addNotice('success', self::$locale['forum_061']);
         }
     }
     if (isset($_POST['savesettings'])) {
         $numofthreads = form_sanitizer($_POST['numofthreads'], 20, 'numofthreads');
         $threads_num = form_sanitizer($_POST['threads_per_page'], 20, 'threads_per_page');
         $posts_num = form_sanitizer($_POST['posts_per_page'], 20, 'posts_per_page');
         $forum_ips = form_sanitizer($_POST['forum_ips'], -103, 'forum_ips');
         $attachmax = form_sanitizer($_POST['calc_b'], 1, 'calc_b') * form_sanitizer($_POST['calc_c'], 1000000, 'calc_c');
         $attachmax_count = form_sanitizer($_POST['forum_attachmax_count'], 5, 'forum_attachmax_count');
         $attachtypes = form_sanitizer($_POST['forum_attachtypes'], '.pdf,.gif,.jpg,.png,.zip,.rar,.tar,.bz2,.7z', 'forum_attachtypes');
         $thread_notify = form_sanitizer($_POST['thread_notify'], '0', 'thread_notify');
         $forum_ranks = form_sanitizer($_POST['forum_ranks'], '0', 'forum_ranks');
         $forum_rank_style = form_sanitizer($_POST['forum_rank_style'], '0', 'forum_rank_style');
         $forum_edit_lock = form_sanitizer($_POST['forum_edit_lock'], '0', 'forum_edit_lock');
         $forum_edit_timelimit = form_sanitizer($_POST['forum_edit_timelimit'], '0', 'forum_edit_timelimit');
         $popular_threads_timeframe = form_sanitizer($_POST['popular_threads_timeframe'], '604800', 'popular_threads_timeframe');
         $forum_last_posts_reply = form_sanitizer($_POST['forum_last_posts_reply'], '0', 'forum_last_posts_reply');
         $forum_last_post_avatar = form_sanitizer($_POST['forum_last_post_avatar'], '0', 'forum_last_post_avatar');
         $forum_editpost_to_lastpost = form_sanitizer($_POST['forum_editpost_to_lastpost'], '0', 'forum_editpost_to_lastpost');
         if (\defender::safe()) {
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$numofthreads}' WHERE settings_name='numofthreads' AND settings_inf='forum'");
             dbquery("UPDATE " . DB_SETTINGS_INF . " SET settings_value='{$threads_num}' WHERE settings_name='threads_ 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP form_select_tree函数代码示例发布时间:2022-05-15
下一篇:
PHP form_security_validate函数代码示例发布时间: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