本文整理汇总了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>', ' <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>',
' <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>', ' Search: <input name=SEARCH value="', $MYREQUEST['SEARCH'], '" type=text size=25/>', ' <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>', ' Search: <input name=SEARCH value="', $MYREQUEST['SEARCH'], '" type=text size=25/>', ' <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;未经允许,请勿转载。 |
请发表评论