/**
  * Initialize Inactive Accounts Page
  */
 public function init()
 {
     parent::init();
     // Tell the accounts table widget to only show "pending" accounts
     $widget = $this->forms['inactive_accounts']->getField("accounts")->getWidget();
     $widget->setStatus("Inactive");
 }
 /**
  * Initialize View Server Page
  */
 function init()
 {
     parent::init();
     // Set URL Field
     $this->setURLField("server", $this->get['server']->getID());
     if (isset($this->session['tab'])) {
         $this->smarty->assign("tab", $this->session['tab']);
     }
     // Store Server DBO in session
     $this->session['server_dbo'] =& $this->get['server'];
     // Set this page's Nav Vars
     $this->setNavVar("id", $this->get['server']->getID());
     $this->setNavVar("hostname", $this->get['server']->getHostName());
     // Setup the IP table
     $ipField = $this->forms['view_server_ips']->getField("ips");
     $ipField->getWidget()->setServerID($this->get['server']->getID());
     // Setup the Services table
     $hsField = $this->forms['view_server_services']->getField("services");
     $hsField->getWidget()->setServerID($this->get['server']->getID());
     // Provide the control panel config page
     if (null != ($moduleName = $this->get['server']->getCPModule())) {
         $registry = ModuleRegistry::getModuleRegistry();
         $CPModule = $registry->getModule($moduleName);
         $this->smarty->assign("ServerConfigPage", $CPModule->getServerConfigPage());
     }
 }
 /**
  * Initialize View Account Page
  */
 function init()
 {
     parent::init();
     // Store Account DBO in session
     $this->session['account_dbo'] =& $this->get['account'];
     $accountID = $this->get['account']->getID();
     // Set URL Fields
     $this->setURLField("account", $accountID);
     // Set this page's Nav Vars
     $this->setNavVar("account_id", $accountID);
     $this->setNavVar("account_name", $this->get['account']->getAccountName());
     // Provide the service and product counts to the template
     $this->smarty->assign("hosting_count", count($this->get['account']->getHostingServices()));
     $this->smarty->assign("domain_count", count($this->get['account']->getDomainServices()));
     $this->smarty->assign("product_count", count($this->get['account']->getProducts()));
     // Setup the note table
     $nField = $this->forms['view_account_note']->getField("notes");
     $nField->getWidget()->setAccountID($accountID);
     $nField->getValidator()->setAccountID($accountID);
     // Setup the hosting service table
     $hsField = $this->forms['hosting_purchases']->getField("services");
     $hsField->getWidget()->setAccountID($accountID);
     $hsField->getValidator()->setAccountID($accountID);
     // Setup the domain service table
     $dsField = $this->forms['domain_purchases']->getField("domains");
     $dsField->getWidget()->setAccountID($accountID);
     $dsField->getValidator()->setAccountID($accountID);
     // Setup the product purchase table
     $ppField = $this->forms['product_purchases']->getField("products");
     $ppField->getWidget()->setAccountID($accountID);
     $ppField->getValidator()->setAccountID($accountID);
     // Setup the invoice table
     $inField = $this->forms['view_account_invoices']->getField("invoices");
     $inField->getWidget()->setAccountID($accountID);
 }
 /**
  * Initialize Outstanding Invoices Page
  */
 public function init()
 {
     parent::init();
     // Tell the orders table widget to only show "pending" orders
     $widget = $this->forms['outstanding_invoices']->getField("invoices")->getWidget();
     $widget->setOutstanding("Yes");
 }
Esempio n. 5
0
 /**
  * Initialize the Home Page
  *
  * Gather billing stats and account stats from the database, then assign those
  * stats to template variables.
  */
 function init()
 {
     parent::init();
     // Current month
     $now = getDate(time());
     $this->smarty->assign("month", $now['month']);
     // Invoice Summary
     $stats = outstanding_invoices_stats();
     $this->smarty->assign("os_invoices_count", $stats['count']);
     $this->smarty->assign("os_invoices_total", $stats['total']);
     $this->smarty->assign("os_invoices_count_past_due", $stats['count_past_due']);
     $this->smarty->assign("os_invoices_total_past_due", $stats['total_past_due']);
     $this->smarty->assign("os_invoices_count_past_due_30", $stats['count_past_due_30']);
     $this->smarty->assign("os_invoices_total_past_due_30", $stats['total_past_due_30']);
     // Payment Summary
     $stats = payments_stats();
     $this->smarty->assign("payments_count", $stats['count']);
     $this->smarty->assign("payments_total", $stats['total']);
     // Account Summary
     $active_accounts = count_all_AccountDBO("status='Active'");
     $inactive_accounts = count_all_AccountDBO("status='Inactive'");
     $pending_accounts = count_all_AccountDBO("status='Pending'");
     $total_accounts = $active_accounts + $inactive_accounts;
     $this->smarty->assign("active_accounts_count", $active_accounts);
     $this->smarty->assign("inactive_accounts_count", $inactive_accounts);
     $this->smarty->assign("pending_accounts_count", $pending_accounts);
     $this->smarty->assign("total_accounts", $total_accounts);
 }
 /**
  * Initialize Fulfilled Orders Page
  */
 public function init()
 {
     parent::init();
     // Tell the orders table widget to only show "pending" orders
     $widget = $this->forms['fulfilled_orders']->getField("orders")->getWidget();
     $widget->setStatus("Fulfilled");
 }
 /**
  * Initialize View Hosting Service Page
  */
 function init()
 {
     parent::init();
     // Set URL Fields
     $this->setURLField("hservice", $this->get['hservice']->getID());
     // Store service DBO in session
     $this->session['hosting_dbo'] =& $this->get['hservice'];
 }
 /**
  * Initialize the Edit Payment Page
  */
 function init()
 {
     parent::init();
     // Set URL Fields
     $this->setURLField("payment", $this->get['payment']->getID());
     // Give the template access to the Payment DBO
     $this->session['payment_dbo'] =& $this->get['payment'];
 }
 /**
  * Initialize Page
  */
 function init()
 {
     parent::init();
     // Reference the order object from the local session so the template can see it
     $this->session['order'] =& $_SESSION['order'];
     // Supress the login link
     $this->smarty->assign("supressWelcome", true);
 }
 /**
  * Initialize View Product Page
  */
 function init()
 {
     parent::init();
     // Set URL Fields
     $this->setURLField("product", $this->get['product']->getID());
     // Store service DBO in session
     $this->session['product_dbo'] =& $this->get['product'];
 }
 /**
  * Initialize the View Domain Service Page
  */
 function init()
 {
     parent::init();
     // Set URL Fields
     $this->setURLField("dservice", $this->get['dservice']->getTLD());
     // Store service DBO in session
     $this->session['domain_service_dbo'] =& $this->get['dservice'];
 }
Esempio n. 12
0
 /**
  * Initialize the Page
  */
 public function init()
 {
     parent::init();
     // Setup the theme drop-down
     $tField = $this->forms['login']->getField("theme");
     $tField->getWidget()->setType("manager");
     $tField->getValidator()->setType("manager");
 }
 /**
  * Initialize Delete Account Page
  */
 function init()
 {
     parent::init();
     // Store account DBO in session
     $this->session['account_dbo'] =& $this->get['account'];
     // Set URL Fields
     $this->setURLField("account", $this->get['account']->getID());
 }
Esempio n. 14
0
 /**
  * Provides statistics to the template
  */
 function init()
 {
     parent::init();
     // Get stats
     $stats = domain_stats();
     // Put stats on the page
     $this->smarty->assign("domains_count", $stats['domains_count']);
     $this->smarty->assign("expired_domains_count", $stats['expired_domains_count']);
 }
 /**
  * Initialize the Page
  */
 public function init()
 {
     parent::init();
     // Setup the pricing/term menu
     $widget = $this->forms['edit_product_purchase']->getField("term")->getWidget();
     $widget->setPurchasable($this->get['ppurchase']->getPurchasable());
     // Give the template access to the purchase DBO
     $this->smarty->assign_by_ref("purchaseDBO", $this->get['ppurchase']);
     // Set URL Fields
     $this->setURLField("ppurchase", $this->get['ppurchase']->getID());
 }
Esempio n. 16
0
 /**
  * Initialize the Services Page
  *
  * Provides statistics to the template
  */
 function init()
 {
     parent::init();
     // Get stats
     $services = services_stats();
     $domain_services = domain_services_stats();
     $products = products_stats();
     // Put stats on the page
     $this->smarty->assign("services_count", $services['count']);
     $this->smarty->assign("domain_services_count", $domain_services['count']);
     $this->smarty->assign("products_count", $products['count']);
 }
 /**
  * Initializes the Page
  */
 function init()
 {
     parent::init();
     // Set URL Fields
     $this->setURLField("account", $this->get['account']->getID());
     // Store Account DBO in session
     $this->session['account_dbo'] =& $this->get['account'];
     // Place values on the template
     $this->smarty->assign("email", $this->get['account']->getContactEmail());
     $this->smarty->assign("subject", $this->conf['welcome_subject']);
     $this->smarty->assign("email_body", $this->conf['welcome_email']);
 }
 /**
  * Initialize the Page
  */
 public function init()
 {
     parent::init();
     // Setup the pricing/term menu
     $widget = $this->forms['edit_hosting_purchase']->getField("term")->getWidget();
     $widget->setPurchasable($this->get['hspurchase']->getPurchasable());
     // Provide the purchase and server objects to the template
     $this->smarty->assign_by_ref("purchaseDBO", $this->get['hspurchase']);
     $this->smarty->assign_by_ref("serverDBO", $this->get['hspurchase']->getServerDBO());
     // Set URL Fields
     $this->setURLField("hspurchase", $this->get['hspurchase']->getID());
 }
 /**
  * Initialize the Page
  */
 function init()
 {
     parent::init();
     $registry = ModuleRegistry::getModuleRegistry();
     $this->ppModule = $registry->getModule('paypalwps');
     $this->smarty->assign("account", $this->ppModule->getAccount());
     $this->smarty->assign("cartURL", $this->ppModule->getCartURL());
     $this->smarty->assign("currencyCode", $this->ppModule->getCurrencyCode());
     $this->smarty->assign("orderid", $_SESSION['order']->getID());
     // Dump the cart contents into a Smarty variable.  The Paypal cart upload
     // form will be generated by the template.
     $this->smarty->assign("paypalCart", $this->dumpCart());
 }
Esempio n. 20
0
 /**
  * Initialize Accounts Page
  *
  * Gather account stats from the database and assign them to template variables.
  */
 function init()
 {
     parent::init();
     // Account Summary
     $active_accounts = count_all_AccountDBO("status='Active'");
     $inactive_accounts = count_all_AccountDBO("status='Inactive'");
     $pending_accounts = count_all_AccountDBO("status='Pending'");
     $total_accounts = $active_accounts + $inactive_accounts;
     $this->smarty->assign("active_accounts_count", $active_accounts);
     $this->smarty->assign("inactive_accounts_count", $inactive_accounts);
     $this->smarty->assign("pending_accounts_count", $pending_accounts);
     $this->smarty->assign("total_accounts", $total_accounts);
 }
 /**
  * Initialize Delete Invoice Page
  */
 function init()
 {
     parent::init();
     // Provide the template with access to the Invoice DBO
     $this->session['invoice_dbo'] =& $this->get['invoice'];
     // Set URL Fields
     $this->setURLField("invoice", $this->get['invoice']->getID());
     // Set this page's Nav Vars
     $this->setNavVar("invoice_id", $this->get['invoice']->getID());
     // Setup the item table
     $widget = $this->forms['delete_invoice_items']->getField("items")->getWidget();
     $widget->setInvoiceID($this->get['invoice']->getID());
 }
Esempio n. 22
0
 /**
  * Initialize Page
  */
 public function init()
 {
     parent::init();
     // Access the registrar module for the selected TLD
     $moduleName = $this->get['tld']->getModuleName();
     $registrar = ModuleRegistry::getModuleRegistry()->getModule($moduleName);
     $fqdn = $this->get['domain'] . '.' . $this->get['tld']->getTLD();
     $this->smarty->assign("fqdn", $fqdn);
     if (!$registrar->checkAvailability($fqdn)) {
         $this->setTemplate("unavailable");
     } else {
         $this->setURLField("domain", $this->get['domain']);
         $this->setURLField("tld", $this->get['tld']->getTLD());
     }
 }
Esempio n. 23
0
 /**
  * Initialize the Edit Domain Page
  */
 function init()
 {
     parent::init();
     // Set URL Field
     $this->setURLField("dpurchase", $this->get['dpurchase']->getID());
     // Store DBO in session
     $this->smarty->assign_by_ref("domainDBO", $this->get['dpurchase']);
     try {
         $widget = $this->forms['edit_domain']->getField("term")->getWidget();
         $widget->setPurchasable($this->get['dpurchase']->getPurchasable());
         $widget = $this->forms['renew_domain']->getField("term")->getWidget();
         $widget->setPurchasable($this->get['dpurchase']->getPurchasable());
     } catch (DBNoRowsFoundException $e) {
         throw new SWUserException("[THERE_ARE_NO_DOMAIN_SERVICES]");
     }
 }
 /**
  * Initialize Assign Product Page
  */
 function init()
 {
     parent::init();
     // Set URL Fields
     $this->setURLField("account", $this->get['account']->getID());
     // Store service DBO in session
     $this->session['account_dbo'] = $dbo;
     try {
         $products = load_array_ProductDBO();
     } catch (DBNoRowsFoundException $e) {
         throw new SWUserException("[THERE_ARE_NO_PRODUCTS]");
     }
     if (!isset($this->post['product'])) {
         $this->updatePrices(array_shift($products));
     }
 }
Esempio n. 25
0
 /**
  * Initialize Add Payment Page
  *
  * If the Account ID and/or the Invoice ID is provided in the query string, then
  * load those DBOs and store them in the session.
  */
 function init()
 {
     parent::init();
     if (isset($this->get['invoice'])) {
         $this->setURLField("invoice", $this->get['invoice']->getID());
         $this->smarty->assign("invoice_id", $this->get['invoice']->getID());
         $this->session['invoice_dbo'] =& $this->get['invoice'];
     }
     // Indicate to the InvoiceSelect widget that we only want to display
     // invoices for this account
     $ISWidget =& $this->forms['new_payment']->getField("invoice")->getWidget();
     $ISWidget->setAccountID($this->get['account']->getID());
     $this->setURLField("account", $this->get['account']->getID());
     $this->setNavVar("account_id", $this->get['account']->getID());
     $this->setNavVar("account_name", $this->get['account']->getAccountName());
     $this->session['account_dbo'] =& $this->get['account'];
 }
 /**
  * Initializes the Page
  *
  * If an invoice ID appears in the URL, then init() attempts to load that Invoice,
  * otherwise, it uses an invoice already in the session.
  */
 function init()
 {
     parent::init();
     // Set URL Field values
     $this->setURLField("invoice", $this->get['invoice']->getID());
     // Set this page's Nav Vars
     $this->setNavVar("invoice_id", $this->get['invoice']->getID());
     // Retrieve the Account DBO for this invoice
     $account_dbo = $this->get['invoice']->getAccountDBO();
     // Replace tokens in subject field
     $subject = $this->conf['invoice_subject'];
     $subject = str_replace("{company_name}", $this->conf['company']['name'], $subject);
     $subject = str_replace("{period_begin_date}", date("m/d/y", DBConnection::datetime_to_unix($this->get['invoice']->getPeriodBegin())), $subject);
     $subject = str_replace("{period_end_date}", date("m/d/y", DBConnection::datetime_to_unix($this->get['invoice']->getPeriodEnd())), $subject);
     $this->smarty->assign("email", $account_dbo->getContactEmail());
     $this->smarty->assign("subject", $subject);
     $this->smarty->assign("body", $this->get['invoice']->text($this->conf['invoice_text']));
 }
 /**
  * Initialize the Page
  */
 public function init()
 {
     parent::init();
     try {
         $services = load_array_HostingServiceDBO();
     } catch (DBNoRowsFoundException $e) {
         $e->setMessage("No hosting services have been setup");
         throw $e;
     }
     // Start a new order (if necessary)
     if (!isset($_SESSION['order'])) {
         $_SESSION['order'] = new OrderDBO();
     }
     // Give the template access to the DBOs
     $this->smarty->assign_by_ref("orderDBO", $_SESSION['order']);
     // Show prices for the selected hosting package
     $HPTermWidget = $this->forms['purchasehosting']->getField("hostingterm")->getWidget();
     $serviceField = $this->forms['purchasehosting']->getField("hostingservice");
     $hservice = isset($_POST['hostingservice']) ? $serviceField->set($_POST['hostingservice']) : array_shift(load_array_HostingServiceDBO());
     $HPTermWidget->setPurchasable($hservice);
     // Give the template access to the hosting service DBO
     $this->smarty->assign_by_ref("serviceDBO", $hservice);
     // Show prices for the selected domain package
     $RDTermWidget = $this->forms['purchasehosting']->getField("registerdomainterm")->getWidget();
     $tldField = $this->forms['purchasehosting']->getField("registerdomaintld");
     $dservice = isset($_POST['registerdomaintld']) ? $tldField->set($_POST['registerdomaintld']) : array_shift(load_array_DomainServiceDBO());
     $RDTermWidget->setPurchasable($dservice);
     $TDTermWidget = $this->forms['purchasehosting']->getField("transferdomainterm")->getWidget();
     $tldField = $this->forms['purchasehosting']->getField("transferdomaintld");
     $dservice = isset($_POST['transferdomaintld']) ? $tldField->set($_POST['transferdomaintld']) : array_shift(load_array_DomainServiceDBO());
     $TDTermWidget->setPurchasable($dservice);
     // Setup the in-cart domains drop-down
     $widget = $this->forms['purchasehosting']->getField("incartdomain")->getWidget();
     $widget->setOrder($_SESSION['order']);
     if (isset($this->get['service'])) {
         // Select the hosting service and terms provided in the URL
         $this->smarty->assign("service", $this->get['service']->getID());
         $HPTermWidget->setPurchasable($this->get['service']);
     }
     if (isset($this->get['domain']) && isset($this->get['tld'])) {
         $this->smarty->assign("domain", $this->get['domain']);
         $this->smarty->assign("tld", $this->get['tld']->getTLD());
     }
 }
Esempio n. 28
0
 /**
  * Initialize Billing Page
  *
  * Gather billing statistics from the database and assign them to template variables
  */
 function init()
 {
     parent::init();
     // Current month
     $now = getDate(time());
     $this->smarty->assign("month", $now['month']);
     // Invoice Summary
     $stats = outstanding_invoices_stats();
     $this->smarty->assign("os_invoices_count", $stats['count']);
     $this->smarty->assign("os_invoices_total", $stats['total']);
     $this->smarty->assign("os_invoices_count_past_due", $stats['count_past_due']);
     $this->smarty->assign("os_invoices_total_past_due", $stats['total_past_due']);
     $this->smarty->assign("os_invoices_count_past_due_30", $stats['count_past_due_30']);
     $this->smarty->assign("os_invoices_total_past_due_30", $stats['total_past_due_30']);
     // Payment Summary
     $stats = payments_stats();
     $this->smarty->assign("payments_count", $stats['count']);
     $this->smarty->assign("payments_total", $stats['total']);
 }
 /**
  * Initialize the Page
  */
 public function init()
 {
     parent::init();
     // Start a new order (if necessary)
     if (!isset($_SESSION['order'])) {
         $_SESSION['order'] = new OrderDBO();
     }
     // Give the template access to the order object
     $this->smarty->assign_by_ref("orderDBO", $_SESSION['order']);
     // Show prices for the selected domain package
     $termWidget = $this->forms['purchasedomain']->getField("domainterm")->getWidget();
     $tldField = $this->forms['purchasedomain']->getField("domaintld");
     $dservice = isset($_POST['domaintld']) ? $tldField->set($_POST['domaintld']) : array_shift(load_array_DomainServiceDBO());
     $termWidget->setPurchasable($dservice);
     if (isset($this->get['domain']) && isset($this->get['tld'])) {
         $this->smarty->assign("domain", $this->get['domain']);
         $this->smarty->assign("tld", $this->get['tld']->getTLD());
     }
 }
Esempio n. 30
0
 /**
  * Initialize the View Order Page
  */
 function init()
 {
     parent::init();
     // Set URL Fields
     $this->setURLField("order", $this->get['order']->getID());
     // Give the template access to the Order DBO
     $this->session['orderdbo'] =& $this->get['order'];
     // Setup the Order Items table
     $oiField = $this->forms['order']->getField("items");
     $oiField->getWidget()->setOrder($this->get['order']);
     $oiField->getValidator()->setOrder($this->get['order']);
     // Setup the payment table
     $payField = $this->forms['order']->getField("payments");
     $payField->getWidget()->setOrderID($this->get['order']->getID());
     // If this is an existing account order, make sure the template has access
     // to the account DBO
     if ($this->get['order']->getAccountType() == "Existing Account") {
         $this->session['accountdbo'] = $this->get['order']->getAccount();
     }
     // Set Nav vars
     $this->setNavVar("order_id", $this->get['order']->getID());
 }