Exemplo n.º 1
0
<?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();
Exemplo n.º 2
0
     }
     $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;
Exemplo n.º 3
0
<?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();