Пример #1
0
    public static string B_get_maximized_dialog(Global global)
    {
        string sTextInputId = getContainerId() + "_text";
        string sOldValue    = global.shop_live_current_timestamp.ToString();

        StringBuilder sb = new StringBuilder();

        // ******** overflow:hidden; Important, it makes all the tables wrap INSIDE the div !!! **************
        sb.Append("<div style='overflow:hidden;ccccccborder:2px solid rgb(200,200,200);xxxxxborder-radius:6px;xxxxxxxbackground-color:rgb(100,100,100);'>"); // Rundt alle tabellene


        sb.Append("<div style='float:left;padding:10px;'>");
        sb.Append(HTML_TOOLBOX.table_START_with_class("live_date_class"));

        sb.Append(HTML_TOOLBOX.tr_START("Timer bakover"));
        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
        sb.Append("Antall timer bakover");
        sb.Append(HTML_TOOLBOX.td_END(""));


        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));

        StringBuilder select_hours = new StringBuilder();

        select_hours.Append("<select id=nof_hours onchange=shop_live_refresh_hours_and_to_hour() style='font-size:10px;font-family:arial;'>");
        select_hours.Append("<option value=1>1 time</option>");
        select_hours.Append("<option value=2>2 timer</option>");
        select_hours.Append("<option value=3>3 timer</option>");
        select_hours.Append("<option value=4>4 timer</option>");
        select_hours.Append("<option value=5>5 timer</option>");
        select_hours.Append("<option value=6>6 timer</option>");
        select_hours.Append("<option value=7>7 timer</option>");
        select_hours.Append("<option value=8>8 timer</option>");
        select_hours.Append("<option value=9>9 timer</option>");
        select_hours.Append("<option value=10>10 timer</option>");
        select_hours.Append("<option value=11>11 timer</option>");
        select_hours.Append("<option value=12>12 timer</option>");
        select_hours.Append("<option value=24>24 timer</option>");
        select_hours.Append("<option value=48>2 dager</option>");
        select_hours.Append("<option value=72>3 dager</option>");
        select_hours.Append("<option value=96>4 dager</option>");
        select_hours.Append("<option value=120>5 dager</option>");
        select_hours.Append("<option value=144>6 dager</option>");
        select_hours.Append("<option value=168>1 uke</option>");
        select_hours.Append("</select>");

        string sss = select_hours.ToString();

        sss = sss.Replace("value=" + global.iHours.ToString() + ">", " selected value=" + global.iHours.ToString() + ">");

        sb.Append(sss);
        sb.Append(HTML_TOOLBOX.td_END(""));


        /*
         * for (int iHour = 1; iHour <= 24; ++iHour)
         * {
         *  sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
         *  sb.Append(getHoursSinceButton(iHour));
         *  sb.Append(HTML_TOOLBOX.td_END(""));
         * }
         */
        sb.Append(HTML_TOOLBOX.tr_END(""));
        sb.Append(HTML_TOOLBOX.table_END(""));
        sb.Append("</div>");


        sb.Append("<div style='float:left;padding:14px;padding-left:5px;'>"); // Tilogmed klokken

        if (global.bRunningLive)
        {
            sb.Append(HTML_TOOLBOX.link_TWITTER_call_javascript_function("Stop live data!", "shop_live_stop_timer_job()", 14, true, "padding-right:10px;"));
        }
        else
        {
            sb.Append(HTML_TOOLBOX.link_TWITTER_call_javascript_function("Live data!", "shop_live_start_timer()", 14, true, "padding-right:10px;"));
        }

        sb.Append("</div>"); // Tilogmed klokken


        sb.Append("<div style='float:left;padding:10px;'>"); // Tilogmed klokken
        sb.Append(HTML_TOOLBOX.table_START_with_class("live_date_class"));
        sb.Append(HTML_TOOLBOX.tr_START("Tilogmed klokken"));
        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
        sb.Append("Inntil klokken");
        sb.Append(HTML_TOOLBOX.td_END(""));

        // sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
        // sb.Append(getHourToButton(0));
        // sb.Append(HTML_TOOLBOX.td_END(""));

        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));

        StringBuilder sSelect = new StringBuilder();

        sSelect.Append("<select id=to_hour onchange=shop_live_refresh_hours_and_to_hour() style='font-size:10px;font-family:arial;'>");
        sSelect.Append("<option value=10>10:00</option>");
        sSelect.Append("<option value=11>11:00</option>");
        sSelect.Append("<option value=12>12:00</option>");
        sSelect.Append("<option value=13>13:00</option>");
        sSelect.Append("<option value=14>14:00</option>");
        sSelect.Append("<option value=15>15:00</option>");
        sSelect.Append("<option value=16>16:00</option>");
        sSelect.Append("<option value=17>17:00</option>");
        sSelect.Append("<option value=18>18:00</option>");
        sSelect.Append("<option value=19>19:00</option>");
        sSelect.Append("<option value=20>20:00</option>");
        sSelect.Append("<option value=21>21:00</option>");
        sSelect.Append("<option value=22>22:00</option>");
        sSelect.Append("<option value=23>23:00</option>");
        sSelect.Append("</select>");

        string sss2 = sSelect.ToString();

        sss2 = sss2.Replace("value=" + global.iToHour.ToString() + ">", " selected value=" + global.iToHour.ToString() + ">");

        sb.Append(sss2);
        sb.Append(HTML_TOOLBOX.td_END(""));

        /*
         * for (int iHour = 10; iHour <= 24; ++iHour)
         * {
         *  sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
         *  sb.Append(getHourToButton(iHour));
         *  sb.Append(HTML_TOOLBOX.td_END(""));
         * }
         */
        sb.Append(HTML_TOOLBOX.tr_END(""));
        sb.Append(HTML_TOOLBOX.table_END(""));
        sb.Append("</div>"); // end tilogmedklokken



        sb.Append("<div style='float:left;padding:14px;;padding-left:5px;'>"); // Tilogmed klokken
        sb.Append(HTML_TOOLBOX.link_TWITTER_call_javascript_function("Skjul dialog", "shop_live_date_clicked_cancel()", 14, true, "padding-right:10px;"));
        sb.Append("</div>");                                                   // Tilogmed klokken



        sb.Append("<div style='clear:both;padding:10px;'>");
        sb.Append(HTML_TOOLBOX.table_START_with_class("xxxxxxxxxxxxxxxxxxxxxxxlive_date_class"));

        sb.Append(HTML_TOOLBOX.tr_START("Ukedag"));

        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
        // sb.Append(HTML_TOOLBOX.button_GOOGLE("Tilbake",14,10,10,10,10, "shop_live_date_clicked_cancel()"));
        // sb.Append(HTML_TOOLBOX.link_TWITTER_call_javascript_function("Live data!", "shop_live_date_clicked_cancel()", 14, true,"padding-right:10px;"));
        sb.Append(HTML_TOOLBOX.td_END(""));

        DateTime now = DateTime.Now;

        if (global.bDEBUG_TESTING_OLD_DATABASE)
        {
            now = new DateTime(2015, 6, 30, 20, 0, 0);
        }


        int iDayNoToday = (int)now.DayOfWeek;


        string sCellStyle = "font-size:12px;bold;background-color:rgb(240,240,240);padding-right:10px;padding-left:10px;";

        sb.Append(HTML_TOOLBOX.td_START_cell(sCellStyle)); sb.Append("Mandag"); sb.Append(HTML_TOOLBOX.td_END(""));
        sb.Append(HTML_TOOLBOX.td_START_cell(sCellStyle)); sb.Append("Tirsdag"); sb.Append(HTML_TOOLBOX.td_END(""));
        sb.Append(HTML_TOOLBOX.td_START_cell(sCellStyle)); sb.Append("Onsdag"); sb.Append(HTML_TOOLBOX.td_END(""));
        sb.Append(HTML_TOOLBOX.td_START_cell(sCellStyle)); sb.Append("Torsdag"); sb.Append(HTML_TOOLBOX.td_END(""));
        sb.Append(HTML_TOOLBOX.td_START_cell(sCellStyle)); sb.Append("Fredag"); sb.Append(HTML_TOOLBOX.td_END(""));
        sb.Append(HTML_TOOLBOX.td_START_cell(sCellStyle)); sb.Append("Lørdag"); sb.Append(HTML_TOOLBOX.td_END(""));
        sb.Append(HTML_TOOLBOX.td_START_cell(sCellStyle)); sb.Append("Søndag"); sb.Append(HTML_TOOLBOX.td_END(""));

        sb.Append(HTML_TOOLBOX.tr_END(""));


        sb.Append(HTML_TOOLBOX.tr_START("Ukedag"));

        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
        sb.Append("Denne uken");
        sb.Append(HTML_TOOLBOX.td_END(""));

        // Finn mandag denne uken og finn ut hvilken dato det er ...
        DateTime thisMonday = now.AddDays(1 - (iDayNoToday));

        for (int iWeekDay = 1; iWeekDay <= iDayNoToday; ++iWeekDay)
        {
            DateTime day = thisMonday.AddDays(iWeekDay - 1);
            sb.Append(getDayButton_TD_PART(global.shop_live_current_timestamp, day));
        }
        sb.Append(HTML_TOOLBOX.tr_END(""));


        // Finn mandag Forrige uke og finn ut hvilken dato det er ...
        DateTime thisMondayMinus_1_week = now.AddDays(1 - (iDayNoToday) - 7);

        sb.Append(HTML_TOOLBOX.tr_START("Ukedag"));
        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
        sb.Append("Forrige uke");
        sb.Append(HTML_TOOLBOX.td_END(""));

        for (int iWeekDay = 1; iWeekDay <= 7; ++iWeekDay)
        {
            DateTime day = thisMondayMinus_1_week.AddDays(iWeekDay - 1);
            sb.Append(getDayButton_TD_PART(global.shop_live_current_timestamp, day));
        }

        sb.Append(HTML_TOOLBOX.tr_END(""));

        // Finn mandag Forrige Forrige uke og finn ut hvilken dato det er ...
        DateTime thisMondayMinus_2_weeks = now.AddDays(1 - (iDayNoToday) - 14);

        sb.Append(HTML_TOOLBOX.tr_START("Ukedag"));
        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
        sb.Append("Uken før det");
        sb.Append(HTML_TOOLBOX.td_END(""));

        for (int iWeekDay = 1; iWeekDay <= 7; ++iWeekDay)
        {
            DateTime day = thisMondayMinus_2_weeks.AddDays(iWeekDay - 1);
            sb.Append(getDayButton_TD_PART(global.shop_live_current_timestamp, day));
        }
        sb.Append(HTML_TOOLBOX.tr_END(""));

        // Finn mandag Forrige Forrige uke og finn ut hvilken dato det er ...
        DateTime thisMondayMinus_3_weeks = now.AddDays(1 - (iDayNoToday) - 21);

        sb.Append(HTML_TOOLBOX.tr_START("Ukedag"));
        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
        sb.Append("Uken før det ...");
        sb.Append(HTML_TOOLBOX.td_END(""));

        for (int iWeekDay = 1; iWeekDay <= 7; ++iWeekDay)
        {
            DateTime day = thisMondayMinus_3_weeks.AddDays(iWeekDay - 1);
            sb.Append(getDayButton_TD_PART(global.shop_live_current_timestamp, day));
        }
        sb.Append(HTML_TOOLBOX.tr_END(""));



        // Finn mandag Forrige Forrige uke og finn ut hvilken dato det er ...
        DateTime thisMondayMinus_4_weeks = now.AddDays(1 - (iDayNoToday) - 28);

        sb.Append(HTML_TOOLBOX.tr_START("Ukedag"));
        sb.Append(HTML_TOOLBOX.td_START_cell("font-size:12px;bold;"));
        sb.Append("Uken før det ... ...");
        sb.Append(HTML_TOOLBOX.td_END(""));

        for (int iWeekDay = 1; iWeekDay <= 7; ++iWeekDay)
        {
            DateTime day = thisMondayMinus_4_weeks.AddDays(iWeekDay - 1);
            sb.Append(getDayButton_TD_PART(global.shop_live_current_timestamp, day));
        }
        sb.Append(HTML_TOOLBOX.tr_END(""));



        sb.Append(HTML_TOOLBOX.table_END(""));
        sb.Append("</div>"); // Slutt på datovalg


        sb.Append("</div>");
        return(sb.ToString());
    }