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

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

?? a2b_entity_create_invoice.php

?? asterisk用 的voip記費軟件
?? PHP
字號:
<?phpinclude ("../lib/defines.php");include ("../lib/module.access.php");include ("../lib/Form/Class.FormHandler.inc.php");include ("./form_data/FG_var_view_invoice.inc");include ("../lib/smarty.php");include ("../lib/invoice.php");if (! has_rights (ACX_BILLING)){ 	Header ("HTTP/1.0 401 Unauthorized");	Header ("Location: PP_error.php?c=accessdenied");	   	die();	   }getpost_ifset(array('tocustomer','forcustomer','sendemail'));$HD_Form -> setDBHandler (DbConnect());$verbose_level = 0;$groupcard = 100;if($forcustomer != ""){	$instance_table = new Table();	$currencies_list = get_currencies($HD_Form ->DBHandle);		// CHECK COUNT OF CARD ON WHICH APPLY THE SERVICE	if($tocustomer == "")		{		$QUERY = "SELECT count(*) FROM cc_card WHERE ID = '$forcustomer' ";	}	else	{		$QUERY = "SELECT count(*) FROM cc_card WHERE ID >= '$forcustomer' AND ID <= '$tocustomer'";	}		$result = $instance_table -> SQLExec ($HD_Form ->DBHandle, $QUERY);	$nb_card = $result[0][0];	$nbpagemax = (intval($nb_card/$groupcard));		if ($verbose_level>=1) echo "===> NB_CARD : $nb_card - NBPAGEMAX:$nbpagemax\n";		if (!($nb_card>0)){		if ($verbose_level>=1) echo "[No card to create the Invoice]\n";				exit();	}				for ($page = 0; $page <= $nbpagemax; $page++) 	{		if ($verbose_level >= 1)  echo "$page <= $nbpagemax \n";		$Query_Customers = "SELECT id, creationdate, firstusedate, expirationdate, enableexpire, expiredays, username, vat, invoiceday FROM cc_card ";		if ($tocustomer == "")		{			$Query_Customers .= " WHERE ID = '$forcustomer' ";		}		else		{			$Query_Customers .= "  WHERE ID >= '$forcustomer' AND ID <= '$tocustomer'";		}		if ($A2B->config["database"]['dbtype'] == "postgres")		{			$Query_Customers .= " LIMIT $groupcard OFFSET ".$page*$groupcard;		}		else		{			$Query_Customers .= " LIMIT ".$page*$groupcard.", $groupcard";		}				$resmax = $instance_table -> SQLExec ($HD_Form ->DBHandle, $Query_Customers);				if (is_array($resmax)){			$numrow = count($resmax);			if($verbose_level >= 2) print_r($resmax[0]);		}else{			$numrow = 0;		}		if($verbose_level >= 1) echo "\n Total Customers Found: ".$numrow;				if ($numrow == 0) {			if ($verbose_level>=1) echo "\n[No card to create the Invoice]\n";						exit();					}else{						foreach($resmax as $Customer){													// Here we have to check for the Last Invoice date to set the Cover Start date. 				// if a user dont have a Last invocie then we have to Set the Cover Start date to it Creation Date.				$query_billdate = "SELECT CASE WHEN max(cover_enddate) is NULL THEN '0001-01-01 00:01:00' ELSE max(cover_enddate) END FROM cc_invoices WHERE cardid='$Customer[0]'";				if ($verbose_level>=1) echo "\nQUERY_BILLDATE = $query_billdate";								$resdate = $instance_table -> SQLExec ($HD_Form ->DBHandle, $query_billdate);				if($verbose_level >= 2) print_r($resdate);				if (is_array($resdate) && count($resdate)>0 && $result[0][0] != "0001-01-01 00:01:00"){					// Customer Last Invoice Date					$cover_startdate = $resdate[0][0];				} else {					// Customer Creation Date								$cover_startdate = $Customer[1];				}				if($verbose_level >= 1)	echo "\n Cover Start Date for '$Customer[6]': ".$cover_startdate;								$FG_TABLE_CLAUSE = " t1.username='$Customer[6]' AND t1.starttime > '$cover_startdate'";												// init totalcost				$totalcost = 0;				$totaltax = 0;				$totalcall = 0;				$totalminutes = 0;				$totalcharge = 0;								//************************************* CALLS SECTION *************************************************				//$Query_Destinations = "SELECT destination, sum(t1.sessiontime) AS calltime, sum(t1.sessionbill) AS cost, count(*) AS nbcall FROM cc_call t1 WHERE (t1.sipiax<>2 AND t1.sipiax<>3) AND ".$FG_TABLE_CLAUSE." GROUP BY destination";						$Query_Destinations = "SELECT destination, sum(t1.sessiontime) AS calltime, sum(t1.sessionbill) AS cost, count(*) AS nbcall FROM cc_call t1 WHERE ".									  $FG_TABLE_CLAUSE." GROUP BY destination";				$list_total_destination = $instance_table -> SQLExec ($HD_Form ->DBHandle, $Query_Destinations);				if (is_array($list_total_destination)){					$num = count($list_total_destination);				}else{					$num = 0;				}								if($verbose_level >= 1){					echo "\n Query_Destinations = $Query_Destinations";					echo "\n Number of Destinatios for '$Customer[6]' Found: ".$num;				}								//Get the calls destination wise and calculate total cost							if (is_array($list_total_destination) && count($list_total_destination) > 0){					foreach ($list_total_destination as $data){						$totalcall+=$data[3];						$totalminutes+=$data[1];						$totalcost+=$data[2];					}				}				if($verbose_level >= 1){					echo "\n AFTER DESTINATION : totalcall = $totalcall - totalminutes = $totalminutes - totalcost = $totalcost ";				}											//************************************* CHARGE SECTION *************************************************				// chargetype : 1 - connection charge for DID setup, 2 - Montly charge for DID use, 3 - Subscription fee, 4 - Extra Charge, etc...				$FG_TABLE_CLAUSE = " id_cc_card='$Customer[0]' AND creationdate > '$cover_startdate'";				$QUERY_CHARGE = "SELECT id, id_cc_card, iduser, creationdate, amount, chargetype, description, id_cc_did, currency, id_cc_subscription_fee FROM cc_charge".								" WHERE $FG_TABLE_CLAUSE";				$list_total_charge = $instance_table -> SQLExec ($HD_Form ->DBHandle, $QUERY_CHARGE, 1);				$num  = 0;								$num = count($list_total_charge);				if($verbose_level >= 1){					echo "\n QUERY_CHARGE = $QUERY_CHARGE";					echo "\n Number of Charge for '$Customer[6]' Found: ".$num;				}								//Get the calls destination wise and calculate total cost							if (is_array($list_total_charge) && count($list_total_charge) > 0){					foreach ($list_total_charge as $data){						$charge_amount = $data[4];						$charge_currency = $data[8];						$base_currency = $A2B->config['global']['base_currency'];						$charge_converted = convert_currency ($currencies_list, $charge_amount, strtoupper($charge_currency), strtoupper($base_currency));						if($verbose_level >= 1){							echo "\n charge_amount = $charge_amount - charge_currency = $charge_currency ".								 " - charge_converted=$charge_converted - base_currency=$base_currency";						}						$totalcharge+=1;						$totalcost+=$charge_converted;					}				}				if($verbose_level >= 1){					echo "\n AFTER DESTINATION : totalcharge = $totalcharge - totalcost = $totalcost";				}								//************************************* INSERT INVOICE *************************************************							if ($Customer[7] > 0 && $totalcost > 0){					$totaltax = ($totalcost / 100) * $Customer[7];				}								// Here we have to Create a Insert Statement to insert Records into the Invoices Table.				$Query_Invoices = "INSERT INTO cc_invoices (cardid, orderref, invoicecreated_date, cover_startdate, cover_enddate, amount, tax, total, invoicetype,".					"filename) VALUES ('$Customer[0]', NULL, NOW(), '$cover_startdate', NOW(), $totalcost, $totaltax, $totalcost + $totaltax, NULL, NULL)";				$instance_table -> SQLExec ($HD_Form ->DBHandle, $Query_Invoices);				if($sendemail =="Yes")				{					$QUERY = "Select Max(id) from cc_invoices";					$result = $instance_table -> SQLExec ($HD_Form ->DBHandle, $QUERY);					$invoice_id = $result[0][0];					$ok = EmailInvoice($invoice_id, 2);					$issent = 0;					if($ok)					{						$issent = 1;					}					$currentdate = date("Y-m-d h:i:s");					$QUERY = "INSERT INTO cc_invoice_history (invoiceid,invoicesent_date,invoicestatus) VALUES('$invoice_id', '$currentdate', '$issent')";					$instance_table -> SQLExec ($HD_Form ->DBHandle, $QUERY);				}								if($verbose_level >= 1)				{					echo "\n Total Cost for '$Customer[0]': ".$totalcost;					echo "\n Query_Invoices=$Query_Invoices \n";					echo "\n ################################################################################# \n\n";				}							}// END foreach($resmax as $Customer)		}	}			//End of ALL}$HD_Form -> init();if (cardid!='' || !is_null($cardid)){		$HD_Form -> FG_EDITION_CLAUSE = str_replace("%id", "$cardid", $HD_Form -> FG_EDITION_CLAUSE);	}$HD_Form -> FG_OTHER_BUTTON1 = false;$HD_Form -> FG_OTHER_BUTTON2 = false;if (!isset($form_action))  $form_action="list"; //ask-addif (!isset($action)) $action = $form_action;$list = $HD_Form -> perform_action($form_action);$smarty->display('main.tpl');// #### TOP SECTION PAGE$HD_Form -> create_toppage ($form_action);// #### CREATE FORM OR LIST//$HD_Form -> CV_TOPVIEWER = "menu";if (strlen($_GET["menu"])>0) $_SESSION["menu"] = $_GET["menu"];// #### HELP SECTIONecho $CC_help_money_situation;?><br><form name="theForm" action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST"><table align="center"  class="bgcolor_001" border="0" width="55%">        <tbody><tr>	          <td align="left" width="35%">		<?php echo gettext("FROM CARD ID");?>:					  		</td>				<td width="65%" align="left" valign="bottom"><INPUT TYPE="text" NAME="forcustomer" value="<?php echo $forcustomer?>" class="form_input_text">						<a href="#" onclick="window.open('A2B_entity_card.php?popup_select=1&popup_formname=theForm&popup_fieldname=forcustomer' , 'CardNumberSelection','scrollbars=1,width=550,height=330,top=20,left=100,scrollbars=1');"><img src="<?php echo Images_Path;?>/icon_arrow_orange.gif"></a>         </td>	        </tr>          <tr>            <td align="left"><?php echo gettext("TO CARD ID");?>:</td>            <td align="left" valign="bottom"><INPUT TYPE="text" NAME="tocustomer" value="<?php echo $tocustomer?>" class="form_input_text">						<a href="#" onclick="window.open('A2B_entity_card.php?popup_select=1&popup_formname=theForm&popup_fieldname=tocustomer' , 'CardNumberSelection','scrollbars=1,width=550,height=330,top=20,left=100,scrollbars=1');"><img src="<?php echo Images_Path;?>/icon_arrow_orange.gif"></a></td>          </tr>          <tr>            <td align="left"><?php echo gettext("EMAIL TO CUSTOMER");?>:</td>            <td align="left" valign="bottom"><input type="radio" name="sendemail" value="Yes"><?php echo gettext("Yes");?>&nbsp;&nbsp;<input type="radio" name="sendemail" value="No" checked><?php echo gettext("No");?></td>          </tr>          <tr>            <td align="left">&nbsp;</td>            <td align="left" valign="bottom"><input name="submit" type="submit" class="form_input_button"  value=" GENERATE INVOICE "></td>          </tr>      </tbody></table>	   </form><br>	  <?php	$HD_Form -> create_form ($form_action, $list, $id=null);?>	  <br><?php$smarty->display('footer.tpl');?>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩免费观看高清完整版在线观看| 7777精品伊人久久久大香线蕉完整版 | 亚洲香肠在线观看| 日本伊人精品一区二区三区观看方式| 国内精品写真在线观看| 在线观看免费一区| 久久久久久久电影| 老司机午夜精品99久久| 欧美这里有精品| 亚洲视频小说图片| 大胆欧美人体老妇| 久久婷婷成人综合色| 日韩精品乱码免费| 欧美日韩一区中文字幕| 综合精品久久久| 国产成人日日夜夜| 精品国产免费人成电影在线观看四季 | 久久夜色精品国产噜噜av| 亚洲国产精品久久久久婷婷884| 成人午夜激情视频| 久久日韩精品一区二区五区| 男人的天堂久久精品| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 国产99久久久国产精品潘金网站| 欧美一级久久久久久久大片| 午夜国产精品影院在线观看| 91久久精品国产91性色tv| 国产精品卡一卡二卡三| 福利一区福利二区| 亚洲欧美日韩国产手机在线| 国产福利视频一区二区三区| 久久综合久久综合久久| 国精品**一区二区三区在线蜜桃| 欧美成人女星排名| 国产精品影视在线| 国产亚洲视频系列| 粉嫩久久99精品久久久久久夜| 国产亚洲欧美色| 成人黄色软件下载| 亚洲男人的天堂在线观看| 不卡一区在线观看| 亚洲女同女同女同女同女同69| 色哟哟欧美精品| 午夜视频一区在线观看| 这里只有精品免费| 国产一区视频网站| 国产午夜亚洲精品羞羞网站| 成人h动漫精品一区二区| 中文字幕欧美日韩一区| 成人小视频在线| 亚洲免费观看在线视频| 欧美日韩久久一区| 黄色小说综合网站| 亚洲欧洲综合另类在线| 欧美日韩精品是欧美日韩精品| 青青青伊人色综合久久| 国产欧美日韩精品一区| 欧美在线free| 麻豆精品在线播放| 亚洲三级免费电影| 日韩精品一区二区三区四区视频| 国产美女精品人人做人人爽| 免费高清在线一区| 国产亚洲欧美日韩俺去了| 91在线视频播放| 日韩av一区二区在线影视| 精品久久久久av影院| 91美女视频网站| 久久99国产乱子伦精品免费| 国产精品毛片久久久久久久| 91激情五月电影| 激情另类小说区图片区视频区| 国产精品天天看| 91麻豆精品国产91久久久使用方法 | 久久久久99精品一区| 欧美性大战xxxxx久久久| 国产一区视频网站| 亚洲成人先锋电影| 中文一区二区完整视频在线观看| 欧美日韩国产成人在线91| 国产精品香蕉一区二区三区| 午夜免费久久看| 国产精品麻豆欧美日韩ww| 日韩午夜av一区| 欧洲精品在线观看| 99精品国产91久久久久久| 激情久久久久久久久久久久久久久久| 悠悠色在线精品| 国产精品婷婷午夜在线观看| 精品国内二区三区| 欧美性猛交xxxxxxxx| k8久久久一区二区三区| 激情偷乱视频一区二区三区| 午夜久久电影网| 亚洲人成在线观看一区二区| 久久综合色8888| 日韩一级免费一区| 欧美午夜在线观看| 9i在线看片成人免费| 懂色av一区二区三区免费看| 青青草伊人久久| 日韩中文欧美在线| 亚洲在线观看免费视频| 中文字幕一区在线| 国产精品久久久久久久久免费丝袜 | 成人黄色在线视频| 成人免费视频国产在线观看| 国产一区二区三区四| 久久99精品国产麻豆婷婷| 99久久精品国产导航| 国产精品一区二区在线观看网站| 另类的小说在线视频另类成人小视频在线| 艳妇臀荡乳欲伦亚洲一区| 亚洲视频狠狠干| 日韩毛片高清在线播放| 亚洲欧美电影院| 中文字幕一区免费在线观看| 综合久久给合久久狠狠狠97色| 中文乱码免费一区二区| 欧美极品aⅴ影院| 国产精品国产三级国产aⅴ入口| 国产精品久久久久久久久晋中| 国产午夜亚洲精品不卡| 久久久99精品免费观看不卡| 久久品道一品道久久精品| 久久网站最新地址| 中文字幕一区二区三区蜜月| 最好看的中文字幕久久| 亚洲国产成人va在线观看天堂| 亚洲福利视频导航| 裸体一区二区三区| 狠狠色丁香久久婷婷综合丁香| 国产精品一区二区不卡| 91色乱码一区二区三区| 欧美日韩精品免费观看视频| 精品成人在线观看| 中文字幕中文乱码欧美一区二区 | 99re6这里只有精品视频在线观看 99re8在线精品视频免费播放 | 色系网站成人免费| 欧美绝品在线观看成人午夜影视| 欧美美女直播网站| 久久婷婷国产综合精品青草| 亚洲天堂网中文字| 免费视频一区二区| 国产成人av一区| 欧美在线啊v一区| 久久综合狠狠综合久久激情| 亚洲欧美日韩中文播放| 日韩中文字幕不卡| 高潮精品一区videoshd| 欧美色电影在线| 久久亚区不卡日本| 午夜激情综合网| 岛国一区二区在线观看| 欧美欧美欧美欧美| 日韩美女视频19| 国内成人自拍视频| 欧美系列亚洲系列| 国产精品午夜免费| 裸体在线国模精品偷拍| 91片在线免费观看| 久久综合成人精品亚洲另类欧美| 亚洲精品国产精华液| 国产精品亚洲成人| 欧美一区在线视频| 亚洲女人小视频在线观看| 国模冰冰炮一区二区| 欧美久久一二区| 中文字幕在线一区| 国产一区二区主播在线| 777a∨成人精品桃花网| 亚洲精品大片www| 国产福利91精品| 日韩精品一区二区三区视频| 亚洲国产精品久久一线不卡| 99精品视频一区二区| 国产亚洲自拍一区| 免费久久99精品国产| 欧美日韩黄色一区二区| 亚洲视频1区2区| zzijzzij亚洲日本少妇熟睡| 久久一区二区三区四区| 日产精品久久久久久久性色| 在线观看三级视频欧美| 亚洲欧美一区二区不卡| 成人在线视频首页| 久久精品视频在线看| 久久国产尿小便嘘嘘| 欧美久久久久久蜜桃| 亚洲成av人片一区二区三区| 99国产精品一区| 国产精品乱码一区二三区小蝌蚪| 国产在线视频一区二区三区| 精品免费99久久| 极品少妇xxxx偷拍精品少妇| 日韩免费在线观看| 国产一区二区电影| 欧美激情自拍偷拍| jlzzjlzz欧美大全| 亚洲免费在线观看视频|