[Added SIP domains Adrian Georgescu **20070310095646] hunk ./provisioning.phtml 45 + 'domains' => array('recordsClass' => 'DomainStatistics', + 'soapClass' => 'WebService_NGNPro_SipPort' + ), hunk ./provisioning.phtml 255 - var $sortElements=array('changeDate'=>'Change date', - 'number' => 'E.164 numberame' + var $sortElements=array('changeDate' => 'Change date', + 'number' => 'E.164 number', + 'tld' => 'TLD', + 'owner' => 'Owner' hunk ./provisioning.phtml 263 + 'tld' => trim($_REQUEST['tld_filter']), hunk ./provisioning.phtml 265 - 'mapto' => trim($_REQUEST['mapto_filter']) + 'mapto' => trim($_REQUEST['mapto_filter']), + 'owner' => trim($_REQUEST['owner_filter']) hunk ./provisioning.phtml 448 + printf (" TLD: ",$this->filters['tld']); hunk ./provisioning.phtml 950 +class DomainStatistics extends Records { + + var $maxrowsperpage= 200; + + function DomainStatistics(&$SOAPEngine) { + $this->filters = array( + 'domain' => trim($_REQUEST['domain_filter']) + ); + + $this->Records(&$SOAPEngine); + } + + function listRecords() { + + $this->showSeachForm(); + + // Insert credetials + $this->SOAPEngine->soapclient->addHeader($this->SOAPEngine->SoapAuth); + + $filter=$this->filters['domain']; + // Call function + $result = $this->SOAPEngine->soapclient->getDomainStatistics($filter); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error: %s (%s): %s",$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + + $this->rows = count($result); + + print " + + +
$this->rows records found
+

+ + + + + + + + "; + + if (!$this->next) $this->next=0; + + if ($this->rows > $this->maxrowsperpage) { + $maxrows = $this->maxrowsperpage + $this->next; + if ($maxrows > $this->rows) $maxrows = $this->maxrowsperpage; + } else { + $maxrows=$this->rows; + } + + $i=0; + + if ($this->rows) { + while ($i < $this->maxrowsperpage) { + + $domain = $result[$i]; + if (!$domain->domain) break; + + $index = $this->next+$i+1; + + $rr=floor($index/2); + $mod=$index-$rr*2; + + if ($mod ==0) { + $bgcolor="lightgrey"; + } else { + $bgcolor="white"; + } + + printf(" + + + + + + + ", + $index, + $domain->domain, + $domain->users, + $domain->onlineUsers, + $domain->onlineDevices + ); + + printf(" + + "); + + $i++; + + } + } + + print "
Id + SIP domainSIP subscribersOnline subscribersOnline SIP devices
%s%s%s%s%s
"; + + $this->showPagination($next,$maxrows); + + return true; + } + } + + function showSeachFormCustom() { + + printf (" Domain: ",$this->filters['domain']); + + } + +} + +