home *** CD-ROM | disk | FTP | other *** search
- <%
- if (!Application("Started") || !Session("Started"))
- {
- %>
- <!-- #INCLUDE FILE="../global.asa" -->
- <%
- if (!Application("Started")) Application_OnStart();
- if (!Session("Started")) Session_OnStart();
- };
- %>
-
-
- <%
- function calcDeduc(price)
- {
- sleva = Application("sleva");
- return Math.ceil(price * sleva / 100.0);
- };
-
- function bookingKindToText(kind)
- {
- kindDobirka = Application("kindDobirka");
- kindPrevod = Application("kindPrevod");
- switch ("".concat(kind).toLowerCase())
- {
- case kindDobirka.toLowerCase(): return "Dobφrka";
- case kindPrevod.toLowerCase(): return "Bankovnφ p°evod";
- default: return "< NEZN┴M▌ >";
- };
- };
-
- function ordStav(state)
- {
- statZalozena = Application("statZalozena");
- statAkceptovana = Application("statAkceptovana");
- statVypis = Application("statVypis");
- statNaCeste = Application("statNaCeste");
- statVyrizena = Application("statVyrizena");
-
- switch ("".concat(state).toLowerCase())
- {
- case statZalozena.toLowerCase(): return 0
- case statAkceptovana.toLowerCase(): return 1
- case statVypis.toLowerCase(): return 2
- case statNaCeste.toLowerCase(): return 3
- case statVyrizena.toLowerCase(): return 4
- default: return -1;
- };
- };
-
- function bookingStateToText(state)
- {
- switch (ordStav(state))
- {
- case 0: return "Zalo₧ena";
- case 1: return "Akceptovßna";
- case 2: return "╚ekß se na v²pis";
- case 3: return "Odeslßno";
- case 4: return "Vy°φzeno";
- default: return "< NEZN┴M▌ >";
- };
- };
-
-
-
-
-
- function stavHotov(zazStav, stav)
- {
- return (ordStav(stav) <= ordStav(zazStav));
- };
-
- function stavJe(zazStav, stav)
- {
- return (ordStav(stav) == ordStav(zazStav));
- };
-
- function nl(num, strLen)
- {
- res = "".concat(num);
- while (res.length < strLen) res = "0".concat(res);
- return res;
- };
-
- function EncodeDT(datetime)
- {
- fmtDateTime = Application("fmtDateTime");
- if (!datetime) d = new Date(); else d = new Date(datetime);
- return "".concat(d.getFullYear(), nl(d.getMonth()+1, 2), nl(d.getDate(), 2), nl(d.getHours(), 2), nl(d.getMinutes(), 2), nl(d.getSeconds(), 2));
- };
-
- function en(s)
- {
- while ((s.length > 0) && (s.charAt(0) == "0")) s = s.substr(1, s.length-1);
- return s;
- };
-
- function DecodeDT(strDT)
- {
- strDT = "".concat(strDT);
- return strDT.substr(6, 2)+"."+en(strDT.substr(4, 2))+"."+en(strDT.substr(0, 4))+" "+
- en(strDT.substr(8, 2))+":"+en(strDT.substr(10, 2))+":"+en(strDT.substr(12, 2));
- };
-
-
- function NormNumStr(strNum)
- {
- var
- i;
-
- strNum = "".concat(strNum);
-
- while ((strNum.length > 1) && ((strNum.charAt(0) <= ' ') || (strNum.charAt(0) == '0')))
- strNum = strNum.substr(1, strNum.length-1);
- while ((strNum.length > 1) && (strNum.charAt(strNum.length-1) <= ' '))
- strNum = strNum.substr(0, strNum.length-1);
-
- p = strNum.indexOf(".");
- if (p >= 0)
- {
- for (i = p + 4; i < (l = strNum.length); i += 4)
- strNum = strNum.substr(0, i)+"."+strNum.substr(i, l - i);
- strNum = strNum.substr(0, p)+","+strNum.substr(p+1, l - p - 1);
- }
- else
- p = strNum.length;
-
- for (i = --p - 3; i >= 0; i -= 3)
- strNum = strNum.substr(0, i+1)+"."+strNum.substr(i+1, strNum.length - i - 1);
-
- return strNum;
- };
-
- function NumToHTMLImg(strNum)
- {
- res = "<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\n";
- res += " <tr>\n";
- for (i = 0; i < strNum.length; i++)
- {
- res += " <td>\n";
- res += " <img src=\"Images/pr_";
- c = strNum.charAt(i);
- if ((c >= '0') && (c <= '9'))
- res += c;
- else
- if (c == '.')
- res += "point";
- else
- if (c == ',')
- res += "comma";
- else
- res += "space";
- res += ".gif\" border=\"0\" hspace=\"0\" vspace=\"0\">\n";
- res += " </td>\n";
- };
- res += " </tr>\n";
- res += "</table>\n";
- return res;
- };
-
- function countToHTMLText(count)
- {
- res = NormNumStr(count);
- //res = NumToHTMLImg(res);
- return res;
- };
-
- function priceToHTMLText(price)
- {
- res = NormNumStr(price);
- //res = NumToHTMLImg(res);
- return res;
- };
-
- %>
-