亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fee_rec.c

?? BC3.1編譯,小交換機計費系統.使用Dos做出如此好的界面,少有.
?? C
?? 第 1 頁 / 共 2 頁
字號:
#include <string.h>
#include <stdlib.h>
#include <mem.h>
#include <alloc.h>
#include <graphics.h>
#include <bio.inc>
#include <menu.inc>
#include "feedef.h"

void InnerToExt(void);

/* function  : calculate InterNational call charge
 * called by : all_record_transfer(),imm_record_transfer()
 * input     : len -- the number length of callee (including the ending fd)
 *             in_fp -- file pointer to Intern.tmp
 * output    : write charge to Intern.tmp
 * date      : 1993.9.28
 */
void Intern_charge(void)
{
    UC   flag;
    UL   second, secc;
	 RATE_STRUCT huge *rate_tmp;

    rate_tmp = get_rate(&temp_list.callee[2],IDD);   /* get charge rate */
    if(rate_tmp == NULL)              /* the area No. does not exist    */
    {
	rate.first_rate = 0;
	rate.first_time = 60;
	rate.formal_rate = 0;
	rate.formal_time = 60;
	rate.add_fee = 0;
    }
    else
	rate = *rate_tmp;

    if(rate.formal_time == 0)
		  rate.formal_time = 60;

    flag = normal_charge_hour();            /* calculate calling time   */
    if(flag == TRUE)
    {
        second = (UL)hour*60*60+min*60+sec;
        if(second >= 43200L) /* calling time is longer than 12 hours */
            second = 180;
    }
    else                        /* calling time is too long */
		  second = 180;

	 temp_list.time = second;    /* calling time */

    second += Intern_add.add_time;
    temp_list.charge = rate.first_rate;     /* calling charge*/
    if(second > rate.first_time)
    {
        secc = (second-rate.first_time)/rate.formal_time;
        if( (second-rate.first_time-secc*rate.formal_time) > 0)
            secc++;
        temp_list.charge += secc*rate.formal_rate;
	 }

	 if( ( strcmp("852", rate.area_no) == 0 ) || \
        ( strcmp("853", rate.area_no) == 0 ) )
    {
        temp_list.add = (UL) (temp_list.charge*Honkon_add.add_percent/100  \
                         +Honkon_add.add_rate*((second-1)/rate.formal_time + 1)\
			 +Honkon_add.add_record + rate.add_fee);
    }
    else
    {
	temp_list.add = (UL) (temp_list.charge*Intern_add.add_percent/100  \
								 +Intern_add.add_rate*((second-1)/rate.formal_time + 1)\
			 +Intern_add.add_record + rate.add_fee);
	 }

//    temp_list.add = ((temp_list.add+9)/10)*10;

    temp_list.charge += temp_list.add;

//    temp_list.charge = ((temp_list.charge+9)/10)*10;

    temp_list.flag = TRUE;

	 return;
}

/* function  : calculate National call charge
 * called by : all_record_transfer(),imm_record_transfer()
 * input     : len -- the number length of callee (including the ending fd)
 *             na_fp -- file pointer to Nation.tmp
 * output    : write charge to Nation.tmp
 * date      : 1993.9.28
 */
void Nation_charge(void)
{
    UC   flag;
    UL   second,sec0,semi_sec0,secc;
    RATE_STRUCT huge *rate_tmp;

    rate_tmp = get_rate(&temp_list.callee[1],DDD);   /* get charge rate */
    if(rate_tmp == NULL)              /* the area No. does not exist    */
    {
        rate.first_rate = 0;
        rate.first_time = 60;
        rate.formal_rate = 0;
        rate.formal_time = 60;
    }
	 else
        rate = *rate_tmp;

    strcpy(Distr_name, rate.area_name);
    if(rate.formal_time == 0)
        rate.formal_time = 60;

    flag = nation_charge_hour();            /* calculate calling time   */
    if(flag == TRUE)
    {
        sec0 = (UL)hour*60*60+min*60+sec;
        semi_sec0 = (UL)semi_hour*60*60+semi_min*60+semi_sec;
		  second = sec0+semi_sec0;
        if(second >= 43200L) /* calling time is longer than 12 hours */
		  {
            second = 180;
            sec0   = 180;
            semi_sec0 = 0;
        }
    }
    else                        /* calling time is too long */
    {
        second = 180;
        sec0   = 180;
		  semi_sec0 = 0;
    }

    temp_list.time = second;

    second += Nation_add.add_time;
    sec0   += Nation_add.add_time;
    temp_list.charge = rate.first_rate;

    if(second > rate.first_time)
    {
        secc = (second-rate.first_time)/rate.formal_time;
		  if((second-rate.first_time-secc*rate.formal_time) > 0)
            secc++;
		  temp_list.charge += secc*rate.formal_rate;
    }

    if(second < 1)
        second = 1;                       /* for if second=0 &&&*/
    temp_list.charge = temp_list.charge/2.0*((double)semi_sec0/second)    \
                      +temp_list.charge*((double)sec0/second);

    temp_list.add = (UL)(temp_list.charge*Nation_add.add_percent/100  \
			+Nation_add.add_rate*((second-1)/rate.formal_time + 1)\
			+Nation_add.add_record + rate.add_fee);

//    temp_list.add = ((temp_list.add+9)/10)*10;

    temp_list.charge += temp_list.add;

//    temp_list.charge = ((temp_list.charge+9)/10)*10;

    temp_list.flag = TRUE;

	 return;
}

/* function  : calculate Local call charge
 * called by : all_record_transfer(),imm_record_transfer()
 * input     : len -- the number length of callee (including the ending fd)
 *             lo_fp -- file pointer to loacl.tmp
 * output    : write charge to Local.tmp
 * date      : 1993.9.28
 */
void Local_charge(void)
{
	 UC   flag;
    UL   second,secc;
	 RATE_STRUCT huge *rate_tmp;

    rate_tmp = get_rate(temp_list.callee,LDD);       /* get charge rate */
    if(rate_tmp == NULL)              /* the area No. does not exist    */
    {
        rate.first_rate = 0;
        rate.first_time = 60;
        rate.formal_rate = 0;
        rate.formal_time = 60;
    }
	 else
        rate = *rate_tmp;

    if(rate.formal_time == 0)
        rate.formal_time = 60;

    flag = normal_charge_hour();            /* calculate calling time   */
    if(flag == TRUE)
    {
        second = (UL)hour*60*60+min*60+sec;
        if(second >= 43200L) /* calling time is longer than 12 hours */
            second = 180;
	 }
    else                        /* calling time is too long */
		  second = 180;

    temp_list.time = second;    /* calling time */

    second += Local_add.add_time;
    temp_list.charge = rate.first_rate;
    if(second > rate.first_time)
    {
        secc = (second-rate.first_time)/rate.formal_time;
        if((second-rate.first_time-secc*rate.formal_time) > 0)
				secc++;
        temp_list.charge += secc*rate.formal_rate;
	 }

    if(temp_list.charge == 0)
        temp_list.add = 0;
    else
        temp_list.add = (UL)(temp_list.charge*Local_add.add_percent/100 \
                         +Local_add.add_rate*((second-1)/rate.formal_time + 1)\
					     +Local_add.add_record + rate.add_fee);

//    temp_list.add = ((temp_list.add+9)/10)*10;

    temp_list.charge += temp_list.add;

//    temp_list.charge = ((temp_list.charge+9)/10)*10;

    temp_list.flag = TRUE;

    return;
}

/* function  : transfer telephone records to Intern.tmp, Nation.tmp and
 *             Local.tmp respectively, from pabx.dat
 * called by : take_all()
 * date      : 1993.9.28
 */
void all_record_transfer(void)
{
    int   i, k;
    UC    caller[6], mark, flag, w_flag = 0;
    FILE  *in_fp, *na_fp, *lo_fp, *pabx_fp;
    UC     port;
    UC    mode;
    UC    user[10];
    PHONE_STRUCT  *phone;
    UI    SpecLen[2];

    flag  = load_rate_tab();
    if(flag != TRUE)              /* *.rat does not exist    */
    {
	message(RATE_FILE_ERR);
	return;
    }

    for(mode =0; mode<2; mode++)
	if(Cashflg[mode])
	{
	    flag = load_cash_tbl(mode);
	    if(flag != 1)             /* cash data does not exist */
		 Cashflg[mode] = 0;
	    else
		Cash_len[mode] = cash_tbl_len(mode);
	}

    load_special_tbl(0);  /* local call definition table */
    load_special_tbl(1);  /* information call definition table */
    SpecLen[0] = special_tbl_len(0);  /* local */
    SpecLen[1] = special_tbl_len(1);  /* information */

    load_phone_tbl();
    Newlen = phone_tbl_len();

    in_fp = fopen("idd.tmp","ab");
    na_fp = fopen("ddd.tmp","ab");
    lo_fp = fopen("ldd.tmp","ab");

    pabx_fp = fopen("pabx.chg","rb");
    if(pabx_fp != NULL )     /* the file exists */
    {
	while(fread(caller,sizeof(UC),1,pabx_fp) == 1)
	{
	    w_flag = 0;      /*  Reset the error flag */

	    port = caller[0];

	    fread(caller,sizeof(UC),1,pabx_fp);
	    temp_list.year2 = ((caller[0] & 0xF0)>>4)*10+(caller[0] & 0x0F);
	    temp_list.year2 += 1900;
	    fread(caller,sizeof(UC),1,pabx_fp);
	    temp_list.mon2 = cbcd_uc(caller);
	    fread(caller,sizeof(UC),1,pabx_fp);
	    temp_list.day2 = cbcd_uc(caller);

	    temp_list.year1 = temp_list.year2;
	    temp_list.mon1 = temp_list.mon2;
	    temp_list.day1 = temp_list.day2;

	    fread(caller, sizeof(UC), 1, pabx_fp);
	    temp_list.caller2 = ((caller[0] & 0xF0)>>4)*10+(caller[0] & 0x0F)+PhonesPerPort*port;
	    InnerToExt();
	    temp_list.caller1 = temp_list.caller2;

	    fread(caller,sizeof(UC), 3, pabx_fp);
	    cbcd_hex(&temp_list.auth_code, caller, 6);

	    if(caller[0] != 0x0a )
		cbcd_hex(&temp_list.auth_code, caller, 6);
	    else if(caller[0] == 0x0a )
		temp_list.auth_code = 0xaaaaaa;

	    fread(caller,sizeof(UC),1,pabx_fp);
	    temp_list.hour1 = cbcd_uc(caller);

	    fread(caller,sizeof(UC),1,pabx_fp);
	    temp_list.min1 = cbcd_uc(caller);

	    fread(caller,sizeof(UC),1,pabx_fp);
	    temp_list.sec1 = cbcd_uc(caller);

	    fread(caller,sizeof(UC),1,pabx_fp);
	    temp_list.hour2 = cbcd_uc(caller);

	    fread(caller,sizeof(UC),1,pabx_fp);
	    temp_list.min2 = cbcd_uc(caller);

	    fread(caller,sizeof(UC),1,pabx_fp);
	    temp_list.sec2 = cbcd_uc(caller);

	    /* in caller number, if it is National long call, then the
	     * first 0 is saved as A, if it is an InterNation long call,
	     * then save the first two 0 as AA. The 0s in the tail are
	     * saved as 0s
	     */
	    for(i=0, k=0; i<7; i++)       /* callee number */
	    {
		fread(caller,1,1,pabx_fp);
		if( i == 0 && (caller[0] & 0xf0) == 0)
		{
		    w_flag = 1;    /*  Set the error flag */
		    continue;
		}

                if((caller[0] & 0xf0) == 0)      /* 0 in the tail */
                    break;
                else
					 {
                    temp_list.callee[k] = (caller[0] & 0xf0)>>4;
						  if( temp_list.callee[k] > 0x0a)
                    {
                        w_flag = 1;    /*  Set the error flag */
			continue;
                    }

                    if(temp_list.callee[k] == 0x0a)   /* 0 in the head */
			temp_list.callee[k] = 0;
                    k++;

		    if((caller[0] & 0x0f) == 0)
			break;
		    else     /* if((caller[0] & 0x0f) != 0) */
		    {
			temp_list.callee[k] = caller[0] & 0x0f;

			if( temp_list.callee[k] > 0x0a)
			{
			    w_flag = 1;  /*  Set the error flag */
			    continue;
			}

			if(temp_list.callee[k] == 0x0a)
			    temp_list.callee[k] = 0;

			k++;
			if(k >= 14)    /* 14 bytes are enough for callee number */
			    break;
                    }   /* end of "if((caller[0] & 0x0f) != 0)" */
                }       /* end of "else if((caller[0] & 0xf0) != 0)" */
            }      /* end of "for(i=0,k=0;i<8;i++)" */

	    if(w_flag == 1)
            {
					 for(;;)
                {
						  fread(caller,sizeof(UC),1,pabx_fp);
                    if(caller[0] == 0xfd)           /* end of a phone record */
                        break;
		}
                continue;
            }

	    if(k > 14)
                k = 14;
	    for(;k<16;k++)
					 temp_list.callee[k] = 0xfd;

				if(temp_list.callee[0] == 0)
            {
                if(temp_list.callee[1] == 0)
		    mark = IDD;             /* InterNational */
		else
                    mark = DDD;             /* National      */
	    }
	    else
		mark = LDD;                 /* Local         */

	    for(; ;)
	    {
					 fread(caller,sizeof(UC),1,pabx_fp);
		if(caller[0] == 0xfd)       /* end of a phone record */
		    break;
	    }

	    if(delay_proc(mark) == FALSE)
		continue;

//          if((temp_list.caller1==0) && (temp_list.caller2==0))
//              continue;

	    just_date();

	    /* compute week day of day1 and day2 */
	    week1 = weekday(temp_list.year1,temp_list.mon1,temp_list.day1);
	    week2 = weekday(temp_list.year2,temp_list.mon2,temp_list.day2);

	    if(mark==IDD)
	    {
		Intern_charge();
		fwrite(&temp_list,sizeof(RECORD_STRUCT),1,in_fp);

					 /* handle cash in pledge */
		if(temp_list.auth_code !=  0xaaaaaa) /* auth*/
		    update_cash(AUTH_CASH);
		else
		{
		    ltoa(temp_list.caller2, user, 10);   /* int to ASCII string */
		    phone = binary_search(user);         /* locate the phone No */
		    if( (phone != NULL) && phone->feeflag[4])  	/* IDD fee */
			update_cash(PHONE_CASH);
		}
	    }
	    else if(mark==DDD)
	    {
		Nation_charge();
		fwrite(&temp_list,sizeof(RECORD_STRUCT),1,na_fp);
		/* handle cash in pledge */
		if(temp_list.auth_code !=  0xaaaaaa) /* auth*/
		    update_cash(AUTH_CASH);
		else
		{
		    ltoa(temp_list.caller2, user, 10);   /* int to ASCII string */
		    phone = binary_search(user);         /* locate the phone No */
		    if( (phone != NULL) && phone->feeflag[3])  	/* DDD fee */
			update_cash(PHONE_CASH);
		 }

	    }
	    else if(mark==LDD)
	    {
		Local_charge();
		fwrite(&temp_list,sizeof(RECORD_STRUCT),1,lo_fp);
		/* handle cash in pledge */
		if(Usr_typ == NORMAL_USR || Ldd_fflg == YES)
		    if(temp_list.auth_code !=  0xaaaaaa) /* auth*/
			update_cash(AUTH_CASH);
		    else
						  {
			ltoa(temp_list.caller2, user, 10);   /* int to ASCII string */
								phone = binary_search(user);         /* locate the phone No */
			if( phone != NULL)
			{
			    UC f1, f2;

			    f1 = IsSpecialCall(temp_list.callee,SpecLen[0],0);
			    f2 = IsSpecialCall(temp_list.callee,SpecLen[1],1);

			    if(   (phone->feeflag[1] && f1)
				||(phone->feeflag[2] && f2)
										  ||(phone->feeflag[0] && !(f1 && f2) ))
				update_cash(PHONE_CASH);
							 }
		    }
	    }
	}     /* end of "while(!feof(pabx_fp))" */
	fclose(pabx_fp);
    }         /* end of "if(pabx_fp != NULL )"  */

    fclose(in_fp);
    fclose(na_fp);
    fclose(lo_fp);

    unload_special_tbl(0);
    unload_special_tbl(1);

    for(mode=0; mode<2; mode++)
	if(Cashflg[mode])
	{
	    save_cash_tbl(mode);
	    unload_cash_tbl(mode);
	}

    unload_rate_tab();
    unload_phone_tbl();

    return;
}

/* function  : transfer telephone records to Intern.tmp, Nation.tmp and
 *             Local.tmp respectively, for immediate method
 * called by : take_immediate_record()
 * date      : 1993.9.28
 */
UC imm_record_transfer(UC port)
{
   int   i, k, mark;
   UC    flag, phone_no[10];
   char  auth_name[9];
   char *a_name="    ";
   RATE_STRUCT huge *rate_tmp;
   PHONE_STRUCT *phone;
   UC    user[10];
   UI    SpecLen[2];
   UC    f1, f2;
   UC    tmp[20], err;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色88888久久久久久影院野外| 中文字幕欧美三区| 一区二区三区在线播放| 不卡视频在线观看| 亚洲欧美综合色| a在线播放不卡| 亚洲乱码国产乱码精品精可以看 | 91尤物视频在线观看| 亚洲天堂精品视频| 欧美视频在线一区| 蜜桃av噜噜一区| 国产免费成人在线视频| 色伊人久久综合中文字幕| 亚洲午夜影视影院在线观看| 欧美一区二区三区啪啪| 国模少妇一区二区三区| 国产精品电影院| 欧美日韩国产一级二级| 韩日精品视频一区| 亚洲欧美色一区| 欧美人成免费网站| 粉嫩一区二区三区在线看| 日韩理论电影院| 日韩一区二区在线免费观看| 国产aⅴ综合色| 天天影视涩香欲综合网| 国产欧美综合色| 欧洲视频一区二区| 国产乱子伦视频一区二区三区| 自拍偷拍亚洲欧美日韩| 日韩精品一区二区三区蜜臀| 99麻豆久久久国产精品免费| 日韩精品高清不卡| 自拍偷拍亚洲激情| 日韩免费电影网站| 91成人网在线| 国产99久久久久| 免费一区二区视频| 亚洲另类色综合网站| 久久综合99re88久久爱| 欧美片在线播放| 91亚洲国产成人精品一区二区三| 蜜桃传媒麻豆第一区在线观看| 亚洲女同一区二区| 国产日产精品1区| 日韩视频国产视频| 欧美视频你懂的| 97se亚洲国产综合自在线| 极品美女销魂一区二区三区| 亚洲小少妇裸体bbw| 亚洲丝袜制服诱惑| 欧美激情在线看| 精品裸体舞一区二区三区| 欧美日韩国产色站一区二区三区| 国产成人综合精品三级| 免费精品99久久国产综合精品| 国产精品国产三级国产aⅴ中文 | 国产亚洲精品资源在线26u| 欧美日韩在线一区二区| 成人av资源在线观看| 久久99国产精品麻豆| 石原莉奈一区二区三区在线观看 | 欧美日本在线视频| 日本乱人伦一区| 99riav久久精品riav| 国产成人午夜高潮毛片| 国产一区欧美日韩| 久久爱www久久做| 蜜臀av性久久久久蜜臀aⅴ流畅| 亚洲国产va精品久久久不卡综合 | 亚洲成av人片在线| 夜夜爽夜夜爽精品视频| 亚洲精品伦理在线| 玉足女爽爽91| 亚洲曰韩产成在线| 亚洲三级小视频| 亚洲日本丝袜连裤袜办公室| 中文字幕在线不卡国产视频| 国产精品剧情在线亚洲| 国产精品久久精品日日| 亚洲欧洲一区二区三区| 亚洲美女在线一区| 亚洲午夜日本在线观看| 无吗不卡中文字幕| 日本不卡123| 精品一区二区三区在线观看| 黄网站免费久久| 高清成人在线观看| 91在线视频在线| 欧美色综合天天久久综合精品| 欧美亚洲国产怡红院影院| 在线观看日韩电影| 欧美嫩在线观看| 欧美成人伊人久久综合网| 精品国产成人在线影院| 欧美国产日韩在线观看| 亚洲婷婷综合色高清在线| 亚洲一区二区偷拍精品| 日韩激情视频网站| 国产乱子轮精品视频| 99视频在线精品| 欧美高清一级片在线| 精品国产伦一区二区三区观看体验| 久久精品日产第一区二区三区高清版| 国产亲近乱来精品视频| 一区二区三区在线观看视频| 日本亚洲一区二区| 国产成人在线影院| 在线观看91精品国产入口| 欧美大片一区二区| 一区精品在线播放| 久久国产乱子精品免费女| 成人黄色在线网站| 宅男噜噜噜66一区二区66| 国产午夜精品一区二区三区视频| 亚洲免费av观看| 久久91精品国产91久久小草 | 色网综合在线观看| 日韩一级免费一区| ...xxx性欧美| 精品中文字幕一区二区小辣椒| 99久久精品国产毛片| 日韩一级成人av| 亚洲私人黄色宅男| 国精产品一区一区三区mba视频| 91麻豆视频网站| 久久青草国产手机看片福利盒子| 一区二区三区国产豹纹内裤在线| 国产在线一区观看| 欧美欧美午夜aⅴ在线观看| 欧美国产日韩在线观看| 蜜臀久久99精品久久久久宅男| 不卡的av在线| 精品成人在线观看| 亚洲电影第三页| 成人精品在线视频观看| 日韩美女在线视频| 亚洲国产另类精品专区| av一区二区不卡| 久久综合国产精品| 久久不见久久见免费视频1| 欧美专区日韩专区| 国产精品嫩草影院com| 毛片av一区二区| 欧美日韩一二三| 亚洲欧美日韩电影| 成人av电影在线| 久久精品亚洲乱码伦伦中文| 免费av成人在线| 欧美三级中文字| 一区二区理论电影在线观看| 不卡大黄网站免费看| 国产欧美精品区一区二区三区| 另类人妖一区二区av| 91精品在线麻豆| 亚洲超碰97人人做人人爱| 色94色欧美sute亚洲线路一久| 久久久精品免费网站| 久99久精品视频免费观看| 欧美一区二区三区播放老司机| 一区二区三区四区蜜桃| 91久久精品国产91性色tv| 中文字幕亚洲欧美在线不卡| 成人激情动漫在线观看| 中文字幕一区二区三| 99国内精品久久| 1024成人网| 91看片淫黄大片一级在线观看| 中文字幕一区视频| 一本一本大道香蕉久在线精品| 亚洲欧美日韩综合aⅴ视频| 91蜜桃传媒精品久久久一区二区| 亚洲欧美乱综合| 欧美在线免费播放| 婷婷国产在线综合| 日韩一区二区在线观看视频| 麻豆精品国产91久久久久久| 精品久久久久av影院| 国产精品一区一区三区| 国产精品美女久久久久高潮| 91在线观看一区二区| 一区二区三区在线观看网站| 欧美老女人在线| 久久se这里有精品| 国产三级精品视频| 91视视频在线观看入口直接观看www | 99在线精品一区二区三区| 91免费国产在线观看| 亚洲欧洲日韩在线| 狠狠v欧美v日韩v亚洲ⅴ| 91精品国产综合久久婷婷香蕉| 无吗不卡中文字幕| 2021久久国产精品不只是精品| 国产精品一区二区在线看| 中文字幕在线观看一区| 欧美日韩国产综合一区二区| 久久机这里只有精品| 中文无字幕一区二区三区| 99久久99久久久精品齐齐| 日韩激情av在线|