PARAMETERS cBdd, cIdView, cIdServ


SET TALK off
SET STATUS BAR OFF
SET SYSMENU off
SET DELETED on
SET CONFIRM OFF
SET NOTIFY off
SET SAFETY off
SET CENTURY ON
SET DATE TO DMY
SET FIXED OFF
SET DECIMALS TO 5
SET ESCAPE On

SET PATH TO proj,json,classes, form,prg,class

IF EMPTY(cIdServ)
	cIdServ = '1'
ENDIF


_screen.Caption = 'Ghost-Server '+cIdServ
_screen.AutoCenter= .T.
_screen.Icon = 'procesos.ICO'
_screen.Width  = 700
_screen.height = 500

_screen.Closable = .f.
*_screen.AutoCenter = .t.
_screen.Show
_screen.BorderStyle=3
_screen.MaxButton= .F.



PUBLIC lSalir

lSalir=.F.

ON ESCAPE lSalir=.t.


IF EMPTY(cBdd)
	cBdd='fss1'
ENDIF

DECLARE Sleep IN Win32API INTEGER   


*!*	*** Clases para el manejo de Web
*!*	SET PATH TO ".\classes" ADDITIVE

*!*	SET PROCEDURE TO wwHTTP ADDITIVE   
*!*	SET PROCEDURE TO wwAPI ADDITIVE
*!*	SET PROCEDURE TO wwFTP ADDITIVE
*!*	SET PROCEDURE TO wwUtils ADDITIVE

DO app.prg WITH cBdd

oApp.lgServ			 = .T.
oApp.loadGhost()
oApp.setGhost()
oApp.host = oApp.hostjson

IF oApp.lGhostLocal
	oApp.host = 'localhost'+IIF(!EMPTY(oApp.portjson),':'+oApp.portjson,'')
ENDIF


_screen.Caption = 'Ghost-Server '+cIdServ+ '   ('+oApp.host+') '


DO invoicer.prg

*SET PATH TO ".\json\boleteria" ADDITIVE
SET PATH TO ".\json\" ADDITIVE

DO json\js.prg WITH cbdd, cIdView, cIdServ
DO json\json_cliente.prg

oApp.lgServ			 = .T.
oApp.loadGhost()
oApp.setGhost()
oApp.host = oApp.hostjson


IF oJs.ltest
	_screen.WindowState = 2	
ELSE
	_screen.WindowState = 1
ENDIF


DO stock.prg

DO FORM json

Read Events

_SCREEN.WindowState = 2
CLEAR ALL
CLOSE ALL
SET SYSMENU TO defa
On SHUTDOWN 
Clear Events 
IF _vfp.StartMode > 0
	QUIT 
ENDIF


_screen.ControlBox= .T.
_screen.MaxButton= .T.
_screen.Closable = .T.

