* Create the HTML tags objects.
 */
$log_in_to_account_div = new HTMLTags_Div();
$log_in_to_account_div->set_attribute_str('id', 'log_in_to_account_div');
if ($log_in_manager->is_logged_in()) {
    // Change Account
    $log_in_to_account_div->append_str_to_content($page_manager->get_inc_file_as_string('body.p.log-out'));
    //$log_in_to_account_div->append_str_to_content(
    //	$page_manager->get_inc_file_as_string('body.a.log-out')
    //);
} else {
    /*
     * Tell the customer about any log in errors.
     */
    if (isset($_GET['error_message'])) {
        $log_in_to_account_div->append_tag_to_content(new HTMLTags_LastActionBoxDiv($message = stripslashes(urldecode($_GET['error_message'])), $no_script_href = '', $status = 'error'));
    }
    /*
     * Log into the customer's account.
     */
    $form_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'log-in', 'html');
    $redirect_script_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'log-in', 'redirect-script');
    $desired_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'products', 'html');
    $cancel_page_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'products', 'html');
    //$login_form_div = $log_in_manager->get_login_form_div();
    $login_form_div = new HTMLTags_Div();
    $login_form_div->set_attribute_str('class', 'cmx-form');
    $login_form_div->append_tag_to_content($log_in_manager->get_log_in_form($form_location, $redirect_script_location, $desired_location, $cancel_page_location));
    $log_in_to_account_div->append_tag_to_content($login_form_div);
}
echo $log_in_to_account_div->get_as_string();
$add_customer_h = new HTMLTags_Heading(3, 'Create a new account');
$accounts_div->append_tag_to_content($add_customer_h);
/*
 * The form for creating an account.
 */
$form_location = $current_page_url;
$redirect_script_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'create-new-account', 'redirect-script');
$desired_location = $current_page_url;
$cancel_page_location = $current_page_url;
//print_r($current_page_url);
//exit;
$accounts_div->append_tag_to_content($log_in_manager->get_create_new_account_form($form_location, $redirect_script_location, $desired_location, $cancel_page_location));
// LOG IN FORM
$log_in_h = new HTMLTags_Heading(3, 'Log in with your existing account');
$accounts_div->append_tag_to_content($log_in_h);
$login_form_div = new HTMLTags_Div();
#$login_form_div->set_attribute_str('class', 'cmx-form');
$form_location = $current_page_url;
$redirect_script_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'log-in', 'redirect-script');
$desired_location = $current_page_url;
$cancel_page_location = $current_page_url;
$login_form_div->append_tag_to_content($log_in_manager->get_log_in_form($form_location, $redirect_script_location, $desired_location, $cancel_page_location));
/*
 * The link to the password reset page.
 */
$password_reset_confirmation_url = $log_in_manager->get_password_reset_confirmation_url();
$password_reset_confirmation_a = new HTMLTags_A('Forgotten your password?');
$password_reset_confirmation_a->set_href($password_reset_confirmation_url);
$login_form_div->append_tag_to_content($password_reset_confirmation_a);
$accounts_div->append_tag_to_content($login_form_div);
echo $accounts_div->get_as_string();
 public function get_customer_region_selection_div()
 {
     $page_manager = PublicHTML_PageManager::get_instance();
     //                $mysql_user_factory = Database_MySQLUserFactory::get_instance();
     //                $mysql_user = $mysql_user_factory->get_for_this_project();
     //                $database = $mysql_user->get_database();
     #$customer_regions_table = $database->get_table('hpi_shop_customer_regions');
     $customer_regions_table = $this->get_element();
     $customer_regions = $customer_regions_table->get_all_rows('sort_order', 'ASC');
     $customer_regions_div = new HTMLTags_Div();
     $customer_regions_div->set_attribute_str('id', 'tabs');
     $customer_regions_ul = new HTMLTags_UL();
     foreach ($customer_regions as $customer_region) {
         $customer_region_li = new HTMLTags_LI();
         $customer_region_link_span = new HTMLTags_Span($customer_region->get_name());
         if ($customer_region->get_id() == $_SESSION['customer_region_id']) {
             $double_span = new HTMLTags_Span();
             $double_span->set_attribute_str('class', 'current');
             $double_span->append_tag_to_content($customer_region_link_span);
             $customer_region_li->append_tag_to_content($double_span);
         } else {
             //$customer_region_link_file = '/';
             //$customer_region_link_location = new HTMLTags_URL();
             //$customer_region_link_location->set_file($customer_region_link_file);
             //$customer_region_link_location->set_get_variable('page', $page_manager->get_page());
             $redirect_script_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'customer-region', 'redirect-script');
             $redirect_script_location->set_get_variable('customer_region_session', $customer_region->get_id());
             $desired_location = $page_manager->get_script_uri();
             if (isset($_GET['product_id'])) {
                 $desired_location->set_get_variable('product_id', $_GET['product_id']);
             }
             if (isset($_GET['product_category_id'])) {
                 $desired_location->set_get_variable('product_category_id', $_GET['product_category_id']);
             }
             $redirect_script_location->set_get_variable('desired_location', urlencode($desired_location->get_as_string()));
             $customer_region_link_anchor = new HTMLTags_A();
             $customer_region_link_anchor->set_href($redirect_script_location);
             $customer_region_link_anchor->set_attribute_str('title', 'Change your location to ' . $customer_region->get_name());
             $customer_region_link_anchor->append_tag_to_content($customer_region_link_span);
             $customer_region_li->append_tag_to_content($customer_region_link_anchor);
         }
         $customer_regions_ul->append_tag_to_content($customer_region_li);
     }
     $customer_regions_div->append_tag_to_content($customer_regions_ul);
     #echo $customer_regions_div->get_as_string();
     return $customer_regions_div;
 }
//                )
//        );
//}
/*
 * Print any errors.
 */
if (isset($_GET['error_message'])) {
    $last_action_div = new HTMLTags_Div();
    $last_action_div->set_attribute_str('id', 'last_action_div');
    $error_p = new HTMLTags_P(stripcslashes($_GET['error_message']));
    $error_p->set_attribute_str('class', 'error');
    $last_action_div->append_tag_to_content($error_p);
    $shipping_details_div->append_tag_to_content($last_action_div);
    $clear_div = new HTMLTags_Div();
    $clear_div->set_attribute_str('style', 'clear:both;');
    $shipping_details_div->append_tag_to_content($clear_div);
}
/*
 * The form for creating an account.
 */
$form_location = $current_page_url;
$redirect_script_location = PublicHTML_PublicURLFactory::get_url('plug-ins', 'shop', 'customer-details', 'redirect-script');
$desired_location = $current_page_url;
$cancel_page_location = $current_page_url;
$user = $log_in_manager->get_user();
$user_renderer = $user->get_renderer();
$shipping_details_div->append_tag_to_content($user_renderer->get_customer_details_editing_form($form_location, $redirect_script_location, $desired_location, $cancel_page_location));
//$customer_adding_form
//        = $customers_table_renderer->get_simplified_customer_adding_form($add_customer_url, $cancel_href);
//$shipping_details_div->append_tag_to_content($customer_adding_form);
echo $shipping_details_div->get_as_string();