1 <? $title ='Change Package'; include('elements/header.php'); ?>
2 <? $current_menu = 'services.php'; include('elements/menu.php'); ?>
6 require_once('elements/session.php');
10 $params = array( 'custnum', 'pkgpart', 'pkgnum' );
13 if ( preg_match( '/^(\d+)_(\d+)$/', $_POST['pkgpart_svcpart'], $matches ) ) {
14 $_POST['pkgpart'] = $matches[1];
15 $_POST['svcpart'] = $matches[2];
16 $params[] = 'svcpart';
17 $svcdb = $_POST['svcdb'];
18 if ( $svcdb == 'svc_acct' ) { $params[] = 'domsvc'; }
23 if ( $svcdb == 'svc_acct' ) {
25 array_push($params, 'username', '_password', '_password2', 'sec_phrase', 'popnum' );
27 #if ( strlen($_POST['_password']) == 0 ) {
28 # $results['error'] = 'Empty password';
30 #if ( $_POST['_password'] != $_POST['_password'] ) {
31 # $results['error'] = 'Passwords do not match';
32 # $_POST['_password'] = '';
33 # $_POST['_password2'] = '';
36 } elseif ( $svcdb == 'svc_phone' ) {
38 array_push($params, 'phonenum', 'sip_password', 'pin', 'phone_name' );
41 die("$svcdb not handled on process_change_pkg yet");
44 if ( ! $results['error'] ) {
47 'session_id' => $_COOKIE['session_id'],
50 foreach ( $params AS $param ) {
51 $change_pkg[$param] = $_POST[$param];
54 $results = $freeside->change_pkg($change_pkg);
58 # if ( $results->{'error'} ) {
59 # $action = 'customer_change_pkg';
62 # %{customer_change_pkg()},
63 # 'error' => '<FONT COLOR="#FF0000">'. $results->{'error'}. '</FONT>',
70 ## reload below except pkgnum
71 if ( isset($results['error']) && $results['error'] ) {
72 $error = $results['error'];
73 # header('Location:services.php?error='. urlencode($error));
77 #$pkgnum = $results['pkgnum'];
79 #header("Location:services.php"); # #pkgnum ?
82 <? include('elements/error.php'); ?>
84 <FONT SIZE=4>Package Successfully Changed To "<? echo htmlspecialchars($results['pkg']); ?>"</FONT><BR><BR>
86 <? include('elements/menu_footer.php'); ?>
87 <? include('elements/footer.php'); ?>