本文整理汇总了PHP中Computer::sortBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Computer::sortBy方法的具体用法?PHP Computer::sortBy怎么用?PHP Computer::sortBy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Computer
的用法示例。
在下文中一共展示了Computer::sortBy方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initFastTemplate
<?php
//pc.php v5.2.0
setlocale(LC_ALL, 'ru_RU');
require_once 'config.php';
require_once OLIB_PATH . '/class.ad.php';
require_once OLIB_PATH . '/class.session.php';
require_once OLIB_PATH . '/class.process.php';
$tpl =& initFastTemplate();
$tpl->define(array('pc_table' => 'body.pc.table_head.tpl', 'pc' => 'body.pc.tpl', 'process' => 'body.pc.process.tpl'));
$ses = new Session(true);
$tpl->assign('MESSAGE', $ses->msg());
$users = new Computer('TONIPI-*');
$users->tplLink('TABLE_TEXT', 'Export hosts file', 'hostsexport.php');
$tpl->parse('TABLE_TEXT', '.pc_table');
$users->fieldUpper('cn');
$users->sortBy($sort);
$users->tplTableInner('TABLE_TEXT', array('cn', 'description', 'location'), array(FALSE, FALSE, FALSE), array(FALSE, FALSE, FALSE));
$tpl->parse('BODY', 'table');
$tpl->parse('PAGE', 'page');
$tpl->FastPrint();
示例2: RequestClass
}
$rc = new RequestClass();
$rc->retrive();
$rc->tplComboboxInner('LIST', 'name', 'id');
$tpl->assign(array('TARGET' => $reqData->targetname, 'URL' => '?action=step2', 'TITLE' => '33% - New - Requests - TO'));
$tpl->parse('BODY', 'step1');
$ses->valueOf('tmp_request', $reqData);
break;
case 'step2':
$reqData = $ses->valueOf('tmp_request');
if (isset($_POST['CLASS_ID'])) {
$reqData->cid = $_POST['CLASS_ID'];
}
$cidData = new RequestClass($reqData->cid);
$pc = new Computer('*');
$pc->sortBy('description');
$pc->tplComboboxInner('LIST', 'description', 'cn');
$tpl->assign(array('TARGET' => $reqData->targetname, 'CLASS' => $cidData->name[0], 'BACK_URL' => '?action=step1', 'URL' => '?action=step3', 'TITLE' => '66% - New - Requests - TO'));
$tpl->parse('BODY', 'step2');
$ses->valueOf('tmp_request', $reqData);
break;
case 'step3':
$reqData = $ses->valueOf('tmp_request');
if (isset($_POST['OBJ'])) {
$reqData->pcname = $_POST['OBJ'];
}
$cidData = new RequestClass($reqData->cid);
$tpl->assign(array('PC' => $reqData->pcname, 'TARGET' => $reqData->targetname, 'CLASS' => $cidData->name[0], 'BACK_URL' => '?action=step2', 'URL' => '?action=finish', 'TITLE' => '100% - New - Requests - TO'));
$tpl->parse('BODY', 'step4');
$ses->valueOf('tmp_request', $reqData);
break;
示例3: initFastTemplate
<?php
//hostsexport.php v5.0.0
setlocale(LC_ALL, 'ru_RU');
header('Content-type: text/plain; charset=windows-1251');
require_once 'config.php';
require_once OLIB_PATH . '/class.ad.php';
require_once OLIB_PATH . '/class.session.php';
$tpl =& initFastTemplate();
$tpl->define(array('host' => '../templ.export/host.tpl'));
$ses = new Session(TRUE);
$tpl->assign('MESSAGE', $ses->msg());
$objs = new Computer('TONIPI-*');
$objs->fieldUpper('cn');
$objs->sortBy('cn');
for ($i = 0; $i < $objs->count; $i++) {
if (isset($objs->location[$i]) && strlen($objs->location[$i]) > 0) {
$tpl->assign(array('HOST_IP' => $objs->location[$i], 'HOST_NAME' => $objs->cn[$i], 'HOST_FULLNAME' => $objs->cn[$i] . '.oao.sng', 'HOST_USERNAME' => $objs->description[$i]));
$tpl->parse(BODY, '.host');
}
}
//$tpl->parse('BODY', 'empty');
$tpl->FastPrint();