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

📄 cx170.c

📁 170话费催交系统
💻 C
📖 第 1 页 / 共 5 页
字号:
			pp.str[3] = ch ;			ch = pp.str[1] ;			pp.str[1] = pp.str[2] ;			pp.str[2] = ch ;			phone = pp.dec ;			lseek (hle, 4, 1) ;			read (hle, pp.str, 4) ;			ch = pp.str[0] ;			pp.str[0] = pp.str[3] ;			pp.str[3] = ch ;			ch = pp.str[1] ;			pp.str[1] = pp.str[2] ;			pp.str[2] = ch ;			skadr = pp.dec ;			if (ulphnum <= phone) {				if (yflg == 2 || yflg == 3) {					if (ulphnum == phone) {//printf ("find\n") ;						close (hle) ;						return (skadr) ;					} else {//printf ("seek stop\n") ;						close (hle) ;						return 0 ;					}				} else {//printf ("seek continue\n") ;					lseek (hle, skadr, 0) ;					break ;				}			}		}		if (i == numind)			break ;	}	close (hle) ;/*	if (newtsonhk () != 1) {		longjmp (idlestate, 1) ;	}*/	return 0 ;}void skprot (){	char fname[32], temp[64];	char month[8] ;	long dataplace ;	unsigned long phnm ;	strcpy(proto, "       ");	if (*phonenum != '9' && *phonenum != '1')	{		strcpy(fname, "/jfsrv/xtydj/i-cksjd0.idx");     		dataplace = skidx11(fname);		if (dataplace == 0)			return ;		strcpy(fname, "/jfsrv/xtydj/d-cksj0.dbf");		if (duse(fname) == NULL)			return;		gotorecord(dataplace);			getsc("A1", proto);	} else {		strcpy(fname, "/jfsrv/xtydj/i-ydsjd0.idx") ;     		dataplace = skidx11(fname) ;		if (dataplace == 0)			return ;		strcpy(fname, "/jfsrv/xtydj/d-ydsj0.dbf") ;		if (duse(fname) == NULL)			return;		gotorecord(dataplace);		getsc("Y1", proto);				}	dclose();	sprintf(temp, "The %s contract no is %s", phonenum, proto);	writefifo(2, temp);	return;}void plyhth(){	char	dig[4];	int	i;	playmsg("hth");	dig[1] = '\0' ;	for (i=0;i<7;i++) {		if ((proto[i] >= '0') && (proto[i] <= '9')) {			dig[0] = proto[i] ;			playmsg (dig) ;		}	}	playmsg ("dwdhf") ;	if (newtsonhk () != 1)		longjmp (idlestate, 1) ;	if (ATDX_TERMMSK(devhandle) & TM_MAXDTMF)		pppflg = 1 ;	return ;}void now_fnhu (){	char		month[4], fname[32] ;	int		mm;	unsigned long	recno;	sprintf (routnm, "now_fnhu") ;	writefifo(1, "Contract Organization Bill");	month[0] = strtime[4] ;	month[1] = strtime[5] ;	month[2] = '\0' ;	mm = atoi(month) - 1 ;	if (mm == 0)		mm = 12 ;	plyhth();	sprintf (month, "%d", mm) ;	strcpy (fname, "/jfsrv/xtydj/i-fhsj") ;	strcat (fname, month) ;	strcat (fname, ".idx") ;	recno = skidx3(fname);	if (recno > 0) 		skfd3(mm, recno) ; 	else		playmsg("datano1");	return ;}void lst_fnhu (){	char		month[4], fname[32] ;	int		mm;	unsigned long	recno;	sprintf (routnm, "lst_fnhu") ;	writefifo(1, "Contract Organization Bill");	month[0] = strtime[4] ;	month[1] = strtime[5] ;	month[2] = '\0' ;	mm = atoi(month) - 2 ;	if (mm <= 0)		mm += 12 ;	plyhth();	sprintf (month, "%d", mm) ;	strcpy (fname, "/jfsrv/xtydj/i-fhsj") ;	strcat (fname, month) ;	strcat (fname, ".idx") ;	recno = skidx3(fname);	if (recno > 0)		skfd3(mm, recno) ; 	else		playmsg("datano1");	return ;}void mon_fnhu (){	char		month[4], fname[32];	static int	mm;	DL_DATA 	dl_databgn ;	unsigned long	recno;	sprintf (routnm, "mon_fnhu") ;	writefifo(1, "Contract Organization Bill");	if (glb1 == 0) {		dl_databgn.da_recvdig = 2 ;		dl_databgn.da_time = 100 ;		dl_databgn.da_digit = "#" ;		dl_databgn.da_numretry = 3 ;		gt_data (month, val_month, "monin", "monerr", bye_month, &dl_databgn) ;		if (month[0] == '0') {			month[0] = month[1] ;			month[1] = '\0' ;		}		mm = atoi(month) ;	}	glb1 = 1;	plyhth();	sprintf (month, "%d", mm) ;	strcpy (fname, "/jfsrv/xtydj/i-fhsj") ;	strcat (fname, month) ;	strcat (fname, ".idx") ;	recno = skidx3(fname);	if (recno > 0)		skfd3(mm, recno) ; 	else		playmsg("datano1");	return ;}void yer_fnhu (){	char month[4], fname[32], ams[16];	int  i, mm, flag = 0;	unsigned long	recno;	sprintf (routnm, "yer_fnhu") ;	writefifo(1, "Contract Organization Bill");	pppflg = 0 ;	month[0] = strtime[4] ;	month[1] = strtime[5] ;	month[2] = '\0' ;	mm = atoi(month) ;	plyhth();	sprintf (ams, "month%d", mm) ;	for (i=mm-1;i>0;i--) {		sprintf (month, "%d", i) ;		strcpy (fname, "/jfsrv/xtydj/i-fhsj") ;		strcat (fname, month) ;		strcat (fname, ".idx") ;		recno = skidx3(fname);		sprintf (ams, "month%d", i) ;		if (recno > 0)			skfd3(i, recno) ; 		else			flag = 1;		if (pppflg == 1) {			pppflg = 0 ;			return ;		}	}	if(flag == 0 || flag ==1)	{		playmsg(ams);		playmsg("datano1");	}	return ;}unsigned long skidx3 (fname)char	*fname;{	union {		unsigned long dec ;		unsigned char str[4] ;	} pp ;	union {		unsigned short dec ;		unsigned char  str[4] ;	} pp2 ;	unsigned long	rtblk, phone, skadr ;	unsigned char	ch, contract[8];	int		i, yflg, numind, forever, hle;	char		month[4];	if ((hle = open(fname, O_RDONLY)) == -1)	{		printf ("File %s not found\n", fname) ;//		playmsg ("datano1") ;		return 0 ;	}	lseek (hle, 0, 0) ;	read (hle, pp.str, 4) ;	rtblk = pp.dec ;	lseek (hle, rtblk, 0) ;	forever = 1 ;	contract[7] = '\0';	while (forever)	{		read (hle, pp2.str, 2);	/* block flag */		pp2.str[2] = '\0';		yflg = pp2.dec;		read (hle, pp2.str, 2);	/* number of index */		pp2.str[2] = '\0' ;		numind = pp2.dec ;		lseek(hle, 8L, 1);	/* skip low & upper address*/		for (i=0;i<numind;i++)		{			read (hle, contract, 7) ;			read (hle, pp.str, 4) ;			ch = pp.str[0] ;			pp.str[0] = pp.str[3] ;			pp.str[3] = ch ;			ch = pp.str[1] ;			pp.str[1] = pp.str[2] ;			pp.str[2] = ch ;			skadr = pp.dec ;			if (strcmp(proto, contract) <= 0) {				if (yflg == 2 || yflg == 3) {					if (! strcmp(proto, contract)) {//						printf ("find\n") ;						close (hle) ;						return (skadr) ;					} else {//						printf ("seek stop\n") ;						close (hle) ;						return 0 ;					}				} else {//					printf ("seek continue\n") ;					lseek (hle, skadr, 0) ;					break ;				}			}		}		if (i == numind)			break ;	}	close (hle) ;/*   if (newtsonhk () != 1) {      longjmp (idlestate, 1) ;   }*/	return 0 ;}void skfd3 (mm, recnum)int		mm;unsigned long	recnum ;{//	int    hle, i ;	int	i;	char   fname[32], month[8], tmp[16], bufdbl[16] ;	double sumcost, cqcost, cost113, telecost, shcost ;	double mobilecost, othercost, bpcost, cost168;	sprintf (routnm, "skfd3") ;	sprintf (month, "%d", mm) ;	strcpy (fname, "/jfsrv/xtydj/d-fhsj") ;	strcat (fname, month) ;	strcat (fname, ".dbf") ;	sprintf (month, "month%d", mm) ;	if(duse(fname)==NULL)		return;	gotorecord(recnum);	shcost=getsn("F4");	cqcost=getsn("F5");	cost113=getsn("F6");	telecost=getsn("F7");	mobilecost = getsn("F8");	bpcost = getsn("F13");	sumcost = getsn("F16");	cost168 = getsn("F17");	dclose();	playmsg(month);	if (shcost > 0.01) {		sprintf (bufdbl, "%10.2f", shcost) ;		playmsg ("shcost") ;		plymny (bufdbl) ;	}	if (cqcost > 0.01) {		sprintf (bufdbl, "%10.2f", cqcost) ;		playmsg ("cthuafei") ;		plymny (bufdbl) ;	}	if (cost113 > 0.01) {		sprintf (bufdbl, "%10.2f", cost113) ;		playmsg ("f113") ;		plymny (bufdbl) ;	}	if (telecost > 0.01) {		sprintf (bufdbl, "%10.2f", telecost) ;		playmsg ("dbfei") ;		plymny (bufdbl) ;	}	if (mobilecost > 0.01) {		sprintf (bufdbl, "%10.2f", mobilecost) ;		playmsg ("myf") ;		plymny (bufdbl) ;	}	if (cost168 > 0.01) {		sprintf (bufdbl, "%10.2f", cost168) ;		playmsg ("f168") ;		plymny (bufdbl) ;	}	sprintf (bufdbl, "%10.2f", sumcost) ;	playmsg ("sumcost") ;	plymny (bufdbl) ;	if (newtsonhk () != 1)		longjmp (idlestate, 1) ;	if (ATDX_TERMMSK(devhandle) & TM_MAXDTMF)		pppflg = 1 ;	return ;}void now_dgd (){//	int  hle ;	char tmp[16], fname1[32], fname2[32] ;	static char month[8] ;	static int  pst ;	int  kk, ll;	static long dataplace ;	char tlpn[16], rentpermon[16], tjzhf[16], buff1[16], ams[16] ;	long gjz, gaz, twz, gnz, shz ;	double gjf, gaf, twf, gnf, shf, fdf, cjf, syf, qtf, ljqf, hjf;	double myf ,ctcost, bbjf, cost168;	sprintf (routnm, "now_dgd") ;	writefifo(1, "Mobile Phone Total Bill");	if (glb1 == 0) {		month[0] = strtime[4] ;		month[1] = strtime[5] ;		month[2] = '\0' ;		pst = atoi(month) - 1 ;		if (pst == 0)			pst = 12 ;		sprintf (month, "%d", pst) ;		strcpy (fname1, "/jfsrv/xtydj/i-ydsjd") ;		strcat (fname1, month) ;		strcat (fname1, ".idx") ;		dataplace = skidx14(fname1) ;		if (dataplace == 0) {			playmsg ("datano1") ;			return ;		}	}	glb1 = 1 ;	sprintf (ams, "month%d", pst) ;	strcpy (fname2, "/jfsrv/xtydj/d-ydsj") ;	strcat (fname2, month) ;	strcat (fname2, ".dbf") ;	if(duse(fname2)==NULL)		return;	gotorecord(dataplace);	kk = getsl("Y4");	sprintf (rentpermon, "%d", kk) ;	shf = getsn("Y11"); 	ctcost= getsn("Y13")+getsn("Y14")+getsn("Y15")+getsn("Y16")+getsn("Y17");	hjf = getsn("Y18");	myf = getsn("Y19");	shf += getsn("Y28");	bbjf = getsn("Y29") + getsn("Y30");	cost168 = getsn("Y31");	dclose();	playmsg(ams) ;	if (kk > 0) {		playmsg ("rentpermth") ;		playmsg (rentpermon) ;		playmsg ("yuan") ;	}	if (shf > 0.01) {		sprintf (buff1, "%10.2f", shf) ;		playmsg ("shf") ;		plymny (buff1) ;        }	if (ctcost > 0.10) {		sprintf (buff1, "%10.2f", ctcost) ;		playmsg ("cthuafei") ;		plymny (buff1) ;	}	if (myf > 0.10)	{		sprintf(buff1, "%10.2f", myf);		playmsg("myf");		plymny(buff1);	}	if ( bbjf > 0.10) {		sprintf(buff1, "%10.2f", bbjf);		playmsg ("callbpfee") ;		plymny (buff1) ;	}	if ( cost168 > 0.10) {		sprintf(buff1, "%10.2f",cost168);printf("buff1 = %s\n",buff1);		playmsg ("f168") ;		plymny (buff1) ;	}	if (hjf > 0.10) {		sprintf (buff1, "%10.2f", hjf) ;		playmsg ("hjf") ;		plymny (buff1) ;	}	return ;}void lst_dgd (){//	int  hle ;	char tmp[16], fname1[32], fname2[32] ;	static char month[8] ;	static int  pst ;	int  kk, ll;	static long dataplace ;	char tlpn[16], rentpermon[16], tjzhf[16], buff1[16], ams[16] ;	long gjz, gaz, twz, gnz, shz ;	double gjf, gaf, twf, gnf, shf, fdf, cjf, syf, qtf, ljqf, hjf ;	double myf, ctcost, bbjf, cost168 ;	sprintf (routnm, "lst_dgd") ;	writefifo(1, "Mobile Phone Total Bill");	if (glb1 == 0) {		month[0] = strtime[4] ;		month[1] = strtime[5] ;		month[2] = '\0' ;		pst = atoi(month) - 2 ;		if (pst <= 0)			pst += 12 ;		sprintf (month, "%d", pst) ;		strcpy (fname1, "/jfsrv/xtydj/i-ydsjd") ;		strcat (fname1, month) ;		strcat (fname1, ".idx") ;		dataplace = skidx14(fname1) ;		if (dataplace == 0) {			playmsg ("datano1") ;			return ;		}	}	glb1 = 1 ;	sprintf (ams, "month%d", pst) ;	strcpy (fname2, "/jfsrv/xtydj/d-ydsj") ;	strcat (fname2, month) ;	strcat (fname2, ".dbf") ;	if(duse(fname2)==NULL)		return;	gotorecord(dataplace);	kk = getsl("Y4");	sprintf (rentpermon, "%d", kk) ;	shf = getsn("Y11"); 	ctcost= getsn("Y13")+getsn("Y14")+getsn("Y15")+getsn("Y16")+getsn("Y17");	hjf = getsn("Y18");	myf = getsn("Y19");	shf += getsn("Y28");	bbjf = getsn("Y29") + getsn("Y30");	cost168 = getsn("Y31");	dclose();/*     printf ("telephone No = %s\n", tlpn) ;     printf ("rentpermon=%s\n", rentpermon) ;     printf ("gjz=%ld\n", gjz) ;     printf ("gaz=%ld\n", gaz) ;     printf ("twz=%ld\n", twz) ;     printf ("gnz=%ld\n", gnz) ;     printf ("shz=%ld\n", shz) ;     printf ("gjf=%f\n", gjf) ;     printf ("gaf=%f\n", gaf) ;     printf ("twf=%f\n", twf) ;     printf ("gnf=%f\n", gnf) ;     printf ("shf=%f\n", shf) ;     printf ("fdf=%f\n", fdf) ;     printf ("cjf=%f\n", cjf) ;     printf ("syf=%f\n", syf) ;     printf ("qtf=%f\n", qtf) ;     printf ("ljqf=%f\n", ljqf) ;     printf ("hjf=%f\n", hjf) ;*/	playmsg (ams) ;	if (kk > 0) {		playmsg ("rentpermth") ;		

⌨️ 快捷键说明

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