Kod: Tümünü seç
if str='admin' then
begin
com.hideselection:=false;
com.selected:=com.findcaption(0,Socket.RemoteHost,true,true,true);
com.Selected.ImageIndex:=3;
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('update Data\makine.DB set durum="3" WHERE');
Query1.SQL.Add('MAKINAAD="'+Socket.RemoteHost+'"');
Query1.ExecSQL;
end
else
if str='adminoff' then
begin
com.hideselection:=false;
com.selected:=com.findcaption(0,Socket.RemoteHost,true,true,true);
com.Selected.ImageIndex:=0;
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('update Data\makine.DB set durum="0" WHERE');
Query1.SQL.Add('MAKINAAD="'+Socket.RemoteHost+'"');
Query1.ExecSQL;
end
else
if str='loginistek' then
begin
form2 := Tform2.Create (Application);
form2.masa.Caption:=Socket.RemoteHost;
form2.ip.Caption:=Socket.RemoteAddress;
form2.Showmodal;
end
else
if (copy(str,1,6)='durum=') then
if com.FindCaption(-1,AnsiUpperCase(Socket.RemoteHost),false,false,false)<>NIL then
begin
com.hideselection:=false;
com.selected:=com.findcaption(0,Socket.RemoteHost,true,true,true);
com.Selected.ImageIndex:=strtoint(pchar(copy(str,7,length(str)-6)));
end
else
begin
durum:=pchar(copy(str,7,length(str)-6));
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('SELECT * From Data\makine.db WHERE MAKINAAD="'+Socket.RemoteHost+'"');
Query1.ExecSQL;
Query1.Active:=True;
if query1.recordcount = 0 then
begin
Query1.Active:=False;
Query1.sql.clear;
Query1.SQL.add('Insert into Data\makine.db (MAKINAIP,MAKINAAD,DURUM)');
Query1.Sql.Add('VALUES ("'+Socket.RemoteAddress+'","'+Socket.RemoteHost+'","'+durum+'")');
Query1.execsql;
Query1.Active:=False;
end;
Query1.Active:=False;
Query1.SQL.Clear;
Query1.SQL.Add('update Data\makine.DB set durum="'+durum+'" WHERE');
Query1.SQL.Add('MAKINAAD="'+Socket.RemoteHost+'" and MAKINAIP="'+Socket.RemoteAddress+'"');
Query1.ExecSQL;
NewItem:=com.Items.Add;
newitem.Caption:=AnsiUpperCase(Socket.RemoteHost);
newitem.ImageIndex:=strtoint(durum);
NewItem.SubItems.Add(Socket.RemoteAddress);
sipkullaniciadi.Items.Add(Socket.RemoteHost);
label1.Caption:=inttostr(strtoint(label1.Caption)+1);
form13.makine.Items.Add(Socket.RemoteHost);
com.CustomSort(@CustomSortProc, 0);
end
else
if (copy(str,1,6)='islem=') then
begin
form11 := Tform11.Create (Application);
form11.ProcList.Items.LoadFromFile(copy(str,7,length(str)-6));
form11.Showmodal;
end