Курсовая работа: Разработка базы данных "Учащиеся"
tempm[9]:='';
end;
repeat
repeat
for i:=1 to 2
do
begin
if i=ind
then
begin
textbackground(white);
textcolor(black);
end
else
begin
textcolor(white);
textbackground(black);
end;
gotoxy(2,i*2+1);
write(menunew[i]);
end;
gotoxy(50,posy*2+5);
ch:=readkey;
errd:=false;
case ch of
#66:
if admin
then
begin
masill[numb].number:=0;
masill[numb].sur:='';
masill[numb].name:='';
masill[numb].otch:='';
masill[numb].dateburn:='';
masill[numb].surdoc:='';
masill[numb].namedoc:='';
masill[numb].otchdoc:='';
ch:=#13;
ind:=2;
end;
#9: begin
textbackground(black);
textcolor(white);
s:='';
if posy = 8
then
posy:=1
else
inc(posy);
ii:=1;
end;
#83: {delete}
if admin
then
{if ch=chr(0)
{ then }
begin
gotoxy(50,posy*2+5);
write(' ');
s:='';
ii:=1;
end;
#8:{backspase}
if admin
then
if
(s<>'')
then
begin
dec(ii);
delete(s,ii,1);
textbackground(black);
textcolor(white);
gotoxy(50,posy*2+5);
write(' ');
gotoxy(50,posy*2+5);
write(s);
end;
#80:
if ind=1
then
inc(ind);
#72:
if ind=2
then
dec(ind);
else
if admin
then
begin
if (posy=4) or
(posy=8)
then
flagg:=true
else
flagg:=false;
if
((chr(ord(ch)) in simvN) and not(flagg)) or
((chr(ord(ch))
in simvD) and flagg)
then
if ii<=15
then
begin
if flagg
then
begin
case ii of
1,2,4,5,7,8,9,10:
if
not((chr(ord(ch)) in simvdig))
then
errd:=true;
3,6:
if
(ch<>'.')
then
errd:=true;
else
errd:=true;
end;
end;
if not(errd)
then
begin
s:=s+chr(ord(ch));
tempm[posy+1]:=s;
textbackground(black);
textcolor(white);
gotoxy(50,posy*2+5);
write(' ');
gotoxy(50,posy*2+5);
write(s);
inc(ii);
end;
end;
end;
end;
until ch=#13;
case ind of
1: if admin
then
begin
if flag
then
numb:=numfind;
masill[numb].number:=numb;
masill[numb].sur:=tempm[2];
masill[numb].name:=tempm[3];;
masill[numb].otch:=tempm[4];
masill[numb].dateburn:=tempm[5];
masill[numb].surdoc:=tempm[6];
masill[numb].namedoc:=tempm[7];
masill[numb].otchdoc:=tempm[8];
ind:=2
end;
2: begin
dec(numb);
ind:=2
end;
end;
until ind=2;
tempm[posy+1]:=s;
s:='';
clear;
flag:=false;
end;{menunewkar}
procedure
menufinder;{+++++++++++++++++++++++++++++++++++++++++}
var
t, code, tt,
tmp, ii, posy, i, ind:integer;
ch:char;
tempm:array
[1..8] of string[20];
s:string[20];
flagg:boolean;
begin{menufinder}
menucl;
ind:=1;
field;
posy:=1;
ii:=1;
s:='';
for i:=1 to 8
do
tempm[i]:='';
repeat
repeat
for i:=1 to 2
do
begin
if i=ind
then
begin
textbackground(white);
textcolor(black);
end
else
begin
textcolor(white);
textbackground(black);
end;
gotoxy(2,i*2+1);
write(menufind[i]);
end;
gotoxy(50,posy*2+3);
ch:=readkey;
case ch of
#9:
begin
s:='';
if posy = 9
then
posy:=1
else
inc(posy);
for tmp:=1 to
9 do
begin
gotoxy(50,tmp*2+3);
write(' ');
end;
ii:=1;
end;
#8:{backspase}
if
(s<>'')
then
begin
dec(ii);
delete(s,ii,1);
textbackground(black);
textcolor(white);
gotoxy(50,posy*2+3);
write(' ');
gotoxy(50,posy*2+3);
write(s);
end;
#80:
if ind=1
then
inc(ind);
#72:
if ind=2
then
dec(ind);
else
begin
if (posy=1) or
(posy=5) or (posy=9)
then
flagg:=true
else
flagg:=false;
if
((chr(ord(ch)) in simvN) and not(flagg)) or
((chr(ord(ch))
in simvD) and flagg)
then
if ii<=15
then
begin
gotoxy(50,posy*2+3);
s:=s+chr(ord(ch));
textbackground(black);
textcolor(white);
write(s);
inc(ii);
end;
end;
end;
until ch=#13;
if ind=1
then
begin
MakeRamka(22,3,'‘ЇЁб®Є ©¤Ґле:',78,24,white,cyan);
tt:=1;
for tmp:=1 to
illcount do
begin
flag:=false;
val(s,t,code);
case posy of
1: if
((masill[tmp].number = t) and (t<>0)) then flag:=true;
2: if
(masill[tmp].sur = s) then flag:=true;
3: if
(masill[tmp].name = s) then flag:=true;
4: if
(masill[tmp].otch = s) then flag:=true;
5: if
(masill[tmp].dateburn = s) then flag:=true;
6: if (masill[tmp].surdoc
= s) then flag:=true;
7: if
(masill[tmp].namedoc = s) then flag:=true;
8: if
(masill[tmp].otchdoc = s) then flag:=true;
end;
if s=''
then
flag:=false;
if flag
then
begin
textcolor(black);
textbackground(cyan);
gotoxy(40,tt+5);
write('ь: ',masill[tmp].number);
gotoxy(47,tt+5);
write('” ¬Ё«Ёп: '+masill[tmp].sur);
inc(tt);
end;
end;
textcolor(black);
textbackground(cyan);
gotoxy(24,4);
write('‚ўҐ¤ЁвҐ ®¬Ґа п祩ЄЁ:');
textcolor(white);
textbackground(black);
gotoxy(24,5);
write(' ');
gotoxy(24,5);
s:='';
flag:=false;
repeat
ch:=readkey;
if
chr(ord(ch)) in simvdig
then
begin
s:=s+chr(ord(ch));
flag:=true;
val(s,t,code);
if ((t>100)
or (t<0) or (s='00'))
then
begin
s:='';
gotoxy(24,5);
write(' ');
flag:=false;
end;
gotoxy(24,5);
write(' ');
gotoxy(24,5);
write(s);
end;
until
((ch=#13) or (ch=#27));
if ch=#27
then
begin
ind:=2;
flag:=false
end
else
if ((ch=#13)
and flag)
then
begin
ind:=2;
val(s,t,code);
numfind:=t;
end;
end;
until ind=2;
clear;
end;{menufinder}
procedure
user;
var
ind:shortint;
ch:char;
begin {user}
ind:=1;
MakeRamka(22,8,'‚лЎҐаЁвҐ Ї®«м§®ў ⥫п:',78,13,white,cyan);
repeat
for i:=1 to 2
do{Їа®аЁб®ўлў Ґ¬ ЇгЄвл ¬Ґо ўлЎ®а }
begin
if i=ind
then
begin
textcolor(black);
textbackground(white)
end
else
begin
textcolor(white);
textbackground(black)
end;
gotoxy(30,9+i);
write(menuuser[i]);
end;
ch:=readkey;
if ((ch=#80)
and (ind=1))
then
inc(ind);
if ((ch=#72)
and (ind=2))
then
dec(ind);
until
ch=#13;{ ¦ в ‚‚Ћ„}
if ind=1
then
password
else
admin:=false;
clear;
end; {user}
procedure
menus;
var
i,
ind:integer;
ch:char;
begin{menus}
flag:=false;
ind:=1;
menucl;
numb:=0;
repeat
repeat
for i:=1 to 5
do
begin
if i=ind
then
begin
textbackground(white);
textcolor(black);
end
else
begin
textcolor(white);
textbackground(black);
end;
gotoxy(2,i*2+1);
write(mmenu[i]);
end;
ch:=readkey;
if ((ch=#80)
and (ind<>5))
then
inc(ind);
if ((ch=#72)
and (ind<>1))
then
dec(ind);
until ch=#13;
case ind of
1: if admin
then
menunewkar;
2: if admin
then
menuarchh;
3: menufinder;
4: user;
end;
if flag then
menunewkar;
until ind=5;
end;{menus}
procedure
zastavka;
var
mart, mart2:
boolean;
schmart:
integer;
begin{zastavka}
mart:=false;
mart2:=false;
schmart:=0;
TextBackGround(Black);
TextColor(Green);
Randomize;
Clrscr;
sim:=0;
repeat
if schmart=80
then mart:=true;
if schmart=100
then mart2:=true;
if schmart=200
then
begin
mart:=false;
mart2:=false;
schmart:=0;
end;
if sim<25
then
begin
repeat
posx:=random(27)+1
until
m[1,posx]=0;
if mart
then
case posx of
9: simv:=84;
10, 23:
simv:=72;
11: simv:=69;
12: simv:=95;
13: simv:=66;
14, 16:
simv:=65;
15: simv:=90;
17, 18, 19:
simv:=33;
else
simv:=random(24)+97
end
else
simv:=random(24)+97;
m[1,posx]:=posx;
m[2,posx]:=simv;
m[3,posx]:=m[3,posx]+1;
sim:=sim+1;
end;
delay(7000);
for i:=1 to 27
do
begin
if
m[1,i]<>0
then
if
not((m[3,i]=12) and mart2 and (m[1,i]>8) and (m[1,i]<20))
Страницы: 1, 2, 3, 4, 5, 6, 7, 8 |