📄 change_dat.ec
字号:
/* change_dated */#include </u/ebcsav/include/sav.h>$include sqlca;$include sqlda;void addspace();void addspacef();void mess();char y_n();char readdv();char readch();char readst();void prt_inum();void prt_dnum();void prtf_inum();void prtf_dnum();void prtf_inte();double get_rate();void delay();short num_time();#include </u/ebcsav/include/begin>long k,key_num,key=4691813,key_date=99971231;short cred_type,i,j,flag,n,ti;double x;unsigned char c;char key_str[13];char ss[11];char stn[7];FILE *pf;$ char s_num[2],nam[9],ter[2],ter1[2],cu_type[2], addres[25],statu[2],s_type[2],ope_num[2],fla[2],lin_num[2];$ long a_num,pas,cr_num,ope_date,ope_date1,int_date,int_date1, las_date,las_date1,las_month,las_month1,b_num;$ double amoun,amoun1,balanc,balanc1,interes,interes1,int_rate;move(0,23);printw("零 存 整 取 储 蓄 帐 户 重 要 修 改");s_num[1]='\0';ope_num[0]=op_num;ope_num[1]='\0';s_type[1]='\0';ter1[1]='\0';pf=fopen("/u/ebcsav/data/sav_sect.dat","r");fseek(pf,(op.num&0x7f)*34-10,0);fread(ss,10,1,pf);fclose(pf);ss[10]='\0';for(i=0;i<7;i++) if(op.name[i]!='\0')stn[i]=op.name[i]^0xff; else stn[i]='\0';move(2,0);clrtobot();block(1,0,22,80);if(year*10000+month*100+day>key_date) { move(10,20); addstr("修改程序超过使用期限, "); mess((short)3); getch(); endwin(); return; }move(3,6);addstr("密码: ");readst(key_str,12);k=key_num=j=0;for(i=2;i<=11;i++) { n=key_str[i]-97; k+=n; j=n-j; key_num=key_num*10+j; }i=k/26+97;j=(k%26)+97;ti=num_time();key_num+=(key+(year%100)*1000000+month*10000+day*100+ti/100);if((op.num&0x80)!=0) s_num[0]=op.num&0x7f;else { move(5,6); addstr("营业所编号( 按 0 返回): "); readdv(&x,2); s_num[0]=x; if(s_num[0]==0) { endwin(); return; } }move(5,6);addstr("营业所编号: ");prt_inum((long)s_num[0],2);cred_type=3;move(7,6);addstr("帐号( 按 0 返回 ): ");readdv(&x,9);a_num=x;if(a_num==0) { endwin(); return; }move(7,6);addstr("帐号: ");prt_inum(a_num,9);key_num+=a_num;move(10,6);addstr("修改项目(0-返回,1-存期,2-余额,3-开户日,4-起息日,5-最后日: ");move(11,15);addstr("7-定额,8-累计利息,9-最后月份: ");readdv(&x,1);n=x;if(n==0) { endwin(); return; }ti=num_time();if((key_num+s_num[0]*10000+cred_type*100+n)!=2100000000|| i!=key_str[0]||j!=key_str[1]) { move(20,20); addstr("密码错, "); mess((short)3); getch(); endwin(); return; }$ database saving;$ select * into $s_num,$a_num,$nam,$pas,$cu_type,$ter,$amoun, $balanc,$addres,$cr_num,$ope_date,$int_date,$statu,$fla, $las_date,$int_rate,$interes,$las_month,$lin_num from r_dated where sec_num=$s_num and acc_num=$a_num;ter1[0]=ter[0];amoun1=amoun;balanc1=balanc;ope_date1=ope_date;int_date1=int_date;las_date1=las_date;interes1=interes;las_month1=las_month;move(2,0);clrtobot();block(1,0,22,80);move(3,10);addstr("帐 号: ");move(3,48);prt_inum((long)s_num[0],2);addstr("-");prt_inum(a_num,9);move(4,10);addstr("姓 名: ");move(4,48);addstr(nam);move(5,10);addstr("币 种: ");move(5,48);switch(toupper(cu_type[0])) { case 'C': addstr("加拿大元"); break; case 'F': addstr("法国法郎"); break; case 'H': addstr("港元 "); break; case 'J': addstr("日元 "); break; case 'M': addstr("德国马克"); break; case 'P': addstr("英镑 "); break; case 'R': addstr("人民币 "); break; case 'U': addstr("美元 "); }move(6,10);addstr("期 限: ");move(6,48);if(ter[0]<12) printw("%2d个月",ter[0]);else printw("%2d年",ter[0]/12);move(7,10);addstr("余 额: ");move(7,48);prt_dnum(balanc,16);move(8,10);addstr("地 址: ");move(8,48);addstr(addres);move(9,10);addstr("凭 证 号: ");move(9,48);prt_inum(cr_num,7);move(10,10);addstr("开户日期: ");move(10,48);printw("%4d年%2d月%2d日",ope_date/10000,(ope_date%10000)/100,ope_date%100);move(11,10);addstr("起息日期: ");move(11,48);printw("%4d年%2d月%2d日",int_date/10000,(int_date%10000)/100,int_date%100);move(12,10);addstr("最后日期: ");move(12,48);printw("%4d年%2d月%2d日",las_date/10000,(las_date%10000)/100,las_date%100);move(13,10);addstr("最后月份: ");move(13,48);printw("%4d年%2d月",las_month/100,las_month%100);move(14,10);addstr("累计利息: ");move(14,48);printw("%16,4f",interes);move(15,10);addstr("定 额: ");move(15,48);prt_dnum(amoun,16);switch(n) { case 1: flag=0; while(flag==0) { move(17,2); addstr("请选择: 1-一年 3-三年 5-五年"); move(6,20); c=readch(); if(isprint(c)) ter1[0]=c; move(6,48); switch(ter1[0]) { case '1': case '3': case '5': printw("%1d年 ",ter1[0]-48); flag=1; } } ter1[0]*=12; move(17,2); addspace(76); break; case 2: move(7,20); readdv(&x,11); balanc1=x; move(7,20); addspace(11); move(7,48); prt_dnum(balanc1,16); break; case 3: move(10,20); readdv(&x,8); ope_date1=x; move(10,20); addspace(8); move(10,48); printw("%4d年%2d月%2d日",ope_date1/10000,(ope_date1%10000)/100, ope_date1%100); break; case 4: move(11,20); readdv(&x,8); int_date1=x; move(11,20); addspace(8); move(11,48); printw("%4d年%2d月%2d日",int_date1/10000,(int_date1%10000)/100, int_date1%100); break; case 5: move(12,20); readdv(&x,8); las_date1=x; move(12,20); addspace(8); move(12,48); printw("%4d年%2d月%2d日",las_date1/10000,(las_date1%10000)/100, las_date1%100); break; case 7: move(15,20); readdv(&x,11); amoun1=x; move(15,20); addspace(11); move(15,48); prt_dnum(amoun1,16); break; case 8: move(14,20); readdv(&x,11); interes1=x; move(14,20); addspace(11); move(14,48); printw("%16.4f",interes1); break; case 9: move(13,20); readdv(&x,8); las_month1=x; move(13,20); addspace(8); move(13,48); printw("%4d年%2d月",las_month1/100,las_month1%100); }move(20,33);mess((short)33);c=y_n('Y','N','N');move(20,20);addspace(60);if(c=='Y')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -