X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=ng_selfservice%2Fpackages_change.php;fp=ng_selfservice%2Fpackages_change.php;h=20685e8841641fcdc0ada941ea9d304907eff56a;hp=876f6cd1985519bfe023c929e91b467053900293;hb=8df787434943b1004b478ef594cfa106a719e6f0;hpb=6e0f9bf522acce334318adea8ea0b003781f8272
diff --git a/ng_selfservice/packages_change.php b/ng_selfservice/packages_change.php
index 876f6cd19..20685e884 100644
--- a/ng_selfservice/packages_change.php
+++ b/ng_selfservice/packages_change.php
@@ -2,24 +2,39 @@
$current_menu = 'services.php'; include('elements/menu.php'); ?>
+$get_params = array( 'pkgnum' );
+foreach ( $get_params AS $param ) {
+ $params[$param] = $_GET[$param];
+}
+
$customer_info = $freeside->customer_info_short( array(
'session_id' => $_COOKIE['session_id'],
) );
-foreach ( $cust_pkg AS $pkg ) {
- $part_pkg .= $pkg[pkgpart];
- $class_num .= $pkg[classnum];
+$list_pkgs = $freeside->list_pkgs( array(
+ 'session_id' => $_COOKIE['session_id'],
+) );
+
+if ( isset($list_pkgs['error']) && $list_pkgs['error'] ) {
+ $error = $list_pkgs['error'];
+ header('Location:index.php?error='. urlencode($error));
+ die();
}
-$get_params = array( 'pkgnum', 'pkg', 'classnum', 'pkgpart' );
-foreach ( $get_params AS $param ) {
- $params[$param] = $_GET[$param];
+extract($list_pkgs);
+
+foreach ( $cust_pkg AS $pkg ) {
+ if ( $pkg['pkgnum'] == $params['pkgnum'] ) {
+ $pkg_label = $pkg['pkg_label'];
+ $pkg_part = $pkg['pkgpart'];
+ $class_num = $pkg['classnum'];
+ }
}
$pkgselect = $freeside->mason_comp( array(
'session_id' => $_COOKIE['session_id'],
'comp' => '/elements/select-part_pkg.html',
- 'args' => [ 'classnum', $params['classnum'], 'curr_value', $params['pkgpart'], ],
+ 'args' => [ 'classnum', $class_num, 'curr_value', $pkg_part, ],
)
);
@@ -41,7 +56,7 @@ function enable_change_pkg () {
}
-Purchase replacement package for " echo $params['pkg']; ?>"
+Purchase replacement package for " echo htmlspecialchars($pkg_label); ?>"
include('elements/error.php'); ?>