-my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
-print "<TR><TD ALIGN=\"right\">Access number</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct_pop->text. '</TD></TR>'
- if $svc_acct_pop;
-
-if ($svc_acct->uid ne '') {
- print "<TR><TD ALIGN=\"right\">Uid</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->uid. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">Gid</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->gid. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">GECOS</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->finger. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">Home directory</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->dir. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">Shell</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->shell. "</TD></TR>",
- "<TR><TD ALIGN=\"right\">Quota</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->quota. "</TD></TR>"
- ;
-} else {
- print "<TR><TH COLSPAN=2>(No shell account)</TH></TR>";
-}
-
-if ($svc_acct->slipip) {
- print "<TR><TD ALIGN=\"right\">IP address</TD><TD BGCOLOR=\"#ffffff\">".
- ( ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' )
- ? "<I>(Dynamic)</I>"
- : $svc_acct->slipip
- ). "</TD>";
- my($attribute);
- foreach $attribute ( grep /^radius_/, fields('svc_acct') ) {
- #warn $attribute;
- $attribute =~ /^radius_(.*)$/;
- my $pattribute = $FS::raddb::attrib{$1};
- print "<TR><TD ALIGN=\"right\">Radius (reply) $pattribute</TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->getfield($attribute).
- "</TD></TR>";
- }
- foreach $attribute ( grep /^rc_/, fields('svc_acct') ) {
- #warn $attribute;
- $attribute =~ /^rc_(.*)$/;
- my $pattribute = $FS::raddb::attrib{$1};
- print "<TR><TD ALIGN=\"right\">Radius (check) $pattribute: </TD>".
- "<TD BGCOLOR=\"#ffffff\">". $svc_acct->getfield($attribute).
- "</TD></TR>";
- }
-} else {
- print "<TR><TH COLSPAN=2>(No SLIP/PPP account)</TH></TR>";
-}
-
-print '<TR><TD ALIGN="right">RADIUS groups</TD><TD BGCOLOR="#ffffff">'.
- join('<BR>', $svc_acct->radius_groups). '</TD></TR>';
-
-print '</TABLE></TD></TR></TABLE><BR><BR>';
-
-if ( $cust_pkg && $cust_pkg->part_pkg->plan eq 'sqlradacct_hour' ) {
-
- #false laziness w/httemplate/edit/part_pkg... this stuff doesn't really
- #belong in plan data
- my %plandata = map { /^(\w+)=(.*)$/; ( $1 => $2 ); }
- split("\n", $cust_pkg->part_pkg->plandata );
-
- my $last_bill = $cust_pkg->last_bill;
- my $seconds = $svc_acct->seconds_since_sqlradacct(
- $last_bill,
- time,
- $plandata{sql_datasrc},
- $plandata{sql_username},
- $plandata{sql_password},
- );
- my $h = int($seconds/3600);
- my $m = int( ($seconds%3600) / 60 );
- my $s = $seconds%60;
- if ( $seconds ) {
- print 'Online $h h $m m $s s this billing cycle (since '.
- time2str(%C, $last_bill). ') - '.
- $plandata{recur_included_hours}. ' total hours in plan<BR><BR>';