This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
khosb/plugins/provision/_rrad/hInfoService.php
2008-11-26 14:50:40 -08:00

74 lines
1.4 KiB
PHP

<?
class hInfoService extends hService
{
function getContactInfo()
{
$info = new hContactInfo($this->context);
if ($this->getInfo($info))
return $info;
else
return false;
}
function getAdminInfo()
{
$info = new hAdminInfo($this->context);
if ($this->getInfo($info))
return $info;
else
return false;
}
function getServiceInfo()
{
$info = new hServiceInfo($this->context);
if ($this->getInfo($info))
return $info;
else
return $false;
}
function getUsageInfo($startMonth="", $endMonth="")
{
if (strlen($startMonth)> 1)
{
if ($startMonth < 0 || $startMonth > 12)
return false;
}
if (strlen($endMonth)> 1)
{
if ($endMonth < 0 || $endMonth > 12)
return false;
}
// Allow range to be inverted .. i.e. startMonth > endmonth ...
$info = new hUsageInfo($startMonth,$endMonth,$this->context);
if ($this->getInfo($info))
return $info;
else
return false;
}
function setInfo($info)
{
$cmd = &$info->getRRADUpdateCommand();
return $this->RRADServer->write($cmd);
}
function getInfo(&$info)
{
$cmd = &$info->getRRADRetrieveCommand();
$this->RRADServer->simple_write($cmd);
if (!is_array($this->RRADServer->getNextRow()))
return false;
while (($row = $this->RRADServer->getNextRow()))
$info->addElement($row);
return true;
}
}
?>