<% ' FileName="Connection_odbc_conn_dsn.htm" ' Type="ADO" ' DesigntimeType="ADO" ' HTTP="false" ' Catalog="" ' Schema="" Dim MM_mqcot_STRING MM_maq_STRING = "Driver={Mysql}; Database=promad2007; UID=promaddb; PWD=X6qumAh:hb44ATXB;" %> <% Randomize function ZeroPad(sWork, nDigits) ZeroPad = right(string(nDigits, "0") & trim(sWork), nDigits) end function function GetIndexNumber() sDay = Day(Now()) sMonth = Month(Now()) sYear = Year(Now()) sHour = Hour(Now()) sMinute = Minute(Now()) sSecond = Second(Now()) Tail = Int(1000000 * Rnd) GetIndexNumber = ZeroPad(sYear, 4) & ZeroPad(sMonth, 2) & ZeroPad(sDay, 2) & ZeroPad(sHour, 2) & ZeroPad(sMinute, 2) & ZeroPad(sSecond, 2) & ZeroPad(Tail, 6) end function 'Operacion de fechas 'ESTANDARD DE FECHAS if request("DESDE")="" THEN dtCurrentDateM=DATE() iF request("DESDE")<>"" THEN dtCurrentDateM=CDATE(REQUEST("DESDE")) iFirstDayOfMonth = DatePart("w", DateSerial(Year(dtCurrentDateM), Month(dtCurrentDateM), 0)) iDaysInMonth = DatePart("d", DateSerial(Year(dtCurrentDateM), Month(dtCurrentDateM)+1, 1-1)) RE1=CSTR(Month(dtCurrentDateM)) + "/01/" + CSTR(Year(dtCurrentDateM)) RE1=CDATE(RE1) DESx = (RE1) feMy=DESx des=cstr(datepart("yyyy",feMy))+"/" +cstr(datepart("m",feMy))+"/" +cstr(datepart("d",feMy)) strMPasado = (DateAdd("m", -1, RE1)) HASx = (DateAdd("m", 1, RE1)) feMy=HASx HAS=cstr(datepart("yyyy",feMy))+"/" +cstr(datepart("m",feMy))+"/" +cstr(datepart("d",feMy)) iF request("HASTA")<>"" THEN HAS=REQUEST("HASTA") feMy=HAS HAS=cstr(datepart("yyyy",feMy))+"/" +cstr(datepart("m",feMy))+"/" +cstr(datepart("d",feMy)) end if 'FIN STANDARD DE FECHAS 'vALORES gLOBALE S DDE cOTIZACION Dim VCOTS Dim VCOTS_numRows Set VCOTS = Server.CreateObject("ADODB.Recordset") VCOTS.ActiveConnection = MM_maq_STRING VCOTS.Source = "SELECT * FROM VALCOTS" VCOTS.Open() IF NOT VCOTS.EOF THEN PORCBAD=VCOTS("PORCBAD") DIASVENC=VCOTS("DIASVENC") END IF VCOTS.CLOSE set VCOTS= NOTHING Function strReplace(data, dsearch, dreplace) Dim startpos Dim pos Dim strReplaced startpos = 1 pos = InStr(startpos, data, dsearch, 1) do while pos > 0 strReplaced = strReplaced & Mid(data, startpos, pos-startpos) & dreplace startpos = pos + len(dsearch) pos = InStr(startpos, data, dsearch, 1) Loop strReplace = strReplaced & Mid(data, startpos) 'catch the last one End Function %>