本文整理汇总了PHP中Str::selected方法的典型用法代码示例。如果您正苦于以下问题:PHP Str::selected方法的具体用法?PHP Str::selected怎么用?PHP Str::selected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Str
的用法示例。
在下文中一共展示了Str::selected方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<script type="text/javascript" src="/scripts/jquery/jquery.inplace.min.js"></script>
<form method="get" id="list">
<fieldset>
<legend>搜索</legend>
核审状态:<select name="status">
<option value="">请选择</option>
<option value="0" <?php
echo Str::selected($status, '0');
?>
>未审</option>
<option value="1" <?php
echo Str::selected($status, '1');
?>
>已审</option>
<option value="2" <?php
echo Str::selected($status, '2');
?>
>每月系统扣分</option>
</select>
用户名: <input type="text" name="uname" size="20" value="<?php
echo $uname;
?>
" />
<input type="submit" value=" 搜 索 " />
</fieldset>
<table class="tablegrid" width="100%" style="text-align:center;">
<tr>
<th align="left" width="50"><input type="checkbox" name="chkAll" /> 全选</th>
<th>ID</th>
<th align="left">用户名</th>
示例2: date
<tr><td><b>状态:</b></td><td>
<select name="status" >
<option value="approved" <?php
echo Str::selected('approved', $userInfo['status']);
?>
> 通过</option>
<option value="overtime" <?php
echo Str::selected('overtime', $userInfo['status']);
?>
> 过期</option>
<option value="disapproval" <?php
echo Str::selected('disapproval', $userInfo['status']);
?>
> 冻结</option>
<option value="forbid" <?php
echo Str::selected('forbid', $userInfo['status']);
?>
> 禁止</option>
</select>
</td></tr>
<tr><td><b>新密码:</b></td><td><input type="text" size="50" value="" name="password" class="text" gtbfieldid="46" /></td></tr>
<tr><td><b>到期时间:</b></td><td><input type="text" size="50" value="<?php
echo date('Y-m-d', $userInfo['expire_time']);
?>
" name="expire_time" class="date" gtbfieldid="46"></td></tr>
<tr><td><b>用户备注:</b></td><td><textarea cols="100" rows="5" name="memo"><?php
echo $userInfo['memo'];
?>
</textarea></td></tr>
示例3:
<form method="get" id="list">
<fieldset>
<legend>搜索</legend>
发送状态:
<select name="status" >
<option value="-1"> 全部</option>
<option value="0" <?php
echo Str::selected('0', $status);
?>
>未发送</option>
<option value="1" <?php
echo Str::selected('1', $status);
?>
>发送失败</option>
<option value="2" <?php
echo Str::selected('2', $status);
?>
>已发送</option>
</select>
用户名: <input type="text" name="username" size="20" value="<?php
echo $username;
?>
" />
插入时间:<input type="text" id="start_date" name="start_date" class="date" value="<?php
echo $start_date;
?>
" size="10"/> ~ <input type="text" id="end_date" name="end_date" class="date" value="<?php
echo $end_date;
?>
示例4:
?>
>越早上传越靠前</option>
</select>
每页显示数量
<select name="page_num" >
<option value="0">请选择</option>
<option value="20" <?php
echo Str::selected($page_num, '20');
?>
>20</option>
<option value="40" <?php
echo Str::selected($page_num, '40');
?>
>40</option>
<option value="60" <?php
echo Str::selected($page_num, '60');
?>
>60</option>
</select>
<input type="submit" value="" class="search_true"/>
</fieldset>
</form>
<form action="" method="post" id="picList">
<input name="cate_id" type="hidden" value="<?php
echo $cate_id;
?>
" />
<ul class="cate_list yoxview">
<?php
foreach ($results as $key => $item) {
示例5: date
</td></tr>
<tr><td><b>到期时间:</b></td><td><?php
echo date('Y-m-d', $userInfo['expire_time']);
?>
</td></tr>
<tr><td><b>升级到:</b></td><td>
<select name="group" >
<?php
foreach ($group as $item) {
if ($item['id'] != 1) {
?>
<option value="<?php
echo $item['id'];
?>
" <?php
echo Str::selected($userInfo['rank'], $item['id']);
?>
> <?php
echo $item['group_name'];
?>
:<?php
echo $item['max_space'];
?>
</option>
<?php
}
}
?>
</select>
</td></tr>
<tr><td><b>付款方式:</b></td><td>
示例6: foreach
echo $roleId;
?>
&mod_name=<?php
echo $modName;
?>
" method="post" name="aclAssign" id="aclAssign" class="allowKeySubmit">
<div style="border-bottom:4px solid #DEEFFA; padding:10px 0; +padding-bottom:0;">
<select name="role_id">
<?php
foreach ($roles as $role) {
?>
<option value="<?php
echo $role['role_id'];
?>
" <?php
echo Str::selected($role['role_id'], $roleId);
?>
><?php
echo $role['role_name'];
?>
(<?php
echo $role['role_desc'];
?>
)</option>
<?php
}
?>
</select>
<input type="submit" name="saveAssign" value=" 保存设定 " />
<input type="reset" name="resetAssign" value=" 重置表单 " />
</div>
示例7:
</select> <input type="text" name="points" size="5" value="<?php
echo $points;
?>
" />
</fieldset>
<fieldset>
时间
<select name="time_type">
<option value="reg_time" <?php
echo Str::selected('reg_time', $time_type);
?>
>注册时间</option>
<option value="expire_time" <?php
echo Str::selected('expire_time', $time_type);
?>
>过期时间</option>
</select><input type="text" id="start_date" name="start_date" class="date" value="<?php
echo $start_date;
?>
" size="10"/> ~ <input type="text" id="end_date" name="end_date" class="date" value="<?php
echo $end_date;
?>
" size="10"/>
<input type="checkbox" name="index_top" value="1" onclick="this.form.submit();" <?php
if ($index_top) {
echo 'checked="checked"';
}
?>
/> 明星用户
示例8: foreach
>创建</option>
<option value="2" <?php
echo Str::selected('2', $status);
?>
>取消</option>
</select>
<select name="group_id">
<option value="-1">全部</option>
<?php
foreach ($groups as $item) {
?>
<option value="<?php
echo $item['id'];
?>
" <?php
echo Str::selected($item['id'], $group_id);
?>
><?php
echo $item['group_name'];
?>
</option>
<?php
}
?>
</select>
用户名: <input type="text" name="username" size="10" value="<?php
echo $username;
?>
" />
操作时间:<input type="text" id="start_date" name="start_date" class="date" value="<?php
示例9: current
echo $modName;
?>
]">
<?php
if (isset($userRoles[$modName])) {
$userRole = $userRoles[$modName];
} else {
$userRole = current($roles);
}
foreach ($roles as $role) {
?>
<option value="<?php
echo $role['role_id'];
?>
" <?php
echo Str::selected($userRole['role_id'], $role['role_id']);
?>
><?php
echo $role['role_name'];
?>
(<?php
echo $role['role_desc'];
?>
)</option>
<?php
}
?>
</select>
</td>
</tr>
<?php
示例10:
</td></tr>
<?php
}
?>
<tr><td><b>审核状态:</b></td><td>
<select name="status" >
<option value="0" <?php
echo Str::selected('0', $rows['status']);
?>
> 未审</option>
<option value="1" <?php
echo Str::selected('1', $rows['status']);
?>
> 已审</option>
<option value="2" <?php
echo Str::selected('2', $rows['status']);
?>
> 每月系统扣分</option>
</select>
</td></tr>
<tr><td><b>任务描述:</b></td><td><textarea cols="100" rows="5" name="description"><?php
echo $rows['description'];
?>
</textarea></td></tr>
<tr><td><b>审核评语:</b></td><td><textarea cols="100" rows="5" name="audite_memo"><?php
echo $rows['audite_memo'];
?>
</textarea></td></tr>
<tr><td colspan="2"><input type="submit" value="提交" class="button"> <input type="reset" value="重置" class="button"> <input type="button" onclick="javascript:history.back()" value="返回" class="button"></td></tr>
示例11: foreach
<legend>查询</legend>
用户名: <input type="text" name="username" size="20" value="<?php
echo $username;
?>
" />
会员组 :
<select name="rank">
<option value="-1" >全部</option>
<?php
foreach ($group as $item) {
?>
<option value="<?php
echo $item['id'];
?>
" <?php
echo Str::selected($rank, $item['id']);
?>
> <?php
echo $item['group_name'];
?>
</option>
<?php
}
?>
</select>
排序:<select name="order_by">
<option value="tot_flow" <?php
if ($order_by == 'tot_flow') {
echo ' selected="1" ';
}
?>
示例12:
echo Str::selected($type, 2);
?>
>照片名</option>
</select>
<input type="text" value="<?php
echo $keyword;
?>
" class="border" style="width:100px;" name="keyword" />
排序:
<select name="order_by" >
<option value="DESC" <?php
echo Str::selected($order_by, 'DESC');
?>
>越晚上传越靠前</option>
<option value="ASC" <?php
echo Str::selected($order_by, 'ASC');
?>
>越早上传越靠前</option>
</select>
<input type="hidden" value="<?php
echo $cate_id;
?>
" name="cate_id" />
</td>
<td>
<input type="submit" value="" class="search_true"/>
</form>
</td>
</tr>