當前位置: 首頁>>代碼示例>>PHP>>正文


PHP sortheader函數代碼示例

本文整理匯總了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;未經允許,請勿轉載。