show dates on package browse
[freeside.git] / httemplate / search / cust_pkg.cgi
index e862cef..7426276 100755 (executable)
@@ -1,5 +1,5 @@
 <%
-# <!-- $Id: cust_pkg.cgi,v 1.7 2001-12-03 10:59:25 ivan Exp $ -->
+# <!-- $Id: cust_pkg.cgi,v 1.9 2001-12-18 06:38:25 ivan Exp $ -->
 
 use strict;
 use vars qw ( $cgi @cust_pkg $sortby $query %part_pkg
@@ -31,13 +31,11 @@ $limit .= " OFFSET $offset" if $offset;
 
 my $total;
 
-($query) = $cgi->keywords;
 my $unconf = '';
-#this tree is a little bit redundant
+($query) = $cgi->keywords;
 if ( $query eq 'pkgnum' ) {
   $sortby=\*pkgnum_sort;
 
-
 } elsif ( $query eq 'APKG_pkgnum' ) {
 
   $sortby=\*pkgnum_sort;
@@ -86,7 +84,7 @@ my $sth = dbh->prepare($statement)
   or die dbh->errstr. " doing $statement";
 $sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
 
-$total = @{$sth->fetchrow_arrayref}[0];
+$total = $sth->fetchrow_arrayref->[0];
 
 @cust_pkg = qsearch('cust_pkg',{}, '', "$unconf ORDER BY pkgnum $limit" );
 
@@ -100,6 +98,7 @@ if ( scalar(@cust_pkg) == 1 ) {
 } else {
   $total ||= scalar(@cust_pkg);
 
+  #begin pager
   my $pager = '';
   if ( $total != scalar(@cust_pkg) && $maxrecords ) {
     unless ( $offset == 0 ) {
@@ -124,11 +123,17 @@ if ( scalar(@cust_pkg) == 1 ) {
                 '"><B><FONT SIZE="+1">Next</FONT></B></A> ';
     }
   }
+  #end pager
   
   print header('Package Search Results',''),
         "$total matching packages found<BR><BR>$pager", &table(), <<END;
       <TR>
         <TH>Package</TH>
+        <TH><FONT SIZE=-1>Setup</FONT></TH>
+        <TH><FONT SIZE=-1>Next<BR>bill</FONT></TH>
+        <TH><FONT SIZE=-1>Susp.</FONT></TH>
+        <TH><FONT SIZE=-1>Expire</FONT></TH>
+        <TH><FONT SIZE=-1>Cancel</FONT></TH>
         <TH><FONT SIZE=-1>Cust#</FONT></TH>
         <TH>(bill) name</TH>
         <TH>company</TH>
@@ -154,6 +159,11 @@ END
     my($cust_main)=qsearchs('cust_main',{'custnum'=>$cust_pkg->custnum});
     my($pkgnum, $custnum, $last, $first, $company) = (
       $cust_pkg->pkgnum,
+      time2str("%D", $cust_pkg->setup ),
+      time2str("%D", $cust_pkg->bill ),
+      time2str("%D", $cust_pkg->susp ),
+      time2str("%D", $cust_pkg->expire ),
+      time2str("%D", $cust_pkg->cancel ),
       $cust_pkg->custnum,
       $cust_main ? $cust_main->last : '',
       $cust_main ? $cust_main->first : '',