📄 pt_hang.ec
字号:
/* pt_hang */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void addspacef();void prtf_inum();void prtf_dnum();void mess();#include </u/ebcsav/include/begin>struct operator opt;short i,l,count,pa;char c;char s[7],st[21],sn[7];$ char s_num[2],s_type[2],cu_type[2],ter[2],nam[9],ope_num[2],statu[2];$ long a_num,cr_num;$ double balanc;FILE *pf;move(0,27);$ database saving;printw("打 印 挂 解 登 记 簿");pf=fopen("/u/ebcsav/data/sav_sect.dat","r");fseek(pf,((op.num&0x7f)-1)*34+24,0);fread(st,10,1,pf);fclose(pf);st[10]='\0';for(i=0;i<7;i++) if(op.name[i]!='\0')s[i]=op.name[i]^0xff; else s[i]='\0';$ declare read_hang scroll cursor for select * into $s_num,$s_type,$cu_type, $ter,$a_num,$nam,$cr_num,$balanc,$statu,$ope_num from hang;if(sqlca.sqlcode!=0) { move(20,20); addstr("申请"); mess((short)62); printw("(%d), ",sqlca.sqlcode); mess((short)3); getch(); return; }$ open read_hang;if(sqlca.sqlcode!=0) { move(20,20); addstr("打开"); mess((short)62); printw("(%d), ",sqlca.sqlcode); mess((short)3); getch(); return; }move(10,20);mess((short)60);mess((short)4);getch();printf("%c%c%c%c%c%c%c%c%c%c%c%c%c\n\n\n\n",27,'[','5','i',27,'%','9',1,15);count=0;pa=1;l=1;while(1) { $ fetch read_hang; if(sqlca.sqlcode!=0) break; if(l==1) { if(pa>1) printf("%c",12); addspacef(37); printf("%c%c%c%c",28,'p',27,'['); printf("挂失--解挂--冻结--解冻 登 记 簿%c%c%c%c\n",28,'q',27,']'); addspacef(37); printf("───────────────────────────\n\n"); addspacef(18); printf("营业部门: %-10s",st); addspacef(20); printf("%4d年%2d月%2d日",year,month,day); addspacef(20); printf("操作员: %-6s\n\n",s); addspacef(12); printf("┏━━━━━━┯━━━━┯━━━━┯━━━━┯━━┯━━━━┯━━━━━━━┯━━━━┯━━━┯━━━┓\n"); addspacef(12); printf("┃ │ │ │ │ │ │ │ │ │ ┃\n"); addspacef(12); printf("┃ 帐 号 │ 户 名 │ 储 种 │ 币 种 │存期│ 凭证号 │ 金 额 │ 状 态 │操作员│ 备注 ┃\n"); addspacef(12); printf("┃ │ │ │ │ │ │ │ │ │ ┃\n"); } addspacef(12); printf("┠──────┼────┼────┼────┼──┼────┼───────┼────┼───┼───┨\n"); addspacef(12); printf("┃"); prtf_inum((long)s_num[0],2); printf("-"); prtf_inum(a_num,9); printf("│%-8s│",nam); switch(s_type[0]%10) { case 1: printf("整存整取"); break; case 2: printf(" 活 期 "); break; case 3: printf("零存整取"); break; case 4: printf("存本取息"); break; case 5: printf("定活两便"); break; case 6: printf(" 大 额 "); break; case 7: printf("通知存款"); } printf("│"); switch(toupper(cu_type[0])) { case 'R': printf(" 人民币 "); break; case 'U': printf(" 美 元 "); break; case 'J': printf(" 日 元 "); break; case 'H': printf(" 港 元 "); break; case 'M': printf("德国马克"); break; case 'P': printf(" 英 镑 "); break; case 'F': printf("法国法郎"); break; case 'C': printf("加拿大元"); } i=((short)s_type[0])%10; if(i==1||i==3||i==6) { if(ter[0]<12) printf("│%2d月│ ",ter[0]); else printf("│%2d年│ ",ter[0]/12); } else printf("│ │ "); prtf_inum(cr_num,7); printf("│"); prtf_dnum(balanc,14); printf("│"); switch(toupper(statu[0])) { case 'V': printf("口头挂失"); break; case 'H': printf(" 挂 失 "); break; case 'L': printf(" 解 挂 "); break; case 'F': printf(" 冻 结 "); break; case 'U': printf(" 解 冻 "); } pf=fopen("/u/ebcsav/data/sav_op.dat","r"); fseek(pf,(ope_num[0]-1)*17,0); fread(&opt,17,1,pf); fclose(pf); for(i=0;i<7;i++) if(opt.name[i]!='\0')sn[i]=opt.name[i]^0xff; else sn[i]='\0'; printf("│%-6s│ ┃\n",sn); count++; l++; if(l>30) { addspacef(12); printf("┗━━━━━━┷━━━━┷━━━━┷━━━━┷━━┷━━━━┷━━━━━━━┷━━━━┷━━━┷━━━┛\n"); addspacef(80); printf("操作员:\n"); addspacef(60); printf("第%2d页\n",pa); l=1; pa++; } }if(l>1) { addspacef(12); printf("┗━━━━━━┷━━━━┷━━━━┷━━━━┷━━┷━━━━┷━━━━━━━┷━━━━┷━━━┷━━━┛\n"); addspacef(80); printf("操作员:\n"); addspacef(60); printf("第%2d页\n",pa); }if(count>0) { addspacef(20); printf("总户数: %3d\n",count); }printf("%c%c%c%c%c%c%c%c%c%c\n\n\n\n",12,27,'%','9',1,20,27,'[','4','i');$ close read_hang;$ close database;endwin();#include </u/ebcsav/include/end>#include </u/ebcsav/include/mess>#include </u/ebcsav/include/addspace>#include </u/ebcsav/include/addspacef>#include </u/ebcsav/include/prtf_inum>#include </u/ebcsav/include/prtf_dnum>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -