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

PHP sortheader函数代码示例

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

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



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

示例1: sortheader

    // Per-Directory System Cache Entries
    // -----------------------------------------------
    case OB_SYS_CACHE_DIR:
        if (!$AUTHENTICATED) {
            break;
        }
        echo <<<EOB
\t\t<div class=sorting><form>Scope:
\t\t<input type=hidden name=OB value={$MYREQUEST['OB']}>
\t\t<select name=SCOPE>
EOB;
        echo "<option value=A", $MYREQUEST['SCOPE'] == 'A' ? " selected" : "", ">Active</option>", "<option value=D", $MYREQUEST['SCOPE'] == 'D' ? " selected" : "", ">Deleted</option>", "</select>", ", Sorting:<select name=SORT1>", "<option value=H", $MYREQUEST['SORT1'] == 'H' ? " selected" : "", ">Total Hits</option>", "<option value=Z", $MYREQUEST['SORT1'] == 'Z' ? " selected" : "", ">Total Size</option>", "<option value=T", $MYREQUEST['SORT1'] == 'T' ? " selected" : "", ">Number of Files</option>", "<option value=S", $MYREQUEST['SORT1'] == 'S' ? " selected" : "", ">Directory Name</option>", "<option value=A", $MYREQUEST['SORT1'] == 'A' ? " selected" : "", ">Avg. Size</option>", "<option value=C", $MYREQUEST['SORT1'] == 'C' ? " selected" : "", ">Avg. Hits</option>", '</select>', '<select name=SORT2>', '<option value=D', $MYREQUEST['SORT2'] == 'D' ? ' selected' : '', '>DESC</option>', '<option value=A', $MYREQUEST['SORT2'] == 'A' ? ' selected' : '', '>ASC</option>', '</select>', '<select name=COUNT onChange="form.submit()">', '<option value=10 ', $MYREQUEST['COUNT'] == '10' ? ' selected' : '', '>Top 10</option>', '<option value=20 ', $MYREQUEST['COUNT'] == '20' ? ' selected' : '', '>Top 20</option>', '<option value=50 ', $MYREQUEST['COUNT'] == '50' ? ' selected' : '', '>Top 50</option>', '<option value=100', $MYREQUEST['COUNT'] == '100' ? ' selected' : '', '>Top 100</option>', '<option value=150', $MYREQUEST['COUNT'] == '150' ? ' selected' : '', '>Top 150</option>', '<option value=200', $MYREQUEST['COUNT'] == '200' ? ' selected' : '', '>Top 200</option>', '<option value=500', $MYREQUEST['COUNT'] == '500' ? ' selected' : '', '>Top 500</option>', '<option value=0  ', $MYREQUEST['COUNT'] == '0' ? ' selected' : '', '>All</option>', '</select>', ", Group By Dir Level:<select name=AGGR>", "<option value='' selected>None</option>";
        for ($i = 1; $i < 10; $i++) {
            echo "<option value={$i}", $MYREQUEST['AGGR'] == $i ? " selected" : "", ">{$i}</option>";
        }
        echo '</select>', '&nbsp;<input type=submit value="GO!">', '</form></div>', '<div class="info"><table cellspacing=0><tbody>', '<tr>', '<th>', sortheader('S', 'Directory Name', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('T', 'Number of Files', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('H', 'Total Hits', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('Z', 'Total Size', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('C', 'Avg. Hits', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('A', 'Avg. Size', "&OB=" . $MYREQUEST['OB']), '</th>', '</tr>';
        // builds list with alpha numeric sortable keys
        //
        $tmp = $list = array();
        foreach ($cache[$scope_list[$MYREQUEST['SCOPE']]] as $entry) {
            $n = dirname($entry['filename']);
            if ($MYREQUEST['AGGR'] > 0) {
                $n = preg_replace("!^(/?(?:[^/\\\\]+[/\\\\]){" . ($MYREQUEST['AGGR'] - 1) . "}[^/\\\\]*).*!", "\$1", $n);
            }
            if (!isset($tmp[$n])) {
                $tmp[$n] = array('hits' => 0, 'size' => 0, 'ents' => 0);
            }
            $tmp[$n]['hits'] += $entry['num_hits'];
            $tmp[$n]['size'] += $entry['mem_size'];
            ++$tmp[$n]['ents'];
        }
开发者ID:mnpollotta,项目名称:webinar-framework,代码行数:31,代码来源:apc.php


示例2: array

		", Group By Dir Level:<select name=AGGR>",
		"<option value='' selected>None</option>";
		for ($i = 1; $i < 10; $i++)
			echo "<option value=$i",$MYREQUEST['AGGR']==$i ? " selected":"",">$i</option>";
		echo '</select>',
		'&nbsp;<input type=submit value="GO!">',
		'</form></div>',

		'<div class="info"><table cellspacing=0><tbody>',
		'<tr>',
		'<th>',sortheader('S','Directory Name',	"&OB=".$MYREQUEST['OB']),'</th>',
		'<th>',sortheader('T','Number of Files',"&OB=".$MYREQUEST['OB']),'</th>',
		'<th>',sortheader('H','Total Hits',	"&OB=".$MYREQUEST['OB']),'</th>',
		'<th>',sortheader('Z','Total Size',	"&OB=".$MYREQUEST['OB']),'</th>',
		'<th>',sortheader('C','Avg. Hits',	"&OB=".$MYREQUEST['OB']),'</th>',
		'<th>',sortheader('A','Avg. Size',	"&OB=".$MYREQUEST['OB']),'</th>',
		'</tr>';

	// builds list with alpha numeric sortable keys
	//
	$tmp = $list = array();
	foreach($cache[$scope_list[$MYREQUEST['SCOPE']]] as $entry) {
		$n = dirname($entry['filename']);
		if ($MYREQUEST['AGGR'] > 0) {
			$n = preg_replace("!^(/?(?:[^/\\\\]+[/\\\\]){".($MYREQUEST['AGGR']-1)."}[^/\\\\]*).*!", "$1", $n);
		}
		if (!isset($tmp[$n])) {
			$tmp[$n] = array('hits'=>0,'size'=>0,'ents'=>0);
		}
		$tmp[$n]['hits'] += $entry['num_hits'];
		$tmp[$n]['size'] += $entry['mem_size'];
开发者ID:ndejong,项目名称:anyapi,代码行数:31,代码来源:apc.php


示例3: str_replace

 echo '</select>', '<select name=SORT2>', '<option value=D', $MYREQUEST['SORT2'] == 'D' ? ' selected' : '', '>DESC</option>', '<option value=A', $MYREQUEST['SORT2'] == 'A' ? ' selected' : '', '>ASC</option>', '</select>', '<select name=COUNT onChange="form.submit()">', '<option value=10 ', $MYREQUEST['COUNT'] == '10' ? ' selected' : '', '>Top 10</option>', '<option value=20 ', $MYREQUEST['COUNT'] == '20' ? ' selected' : '', '>Top 20</option>', '<option value=50 ', $MYREQUEST['COUNT'] == '50' ? ' selected' : '', '>Top 50</option>', '<option value=100', $MYREQUEST['COUNT'] == '100' ? ' selected' : '', '>Top 100</option>', '<option value=150', $MYREQUEST['COUNT'] == '150' ? ' selected' : '', '>Top 150</option>', '<option value=200', $MYREQUEST['COUNT'] == '200' ? ' selected' : '', '>Top 200</option>', '<option value=500', $MYREQUEST['COUNT'] == '500' ? ' selected' : '', '>Top 500</option>', '<option value=0  ', $MYREQUEST['COUNT'] == '0' ? ' selected' : '', '>All</option>', '</select>', '&nbsp; Search: <input name=SEARCH value="', $MYREQUEST['SEARCH'], '" type=text size=25/>', '&nbsp;<input type=submit value="GO!">', '</form></div>';
 if (isset($MYREQUEST['SEARCH'])) {
     // Don't use preg_quote because we want the user to be able to specify a
     // regular expression subpattern.
     $MYREQUEST['SEARCH'] = '/' . str_replace('/', '\\/', $MYREQUEST['SEARCH']) . '/i';
     if (preg_match($MYREQUEST['SEARCH'], 'test') === false) {
         echo '<div class="error">Error: enter a valid regular expression as a search query.</div>';
         break;
     }
 }
 echo '<div class="info"><table cellspacing=0><tbody>', '<tr>', '<th>', sortheader('S', $fieldheading, "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('H', 'Hits', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('Z', 'Size', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('A', 'Last accessed', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('M', 'Last modified', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('C', 'Created at', "&OB=" . $MYREQUEST['OB']), '</th>';
 if ($fieldname == 'info') {
     $cols += 2;
     echo '<th>', sortheader('T', 'Timeout', "&OB=" . $MYREQUEST['OB']), '</th>';
 }
 echo '<th>', sortheader('D', 'Deleted at', "&OB=" . $MYREQUEST['OB']), '</th></tr>';
 // builds list with alpha numeric sortable keys
 //
 $list = array();
 foreach ($cache[$scope_list[$MYREQUEST['SCOPE']]] as $i => $entry) {
     switch ($MYREQUEST['SORT1']) {
         case 'A':
             $k = sprintf('%015d-', $entry['access_time']);
             break;
         case 'H':
             $k = sprintf('%015d-', $entry['num_hits']);
             break;
         case 'Z':
             $k = sprintf('%015d-', $entry['mem_size']);
             break;
         case 'M':
开发者ID:bitweaver,项目名称:kernel,代码行数:31,代码来源:apc.php


示例4: indexAction


//.........这里部分代码省略.........
                                $output = var_export(apc_fetch($entry[$fieldkey]), true);
                                echo htmlspecialchars($output);
                                echo "</pre></td></tr>\n";
                            }
                            break;
                        }
                    }
                    echo <<<EOB
            </tbody></table>
            </div>
EOB;
                    break;
                }
                $cols = 6;
                echo <<<EOB
        <div class=sorting><form>Scope:
        <input type=hidden name=OB value={$MYREQUEST['OB']}>
        <select name=SCOPE>
EOB;
                echo "<option value=A", $MYREQUEST['SCOPE'] == 'A' ? " selected" : "", ">Active</option>", "<option value=D", $MYREQUEST['SCOPE'] == 'D' ? " selected" : "", ">Deleted</option>", "</select>", ", Sorting:<select name=SORT1>", "<option value=H", $MYREQUEST['SORT1'] == 'H' ? " selected" : "", ">Hits</option>", "<option value=Z", $MYREQUEST['SORT1'] == 'Z' ? " selected" : "", ">Size</option>", "<option value=S", $MYREQUEST['SORT1'] == 'S' ? " selected" : "", ">{$fieldheading}</option>", "<option value=A", $MYREQUEST['SORT1'] == 'A' ? " selected" : "", ">Last accessed</option>", "<option value=M", $MYREQUEST['SORT1'] == 'M' ? " selected" : "", ">Last modified</option>", "<option value=C", $MYREQUEST['SORT1'] == 'C' ? " selected" : "", ">Created at</option>", "<option value=D", $MYREQUEST['SORT1'] == 'D' ? " selected" : "", ">Deleted at</option>";
                if ($fieldname == 'info') {
                    echo "<option value=D", $MYREQUEST['SORT1'] == 'T' ? " selected" : "", ">Timeout</option>";
                }
                echo '</select>', '<select name=SORT2>', '<option value=D', $MYREQUEST['SORT2'] == 'D' ? ' selected' : '', '>DESC</option>', '<option value=A', $MYREQUEST['SORT2'] == 'A' ? ' selected' : '', '>ASC</option>', '</select>', '<select name=COUNT onChange="form.submit()">', '<option value=10 ', $MYREQUEST['COUNT'] == '10' ? ' selected' : '', '>Top 10</option>', '<option value=20 ', $MYREQUEST['COUNT'] == '20' ? ' selected' : '', '>Top 20</option>', '<option value=50 ', $MYREQUEST['COUNT'] == '50' ? ' selected' : '', '>Top 50</option>', '<option value=100', $MYREQUEST['COUNT'] == '100' ? ' selected' : '', '>Top 100</option>', '<option value=150', $MYREQUEST['COUNT'] == '150' ? ' selected' : '', '>Top 150</option>', '<option value=200', $MYREQUEST['COUNT'] == '200' ? ' selected' : '', '>Top 200</option>', '<option value=500', $MYREQUEST['COUNT'] == '500' ? ' selected' : '', '>Top 500</option>', '<option value=0  ', $MYREQUEST['COUNT'] == '0' ? ' selected' : '', '>All</option>', '</select>', '&nbsp; Search: <input name=SEARCH value="', $MYREQUEST['SEARCH'], '" type=text size=25/>', '&nbsp;<input type=submit value="GO!">', '</form></div>';
                if (isset($MYREQUEST['SEARCH'])) {
                    // Don't use preg_quote because we want the user to be able to specify a
                    // regular expression subpattern.
                    $MYREQUEST['SEARCH'] = '/' . str_replace('/', '\\/', $MYREQUEST['SEARCH']) . '/i';
                    if (preg_match($MYREQUEST['SEARCH'], 'test') === false) {
                        echo '<div class="error">Error: enter a valid regular expression as a search query.</div>';
                        break;
                    }
                }
                echo '<div class="info"><table cellspacing=0><tbody>', '<tr>', '<th>', sortheader('S', $fieldheading, "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('H', 'Hits', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('Z', 'Size', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('A', 'Last accessed', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('M', 'Last modified', "&OB=" . $MYREQUEST['OB']), '</th>', '<th>', sortheader('C', 'Created at', "&OB=" . $MYREQUEST['OB']), '</th>';
                if ($fieldname == 'info') {
                    $cols += 2;
                    echo '<th>', sortheader('T', 'Timeout', "&OB=" . $MYREQUEST['OB']), '</th>';
                }
                echo '<th>', sortheader('D', 'Deleted at', "&OB=" . $MYREQUEST['OB']), '</th></tr>';
                // builds list with alpha numeric sortable keys
                //
                $list = array();
                foreach ($cache[$scope_list[$MYREQUEST['SCOPE']]] as $i => $entry) {
                    switch ($MYREQUEST['SORT1']) {
                        case 'A':
                            $k = sprintf('%015d-', $entry['access_time']);
                            break;
                        case 'H':
                            $k = sprintf('%015d-', $entry['num_hits']);
                            break;
                        case 'Z':
                            $k = sprintf('%015d-', $entry['mem_size']);
                            break;
                        case 'M':
                            $k = sprintf('%015d-', $entry['mtime']);
                            break;
                        case 'C':
                            $k = sprintf('%015d-', $entry['creation_time']);
                            break;
                        case 'T':
                            $k = sprintf('%015d-', $entry['ttl']);
                            break;
                        case 'D':
                            $k = sprintf('%015d-', $entry['deletion_time']);
                            break;
                        case 'S':
开发者ID:xiaoguizhidao,项目名称:koala-framework,代码行数:67,代码来源:ApcController.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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