Please,
can someone explain to me what is mod_harbour?
Please,
can someone explain to me what is mod_harbour?
thanks ![]()
Antonio,
So it is easy to show as example Customer.dbf from sample's on the web in a xbrowse now ?
Looking into Genesis.
We need php code to do the job right ?
In fact, you use prg directly, but it would be the same as using files in .php like before ?
At this moment it is not so that Xbrowse will become a single line call in Mod_harbour like Xbrowser("customer")
Ok, I found the source code of Genesis, and mutch more is clear now.
Php is needed !
Maybe FWH can build the php code from xbrowse in the near future... (a Xbrowse light version)
Marc,
PHP is NOT needed at all. We only use Harbour PRG code !!!
thats the beauty of it ![]()
Please read this and follow the steps:
Antonio Linares wrote:Marc,
PHP is NOT needed at all. We only use Harbour PRG code !!!
thats the beauty of it
1. Have you installed Apache on your Windows or Xampp on your Windows ?
2. Have you properly installed mod_harbour ?
Please read this and follow the steps:
viewtopic.php?p=223785#p223785
function BuildBrowse( cTableName )
local cHtml := "", n, nRow := 0
USE ( hb_GetEnv( "PRGPATH" ) + "/data/" + cTableName ) SHARED NEW
if ! Empty( GetAction() ) .and. GetAction() == "add"
APPEND BLANK
GO TOP
endif
if ! Empty( GetAction() ) .and. GetAction() == "del"
USE
USE ( hb_GetEnv( "PRGPATH" ) + "/data/" + cTableName ) NEW
DbGoTo( GetVal1() )
DELETE
PACK
USE
USE ( hb_GetEnv( "PRGPATH" ) + "/data/" + cTableName ) SHARED NEW
GO TOP
endif
if ! Empty( GetAction() ) .and. GetAction() == "search"
SET FILTER TO Upper( GetParam1() ) $ Upper( DBRECORDINFO( 7 ) )
GO TOP
nVal1 = 20
endif
if GetVal2() != 0
DbSkip( GetVal2() )
endif
cHtml += '<table id="browse" class="table table-striped table-hover;"">' + CRLF
cHtml += '<thead>' + CRLF
cHtml += '<tr>' + CRLF
cHtml += '<th scope="col">#</th>' + CRLF
for n = 1 to FCount()
cHtml += '<th scope="col">' + FieldName( n ) + '</th>' + CRLF
next
cHtml += '<th scope="col">ACTIONS</th>' + CRLF
cHtml += '</tr>' + CRLF
cHtml += '</thead>' + CRLF
cHtml += '<tbody>' + CRLF
while ! Eof() .and. nRow < GetVal1()
cHtml += "<tr>" + CRLF
cHtml += '<th scope="row">' + AllTrim( Str( RecNo() ) ) + "</th>" + CRLF
for n = 1 to FCount()
do case
case FieldType( n ) == "M"
cHtml += '<td>' + If( "</" $ FieldGet( n ), "...", SubStr( FieldGet( n ), 1, 20 ) ) + CRLF
if ! "</" $ FieldGet( n )
cHtml += '<button onclick="MsgInfo(' + "'" + ;
StrTran( FieldGet( n ), Chr( 13 ) + Chr( 10 ), "<br>" ) + "', '" + ;
FieldName( n ) + "');" + '"' + ;
' type="button" class="btn btn-primary"' + CRLF
cHtml += ' style="border-color:gray;color:gray;background-color:#f9f9f9;">' + CRLF
cHtml += '<i class="fas fa-eye"' + ;
' style="color:gray;padding-right:15px;font-size:16px;">' + CRLF
cHtml += '</i>View</button>' + CRLF
endif
if FieldName( n ) == "CODE"
cHtml += '<button onclick="location.href=' + "'index.prg?" + Lower( Alias() ) + ":" + ;
AllTrim( Str( RecNo() ) ) + "';" + ;
'" type="button" class="btn btn-primary"' + CRLF
cHtml += ' style="border-color:gray;color:gray;background-color:#f9f9f9;">' + CRLF
cHtml += '<i class="fas fa-flash"' + ;
'style="color:gray;padding-right:15px;font-size:16px;">' + CRLF
cHtml += '</i>Exec</button>' + "</td>" + CRLF
else
cHtml += "</td>" + CRLF
endif
case FieldType( n ) == "L"
cHtml += '<td><input type="checkbox" onclick="return false;"' + ;
If( FieldGet( n ), "checked", "" ) + "></td>" + CRLF
otherwise
cHtml += '<td>' + ValToChar( FieldGet( n ) ) + "</td>" + CRLF
if FieldType( n ) == "C" .and. "." $ FieldGet( n )
// if File( hb_GetEnv( "PRGPATH" ) + FieldGet( n ) )
cHtml += '<td><img src="' + hb_GetEnv( "DOCUMENT_ROOT" ) + ;
AllTrim( FieldGet( n ) ) + ;
'" style="width:50px;border-radius:50%;"></td>' + CRLF
// endif
endif
endcase
next
cHtml += '<td>' + CRLF
cHtml += '<button onclick="Edit(' + AllTrim( Str( RecNo() ) ) + ');"' + ;
' type="button" class="btn btn-primary"' + CRLF
cHtml += ' style="border-color:gray;color:gray;background-color:#f9f9f9;">' + CRLF
cHtml += '<i class="fas fa-edit" style="color:gray;padding-right:15px;font-size:16px;">' + CRLF
cHtml += '</i>Edit</button>' + CRLF
cHtml += '<button onclick="Delete(' + AllTrim( Str( RecNo() ) ) + ');"' + ;
' type="button" class="btn btn-primary"' + CRLF
cHtml += ' style="border-color:gray;color:gray;background-color:#f9f9f9;">' + CRLF
cHtml += '<i class="fas fa-trash" style="color:gray;padding-right:15px;font-size:16px;">' + CRLF
cHtml += '</i>Delete</button>' + CRLF
cHtml += '</td>' + CRLF
SKIP
nRow++
end
cHtml += '</tbody>' + CRLF
cHtml += '</table>' + CRLF
cHtml += "<hr>" + CRLF
cHtml += '<div class="row" style="padding-left:15px">' + CRLF
cHtml += '<div class="col-sm-3">' + CRLF
cHtml += "Showing records " + AllTrim( Str( Max( GetVal2() + 1, 1 ) ) ) + " - " + ;
AllTrim( Str( RecNo() - 1 ) ) + " / Total: " + AllTrim( Str( RecCount() ) ) + "</div>" + CRLF
cHtml += '<div class="col-sm-1"></div>' + CRLF
if RecCount() > nRow
cHtml += '<div class="col-sm-3 btn-group" style="height:50px;">' + CRLF
cHtml += ' <button onclick="' + "location.href='index.prg?" + GetContent() + ":' + GetRowsPerPage() + ':" + ;
AllTrim( Str( 0 ) ) + "'" + '" type="button" class="btn btn-primary" style="background-color:{{GetColor1()}};">' + ;
'<i class="fas fa-angle-double-left" style="color:white;padding-right:15px;font-size:18px;"></i>First</button>' + CRLF
cHtml += ' <button onclick="' + "location.href='index.prg?" + GetContent() + ":' + GetRowsPerPage() + ':" + ;
AllTrim( Str( RecNo() - 41 ) ) + "'" + '" type="button" class="btn btn-primary" style="background-color:{{GetColor2()}};">' + ;
'<i class="fas fa-angle-left" style="color:white;padding-right:15px;font-size:18px;"></i>Prev</button>' + CRLF
cHtml += ' <button onclick="' + "location.href='index.prg?" + GetContent() + ":' + GetRowsPerPage() + ':" + ;
AllTrim( Str( RecNo() - 1 ) ) + "'" + '" type="button" class="btn btn-primary" style="background-color:{{GetColor2()}};">Next' + ;
'<i class="fas fa-angle-right" style="color:white;padding-left:15px;font-size:18px;"></i></button>' + CRLF
cHtml += ' <button onclick="' + "location.href='index.prg?" + GetContent() + ":' + GetRowsPerPage() + ':" + ;
AllTrim( Str( RecCount() - 20 ) ) + "'" + '" type="button" class="btn btn-primary" style="background-color:{{GetColor1()}};">Last' + ;
'<i class="fas fa-angle-double-right" style="color:white;padding-left:15px;font-size:18px;"></i></button>' + CRLF
cHtml += '</div>' + CRLF
endif
cHtml += "</div>" + CRLF + "</div>" + CRLF + "</div>" + CRLF
USE
return cHtmlMarc Venken wrote:
...I can do it in php, but looking for a sample from Harbour. (the index.prg sample is using also PHP) but maybe I'm missing parts of way Mod is working.
Marc,
The generated code is HTML. Thats the web language plus css and javascript.
With mod_harbour you don't have to build an EXE. The PRGs directly run from the web server.
That turns Harbour into a web development language, in the same level as php, python, asp, etc
When you get the mod_harbour concept and test it for yourself, then you will realize the enormous difference this means.
We are organizing a mod_harbour seminar in Otto's Hotel. You should come ![]()
cnavarro wrote:Marc Venken wrote:
...I can do it in php, but looking for a sample from Harbour. (the index.prg sample is using also PHP) but maybe I'm missing parts of way Mod is working.
Sorry, what is the index.prg file that php uses?



Otto,
I wish to come to visit you. Maybe at the end of summer.
We are not so far and I've been a lot of times to ski near your place, many many years ago.
Have a nice evening
Massimo