FiveTech's FiveWeb (free up to version 1.0)

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Antonio Linares » Wed Nov 14, 2012 3:08 pm

Otto,

Here you have it :-)

http://www.fivetechsoft.net/cgi-bin/otto

See how simple is its code :-)

otto.prg
Code: Select all  Expand view  RUN
#include "FiveWeb.ch"

//----------------------------------------------------------------------------//

function Main( cParams )

   local oDlg, oGet1, oGet2, oGet3
   local cTitle := Space( 80 ), cFamilien := Space( 80 ), cVorname := Space( 80 )
   
   SET BACKIMAGE TO "http://fiveweb.googlecode.com/svn/trunk/images/beach.jpg"
   
   SetTheme( "flick" )
   
   if pcount() > 0
      Process( cParams )
      return nil
   endif

   DEFINE DIALOG oDlg TITLE "Otto example" SIZE 600, 400
   
   @ 12, 10 SAY "Title:" OF oDlg

   @ 10, 160 GET oGet1 VAR cTitle OF oDlg SIZE 300, 35

   @ 54, 10 SAY "FamilienName:" OF oDlg

   @ 52, 160 GET oGet2 VAR cFamilien OF oDlg SIZE 300, 35

   @ 94, 10 SAY "Vorname:" OF oDlg

   @ 90, 160 GET oGet3 VAR cVorname OF oDlg SIZE 300, 35

   @ 260, 160 BUTTON "Ok" OF oDlg ;
      ACTION document.location = "otto.exe?add:" + ;
                                 document.getElementById( "oGet1" ).value + ":" + ;
                                 document.getElementById( "oGet2" ).value + ":" + ;
                                 document.getElementById( "oGet3" ).value

   @ 260, 300 BUTTON "Cancel" OF oDlg

   ACTIVATE DIALOG oDlg NOWAIT

return nil

//----------------------------------------------------------------------------//

function Process( cParams )

   local aParams := hb_aTokens( cParams, ":" )
   
   do case
      case aParams[ 1 ] == "add"
           Add( aParams )
           
   endcase
   
return nil          

//----------------------------------------------------------------------------//

function Add( aParams )

   local oDlg, oBrw

   if ! File( "clients.dbf" )
      DbCreate( "clients.dbf", { { "title",   "C", 10, 0 },;
                                 { "family",  "C", 80, 0 },;
                                 { "vorname", "C", 80, 0 } } )
   endif
   
   USE clients SHARED
   
   APPEND BLANK
   
   if RLock()
      clients->title   := aParams[ 2 ]
      clients->family  := aParams[ 3 ]
      clients->vorname := aParams[ 4 ]
      DbUnLock()
   endif    

   DEFINE DIALOG oDlg TITLE "Clients browse" SIZE 800, 600
   
   @ 10, 10 BROWSE oBrw SIZE 500, 400 OF oDlg
   
   ACTIVATE DIALOG oDlg NOWAIT
   
   USE

return nil

//----------------------------------------------------------------------------//                                  
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Antonio Linares » Wed Nov 14, 2012 3:32 pm

Enhanced version with pulldown menu:

http://www.fivetechsoft.net/cgi-bin/otto

otto.prg
Code: Select all  Expand view  RUN
#include "FiveWeb.ch"

//----------------------------------------------------------------------------//

function Main( cParams )

   local oDlg, oGet1, oGet2, oGet3
   local cTitle := Space( 80 ), cFamilien := Space( 80 ), cVorname := Space( 80 )
   
   SET BACKIMAGE TO "http://fiveweb.googlecode.com/svn/trunk/images/beach.jpg"
   
   SetTheme( "flick" )
   
   BuildMenu()

   if pcount() > 0
      Process( cParams )
      return nil
   endif

   DEFINE DIALOG oDlg TITLE "Otto example" SIZE 600, 400
   
   @ 12, 10 SAY "Title:" OF oDlg

   @ 10, 160 GET oGet1 VAR cTitle OF oDlg SIZE 300, 35

   @ 54, 10 SAY "FamilienName:" OF oDlg

   @ 52, 160 GET oGet2 VAR cFamilien OF oDlg SIZE 300, 35

   @ 94, 10 SAY "Vorname:" OF oDlg

   @ 90, 160 GET oGet3 VAR cVorname OF oDlg SIZE 300, 35

   @ 260, 160 BUTTON "Ok" OF oDlg ;
      ACTION document.location = "otto?add:" + ;
                                 document.getElementById( "oGet1" ).value + ":" + ;
                                 document.getElementById( "oGet2" ).value + ":" + ;
                                 document.getElementById( "oGet3" ).value

   @ 260, 300 BUTTON "Cancel" OF oDlg

   ACTIVATE DIALOG oDlg NOWAIT

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

   local oMenu

   MENU
      MENUITEM "Clients"
      MENU
         MENUITEM "Add"    ACTION document.location = "otto"
         MENUITEM "Browse" ACTION document.location = "otto?browse"
      ENDMENU

      MENUITEM "About"
      MENU
         MENUITEM "Wiki"
      ENDMENU
   ENDMENU

return oMenu

//----------------------------------------------------------------------------//

function Process( cParams )

   local aParams := hb_aTokens( cParams, ":" )
   
   do case
      case aParams[ 1 ] == "add"
           Add( aParams )

      case aParams[ 1 ] == "browse"
           Browse()
           
   endcase
   
return nil          

//----------------------------------------------------------------------------//

function Add( aParams )

   if ! File( "clients.dbf" )
      DbCreate( "clients.dbf", { { "title",   "C", 10, 0 },;
                                 { "family",  "C", 80, 0 },;
                                 { "vorname", "C", 80, 0 } } )
   endif
   
   USE clients SHARED
   
   APPEND BLANK
   
   if RLock()
      clients->title   := aParams[ 2 ]
      clients->family  := aParams[ 3 ]
      clients->vorname := aParams[ 4 ]
      DbUnLock()
   endif    

   Browse()

return nil

//----------------------------------------------------------------------------//

function Browse()

   local oDlg, oBrw

   if ! File( "clients.dbf" )
      DbCreate( "clients.dbf", { { "title",   "C", 10, 0 },;
                                 { "family",  "C", 80, 0 },;
                                 { "vorname", "C", 80, 0 } } )
   endif
   
   USE clients SHARED
   
   DEFINE DIALOG oDlg TITLE "Clients browse" SIZE 800, 600
   
   @ 10, 10 BROWSE oBrw SIZE 500, 400 OF oDlg
   
   ACTIVATE DIALOG oDlg NOWAIT
   
   USE

return nil

//----------------------------------------------------------------------------//                                  
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Antonio Linares » Wed Nov 14, 2012 3:43 pm

This version tracks the users IPs :-)

http://www.fivetechsoft.net/cgi-bin/otto

otto.prg
Code: Select all  Expand view  RUN
#include "FiveWeb.ch"

//----------------------------------------------------------------------------//

function Main( cParams )

   local oDlg, oGet1, oGet2, oGet3
   local cTitle := Space( 80 ), cFamilien := Space( 80 ), cVorname := Space( 80 )
   
   SET BACKIMAGE TO "http://fiveweb.googlecode.com/svn/trunk/images/beach.jpg"
   
   SetTheme( "flick" )
   
   BuildMenu()

   if pcount() > 0
      Process( cParams )
      return nil
   endif

   DEFINE DIALOG oDlg TITLE "Otto example" SIZE 600, 400
   
   @ 12, 10 SAY "Title:" OF oDlg

   @ 10, 160 GET oGet1 VAR cTitle OF oDlg SIZE 300, 35

   @ 54, 10 SAY "FamilienName:" OF oDlg

   @ 52, 160 GET oGet2 VAR cFamilien OF oDlg SIZE 300, 35

   @ 94, 10 SAY "Vorname:" OF oDlg

   @ 90, 160 GET oGet3 VAR cVorname OF oDlg SIZE 300, 35

   @ 260, 160 BUTTON "Ok" OF oDlg ;
      ACTION document.location = "otto?add:" + ;
                                 document.getElementById( "oGet1" ).value + ":" + ;
                                 document.getElementById( "oGet2" ).value + ":" + ;
                                 document.getElementById( "oGet3" ).value

   @ 260, 300 BUTTON "Cancel" OF oDlg

   ACTIVATE DIALOG oDlg NOWAIT

return nil

//----------------------------------------------------------------------------//

function BuildMenu()

   local oMenu

   MENU
      MENUITEM "Clients"
      MENU
         MENUITEM "Add"    ACTION document.location = "otto"
         MENUITEM "Browse" ACTION document.location = "otto?browse"
      ENDMENU

      MENUITEM "About"
      MENU
         MENUITEM "Wiki"
      ENDMENU
   ENDMENU

return oMenu

//----------------------------------------------------------------------------//

function Process( cParams )

   local aParams := hb_aTokens( cParams, ":" )
   
   do case
      case aParams[ 1 ] == "add"
           Add( aParams )

      case aParams[ 1 ] == "browse"
           Browse()
           
   endcase
   
return nil          

//----------------------------------------------------------------------------//

function Add( aParams )

   if ! File( "clients.dbf" )
      DbCreate( "clients.dbf", { { "title",   "C", 10, 0 },;
                                 { "family",  "C", 80, 0 },;
                                 { "vorname", "C", 80, 0 },;
                                 { "user_ip", "C", 20, 0 } } )
   endif
   
   USE clients SHARED
   
   APPEND BLANK
   
   if RLock()
      clients->title   := aParams[ 2 ]
      clients->family  := aParams[ 3 ]
      clients->vorname := aParams[ 4 ]
      clients->user_ip := GetEnv( "REMOTE_ADDR" )
      DbUnLock()
   endif    

   Browse()

return nil

//----------------------------------------------------------------------------//

function Browse()

   local oDlg, oBrw

   if ! File( "clients.dbf" )
      DbCreate( "clients.dbf", { { "title",   "C", 10, 0 },;
                                 { "family",  "C", 80, 0 },;
                                 { "vorname", "C", 80, 0 } } )
   endif
   
   USE clients SHARED
   
   DEFINE DIALOG oDlg TITLE "Clients browse" SIZE 800, 600
   
   @ 10, 10 BROWSE oBrw SIZE 500, 400 OF oDlg
   
   ACTIVATE DIALOG oDlg NOWAIT
   
   USE

return nil

//----------------------------------------------------------------------------//                                  


Please remember that you can support FiveWeb development with a little PayPal donation from:
http://code.google.com/p/fiveweb/ (PayPal orange button)
FiveWeb is free, full source code included.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Otto » Wed Nov 14, 2012 4:31 pm

Hello Antonio,
can we use Harbour for windows, too. If yes can you suggest a Hosting company.
Best regards,
Otto

>For those of you that may be looking for a cheap hosting where you may use your FiveWeb apps, you may use: DreamHost

>but you will have to build your apps using Harbour for Linux. FiveWeb provides a build.sh for it.
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Antonio Linares » Wed Nov 14, 2012 9:27 pm

Otto,

Yes, you can also use Harbour for Windows. No problem.

Most hosting companies use Linux servers thats why its a very good solution to use Harbour for Linux. Linux servers use to be much cheaper than Windows ones. Besides that, Linux provides very usefull tools (like ssh) that let you do things in the server as if you were there :-)

Unfortunately I can't recommend you a Windows hosting as it has been years since I use Linux servers only. You may need to use a dedicated Windows server but keep in mind that they are quite expensive and you are responsable for it. Linux servers use to be shared and are automatically updated, back up, etc

These forums are running on Linux :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Otto » Wed Nov 14, 2012 10:13 pm

Hello Antonio,
I understand. I do not have any linux PC. Therefore I can’t try myself FiveWeb at the moment.
But I follow the topic with interest.
All seems promising.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Antonio Linares » Thu Nov 15, 2012 5:57 am

Otto,

You can easily start testing FiveWeb on your Windows PC. The code is exactly the same for Windows or Linux :-)

Simply download and install xampp and you are ready to use it on your PC:
http://www.apachefriends.org/download.php?xampp-win32-1.8.1-VC9-installer.exe
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Otto » Thu Nov 15, 2012 8:59 am

Hello Antonio,
does this mean I can test local with Windows and then upload the files to a linux production server?
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Antonio Linares » Thu Nov 15, 2012 10:35 am

Otto,

Yes! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Otto » Thu Nov 15, 2012 10:57 am

Hello Antonio,

Ruth is working on an ASP form like I posted which we need before the winter season starts.
If you can afford time to support her and if you want I would ask her to restart the work using FiveWeb.
As she is a novice in Fivewin she needs some “How to start” help from
setting up the develop environment to posting the files on the production system.
Sure Iris and Aljoscha which both are Fivewinners can assist too.

Please let me know what you think.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Antonio Linares » Thu Nov 15, 2012 11:11 am

Otto,

I think that using the exampled that I posted here yesterday, you can move further and enhance it to get what you want :-)

Anyhow, this tool is for a Harbour developer, and FiveWin knowledge also would help. And actually is a tool in development, so changes, enhancements, etc will happen.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby BrandelH » Thu Nov 15, 2012 11:35 am

Hi Antonio,

am I right, that someone write FWH / harbour sourcecode for the FiveWeb and the "compiler" translate it (with your libs) to PHP / JSCRIPT code ?
What is JQuery ? A gui designer for the web or only your help for translating the GUI to the web ?

Regards,
Hubert
BrandelH
 
Posts: 7
Joined: Mon Nov 12, 2012 10:20 am

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Antonio Linares » Thu Nov 15, 2012 11:42 am

Hubert,

FiveWeb translate xbase GUI commands (very similar to the ones used in FiveWin) to HTML and DOM (document object model). No php is generated, neither javascript. FiveWeb uses some javascript (fiveweb.js) to manage the DOM objects on the client side.

JQuery is a very popular javascript library:
http://jquery.com/

and JQuery UI is for th GUI, thats the one that FiveWeb uses :-)
http://jqueryui.com/

In fact, your Harbour app, using FiveWeb, acts as a CGI app on a web server, generating the GUI in HTML:
http://en.wikipedia.org/wiki/Common_Gateway_Interface
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42107
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby Otto » Thu Nov 15, 2012 11:58 am

Hello Antonio,
I understand.
I will take the ready form for the moment and then after Christmas we will try to start.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Re: FiveTech's FiveWeb (free up to version 1.0)

Postby BrandelH » Thu Nov 15, 2012 1:28 pm

Antonio Linares wrote:In fact, your Harbour app, using FiveWeb, acts as a CGI app on a web server, generating the GUI in HTML:
http://en.wikipedia.org/wiki/Common_Gateway_Interface

I do know how to write CGI-EXE (Windows 32bit) programs, I have several with my own Xbase++ CGI-CLASS and some with PowerBasic.
Both need Windows Servers with the right to execute CGI-EXE Apps.

So you need with FiveWeb a LINUX or a Windows Server running the EXE file to generate the HTML and DOM files on the fly too ?
I thought it could just generate PHP apps to put them on a normal PHP only web server.
BrandelH
 
Posts: 7
Joined: Mon Nov 12, 2012 10:20 am

PreviousNext

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 44 guests