input['submit'])) { $base->input['submit'] = ""; } if (!isset($base->input['cmd'])) { $base->input['cmd'] = ""; } $submit = $base->input['submit']; if ($submit) { // check the user login information $u->user_login($base->input['user_name'],$base->input['password']); // redirect back to this page to set any cookies properly print ""; } //echo '
';
//var_dump($_SERVER);
//die;
if ($u->user_isloggedin()) {
session_start();
// define this constant
define('INDEX_CITRUS',1);
// this user variable holds the account number
$user = $u->user_getname();
//GET Variables (sorta like the old way for now)
$cmd = $base->input['cmd'];
// print the top of the page
echo "
Customer Account Manager
";
// Print heading and links
echo "$l_customeraccountmanager: $l_account $user
";
echo "$l_profile | ";
echo "$l_services | ";
echo "$l_billing | ";
echo "$l_supportrequest | ";
echo "$l_logout\n";
switch ($cmd) {
/*--------------------------------------------------------------------*/
// Services
/*--------------------------------------------------------------------*/
case 'view_services':
/*----------------------------------------------------*/
// list of services and service details
/*----------------------------------------------------*/
// Get their service information
$query = "SELECT c.signup_date c_signup_date, c.name c_name, c.company c_company, c.street c_street, c.city c_city,
c.state c_state, c.zip c_zip, c.country c_country, c.phone c_phone, c.fax c_fax, c.source c_source,
c.contact_email c_contact_email, c.default_billing_id c_default_billing_id,
c.cancel_date c_cancel_date, c.removal_date c_removal_date, b.id b_id,
b.name b_name, b.company b_company, b.street b_street, b.city b_city, b.state b_state,
b.country b_country, b.zip b_zip, b.phone b_phone, b.fax b_fax, b.contact_email b_contact_email,
b.account_number b_account_number, b.billing_type b_billing_type,
b.creditcard_number b_creditcard_number, b.creditcard_expire b_creditcard_expire,
b.billing_status b_billing_status, b.next_billing_date b_next_billing_date,
b.prev_billing_date b_prev_billing_date,
u.account_number u_account_number, u.master_service_id u_master_service_id,
u.billing_id u_billing_id, u.start_datetime u_start_datetime,
u.salesperson u_salesperson, u.usage_multiple u_usage_multiple,
u.id u_id, u.removed u_removed,
m.id m_id, m.service_description m_service_description, m.pricerate m_pricerate,
m.frequency m_frequency, m.options_table m_options_table
FROM customer c LEFT JOIN billing b ON b.id = c.default_billing_id
LEFT JOIN user_services u ON u.account_number = c.account_number
LEFT JOIN master_services m ON u.master_service_id = m.id
WHERE c.account_number = '$user' AND removed <> 'y'";
$DB->SetFetchMode(ADODB_FETCH_ASSOC);
//$DB->debug = true;
$result = $DB->Execute($query) or die ("$l_queryfailed");
echo "$l_services
| $l_id | $l_description | $l_details | $l_price |
| $u_id | $m_service_description | $optiondetails | \$$m_pricerate |
$l_addnewservice"; break; case 'add_services': echo "
| $l_description | $l_rate | |
| $service_description | \$$pricerate | $l_add |
$l_sentrequesttoaddnew $servicename
Home
";
break;
/*--------------------------------------------------------------------*/
// Support Request
/*--------------------------------------------------------------------*/
case 'support':
echo "
$l_messagesent.
$l_home
";
break;
/*--------------------------------------------------------------------*/
// Billing
/*--------------------------------------------------------------------*/
case 'view_bill':
// view their invoices (much like the invoice maintenance tool)
echo "
| $l_id | $l_date | $l_type | $l_status | $l_response | $l_amount | "; // get the billing_history for this account, the account number // is stored in the corresponding billing record $query = "SELECT p.id p_id, p.creation_date p_cdate, p.payment_type p_payment_type, p.status p_status, p.billing_amount p_billing_amount, p.response_code p_response_code, c.account_number c_acctnum, b.account_number b_acctnum, b.id b_id FROM payment_history p LEFT JOIN billing b ON p.billing_id = b.id LEFT JOIN customer c ON b.account_number = c.account_number WHERE b.account_number = '$user' ORDER BY p.id DESC LIMIT 3"; $DB->SetFetchMode(ADODB_FETCH_ASSOC); $result = $DB->Execute($query) or die ("$l_queryfailed"); while ($myresult = $result->FetchRow()) { $id = $myresult['p_id']; $date = $myresult['p_cdate']; $type = $myresult['p_payment_type']; $status = $myresult['p_status']; $response = $myresult['p_response_code']; $amount = $myresult['p_billing_amount']; print "
| $id | "; print "$date | "; print "$type | "; print "$status | "; print "$response | "; print "$amount | "; } echo '
| $l_invoicenum | $l_date | $l_type | $l_from | $l_to | $l_newcharges | $l_total | "; // get the billing_history for this account, the account number is // stored in the corresponding billing record $query = "SELECT h.id h_id, h.billing_id h_bid, h.billing_date h_bdate, h.billing_type h_btype, h.from_date h_from, h.to_date h_to, h.total_due h_total, h.new_charges h_new_charges, c.account_number c_acctnum, b.account_number b_acctnum, b.id b_id FROM billing_history h LEFT JOIN billing b ON h.billing_id = b.id LEFT JOIN customer c ON b.account_number = c.account_number WHERE b.account_number = '$user' ORDER BY h.id DESC LIMIT 3"; $DB->SetFetchMode(ADODB_FETCH_ASSOC); $result = $DB->Execute($query) or die ("$l_queryfailed"); while ($myresult = $result->FetchRow()) { $id = $myresult['h_id']; $billing_date = $myresult['h_bdate']; $billing_type = $myresult['h_btype']; $from_date = $myresult['h_from']; $to_date = $myresult['h_to']; $new_charges = $myresult['h_new_charges']; $total_due = $myresult['h_total']; print "
| $id | "; print "$billing_date | "; print "$billing_type | "; print "$from_date | "; print "$to_date | "; print "$new_charges | "; print "$total_due | "; } echo '
$l_paybillonline"; break; case 'pay_bill': // link to external online payment form? break; /*--------------------------------------------------------------------*/ // Profile /*--------------------------------------------------------------------*/ default: /*----------------------------------------------------*/ // print customer and billing info /*----------------------------------------------------*/ $query = "SELECT c.signup_date c_signup_date, c.name c_name, c.company c_company, c.street c_street, c.city c_city, c.state c_state, c.zip c_zip, c.country c_country, c.phone c_phone, c.fax c_fax, c.source c_source, c.contact_email c_contact_email, c.default_billing_id c_default_billing_id, c.cancel_date c_cancel_date, c.removal_date c_removal_date, b.name b_name, b.company b_company, b.street b_street, b.city b_city, b.state b_state, b.country b_country, b.zip b_zip, b.phone b_phone, b.fax b_fax, b.contact_email b_contact_email, b.account_number b_account_number, b.billing_type b_billing_type, b.creditcard_number b_creditcard_number, b.creditcard_expire b_creditcard_expire, b.billing_status b_billing_status, b.next_billing_date b_next_billing_date, b.prev_billing_date b_prev_billing_date FROM customer c LEFT JOIN billing b ON b.id = c.default_billing_id WHERE c.account_number = '$user'"; $DB->SetFetchMode(ADODB_FETCH_ASSOC); //$DB->debug = true; $result = $DB->Execute($query) or die ("$l_queryfailed"); $myresult = $result->fields; // // Put values into variablies and Print basic customer info // $signup_date = $myresult['c_signup_date']; $name = $myresult['c_name']; $company = $myresult['c_company']; $street = $myresult['c_street']; $city = $myresult['c_city']; $state = $myresult['c_state']; $zip = $myresult['c_zip']; $country = $myresult['c_country']; $phone = $myresult['c_phone']; $fax = $myresult['c_fax']; $source = $myresult['c_source']; $contactemail = $myresult['c_contact_email']; $default_billing_id = $myresult['c_default_billing_id']; $cancel_date = $myresult['c_cancel_date']; $removal_date = $myresult['c_removal_date']; $billingemail = $myresult['b_contact_email']; echo "
$l_customeraccountmanager$l_logintext
|