Help hotel Planning

Help hotel Planning

Postby devwin2010 » Mon Aug 27, 2007 1:58 pm

Dear coleagues

I need develop an hotel planning grid based in dbf, Can somebody help
me with a little sample

Thanks
Dante
devwin2010@yahoo.com.ar
devwin2010
 
Posts: 61
Joined: Tue Jul 17, 2007 12:37 pm

Postby Rick Lipkin » Mon Aug 27, 2007 4:34 pm

Devwin

Here is a snipit of code I user to create a database of calendar days for a vehicle reservation listbox grid .. Hope this give you an idea how to create a database on the fly with fields names that give you days of the week for columns.

Rick Lipkin

//

..................

DBF_STRU := { }
AADD( DBF_STRU, { "VNUMBER", "C", 5, 0 } )
AADD( DBF_STRU, { "LICENSE", "C", 7, 0 } )
AADD( DBF_STRU, { "MILEAGE", "N", 7, 0 } )
AADD( DBF_STRU, { "NEXTSERVCE", "D", 8, 0 } )
AADD( DBF_STRU, { "NEXTMILAGE", "N", 7, 0 } )

SELECT P_TRIPS
GO TOP

IF ( DATE() - P_TRIPS->DATE ) > 45
IF P_TRIPS->DATE = CTOD("00/00/00")
ELSE
SAYING := "There are Reservations over 45 days old that must be "+chr(10)
SAYING += "RESOLVED "+DTOC(P_TRIPS->DATE)+" "+P_TRIPS->VNUMBER+chr(10)
SAYING += " "+P_TRIPS->LNAME+chr(10)
MsgInfo( SAYING )
ENDIF
dDATE1 := DATE()-45
ELSE
dDATE1 := P_TRIPS->DATE
ENDIF

IF dDATE1 > DATE()
dDATE1 := DATE()
ENDIF

dDATE2 := DATE()+30
nSPREAD := ( dDATE2 - dDATE1 )

dTODAY := dDATE1
nCOL := 0

FOR i = 0 to nSPREAD

cDAY := substr( DOM(dTODAY),1,3)+"_" +;
substr( CMONTH(dTODAY),1,3)+"_"+;
strzero( DAY(dTODAY),2)

AADD( DBF_STRU, { cDAY, "C", 15, 0 } )

IF dTODAY = DATE()
IF i > 3
nCOL := (i+2)
ENDIF
ENDIF

dTODAY++

NEXT

DBCREATE( xVOL+"\DBTMP\"+SITEDBF+".DBF", DBF_STRU )

......

//-----------------------
Func DOM( dDATE)

LOCAL nDAY, cDAY

nDAY := DOW( dDATE )

DO CASE
CASE nDAY = 1
cDAY := "Sunday"
CASE nDAY = 2
cDAY := "Monday"
CASE nDAY = 3
cDAY := "Tuesday"
CASE nDAY = 4
cDAY := "Wednesday"
CASE nDAY = 5
cDAY := "Thursday"
CASE nDAY = 6
cDAY := "Friday"
CASE nDAY = 7
cDAY := "Saturday"
ENDCASE

RETURN(cDAY)
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Otto » Tue Aug 28, 2007 7:00 am

Hello windev2010,
could you send me a private mail about the status of your project, your market and your profile.
We do have a grid for hotels. Maybe there is a way to cooperate.
Regards
Otto
Image

datron
@
aon.at
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 115 guests