public static string build_live_table(Global global)
    {
        StringBuilder s = new StringBuilder();

        List<backoffice.admin_shop> shopList = global.www_backoffice().get_all_shops(global.getCurrentChain(),true);

        // DateTime startFromTimestamp = DateTime.Now;

        if (global.shop_live_current_timestamp.Year == 2000)
        {
            global.shop_live_current_timestamp = DateTime.Now;
            if (global.bDEBUG_TESTING_OLD_DATABASE)
            {
                global.shop_live_current_timestamp = new DateTime(2015, 6, 30, 20, 0, 0);
            }
        }
        

        // DateTime startFromTimestamp = new DateTime(2015, 6, 30, 20, 0, 0);
        // global.shop_live_current_timestamp = startFromTimestamp;

        if (!global.bRunningLive)
        {
            global.iToMinute = 0;
            global.iToSecond = 0;
        }

        global.shop_live_current_timestamp = new DateTime(global.shop_live_current_timestamp.Year, global.shop_live_current_timestamp.Month, global.shop_live_current_timestamp.Day, global.iToHour, global.iToMinute, global.iToSecond);

        global.www_backoffice().appendAllEventsForAllShops(global, shopList, global.shop_live_current_timestamp);

        // { A_PHONE_ENROLLED, A_PHONE_SKIPPED, A_PHONE_ALREADY_MEMBER, B_BASKET_NOT_CONFIRMED, C_BASKET_CONFIRMED, D_MEMBERSHIP_ACCEPTED, UNKNOWN }
        global.www_backoffice().setRelationsToHigherLevel(shopList);

        if (global.bShopLiveTimeDialogIsOpen)
            s.Append(SHOP_LIVE_DATE_MODIFY.B_get_maximized_dialog(global));
        else
            s.Append(SHOP_LIVE_DATE_MODIFY.A_get_minimized_dialog(global.shop_live_current_timestamp, true));


        s.Append("<div class=live_body>");

        s.Append("<table class=live_table>");
        s.Append("  <tr>");
        s.Append("      <td valign=top>");
        s.Append(GET_TIMELINE_PART(global,shopList, global.shop_live_current_timestamp, 16));
        s.Append("      </td>");
        s.Append("  </tr>");
        s.Append("  <tr>");
        s.Append("      <td>");
        s.Append(GET_LAST_EVENTS_PART());
        s.Append("      </td>");
        s.Append("  </tr>");
        s.Append("<table>");

        s.Append("</div>");

        global.www_backoffice().log_call("live_table_called " + global.shop_live_current_timestamp.ToShortDateString());

        return s.ToString();
    }
    public static string getAllShopsReport(Global global)
    {
        StringBuilder s = new StringBuilder();

        s.Append(HTML_TOOLBOX.newline());

        s.Append(HTML_TOOLBOX.div_START_input_container_TWITTER(10, 10, 5, 5, "cccccwidth:600px;cccccccheight:200px;"));

        bool bEnrolledAcceptedInTerminal = true;
        List<backoffice.admin_shop> shopList = global.www_backoffice().get_all_shops(global.getCurrentChain(), bEnrolledAcceptedInTerminal);
        s.Append(HTML_TOOLBOX.newline());
        s.Append(HTML_TOOLBOX.infobox_TWITTER("", "Rekruttering i terminal", 14, 300, 20, 10, 10, 10, 10, ""));
        s.Append(HTML_TOOLBOX.newline());

        foreach (backoffice.admin_shop shop in shopList)
        {
            s.Append("<div id=" + SHOP_UPDATE.getContainerId(shop) + " style='float:left;' >");
            s.Append(SHOP_UPDATE.A_get_minimized_dialog(shop));
            s.Append("</div>");
        }
        s.Append(HTML_TOOLBOX.div_END());

        s.Append(HTML_TOOLBOX.newline());
        s.Append(HTML_TOOLBOX.newline());

        bEnrolledAcceptedInTerminal = false;
        shopList = global.www_backoffice().get_all_shops(global.getCurrentChain(), bEnrolledAcceptedInTerminal);
        s.Append(HTML_TOOLBOX.div_START_input_container_TWITTER(10, 10, 5, 5, "cccccwidth:600px;cccccccheight:200px;"));
        s.Append(HTML_TOOLBOX.newline());
        s.Append(HTML_TOOLBOX.infobox_TWITTER("", "Ingen rekruttering", 14, 300, 20, 10, 10, 10, 10, ""));
        s.Append(HTML_TOOLBOX.newline());

        foreach (backoffice.admin_shop shop in shopList)
        {
            s.Append("<div id=shop_container_" + shop.iId + " style='float:left;' >");
            s.Append(SHOP_UPDATE.A_get_minimized_dialog(shop));
            s.Append("</div>");
        }
        s.Append(HTML_TOOLBOX.div_END());

        return s.ToString();
    }