home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
tema
/
SW602
/
Winbase
/
EShop_demo
/
WWW_LOGIN.PGM
< prev
next >
Wrap
Text File
|
2000-03-16
|
3KB
|
116 lines
{$$3220792584 . }//Program www-obj
table obj_header, default_hodnoty, SYS_PAR;
{$I I_wbinet}
var
wd_obch, wd_deal, wd_typ, wd_id:integer;
procedure chybacgi(pomstr:string[200]);
/*********************************************************************/
begin
log_write(pomstr);
/* if rp then SetSTWError(pomstr)
else*/ SetUserError(pomstr);
Halt;
end;
function pridel_id():integer;
/*********************************************************************/
var
pomid:integer;
begin
pomid:=sys_par[0].id_last_od+2;
if (odd(pomid)<>SYS_PAR[0].OPID_LICHE) then pomid:=pomid+1;
pridel_id:=pomid;
sys_par[0].id_last_od:=pomid;
end;
procedure w_defuziv();
/*********************************************************************/
begin
wd_obch:=default_hodnoty[0].obchodnik;
wd_deal:=default_hodnoty[0].deal_sk;
wd_typ:=default_hodnoty[0].typ_uziv;
wd_id:=pridel_id();
end;
procedure W_delobj();
/*********************************************************************/
var
limit, i, id_objdel :integer;
podminka, podminka0: string[120];
cursobj,curs:cursor;
begin //0
limit:=0;
podminka0:="(id_org=-1) AND (potvrzena<>TRUE) AND datum<today";
if not Open_sql_parts(cursobj, "*", "obj_header", podminka0, "") then
begin //1
Rec_cnt(cursobj, limit);
if limit>0 then
begin //2
for i:=0 to limit-1 do
begin //3
id_objdel:=cursobj[i].id_dobj;
podminka:="id_dobj="+int2str(id_objdel);
begin
if not Open_sql_parts(curs, "*", "obj_polozky", podminka, "") then
begin
Delete_all_records(curs);
Close_cursor(curs);
end;
end;
end; //3
end; //2
Delete_all_records(cursobj);
Close_cursor(cursobj);
end; //1
end; //0
procedure w_cis_uziv(id_obj:integer;nazev,heslo:string[35]; zid:integer);
/************************************************************************/
var
podminka: string[120];
curs:cursor;
pocet,i:integer;
u:untyped;
irec:trecnum;
begin //0
u:=id_obj;
irec := Look_up(Obj_header,"id_dobj",u);
if irec=-1 then
chybacgi(" chyba p°i b∞hu procedury w_cis_uziv - nenalezena objednßvka")
else
begin //1
if heslo="" then heslo:=int2str(zid);
podminka:="(id="+int2str(zid)+")";
// podminka:="((nazev1="+""""+nazev+""""+") AND ( intr_pswd="+""""+heslo+""""+"))";
if Open_sql_parts(curs, "id,ico", "obchodni_partneri", podminka, "") then chybacgi(" chyba p°i b∞hu procedury w_cis_uziv - nenalezen u₧ivatel")
else
begin //2
Rec_cnt(curs,pocet);
if pocet>0 then
begin //3
obj_header[irec].id_org:=curs[0].id;
obj_header[irec].ico:=curs[0].ico;
end //3
else chybacgi(" chyba p°i b∞hu procedury w_cis_uziv - nenalezen u₧ivatel");
close_cursor(curs);
end; //2
end; //1
end; //0
begin
end.