'doView' ); function exec(&$Doc) { $this->Doc = &$Doc; $this->DBObj = SiteMap::getObj('NRDSStatictic/NRDSStatictic.php'); parent::exec(); } function doView() { $item['fragmentation'] = array(); $res = $this->DBObj->getIDFragmentationRes(NRDS_ID_START, NRDS_ID_END); if ($_REQUEST['min_space'] && intval($_REQUEST['min_space'])) { $min_space = intval($_REQUEST['min_space']); } else { $min_space = 100; } $item['min_space'] = $min_space; $last_row = array('nrds_id'=>NRDS_ID_START); while (($row = $res->fetchRow())) { if ($row['nrds_id'] - $last_row['nrds_id'] -1 >= $min_space) { $item['fragmentation'][] = array( 'nrds_id_min'=>$last_row['nrds_id'] + 1, 'nrds_id_max'=>$row['nrds_id'] - 1, 'cnt'=>(intval($row['nrds_id']) - intval($last_row['nrds_id']) - 1), ); } $last_row = $row; } $row = array('nrds_id'=>NRDS_ID_END); if ($row['nrds_id'] - $last_row['nrds_id'] -1 >= $min_space) { $item['fragmentation'][] = array( 'nrds_id_min'=>$last_row['nrds_id'] + 1, 'nrds_id_max'=>$row['nrds_id'] - 1, 'cnt'=>(intval($row['nrds_id']) - intval($last_row['nrds_id']) - 1), ); } if (is_array($item['fragmentation']) && !empty($item['fragmentation'])) { $item['fragmentation'] = php_multisort($item['fragmentation'], array(array('key'=>'cnt', 'sort'=>'desc', 'type'=>'numeric'))); } $item['agents'] = $this->DBObj->getAgentDublicates(); $item['brokers'] = $this->DBObj->getBrokersDublicates(); $item['agentsVSbrokers'] = $this->DBObj->getAgentsVSBrokersDublicates(); $item['tpl'] = SiteMap::getPath('NRDSStatictic/tpl/view.tpl'); $this->Doc->addContent($item); } }