*    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *
*
*
*    *    *    *    *    *    *    *    *    *    *    *      #> ver. 2019-10-23 <#       *    *    *    *    *    *    *    *    *    *    *    *    *

o_set_point = SET("POINT")
SET POINT TO "."

*HTTP_READ_ONLY_MODE = .T.

DO (LOWER(JUSTPATH(sys(16))) + "\http_ppgm") WITH "https://alto:1991.Altopraha@canteen-dts-backend.alto-production.mine.nu/"
DO (LOWER(JUSTPATH(sys(16))) + "\ppgm_klienti") &&WITH "logovat"

ACTIVATE SCREEN 
_screen.Cls

*DO stahni_webovy_klienty
DO smaz_puvodni_klienty

USE i:\hot_kred_dts ALIAS hot_kred
SCAN 
    chip_id    = ALLTRIM(hot_kred.chipcode)
    client_id  = ALLTRIM(hot_kred.cis_kred)
    card_id    = ALLTRIM(hot_kred.cis_kred)
    firma      = ALLTRIM(hot_kred.firma)
    surname    = ALLTRIM(hot_kred.prijmeni)
    firstname  = ALLTRIM(hot_kred.krestjm)
    c_hlad     = VAL(hot_kred.c_hlad)
    plc_hlad   = VAL(hot_kred.plc_hlad)
    limit      = hot_kred.limit
    max_denne  = 99
    mail       = m.client_id + "@fake.com"

    status     = "A"
    expiration = "2055-05-25"
    co_s_tim   = "POST"

    INSERT INTO stravnici_karty_web FROM MEMVAR 
ENDSCAN     

DO posli_cloveky

DO stahni_webovy_klienty

SET POINT TO (m.o_set_point)
oznam_hotovo()



*    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *    *
PROCEDURE smaz_puvodni_klienty

FOR iii = 162 TO 182
    ?? "."
    http_request("kredit/crud/client_infos/" + ALLTRIM(STR(m.iii)), "DELETE")
ENDFOR 

FOR iii = 162 TO 182
    ?? "."
    http_request("kredit/crud/clients/" + ALLTRIM(STR(m.iii)), "DELETE")
ENDFOR 

FOR iii = 4 TO 22
    ?? "."
    http_request("auth/crud/users/" + ALLTRIM(STR(m.iii)), "DELETE")
ENDFOR 
