summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2002-10-08 11:10:51 +0000
committerivan <ivan>2002-10-08 11:10:51 +0000
commit61e25db54f2da624a79ecedb6bf3d678c7fdefc5 (patch)
treea3f2dc0230f2df0e1e348ae2d21df4d02046a742
parent2a2fa626446a69e7e1a5953b8bb693b5e4274d8b (diff)
add suspended package browse (closes: Bug#467)
-rw-r--r--httemplate/index.html3
-rwxr-xr-xhttemplate/search/cust_pkg.cgi20
2 files changed, 15 insertions, 8 deletions
diff --git a/httemplate/index.html b/httemplate/index.html
index f17639d44..017a2cc3a 100644
--- a/httemplate/index.html
+++ b/httemplate/index.html
@@ -119,7 +119,8 @@
</UL>
Packages
<UL>
- <LI><A HREF="search/cust_pkg.cgi?pkgnum">packages (by package number)</A>
+ <LI><A HREF="search/cust_pkg.cgi?pkgnum">all packages (by package number)</A>
+ <LI><A HREF="search/cust_pkg.cgi?SUSP_pkgnum">suspended packages (by package number)</A>
<LI><A HREF="search/cust_pkg.cgi?APKG_pkgnum">packages with unconfigured services (by package number)</A>
<LI><A HREF="search/cust_pkg.html">packages (by next bill date range)</A>
</UL>
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi
index 5f0782b8c..78a5bb3bb 100755
--- a/httemplate/search/cust_pkg.cgi
+++ b/httemplate/search/cust_pkg.cgi
@@ -43,10 +43,16 @@ if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
} else {
- my $unconf = '';
+ my $qual = '';
if ( $query eq 'pkgnum' ) {
$sortby=\*pkgnum_sort;
+ } elsif ( $query eq 'SUSP_pkgnum' ) {
+
+ $sortby=\*pkgnum_sort;
+
+ $qual = 'WHERE susp IS NOT NULL AND susp != 0';
+
} elsif ( $query eq 'APKG_pkgnum' ) {
$sortby=\*pkgnum_sort;
@@ -101,12 +107,12 @@ if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
AND pkg_svc.quantity != 0;";
$sth = dbh->prepare($query) or die dbh->errstr. " preparing $query";
$sth->execute or die "Error executing \"$query\": ". $sth->errstr;
- $unconf = " LEFT JOIN temp2_$$ ON cust_pkg.pkgnum = temp2_$$.pkgnum
- WHERE temp2_$$.pkgnum IS NOT NULL";
+ $qual = " LEFT JOIN temp2_$$ ON cust_pkg.pkgnum = temp2_$$.pkgnum
+ WHERE temp2_$$.pkgnum IS NOT NULL";
} else {
- $unconf = "
+ $qual = "
WHERE 0 <
( SELECT count(*) FROM pkg_svc
WHERE pkg_svc.pkgpart = cust_pkg.pkgpart
@@ -120,10 +126,10 @@ if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
}
} else {
- die "Empty QUERY_STRING!";
+ die "Empty or unknown QUERY_STRING!";
}
- my $statement = "SELECT COUNT(*) FROM cust_pkg $unconf";
+ my $statement = "SELECT COUNT(*) FROM cust_pkg $qual";
my $sth = dbh->prepare($statement) or die dbh->errstr." preparing $statement";
$sth->execute or die "Error executing \"$statement\": ". $sth->errstr;
@@ -131,7 +137,7 @@ if ( $cgi->param('magic') && $cgi->param('magic') eq 'bill' ) {
my $tblname = driver_name eq 'mysql' ? 'cust_pkg.' : '';
@cust_pkg =
- qsearch('cust_pkg',{}, '', "$unconf ORDER BY ${tblname}pkgnum $limit" );
+ qsearch('cust_pkg',{}, '', "$qual ORDER BY ${tblname}pkgnum $limit" );
if ( driver_name eq 'mysql' ) {
$query = "DROP TABLE temp1_$$,temp2_$$;";