-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUSER.C
61 lines (56 loc) · 1.21 KB
/
USER.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#include "HRM.H"
char *user_info(INFO **tmp, INFO **prev, char *srch)
{
INFO *t=*tmp,*tprev=*prev;
char buf[30], c;
int m,n=0;
setcolor(RED);
outtextxy(260, 128, "User Info");
setcolor(WHITE);
outtextxy(260, 150, "Username: ");
strcpy(buf, srch);
while(t!=NULL)
{
m=0;
if(!strcmp(t->user_name,buf)) m=1;
if(!strcmp(t->first_name,buf)) m=1;
if(!strcmp(t->last_name,buf)) m=1;
if(!strcmp(t->gender,buf)) m=1;
if(!strcmp(t->tel_no,buf)) m=1;
if(!strcmp(t->email,buf)) m=1;
if(!strcmp(t->address,buf)) m=1;
if(m)
{
n++;
outtextxy(260, 170, "First name: ");
outtextxy(260, 190, "Last name: ");
outtextxy(260, 210, "Gender: ");
outtextxy(260, 230, "Tel. No.: ");
outtextxy(260, 250, "Email: ");
outtextxy(260, 270, "Address: ");
outtextxy(350, 150, t->user_name);
outtextxy(350, 170, t->first_name);
outtextxy(350, 190, t->last_name);
outtextxy(350, 210, t->gender);
outtextxy(350, 230, t->tel_no);
outtextxy(350, 250, t->email);
outtextxy(350, 270, t->address);
if(n==1)
{
*tmp=t;
*prev=tprev;
}
}
tprev=t;
t=t->n;
}
if(m>0 || n < 1)
{
outtextxy(300, 350, "***USER DOES NOT EXIST***");
}
if(n==0)
{
*tmp=NULL;
}
getch();
}