wordpress plugin, RT#75279
[freeside.git] / fs_selfservice / wordpress / example_selfservice.php
1 <?php
2
3 require( dirname( __FILE__ ) . '/wp-blog-header.php' );
4
5 $freeside = new FreesideSelfService();
6
7 error_log( "COOKIE: ". $_COOKIE['freeside_session_id'] );
8 error_log( "COOKIE: ". $GLOBALS['FREESIDE_SESSION_ID'] );
9
10 $customer_info = $freeside->customer_info_short( array(
11   'session_id' => $_COOKIE['freeside_session_id'],
12 ) );
13
14
15 if ( isset($customer_info['error']) && $customer_info['error'] ) {
16   $error = $customer_info['error'];
17   wp_redirect('example_login.php?freeside_error='. urlencode($error));
18   die();
19 }
20
21 extract($customer_info);
22
23 get_header();
24
25 error_log( "COOKIE: ". $_COOKIE['freeside_session_id'] );
26
27 ?>
28
29 <P>Hello <?php echo htmlspecialchars($name); ?></P>
30
31 <?php if ( $signupdate_pretty ) { ?>
32   <P>Thank you for being a customer since <?php echo $signupdate_pretty; ?></P>
33 <?php } ?>
34
35 <P>Your account number is: <B><?php echo $display_custnum ?></B></P>
36
37 <P>Your current balance is: <B><?php echo $balance_pretty ?></B></P>
38
39 <?php echo $announcement ?>
40
41 <!--
42 your open invoices if you have any & payment link if you have one.  more insistant if you're late?
43 <BR><BR>
44
45 your tickets.  some notification if there's new responses since your last login 
46 <BR><BR>
47
48 anything else?
49 -->
50
51 <?php get_footer(); ?>