⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admini.cpp

📁 图书馆管理系统 包括界面、书籍管理、会员管理等内容
💻 CPP
📖 第 1 页 / 共 4 页
字号:
  0x02,0x06,0x20,0xC0,0x03,0xFE,0x20,0xC0,
  0x02,0x04,0x20,0x80,0x02,0x04,0x31,0x80,
  0x02,0x04,0x31,0x00,0x02,0x04,0x11,0x00,
  0x02,0x04,0x12,0x00,0x02,0x04,0x1E,0x00,
  0x02,0x04,0x0C,0x00,0x04,0x0C,0x0C,0x00,
  0x04,0x18,0x1C,0x00,0x04,0x78,0x3E,0x00,
  0x00,0x30,0x63,0x88,0x08,0x00,0xC1,0xF8,
  0x00,0x01,0x00,0xF8,0x00,0x04,0x00,0x78,
 /* 以下是 '员' 的 32点阵华文中宋 字模,128 byte */
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x80,0x02,0x00,0x00,0xFF,0xFF,0x80,
  0x00,0xC0,0x03,0x00,0x00,0xC0,0x03,0x00,
  0x00,0xC0,0x03,0x00,0x00,0xC0,0x03,0x00,
  0x00,0xFF,0xFF,0x00,0x00,0xC0,0x03,0x00,
  0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
  0x01,0x00,0x00,0x80,0x01,0xFF,0xFF,0xC0,
  0x01,0x00,0x01,0x80,0x01,0x01,0x01,0x80,
  0x01,0x01,0xC1,0x80,0x01,0x01,0x81,0x80,
  0x01,0x01,0x81,0x80,0x01,0x01,0x01,0x80,
  0x01,0x01,0x01,0x80,0x01,0x03,0x01,0x80,
  0x01,0x03,0x01,0x80,0x01,0x03,0xE1,0x00,
  0x00,0x06,0x1C,0x00,0x00,0x0C,0x07,0x00,
  0x00,0x18,0x03,0xC0,0x00,0x60,0x00,0xE0,
},{
/* 以下是 '返' 的 32点阵华文中宋 字模,128 byte */
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x08,0x00,0x01,0x80,0x04,0x00,0x07,0xC0,
  0x03,0x04,0x7F,0xC0,0x03,0x07,0xE0,0x00,
  0x01,0x04,0x00,0x00,0x01,0x04,0x00,0x00,
  0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,
  0x00,0x04,0x00,0x80,0x00,0x07,0xFF,0xC0,
  0x02,0x04,0x01,0xC0,0x7F,0x04,0x01,0x80,
  0x02,0x04,0x01,0x00,0x02,0x04,0x01,0x00,
  0x02,0x04,0x22,0x00,0x02,0x04,0x1E,0x00,
  0x02,0x04,0x0C,0x00,0x02,0x08,0x0E,0x00,
  0x02,0x08,0x1F,0x00,0x02,0x00,0x31,0x80,
  0x02,0x10,0x60,0xC0,0x02,0x20,0x80,0x40,
  0x07,0xC2,0x00,0x40,0x08,0x88,0x00,0x00,
  0x30,0x70,0x00,0x06,0x30,0x1F,0xFF,0xF0,
  /* 以下是 '回' 的 32点阵华文中宋 字模,128 byte */
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x20,
  0x07,0xFF,0xFF,0xF0,0x04,0x00,0x00,0x20,
  0x04,0x00,0x00,0x20,0x04,0x00,0x00,0x20,
  0x04,0x00,0x00,0x20,0x04,0x10,0x10,0x20,
  0x04,0x1F,0xF8,0x20,0x04,0x10,0x10,0x20,
  0x04,0x10,0x10,0x20,0x04,0x10,0x10,0x20,
  0x04,0x10,0x10,0x20,0x04,0x10,0x10,0x20,
  0x04,0x10,0x10,0x20,0x04,0x10,0x10,0x20,
  0x04,0x1F,0xF0,0x20,0x04,0x10,0x10,0x20,
  0x04,0x10,0x10,0x20,0x04,0x00,0x00,0x20,
  0x04,0x00,0x00,0x20,0x04,0x00,0x00,0x20,
  0x04,0x00,0x00,0x20,0x07,0xFF,0xFF,0xE0,
  0x04,0x00,0x00,0x20,0x04,0x00,0x00,0x20,
  }};
  int memrow[5]={4,2,2,4,2};
  int row,row1,row2,row3,i,y,bk1,bk2,bk3;

   while(1)
   {
    showmenu(5);
    y=116;
    for(i=0;i<5;i++)
    {
      y+=48;
      drawmat(admenu[i],y,adrow[i]);
    }

    putimage(70,162,buf_curse,XOR_PUT);
    row=0;
    row=getchoice(row,5);
    switch(row)
     {
       case 0:
      while(1)
      {
	showmenu(5);
	y=116;
	for(i=0;i<5;i++)
	{
	  y+=48;
	  drawmat(memmenu[i],y,memrow[i]);
	}
	putimage(70,162,buf_curse,XOR_PUT);
	row1=0;
	row1=getchoice(row1,5);
	switch(row1)
	{
	  case 0: addmember();bk1=0; break;
	  case 1: renewmem(); bk1=0; break;
	  case 2: memdupid(); bk1=0; break;
	  case 3: deletemem();bk1=0; break;
	  case 4: bk1=1;             break;
	}
	if(bk1)break;
      }
      break;
       case 1:
	 while(1)
	 {
	   showmenu(5);
	   y=116;
	   for(i=0;i<5;i++)
	   {
	  y+=48;
	  drawmat(bookmenu[i],y,bookrow[i]);
	   }
	   putimage(70,162,buf_curse,XOR_PUT);
	       row2=0;
	       row2=getchoice(row2,5);
	       switch(row2)
	       {
		 case 0:  addbook();    bk2=0; break;
		 case 1:  issbook();    bk2=0; break;
		 case 2:  retbook();    bk2=0; break;
		 case 3:  deletebook(); bk2=0; break;
		 case 4: bk2=1;                break;
	       }
	       if(bk2)break;
	     }
	     break;
       case 2:
	     while(1)
	     {
	       showmenu(4);
	       y=116;
	       for(i=0;i<4;i++)
	       {
		  y+=48;
		  drawmat(rptmenu[i],y,rptrow[i]);
	       }
	       putimage(70,162,buf_curse,XOR_PUT);
	       row3=0;
	       row3=getchoice(row3,4);
	       switch(row3)
	       {
		 case 0: allmem();     bk3=0; break;
		 case 1: allbook();    bk3=0; break;
		 case 2: alltransac(); bk3=0; break;
		 case 3: bk3=1;               break;
	       }
	       if(bk3)break;
	     }
	     break;
	case 3:
	      notice(); break;
	case 4:
	      return;
     }
  }
}
  void addbook()
   {
     FILE *fb;
     int num,i;
     struct book B;
     struct date d;
     window(1,1,80,2);
     textbackground(LIGHTGRAY);
     clrscr();
     textcolor(YELLOW);
     gotoxy(30,1);
     cprintf("Add Books");
     window(1,2,80,25);
     textcolor(WHITE);
     textbackground(BLUE);
     while(1)
      {
	clrscr();
	gotoxy(40,24);cprintf("Press ESC to return!");
	if(getch()==27)return;
	fb=fopen("E:\\cpp\\book.dat","a+");
	rewind(fb);
	while( fread(&B,sizeof(B),1,fb)==1)
	;
	B.b.gno+=1;     getdate(&d);    B.b.bno=d.da_year;
	fseek(fb,0,SEEK_END);
	gotoxy(1,1);
	fflush(stdin);
	printf("\n\t\t Enter No Of Books::");
	scanf("%d",&num);
	fflush(stdin);
	printf("\n\tEnter Name::");
	gets(B.bname); B.bname[19]=' '; B.bname[20]='\0';
	fflush(stdin);
	printf("\n\t Enter Author's Name::");
	gets(B.author); B.author[14]=' '; B.author[15]='\0';
	fflush(stdin);
	printf("\n\t Enter Publisher's Name::");
	gets(B.pub); B.pub[19]=' '; B.pub[20]='\0';
	fflush(stdin);
	printf("\n\t Enter Book Type::");
	gets(B.type); B.type[19]=' '; B.type[20]='\0';
	fflush(stdin);
	printf("\n\t Enter Book Price::");
	scanf("%f",&B.price);
	for(i=0;i<num;i++)
	 {
	   B.b.no=i+1;
	   fwrite(&B,sizeof(B),1,fb);
	 }
       fclose(fb);
       printf("\n\t\tBook Added!");
       delay(800);
    }
  }
void addmember()
  {
     int month;
     month=6;
     struct member M;
     struct date d;
     window(1,1,80,2);
     textbackground(LIGHTGRAY);
     clrscr();
     textcolor(YELLOW);
     gotoxy(30,1);
     cprintf("Add Members");
     window(1,2,80,25);
     textcolor(WHITE);
     textbackground(BLUE);
     clrscr();
     FILE *fm;
     while(1)
     {
       clrscr();
       gotoxy(40,24);
       cprintf("Press ESC to return!");
       if(getch()==27)return;
       fm=fopen("member.dat","a+");
       rewind(fm);
       while( fread(&M,sizeof(M),1,fm)==1)
       ;
       M.mid+=1;
       fseek(fm,0,SEEK_END);
       gotoxy(1,1);
       printf("\n\t Enter You Name::");
       fflush(stdin);
       gets(M.mname);  M.mname[19]=' ';  M.mname[20]='\0';
       printf("\n\t Enter You Address::");
       fflush(stdin);
       gets(M.madd);   M.madd[29]=' ';   M.madd[30]='\0';
       getdate(&d);
       M.ms.year=d.da_year;     M.ms.day=d.da_day;     M.ms.mon=d.da_mon;
       M.me.day=M.ms.day;       M.me.year=M.ms.year;   M.me.mon=(M.ms.mon+month);
     /*To Set Month After Dec To Jan*/
      if(M.me.mon>12)
       {
	  M.me.year+=1;
	  M.me.mon=(M.me.mon-12);
       }
     /*If Say The Old Date is 31/12/2003 i.e 31 Dec Then   The New Date is 31/06/2004 i.e 31 Jun
       But Jun consists of Only 30 days so we shall add 1 day extra so the correct Date is 01/07/2004 */
      if(M.me.day==31)
       { /*Months Like Apr,Jun,Sep, & Nov have 30 days*/
	 if(M.me.mon==4 || M.me.mon==6 || M.me.mon==9 || M.me.mon==11)
	  {
	      M.me.day=1;
	      M.me.mon+=1;
          }

       /*For the Month of Feb there are 28 OR 29 days*/
          if(M.me.mon==2)
          {/*For Years like(1996,2000,2004 etc there are 29 days in Feb */
             if( (M.me.year%4)==0)
              {
                 M.me.day=31-29;
                 M.me.mon+=1;
              }
             else
              {
                 M.me.day=31-28; 
                 M.me.mon+=1;
              }
          }
     }
     fwrite(&M,sizeof(M),1,fm);
     transac1(M.mid,'A');
     fclose(fm);
     printf("\n\tmember Added!");
     delay(800);
   }
  }



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -