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=6791a1ad20e719686c854c6356a38dc143c42977;hp=20685e8841641fcdc0ada941ea9d304907eff56a;hb=53427a0d7b74c16d646196e70c95971471e1fae8;hpb=68282d000bffde8638af4d70ec2f122356929ecd diff --git a/ng_selfservice/packages_change.php b/ng_selfservice/packages_change.php index 20685e884..6791a1ad2 100644 --- a/ng_selfservice/packages_change.php +++ b/ng_selfservice/packages_change.php @@ -2,39 +2,28 @@ customer_info_short( array( 'session_id' => $_COOKIE['session_id'], ) ); -$list_pkgs = $freeside->list_pkgs( array( - 'session_id' => $_COOKIE['session_id'], -) ); +if ( preg_match( '/^(\d+)$/', $_GET['pkgnum'] ) ) { + $cust_pkg = $freeside->pkg_info( array( + 'session_id' => $_COOKIE['session_id'], + 'pkgnum' => $_GET['pkgnum'], + ) ); +} +else { $cust_pkg['error'] = 'Bad Package Number'; } -if ( isset($list_pkgs['error']) && $list_pkgs['error'] ) { - $error = $list_pkgs['error']; +if ( isset($cust_pkg['error']) && $cust_pkg['error'] ) { + $error = $cust_pkg['error']; header('Location:index.php?error='. urlencode($error)); die(); } -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', $class_num, 'curr_value', $pkg_part, ], + 'args' => [ 'classnum', $cust_pkg['classnum'], 'curr_value', $cust_pkg['pkgpart'], ], ) ); @@ -56,7 +45,7 @@ function enable_change_pkg () { } -Purchase replacement package for ""

+Purchase replacement package for ""

@@ -73,8 +62,7 @@ function enable_change_pkg () {
- - +