3 require_once('elements/session.php');
7 $params = array( 'custnum', 'pkgpart' );
10 if ( preg_match( '/^(\d+)_(\d+)$/', $_POST['pkgpart_svcpart'], $matches ) ) {
11 $_POST['pkgpart'] = $matches[1];
12 $_POST['svcpart'] = $matches[2];
13 $params[] = 'svcpart';
14 $svcdb = $_POST['svcdb'];
15 if ( $svcdb == 'svc_acct' ) { $params[] = 'domsvc'; }
20 if ( $svcdb == 'svc_acct' ) {
22 array_push($params, 'username', '_password', '_password2', 'sec_phrase', 'popnum' );
24 if ( strlen($_POST['_password']) == 0 ) {
25 $results['error'] = 'Empty password';
27 if ( $_POST['_password'] != $_POST['_password2'] ) {
28 $results['error'] = 'Passwords do not match';
29 $_POST['_password'] = '';
30 $_POST['_password2'] = '';
33 } elseif ( $svcdb == 'svc_phone' ) {
35 array_push($params, 'phonenum', 'sip_password', 'pin', 'phone_name' );
38 die("$svcdb not handled on process_order_pkg yet");
41 if ( ! $results['error'] ) {
44 'session_id' => $_COOKIE['session_id'],
47 foreach ( $params AS $param ) {
48 $order_pkg[$param] = $_POST[$param];
51 $results = $freeside->order_pkg($order_pkg);
55 # if ( $results->{'error'} ) {
56 # $action = 'customer_order_pkg';
59 # %{customer_order_pkg()},
60 # 'error' => '<FONT COLOR="#FF0000">'. $results->{'error'}. '</FONT>',
66 if ( isset($results['error']) && $results['error'] ) {
67 $error = $results['error'];
68 header('Location:services_new.php?error='. urlencode($error));
72 #$pkgnum = $results['pkgnum'];
74 header("Location:services.php"); # #pkgnum ?