" . _("Billing") . "


"; return $ret; } /* * Displays stats page * * @param $args * Common arguments */ function display($args) { $display = new Display(); // args $m = getArgument($args,'m'); $q = getArgument($args,'q'); $displayname = $_SESSION['ari_user']['displayname']; $extension = $_SESSION['ari_user']['extension']; // build page content $ret .= checkErrorMessage(); $header_text = _("Billing"); if (!$_SESSION['ari_user']['admin_help']) { $header_text .= sprintf(_(" for %s (%s)"), $displayname, $extension); } // build page content $ret .= checkErrorMessage(); $ret .= $display->displayHeaderText($header_text); $ret .= $display->displayLine(); $freeside = new FreesideSelfService(); $fs_info = $freeside->customer_info( array( 'session_id' => $_SESSION['freeside_session_id'], ) ); $error = $fs_info['error']; if ( $error ) { //$_SESSION['ari_error'] = _("Incorrect Username or Password"); $_SESSION['ari_error'] = $error; #// XXX report as ari_error???! } //$ret .= $fs_info['small_custview']; //$ret .= '
'; $ret .= 'Balance: $'. $fs_info['balance']. '

'; if ( $fs_info['balance'] > 0 ) { #$ret .= 'Make a payment

'; $ret .= 'Make a payment

'; } // XXX count() ??? if ( count($fs_info['open_invoices']) ) { $ret .= ''. ''; $link = ''; $a = $link. $invoice['invnum']. '">'; $ret .= "$td$a". 'Invoice #'. $invoice['invnum']. "$td". "$td$a". $invoice['date']. "$td". ''. ''; if ( $col == $col1 ) { $col = $col2; } else { $col = $col1; } } $ret .= '
Open Invoices
'. $a. '$'. $invoice['owed']. '

'; } else { $ret .= 'You have no outstanding invoices.

'; } #$fs_info = $freeside->customer_info( array( # 'session_id' => $_SESSION['freeside_session_id'], #) ); #$error = $fs_info['error']; #if ( $error ) { # //$_SESSION['ari_error'] = _("Incorrect Username or Password"); # $_SESSION['ari_error'] = $error; #// XXX report as ari_error???! #} // $ret .= 'Billing goes here'; // XXX navigate to make payment, view invoice, // & myaccount change payment info $ret .= 'Make a credit card payment

'; $ret .= 'Make an electronic check payment

'; $ret .= 'Use a prepaid card

'; return $ret; } function make_payment($args) { $display = new Display(); // args $m = getArgument($args,'m'); $q = getArgument($args,'q'); $displayname = $_SESSION['ari_user']['displayname']; $extension = $_SESSION['ari_user']['extension']; // build page content $ret .= checkErrorMessage(); $header_text = _("Billing"); if (!$_SESSION['ari_user']['admin_help']) { $header_text .= sprintf(_(" for %s (%s)"), $displayname, $extension); } // build page content $ret .= checkErrorMessage(); $ret .= $display->displayHeaderText($header_text); $ret .= $display->displayLine(); #$freeside = new FreesideSelfService(); $ret .= 'Make payment goes here'; return $ret; } function view_invoice($args) { $display = new Display(); // args $m = getArgument($args,'m'); $q = getArgument($args,'q'); $displayname = $_SESSION['ari_user']['displayname']; $extension = $_SESSION['ari_user']['extension']; // build page content $ret .= checkErrorMessage(); $header_text = _("Billing"); if (!$_SESSION['ari_user']['admin_help']) { $header_text .= sprintf(_(" for %s (%s)"), $displayname, $extension); } // build page content $ret .= checkErrorMessage(); $ret .= $display->displayHeaderText($header_text); #$ret .= $display->displayLine(); $invnum = getArgument($args, 'invnum'); $freeside = new FreesideSelfService(); $invoice = $freeside->invoice( array( 'session_id' => $_SESSION['freeside_session_id'], 'invnum' => $invnum, ) ); $error = $invoice['error']; if ( $error ) { //$_SESSION['ari_error'] = _("Incorrect Username or Password"); $_SESSION['ari_error'] = $error; // XXX report as ari_error???! } $html = $invoice['invoice_html']->scalar; $html = str_replace( "\xA0", ' ', $html); // XX doh error_log($html); $ret .= '
'. $html. '
'; return $ret; } } ?>