📄 alltrans.cpp
字号:
/*************Function To Display All Details Of All Transactions ***********/
# include"liba.h"
void alltransac()
{
struct transaction T;
int x;
FILE *ft;
ft=fopen("E:\\cpp\\trans.dat","a+");
rewind(ft);
window(1,1,80,2);
textbackground(LIGHTGRAY);
clrscr();
textcolor(YELLOW);
gotoxy(30,1);
cprintf("List Of All Transactions");
window(1,2,80,25);
textcolor(WHITE);
textbackground(BLUE);
clrscr();
printf("\n|--------|-------|----------|----------|------------|------|-------|");
printf("\n|Trans ID|Mem Id | Book ID |Issue Date|Return Date | Fine |Reason |");
printf("\n|--------|-------|----------|----------|------------|------|-------|");
while(fread(&T,sizeof(T),1,ft)==1)
{
if(x==23)
{printf("\nPress any key to continue!");getch();}
printf("\n| %3d | %3d |%4d%3d%3d|%-2d/%-2d/%-4d| %-2d/%-2d/%-4d |%-6.2f| %c |",T.tid,T.mid,T.b.bno,T.b.gno,T.b.no,T.i.day,T.i.mon,T.i.year,T.r.day,T.r.mon,T.r.year,T.fine,T.reason);
x=wherey();
}
printf("\n|--------|-------|----------|----------|------------|------|-------|\n");
gotoxy(1,24);
textcolor(WHITE);
cprintf("A");
textcolor(DARKGRAY);
cprintf("-Member Added ");
textcolor(WHITE);
cprintf("E");
textcolor(DARKGRAY);
cprintf("-Member Renewed ");
textcolor(WHITE);
cprintf("D");
textcolor(DARKGRAY);
cprintf("-Duplicate I card ");
textcolor(WHITE);
cprintf("I");
textcolor(DARKGRAY);
cprintf("-Book Issued ");
textcolor(WHITE);
cprintf("R");
textcolor(DARKGRAY);
cprintf("-Book Returned");
textcolor(RED);
cprintf("press any key to return");
getch();
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -