Jelajahi Sumber

微信通知相关功能

caipin 7 tahun lalu
induk
melakukan
aeb7999ce8

+ 30 - 0
global/js/invoice.js

@@ -633,6 +633,36 @@ $(function() {
 	});
 	
 	
+	$("select[node-notification]").change(function(){
+		var notificationType=$(this).attr('data');
+		var notificationValue=$(this).val();
+		
+		var url="/ajaxSetNotificationConf";
+		$.ajax({
+			url:url,
+			type:"post",
+			cache:false,
+			dataType:"json",
+			data:{
+				notificationType:notificationType,
+				notificationValue:notificationValue
+			},
+			global:true,
+			success:function(data){
+				if(data.status!=1){
+					$("#"+data.msgType+"Msg").addClass("colRed");
+					$("#"+data.msgType+"Msg").html("设置失败").show(300).delay(3000).hide(300);
+				}else{
+					$("#"+data.msgType+"Msg").addClass("colGreen");
+					$("#"+data.msgType+"Msg").html("设置成功").show(300).delay(3000).hide(300); 
+				}
+			},
+			error:function(err){
+				
+			}
+		});
+		
+	});
 	
 	
 })

+ 3 - 0
protected/config/routes.conf.php

@@ -515,6 +515,9 @@ $route['*']['/importInvoiceDo'] = array('InvoiceController', 'importInvoiceDo');
 $route['*']['/importInvoiceReceivables'] = array('InvoiceController', 'importInvoiceReceivables');
 $route['*']['/importInvoiceReceivablesDo'] = array('InvoiceController', 'importInvoiceReceivablesDo');
 
+$route['*']['/notificationConf'] = array('MainController', 'notificationConf');
+$route['*']['/ajaxSetNotificationConf'] = array('MainController', 'ajaxSetNotificationConf');
+
 
 //假期管理
 $route['*']['/myList'] = array('HolidayController', 'myList');

+ 3 - 0
protected/controller/AdminController.php

@@ -978,6 +978,9 @@ class AdminController extends DooController {
 		}
 		return "/adminInvoice";
 	}
+	
+	
+	
 	function ajaxRoleStaff() {
 		$name = $this->get_args ( 'name' ) ? $this->get_args ( 'name' ) : "";
 		

+ 275 - 136
protected/controller/InvoiceController.php

@@ -37,21 +37,21 @@ class InvoiceController extends DooController {
 					'mold' => 'ordinary' 
 			) );
 			
-			//删除审批人后-加入权限问题-暂时关闭
+			// 删除审批人后-加入权限问题-暂时关闭
 			$fileInvoice = file_get_contents ( "protected/config/invoice/invoice.ini" );
-			$fiML=json_decode($fileInvoice,true);
-			if (empty($fiML))
-				$fiML=array();
-			foreach ($fiML as $key=>$value){
-			$sidList=explode(',',$value);
-			foreach ($sidList as $k=>$v){
-			if ($v==$sid){
-			array_push ( $moldList, array (
-			'mold' => $key
-			) );
-			break;
-			}
-			}
+			$fiML = json_decode ( $fileInvoice, true );
+			if (empty ( $fiML ))
+				$fiML = array ();
+			foreach ( $fiML as $key => $value ) {
+				$sidList = explode ( ',', $value );
+				foreach ( $sidList as $k => $v ) {
+					if ($v == $sid) {
+						array_push ( $moldList, array (
+								'mold' => $key 
+						) );
+						break;
+					}
+				}
 			}
 			
 			foreach ( $moldList as $value ) {
@@ -95,19 +95,48 @@ class InvoiceController extends DooController {
 	}
 	function testSend() {
 		
-		// $msTouser='caipin|outaozhen';
+		// 测试根据规则发送信息 普通发送
+		/*
+		 * $pendingApprovalsSid = 41; Doo::loadModel ( 'staff' ); $staff = new staff (); $username2 = $staff->getOne ( array ( 'select' => 'wxid', 'where' => 'sid=' . $pendingApprovalsSid, 'asArray' => TRUE ) ); // 发送微信审批通知 $title2 = '[通知]用户提交了一条开票申请,快到“我的发票”中查看,给用户确认审批。'; $this->msgSend ( '', $title2, '', $username2 ['wxid'], $pendingApprovalsSid, 'approval' );
+		 */
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		$toparty = $this->getToparty ( '广东办' );
+		$wxList = array ();
+		if (! empty ( $toparty )) {
+			$userList = $this->getUserByToparty ( $toparty );
+			$userCon = implode ( ',', $userList );
+			// echo $userCon;
+			$sidList = $staff->getStaffByWxid ( $userCon );
+			foreach ( $sidList as $key => $value ) {
+				$falg = $this->isSendNotification ( $value ['sid'], 'receivables' );
+				if ($falg) {
+					array_push ( $wxList, $value ['wxid'] );
+				}
+			}
+			$wxString = implode ( '|', $wxList );
+			print_r ( $wxList );
+			echo $wxString;
+		}
 		
+		// 测试发送
+		/*
+		 * //$toparty = $this->getWxidByCategory( $receivablesCategory [1] ); $toparty = $this->getToparty ( $receivablesCategory [1] ); $msg = '[通知]财务录入了一笔待认领款项,快到“我的收款”中查看,确认是否是您的客户给您打款了。'; if ($toparty != 0) $this->msgSendToparty ( $msg, '', '', $toparty, 'text' );
+		 */
 		
-		$toparty = $this->getToparty ( $receivablesCategory [1] );
-		$title2 = '[通知]财务录入了一笔待认领款项,快到“我的收款”中查看,确认是否是您的客户给您打款了。';
+		// print_r ( $userList );
+		
+		// $msTouser='caipin|outaozhen';
+		// $toparty = $this->getToparty ( $receivablesCategory [1] );
+		// $title2 = '[通知]财务录入了一笔待认领款项,快到“我的收款”中查看,确认是否是您的客户给您打款了。';
 		
-		//$hfreult = $this->msgSend ( '', $title2, '', 'outaozhen' );
+		// $hfreult = $this->msgSend ( '', $title2, '', 'outaozhen' );
 		
 		// $toparty= $this->getToparty('广东办');
-		//$msg = '[通知]财务录入了一笔待认领款项,快到“我的收款”中查看,确认是否是您的客户给您打款了。';
-		//$toparty = 26;
+		// $msg = '[通知]财务录入了一笔待认领款项,快到“我的收款”中查看,确认是否是您的客户给您打款了。';
+		// $toparty = 26;
 		// $msg = '';
-		 //$url = 'http://m.cld.smartcost.com.cn/invoicePrintDetail/1.html';
+		// $url = 'http://m.cld.smartcost.com.cn/invoicePrintDetail/1.html';
 		// $hfreult = $this->msgSendToparty ( $msg, '', '', $toparty,'text' );
 	}
 	function invoice() {
@@ -126,8 +155,6 @@ class InvoiceController extends DooController {
 		
 		$isMonth = $invoiceStatistics->getStatisticsByMonth ();
 		
-		
-		
 		$year = date ( "Y" );
 		$tmp_date = date ( "Ym" );
 		$tmp_year = substr ( $tmp_date, 0, 4 );
@@ -280,7 +307,7 @@ class InvoiceController extends DooController {
 					$moldManage [$value ['mold']] = $value ['staffList'];
 			}
 			
-			$pendingApprovalsSid=current ( $invoiceManageDetail ['staffList'] ) [0];
+			$pendingApprovalsSid = current ( $invoiceManageDetail ['staffList'] ) [0];
 			
 			$item = array (
 					'cid' => $cid,
@@ -406,18 +433,17 @@ class InvoiceController extends DooController {
 			);
 			$invoiceOperationLog->setInvoiceOperationLog ( $item );
 			
-			
 			Doo::loadModel ( 'staff' );
 			$staff = new staff ();
 			$username2 = $staff->getOne ( array (
 					'select' => 'wxid',
 					'where' => 'sid=' . $pendingApprovalsSid,
-					'asArray' => TRUE
+					'asArray' => TRUE 
 			) );
-			//发送微信审批通知
+			// 发送微信审批通知
 			$title2 = '[通知]用户提交了一条开票申请,快到“我的发票”中查看,给用户确认审批。';
 			
-			$this->msgSend ( '', $title2, '', $username2 ['wxid'] );
+			$this->msgSend ( '', $title2, '', $username2 ['wxid'], $pendingApprovalsSid, 'approval' );
 		}
 		
 		return "/invoice";
@@ -641,13 +667,14 @@ class InvoiceController extends DooController {
 		Doo::loadModel ( 'invoiceTraining' );
 		$invoiceTraining = new invoiceTraining ();
 		
-		$itList=$invoiceTraining->getInvoiceTrainingByStatus(0);
-		
+		$itTodoList = $invoiceTraining->getInvoiceTrainingByTodo ();
+		$itedList = $invoiceTraining->getInvoiceTrainingByStatus ( 2 );
 		$category = $lCategory->getCategory ();
 		
-		//print_r($itList);
+		// print_r($itList);
 		
-		$this->data['itList']=$itList;
+		$this->data ['itTodoList'] = $itTodoList;
+		$this->data ['itedList'] = $itedList;
 		$this->data ['category'] = $category;
 		
 		$this->data ['memu'] = "invoice";
@@ -660,7 +687,6 @@ class InvoiceController extends DooController {
 	 * 创建培训班
 	 */
 	function invoiceTrainingAdd() {
-		
 		$cid = $this->get_args ( 'cid' ) && is_numeric ( $this->get_args ( 'cid' ) ) ? $this->get_args ( 'cid' ) : 0;
 		$trainName = $this->get_args ( 'trainName' ) ? $this->get_args ( 'trainName' ) : "";
 		$trainDate = $this->get_args ( 'trainDate' ) ? $this->get_args ( 'trainDate' ) : "";
@@ -668,7 +694,7 @@ class InvoiceController extends DooController {
 		if (empty ( $this->staff [0] ))
 			die ( 'illegal request' );
 		
-		if (! empty ( $cid ) && ! empty ( $trainName ) && ! empty ( $trainDate ) ) {
+		if (! empty ( $cid ) && ! empty ( $trainName ) && ! empty ( $trainDate )) {
 			
 			Doo::loadModel ( 'invoiceTraining' );
 			$invoiceTraining = new invoiceTraining ();
@@ -687,41 +713,55 @@ class InvoiceController extends DooController {
 					'trainName' => $trainName,
 					'trainDate' => $trainDate,
 					
-					'creator' => $this->staff [0]['sid'],
-					'creatorDate' => date ( "Y-m-d H:i:s" )
+					'creator' => $this->staff [0] ['sid'],
+					'creatorDate' => date ( "Y-m-d H:i:s" ) 
 			);
-			$itid = $invoiceTraining->addInvoiceTraining( $item );
+			$itid = $invoiceTraining->addInvoiceTraining ( $item );
 			
-			//统计相关
+			// 统计相关
 			
-// 			$item = array (
-// 					'date' => date ( "Y-m-d H:i:s" ),
-// 					'operation' => "创建",
-// 					'status' => 1,
-// 					'img' => $this->staff [0] ['avatar'],
-// 					'username' => $this->staff [0] ['username'],
-// 					'uid' => $this->staff [0] ['sid'],
-// 					'category' => $this->staff [0] ['category'],
-// 					'iid' => $iid 
-// 			);
-// 			$invoiceOperationLog->setInvoiceOperationLog ( $item );
-// 			$item = array (
-// 					'date' => date ( "Y-m-d H:i:s" ),
-// 					'operation' => "提交审批",
-// 					'status' => 1,
-// 					'img' => $this->staff [0] ['avatar'],
-// 					'username' => $this->staff [0] ['username'],
-// 					'uid' => $this->staff [0] ['sid'],
-// 					'category' => $this->staff [0] ['category'],
-// 					'iid' => $iid 
-// 			);
-// 			$invoiceOperationLog->setInvoiceOperationLog ( $item );
+			// $item = array (
+			// 'date' => date ( "Y-m-d H:i:s" ),
+			// 'operation' => "创建",
+			// 'status' => 1,
+			// 'img' => $this->staff [0] ['avatar'],
+			// 'username' => $this->staff [0] ['username'],
+			// 'uid' => $this->staff [0] ['sid'],
+			// 'category' => $this->staff [0] ['category'],
+			// 'iid' => $iid
+			// );
+			// $invoiceOperationLog->setInvoiceOperationLog ( $item );
+			// $item = array (
+			// 'date' => date ( "Y-m-d H:i:s" ),
+			// 'operation' => "提交审批",
+			// 'status' => 1,
+			// 'img' => $this->staff [0] ['avatar'],
+			// 'username' => $this->staff [0] ['username'],
+			// 'uid' => $this->staff [0] ['sid'],
+			// 'category' => $this->staff [0] ['category'],
+			// 'iid' => $iid
+			// );
+			// $invoiceOperationLog->setInvoiceOperationLog ( $item );
 		}
 		
 		return "/invoiceTraining";
 	}
 	
 	/**
+	 * 删除培训班
+	 */
+	function invoiceTrainingDelDo(){
+		$itid = $this->get_args ( 'trainingKey' ) ? $this->get_args ( 'trainingKey' ) : "";
+		if (!empty($itid)){
+			Doo::loadModel ( 'invoiceTraining' );
+			$invoiceTraining = new invoiceTraining ();
+			
+			
+		}
+		return "/invoiceTraining";
+	}
+	
+	/**
 	 * 终止开票
 	 */
 	function invoiceDroppedDo() {
@@ -1221,7 +1261,7 @@ class InvoiceController extends DooController {
 			
 			$msg = '';
 			$url = 'http://m.cld.smartcost.com.cn/invoicePrintDetail/' . $XDeode->encode ( $invoicePrintDetail ['iid'] ) . '.html';
-			$hfreult = $this->msgSend ( $msg, $title2, $url, $username2 ['wxid'] );
+			$hfreult = $this->msgSend ( $msg, $title2, $url, $username2 ['wxid'], $invoicePrintDetail ['sid'], 'print' );
 			
 			return "/invoicePrint";
 		}
@@ -1299,7 +1339,7 @@ class InvoiceController extends DooController {
 		$msg = $expCom [0] . ':' . $invoicePrintDetail ['expressNumber'] . '';
 		
 		$url = 'https://m.kuaidi100.com/result.jsp?nu=' . $invoicePrintDetail ['expressNumber'];
-		$hfreult = $this->msgSend ( $msg, $title2, $url, $username2 ['wxid'] );
+		$hfreult = $this->msgSend ( $msg, $title2, $url, $username2 ['wxid'], $invoicePrintDetail ['sid'], 'print' );
 		
 		return '/invoicePost';
 	}
@@ -1436,7 +1476,6 @@ class InvoiceController extends DooController {
 		
 		Doo::loadModel ( 'invoiceStatistics' );
 		
-		
 		$iid = $invoice->authcode ( $untreadIidKey );
 		if (! empty ( $iid ) && ! is_numeric ( $iid ))
 			die ( 'illegal request' );
@@ -1488,7 +1527,7 @@ class InvoiceController extends DooController {
 				$invoiceReceivables->setInvoiceReceivablesByCondition ( $item );
 				
 				if (! empty ( $irDetails )) {
-					//扣除入账
+					// 扣除入账
 					$invoiceStatistics = new invoiceStatistics ();
 					$item = array (
 							'date' => date ( 'Y-m-d', strtotime ( $irDetails ['receivablesDate'] ) ),
@@ -1498,23 +1537,18 @@ class InvoiceController extends DooController {
 							'accountPrice' => - $irDetails ['receivablesPrice'] 
 					);
 					$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
-					//扣除收款
+					// 扣除收款
 					$invoiceStatistics = new invoiceStatistics ();
 					$item = array (
 							'date' => date ( 'Y-m-d', strtotime ( $irDetails ['receivablesDate'] ) ),
 							'priceClass' => 2,
 							'cid' => $invoiceDetails ['cid'],
 							'staff' => $invoiceDetails ['sid'],
-							'irid'=>$irDetails ['irid'],
-							'receivablesPrice' => - $irDetails ['receivablesPrice']
+							'irid' => $irDetails ['irid'],
+							'receivablesPrice' => - $irDetails ['receivablesPrice'] 
 					);
 					$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
-					
 				}
-				
-				
-				
-				
 			}
 		}
 		
@@ -1561,16 +1595,14 @@ class InvoiceController extends DooController {
 					'untreadStatus' => 4,
 					// 关联发票号
 					'lossIid' => $invoiceDetail ['iid'] 
-			)
-			;
+			);
 			$invoice->setInvoiceByCondition ( $item );
 			// 更新原发票
 			$invoice = new invoice ();
 			$item = array (
 					'iid' => $invoiceDetail ['iid'],
 					'lossIid' => $iid 
-			)
-			;
+			);
 			$invoice->setInvoiceByCondition ( $item );
 			
 			// 操作日志
@@ -1610,7 +1642,7 @@ class InvoiceController extends DooController {
 		$receivablesList = $invoiceReceivables->getInvoiceReceivablesByNew ( 4, $sql );
 		
 		// 获取未入账发票
-		$invoiceUnAccount = $invoice->getInvoiceByUnAccount ($invoiceTC);
+		$invoiceUnAccount = $invoice->getInvoiceByUnAccount ( $invoiceTC );
 		
 		$invoiceExistAccount = $invoice->getInvoiceByUnAccount ( '', true );
 		
@@ -1780,13 +1812,13 @@ class InvoiceController extends DooController {
 			);
 			$invoiceOperationLog->setInvoiceOperationLog ( $item );
 			
-			//入账汇总
+			// 入账汇总
 			$invoiceStatistics = new invoiceStatistics ();
-// 			$list = $invoiceReceivables->getInvoiceReceivablesInIridString ( $iridString );
-// 			$accountPrice = 0;
-// 			foreach ( $list as $key => $value ) {
-// 				$accountPrice += $value ['receivablesPrice'];
-// 			}
+			// $list = $invoiceReceivables->getInvoiceReceivablesInIridString ( $iridString );
+			// $accountPrice = 0;
+			// foreach ( $list as $key => $value ) {
+			// $accountPrice += $value ['receivablesPrice'];
+			// }
 			$item = array (
 					'date' => $receivablesDate,
 					'priceClass' => 3,
@@ -1896,6 +1928,7 @@ class InvoiceController extends DooController {
 			}
 			$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
 			
+			// $toparty = $this->getWxidByCategory( $receivablesCategory [1] );
 			$toparty = $this->getToparty ( $receivablesCategory [1] );
 			$msg = '[通知]财务录入了一笔待认领款项,快到“我的收款”中查看,确认是否是您的客户给您打款了。';
 			if ($toparty != 0)
@@ -2072,7 +2105,7 @@ class InvoiceController extends DooController {
 					'cid' => $this->staff [0] ['cid'],
 					'staff' => $this->staff [0] ['sid'] 
 			);
-			$invoiceStatistics->updateInvoiceStatisticsByIrid ( $item, $detail ['irid'],2 );
+			$invoiceStatistics->updateInvoiceStatisticsByIrid ( $item, $detail ['irid'], 2 );
 		}
 		
 		return "/invoiceReceivablesClaim";
@@ -2183,18 +2216,18 @@ class InvoiceController extends DooController {
 		Doo::loadModel ( 'invoiceStatistics' );
 		$invoiceStatistics = new invoiceStatistics ();
 		
-// 		$list = $invoiceReceivables->getInvoiceReceivablesInIridString ( $iridString );
-// 		$accountPrice = 0;
-// 		foreach ( $list as $key => $value ) {
-// 			$accountPrice += $value ['receivablesPrice'];
-// 		}
+		// $list = $invoiceReceivables->getInvoiceReceivablesInIridString ( $iridString );
+		// $accountPrice = 0;
+		// foreach ( $list as $key => $value ) {
+		// $accountPrice += $value ['receivablesPrice'];
+		// }
 		$item = array (
-				'date' => $detailM['receivablesDate'],
+				'date' => $detailM ['receivablesDate'],
 				'priceClass' => 3,
 				
 				'cid' => $detail ['cid'],
 				'staff' => $detail ['sid'],
-				'accountPrice' => $detailM['receivablesPrice'] 
+				'accountPrice' => $detailM ['receivablesPrice'] 
 		);
 		$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
 		
@@ -2705,7 +2738,6 @@ class InvoiceController extends DooController {
 		$invoiceROLog = new invoiceROLog ();
 		Doo::loadModel ( 'invoiceStatistics' );
 		
-		
 		$irid = $invoice->authcode ( $unBundKey );
 		if (! empty ( $irid ) && ! is_numeric ( $irid ))
 			die ( 'illegal request' );
@@ -2753,8 +2785,8 @@ class InvoiceController extends DooController {
 				'priceClass' => 2,
 				'cid' => $invoiceDetails ['cid'],
 				'staff' => $invoiceDetails ['sid'],
-				'irid'=>$irDetails ['irid'],
-				'receivablesPrice' => - $irDetails ['receivablesPrice']
+				'irid' => $irDetails ['irid'],
+				'receivablesPrice' => - $irDetails ['receivablesPrice'] 
 		);
 		$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
 		
@@ -2817,13 +2849,17 @@ class InvoiceController extends DooController {
 		$D1 = '';
 		$D2 = '';
 		if (! empty ( $date )) {
-			$D1 = $dateArr [0];
-			$D2 = $dateArr [1];
+			$D1 = $dateArr [0] . " 00:00:00 ";
+			if (isset ( $dateArr [1] ))
+				$D2 = $dateArr [1] . " 23:59:59 ";
+			else
+				$D2 = $dateArr [0] . " 23:59:59 "; // date ( "Y-m-d" );
+					                                   // $D2 = $dateArr [1];
 		}
 		
 		$con = ' status=2  ';
 		if (! empty ( $D1 ) && ! empty ( $D2 ))
-			$con .= ' and date BETWEEN "' . $D1 . '" AND "' . $D2 . '" ';
+			$con .= ' and printTime BETWEEN "' . $D1 . '" AND "' . $D2 . '" ';
 		
 		if ($status == 'UNRECORD')
 			$con .= ' and printStatus=1 and untreadStatus=0';
@@ -2831,7 +2867,7 @@ class InvoiceController extends DooController {
 			$con .= ' and printStatus=1 and untreadStatus=3';
 		elseif ($status == 'BOUNCED')
 			$con .= ' and untreadStatus=2';
-		elseif($status == 'PARTRECORD')
+		elseif ($status == 'PARTRECORD')
 			$con .= ' and untreadStatus=0 and printStatus=1 and irid!=""';
 		elseif ($status == 'All') {
 			$con .= ' and ( untreadStatus=2 or untreadStatus=0 or untreadStatus=3 )';
@@ -2848,7 +2884,7 @@ class InvoiceController extends DooController {
 		$limit = $pageinfo ['lower'] . ',' . $page_size;
 		
 		$list = $invoice->getInvoiceByUntreadStatusPage ( $limit, $con );
-		// print_r($list);
+		
 		// foreach ($list as $key=>$value){
 		// $list[$key]['rpSum']=0;
 		// if (!empty($value['irid']))
@@ -2888,18 +2924,22 @@ class InvoiceController extends DooController {
 		$D1 = '';
 		$D2 = '';
 		if (! empty ( $date )) {
-			$D1 = $dateArr [0];
-			$D2 = $dateArr [1];
+			$D1 = $dateArr [0]; // ." 00:00:00 ";
+			if (isset ( $dateArr [1] ))
+				$D2 = $dateArr [1]; // ." 23:59:59 ";
+			else
+				$D2 = $dateArr [0]; // ." 23:59:59 ";//date ( "Y-m-d" );
 		}
 		
-		$con = '1';
-		if (! empty ( $D1 ) && ! empty ( $D2 ))
-			$con .= ' and date BETWEEN "' . $D1 . '" AND "' . $D2 . '" ';
-		
-		$descField = 'bindDate';
+		$descField = 'receivablesDate';
 		if ($timeType == 'CREATE')
 			$descField = 'date';
 		
+		$con = '1';
+		if (! empty ( $D1 ) && ! empty ( $D2 ))
+			$con .= ' and ' . $descField . ' BETWEEN "' . $D1 . '" AND "' . $D2 . '" ';
+			
+			// echo $con;
 		if ($status == 'Unclaimed')
 			$con .= ' and bindStatus=0';
 		elseif ($status == 'Credited')
@@ -3600,8 +3640,8 @@ class InvoiceController extends DooController {
 					';
 			
 			$irList = $invoiceReceivables->getInvoiceReceivablesInIridString ( $invoiceDetail ['irid'] );
-			if (empty($irList))
-				$irList [0] ['sumPrice']=0;
+			if (empty ( $irList ))
+				$irList [0] ['sumPrice'] = 0;
 			$balance = $invoiceDetail ['invoicePrice'] - $irList [0] ['sumPrice'];
 			
 			$priceString = '';
@@ -3846,7 +3886,6 @@ class InvoiceController extends DooController {
 			Doo::loadModel ( 'invoiceStatistics' );
 			Doo::loadModel ( 'invoiceOperationLog' );
 			
-			
 			echo DOO::conf ()->SITE_PATH . "upload/invoice/" . iconv ( "UTF-8", "GB2312", $path );
 			$exlArray = $this->_format_excel_to_array ( DOO::conf ()->SITE_PATH . "upload/invoice/" . $path );
 			// print_r ( $exlArray );
@@ -3885,7 +3924,7 @@ class InvoiceController extends DooController {
 				
 				$invoice->printTime = $value ['date'];
 				
-				$invoice->ipSource=1;
+				$invoice->ipSource = 1;
 				
 				$invoice->printStatus = 1;
 				$invoice->status = 2;
@@ -3893,11 +3932,11 @@ class InvoiceController extends DooController {
 				$invoice->untreadStatus = 0;
 				$invoice->invoiceSerial = "#F" . date ( "Ymd" ) . mt_rand ( 1000, 9999 );
 				
-				$iid=$invoice->insert ();
+				$iid = $invoice->insert ();
 				
 				// 汇总
 				$invoiceStatistics = new invoiceStatistics ();
-				// 
+				//
 				$item = array (
 						'date' => $value ['date'],
 						'priceClass' => 1,
@@ -3910,13 +3949,13 @@ class InvoiceController extends DooController {
 				$invoiceOperationLog = new invoiceOperationLog ();
 				$item = array (
 						'date' => date ( "Y-m-d H:i:s" ),
-						'operation' => date ( "Y-m-d" )." 导入",
+						'operation' => date ( "Y-m-d" ) . " 导入",
 						'status' => 1,
 						'img' => $sDetail ['avatar'],
 						'username' => $sDetail ['username'],
 						'uid' => $sDetail ['sid'],
 						'category' => $sDetail ['category'],
-						'iid' => $iid
+						'iid' => $iid 
 				);
 				$invoiceOperationLog->setInvoiceOperationLog ( $item );
 			}
@@ -4001,7 +4040,7 @@ class InvoiceController extends DooController {
 						'priceClass' => 3,
 						'cid' => $sDetail ['cid'],
 						'staff' => $sDetail ['sid'],
-						//'irid' => $irid,
+						// 'irid' => $irid,
 						'accountPrice' => $value ['receivablesPrice'] 
 				);
 				$invoiceStatistics->setInvoiceStatisticsByCondition ( $item );
@@ -4433,6 +4472,11 @@ class InvoiceController extends DooController {
 			}
 		}
 	}
+	/**
+	 * 获取微信部门
+	 * @param string $category
+	 * @return number|mixed
+	 */
 	function getToparty($category = '') {
 		$token = $this->getAccessToken (); //
 		$result = json_decode ( $this->httpGet ( "https://qyapi.weixin.qq.com/cgi-bin/department/list?access_token={$token}&id=5" ), true );
@@ -4443,6 +4487,22 @@ class InvoiceController extends DooController {
 		}
 		return $toparty;
 	}
+	
+	/**
+	 * 获得某部门下的用户
+	 * @param string $toparty
+	 */
+	function getUserByToparty($toparty = '') {
+		$token = $this->getAccessToken (); //
+		
+		$result = json_decode ( $this->httpGet ( "https://qyapi.weixin.qq.com/cgi-bin/user/simplelist?access_token={$token}&department_id={$toparty}" ), true );
+		
+		$userList = array ();
+		foreach ( $result ['userlist'] as $key => $value ) {
+			array_push ( $userList, "'" . $value ['userid'] . "'" );
+		}
+		return $userList;
+	}
 	function msgSendToparty($msg, $title, $url, $toparty, $text = '') {
 		$token = $this->getAccessToken ();
 		if ($text == 'text') {
@@ -4465,22 +4525,98 @@ class InvoiceController extends DooController {
 			return 1;
 		}
 	}
-	private function msgSend($msg, $title, $url, $user, $text = '') {
+	
+	/**
+	 * 获得可以发送微信用户列表
+	 * @param string $category
+	 * @return string
+	 */
+	function getWxidByCategory($category = "") {
+		if (empty ( $category ))
+			return "";
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		$toparty = $this->getToparty ( $category );
+		$wxList = array ();
+		$wxString = "";
+		if (! empty ( $toparty )) {
+			$userList = $this->getUserByToparty ( $toparty );
+			$userCon = implode ( ',', $userList );
+			// echo $userCon;
+			$sidList = $staff->getStaffByWxid ( $userCon );
+			foreach ( $sidList as $key => $value ) {
+				$falg = $this->isSendNotification ( $value ['sid'], 'receivables' );
+				if ($falg) {
+					array_push ( $wxList, $value ['wxid'] );
+				}
+			}
+			$wxString = implode ( '|', $wxList );
+		}
+		return $wxString;
+	}
+	
+	/**
+	 * 读取发送信息规则判断是否需要发送
+	 * @param number $sid
+	 * @param string $sendType
+	 * @return boolean
+	 */
+	function isSendNotification($sid = 0, $sendType = '') {
+		Doo::loadModel ( "notificationConf" );
+		$notificationConf = new notificationConf ();
+		
+		$detail = $notificationConf->getNotificationConfBySid ( $sid );
+		
+		$conf = array ();
+		$sendFlag = true;
+		if (! empty ( $detail )) {
+			$conf = json_decode ( $detail ['conf'], true );
+			if (! empty ( $sendType )) {
+				if (isset ( $conf [$sendType] )) {
+					if ($conf [$sendType] == "CLOSE")
+						$sendFlag = false;
+					elseif ($conf [$sendType] == "Weekend") {
+						$day = date ( "w" );
+						if (1 <= $day && 5 >= $day)
+							$sendFlag = false;
+					} elseif ($conf [$sendType] == "OneToFriday") {
+						$day = date ( "w" );
+						if (0 == $day || 6 == $day)
+							$sendFlag = false;
+					}
+				}
+			} else
+				$sendFlag = false;
+		}
+		return $sendFlag;
+	}
+	
+	/**
+	 * 根据规则发送信息
+	 * @param unknown $msg
+	 * @param unknown $title
+	 * @param unknown $url
+	 * @param unknown $user
+	 * @param string $text
+	 * @return number
+	 */
+	private function msgSend($msg, $title, $url, $user, $sid = 0, $sendType = '') {
 		$token = $this->getAccessToken ();
-		if ($text == 'text') {
-			$data = '{
-   				"touser": "' . $user . '",
-   				"toparty": "",
-   				"totag": "",
-  				"msgtype": "text",
-   				"agentid": 1000002,
-   				"text": {
-       				"content": "' . $msg . '"
-   				},
-   				"safe":0
-			}';
-		} else {
-			$data = '{
+		$falg = $this->isSendNotification ( $sid, $sendType );
+		// if ($text == 'text') {
+		// $data = '{
+		// "touser": "' . $user . '",
+		// "toparty": "",
+		// "totag": "",
+		// "msgtype": "text",
+		// "agentid": 1000002,
+		// "text": {
+		// "content": "' . $msg . '"
+		// },
+		// "safe":0
+		// }';
+		// } else {
+		$data = '{
 				"touser": "' . $user . '",
    				"toparty": "",
    				"totag": "",
@@ -4497,13 +4633,16 @@ class InvoiceController extends DooController {
            			]
    				}
 			}';
-		}
-		$result = json_decode ( $this->httpPOST ( "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={$token}", $data ) );
-		if ($result->errmsg != 'ok') {
+		// }
+		if ($falg) {
+			$result = json_decode ( $this->httpPOST ( "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token={$token}", $data ) );
+			if ($result->errmsg != 'ok') {
+				return 0;
+			} else {
+				return 1;
+			}
+		} else
 			return 0;
-		} else {
-			return 1;
-		}
 	}
 	private function getAccessToken() {
 		// access_token 应该全局存储与更新,以下代码以写入到文件中做示例

+ 64 - 0
protected/controller/MainController.php

@@ -5109,6 +5109,70 @@ class MainController extends DooController {
 		
 		$this->render ( "/admin/admin_addContacts", $data );
 	}
+	
+	/**
+	 * 微信通知设置
+	 */
+	function notificationConf(){
+	
+		Doo::loadModel ( "notificationConf" );
+		$notificationConf = new notificationConf ();
+	
+		$detail=$notificationConf->getNotificationConfBySid($this->staff[0]['sid']);
+		
+		$rule=json_decode($detail['conf'],true);
+		
+		$data ['rule'] = $rule;
+		$data ['memu'] = "notificationConf";
+		$data ['staff'] = $this->staff;
+	
+		$this->render ( "/admin/invoiceNotificationConf", $data );
+	}
+	
+	function ajaxSetNotificationConf(){
+		$notificationType=$this->get_args('notificationType')?$this->get_args('notificationType'):"";
+		$notificationValue=$this->get_args('notificationValue')?$this->get_args('notificationValue'):'';
+		
+		if (!empty($notificationType)&&!empty($notificationValue)&&!empty($this->staff[0]['sid'])){
+			Doo::loadModel("notificationConf");
+			$notificationConf=new notificationConf();
+			
+			$detail=$notificationConf->getNotificationConfBySid($this->staff [0] ['sid']);
+			
+			if (empty($detail)){
+				$rule=array($notificationType=>$notificationValue);
+				$rule=json_encode($rule);
+				$item=array(
+						'sid'=>$this->staff[0]['sid'],
+						'conf'=>$rule
+				);
+				
+				$notificationConf->addNotification($item);
+			}else{
+				$rule=json_decode($detail['conf'],true);
+				$rule[$notificationType]=$notificationValue;
+				$rule=json_encode($rule);
+				$item=array(
+						'nid'=>$detail['nid'],
+						'conf'=>$rule
+				);
+				$notificationConf->setNotificationByCondition($item);
+			}
+			echo json_encode ( array (
+					'status' => 1,
+					'msgType'=>$notificationType,
+					'msg' => ''
+			) );
+			die;
+		}
+		echo json_encode ( array (
+				'status' => 2,
+				'msgType'=>$notificationType,
+				'msg' => 'illegal request'
+		) );
+		die;
+	}
+	
 	function eMailTask() {
 		Doo::loadModel ( 'tag' );
 		$tag = new tag ();

+ 30 - 0
protected/model/invoiceTraining.php

@@ -53,6 +53,36 @@ class invoiceTraining extends DooModel {
 		return $itid;
 	}
 	
+	function getInvoiceTrainingByTodo($select = ""){
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadModel ( 'L_category' );
+		$lCategory = new L_category ();
+		
+		$condition = array (
+				'where' => "status= 0 or status=1 ",
+				'limit'=>8,
+				'asArray' => TRUE
+		);
+		if (! empty ( $select ))
+			$condition += array (
+					'select' => $select
+			);
+				
+			$list=$this->find (
+					$condition
+					);
+		
+			foreach ($list as $key=>$value){
+				$detail=$staff->getStaffBySid($value['creator']);
+				$list[$key]['staff']=$detail;
+				$detail=$lCategory->getCategoryById($value['cid']);
+				$list[$key]['category']=$detail;
+			}
+		
+			return $list;
+	}
+	
 	/**
 	 * 根据状态获取培训班
 	 * @param number $status

+ 65 - 0
protected/model/notificationConf.php

@@ -0,0 +1,65 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+class notificationConf extends DooModel {
+	public $nid;
+	public $sid;
+	public $conf;
+	public $_table = 'CLD_notificationConf';
+	public $_primarykey = 'nid';
+	public $_fields = array (
+			'nid',
+			'sid',
+			'conf',
+			
+	);
+	
+	/**
+	 * 据用户ID获得信息配置
+	 * @param number $sid
+	 */
+	function getNotificationConfBySid($sid = 0) {
+		if (empty($sid))
+			return array();
+		$detail=$this->getOne(array(
+				'where'=>"sid=".$sid,
+				'asArray'=>TRUE
+		));
+		
+		return $detail;
+	}
+	
+	/**
+	 * 添加一个信息配置
+	 * @param array $item 相关数据
+	 * @return number 返回ID
+	 */
+	public function addNotification($item = array()) {
+		$id = 0;
+		if (is_array ( $item ) && ! empty ( $item )) {
+			foreach ( $item as $key => $value ) {
+				$this->$key = $value;
+			}
+			$id = $this->insert ();
+		}
+		return $id;
+	}
+	
+	/**
+	 * 根据参数字段更新相应字段(主键ID必须传)
+	 * @param array $item 相关需要更新的字段信息
+	 * @return number 返回发票ID
+	 */
+	public function setNotificationByCondition($item = array()) {
+		$id = 0;
+		if (is_array ( $item ) && ! empty ( $item )) {
+			foreach ( $item as $key => $value ) {
+				$this->$key = $value;
+			}
+			$id = $this->update ();
+		}
+		return $id;
+	}
+	
+}
+
+?>

+ 13 - 4
protected/model/staff.php

@@ -9,8 +9,6 @@ class staff extends DooModel {
 	public $othercid;
 	public $category;
 	public $othercategory;
-	public $departmentID;
-	public $departmentName;
 	public $gender;
 	public $qq;
 	public $phone;
@@ -21,6 +19,7 @@ class staff extends DooModel {
 	public $avatar;
 	public $appDate;
 	public $hiredate;
+	public $wxid;
 	public $nature;
 	public $_table = 'CLD_staff';
 	public $_primarykey = 'sid';
@@ -33,8 +32,6 @@ class staff extends DooModel {
 			'isadmin',
 			'cid',
 			'othercid',
-			'departmentID',
-			'departmentName',
 			'appDate',
 			'category',
 			'othercategory',
@@ -45,6 +42,7 @@ class staff extends DooModel {
 			'email',
 			'avatar',
 			'hiredate',
+			'wxid',
 			'nature' 
 	);
 	public function checkUser($uid, $passwork) {
@@ -106,6 +104,17 @@ class staff extends DooModel {
 			) );
 		return $detail;
 	}
+	
+	public function getStaffByWxid($wxid=''){
+		//echo "wxid in ( " . $wxid . ")";
+		if (empty($wxid))
+			return array();
+			return $this->find ( array (
+					'select' =>'sid,wxid',
+					'where' => "wxid in ( " . $wxid . ")",
+					'asArray' => TRUE
+			) );
+	}
 }
 
 ?>

+ 4 - 1
protected/view/admin/admin_menu.html

@@ -1,5 +1,8 @@
-<!-- if {{memu}}=="adminmyinfo" -->
+<!-- if {{memu}}=="adminmyinfo"|| {{memu}}=="notificationConf" -->
 <li><a href="/adminmyinfo" <!-- if {{memu}}=="adminmyinfo" --> class="selected" <!-- endif -->>个人信息</a></li>
+<li><a href="/notificationConf" <!-- if {{memu}}=="notificationConf" --> class="selected" <!-- endif -->>微信通知</a></li>
+
+
 <li><a href="/adlogin" target="_blank">后台管理</a></li>
 <!-- else -->
 <li><a  href="/adminpw" <!-- if {{memu}}=="adminpw" --> class="selected" <!-- endif --> >管理员设置</a></li>

+ 103 - 0
protected/view/admin/invoiceNotificationConf.html

@@ -0,0 +1,103 @@
+<!-- include 'header' -->
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.js"></script>
+<body>
+	<div class="mainLayout">
+		<div class="mainMenu">
+			<div class="menuItem">
+				<a href="#" class="mLogo">CLD</a>
+				<ul>
+					<!-- include 'menuReceipt' --></ul>
+			</div>
+		</div>
+		<div class="warpContent">
+			<div class="subMenu fL">
+				<div class="menuItem">
+					<ul>
+						 <!-- include 'admin_menu' -->
+					</ul>
+				</div>
+			</div>
+			<div class="adminContent autoHeight">
+		    <div class="subNav">
+		    	<ul class="navTabs">
+		    	<li class="active"><a href="/notificationConf">发票通知设置</a></li>
+					 <!--  <li><a href="admin-myinfo-wechat.html">请假通知设置</a></li>
+					  
+					  <li><a href="admin-myinfo-wechat-saea.html">费用通知设置</a></li>
+					   -->
+					</ul>
+			</div>
+			
+			<form name="myinfo"  method="post">
+			
+			<div class="control-group">
+				<label class="control-label">审批发票</label>
+				<div class="controls">
+	         <select name="approval" node-notification data="approval" class="form-control">
+	         	<option <!-- if {{rule.approval}}=='DAY' --> selected <!-- endif --> value="DAY">每天</option>
+	         	<option <!-- if {{rule.approval}}=='OneToFriday' --> selected <!-- endif --> value="OneToFriday">星期一至星期五</option>
+	         	<option <!-- if {{rule.approval}}=='Weekend' --> selected <!-- endif --> value="Weekend">星期六、日</option>
+	         	<option <!-- if {{rule.approval}}=='CLOSE' --> selected <!-- endif --> value="CLOSE">关闭</option>
+	         </select><span id="approvalMsg" ></span>
+	       </div>
+	       
+			</div>
+			
+			<div class="control-group">
+				<label class="control-label">发票已出票</label>
+				<div class="controls">
+	         <select node-notification data="print" class="form-control">
+	         	<option <!-- if {{rule.print}}=='DAY' --> selected <!-- endif --> value="DAY">每天</option>
+	         	<option <!-- if {{rule.print}}=='OneToFriday' --> selected <!-- endif --> value="OneToFriday">星期一至星期五</option>
+	         	<option <!-- if {{rule.print}}=='Weekend' --> selected <!-- endif --> value="Weekend">星期六、日</option>
+	         	<option <!-- if {{rule.print}}=='CLOSE' --> selected <!-- endif --> value="CLOSE">关闭</option>
+	         </select><span id="printMsg" ></span>
+	       </div>
+	       
+			</div>
+			
+			<div class="control-group" style="display:none">
+				<label class="control-label">发票退回</label>
+				<div class="controls">
+	         <select class="form-control">
+	         	<option value="DAY">每天</option>
+	         	<option value="OneToFriday">星期一至星期五</option>
+	         	<option value="Weekend">星期六、日</option>
+	         	<option value="CLOSE">关闭</option>
+	         </select>
+	       </div>
+			</div>
+			<div class="control-group" style="display:none">
+				<label class="control-label">发票终止</label>
+				<div class="controls">
+	         <select class="form-control">
+	         	<option value="DAY">每天</option>
+	         	<option value="OneToFriday">星期一至星期五</option>
+	         	<option value="Weekend">星期六、日</option>
+	         	<option value="CLOSE">关闭</option>
+	         </select>
+	       </div>
+			</div>
+			
+			
+			<div class="control-group">
+				<label class="control-label">待认领收款</label>
+				<div class="controls">
+	         <select class="form-control" node-notification data="receivables">
+	         	<option <!-- if {{rule.receivables}}=='DAY' --> selected <!-- endif --> value="DAY">每天</option>
+	         	<option <!-- if {{rule.receivables}}=='OneToFriday' --> selected <!-- endif --> value="OneToFriday">星期一至星期五</option>
+	         	<option <!-- if {{rule.receivables}}=='Weekend' --> selected <!-- endif --> value="Weekend">星期六、日</option>
+	         	<option <!-- if {{rule.receivables}}=='CLOSE' --> selected <!-- endif --> value="CLOSE">关闭</option>
+	         </select><span id="receivablesMsg" ></span>
+	       </div>
+	      
+	       
+			</div>
+			
+			
+			
+			</form>
+		</div>
+	</div>
+<script type="text/javascript">autoFlashHeight();</script>
+</body>

+ 39 - 38
protected/view/admin/invoiceTraining.html

@@ -30,22 +30,20 @@
 							<div class="clearfix">
 								<table class="table table-bordered table-condensed">
 									<tbody>
-									<tr><th class="taC">本月累计开票</th><td>¥{{isMonth.statisticsMonth.0.invoicePrice}}</td>
-									<th class="taC">本月累计入账</th><td>¥{{isMonth.statisticsMonth.0.accountPrice}}</td></tr>
-									{{htm}}
-									<tr><th class="taC">今年累计开票</th><td>¥{{isMonth.statisticsYear.0.invoicePrice}}</td>
-									<th class="taC">今年累计入账</th><td>¥{{isMonth.statisticsYear.0.accountPrice}}</td></tr>
+									<tr><th class="taC">累计培训班</th><td>4</td><th class="taC">累计完成</th><td>3</td></tr>
+									<tr><th class="taC">累计开票金额</th><td>¥838,273.00</td><th class="taC">累计入账金额</th><td>¥838,273.00</td></tr>
+									<tr><th class="taC">累计未入账发票</th><td colspan="3">¥209,484,765.00</td></tr>
 									</tbody>
 								</table>
 							</div>
 							
 							<div class="clearfix">
-								<!-- if !empty({{itList}}) -->
+								<!-- if !empty({{itTodoList}}) -->
 								<legend>待完成入账培训班</legend>
 								<table class="table table-bordered table-condensed">
 									<tbody>
 									<tr><th class="taC">培训班名称</th><th class="taC">办事处</th><th class="taC">创建</th><th class="taC">开班时间</th><th class="taC" width="90">包含发票</th><th class="taC">开票金额合计</th><th class="taC">入账金额合计</th><th class="taC" width="90">入账完成度</th><th class="taC" width="100">操作</th></tr>
-									<!-- loop itList -->
+									<!-- loop itTodoList -->
 									<tr>
 										<td><a href="invoice-batch-detail.html">{{itList' value.trainName}}</a></td>
 										<td>{{itList' value.category.0.title}}</td>
@@ -63,51 +61,37 @@
 									</tr>
 									<!-- endloop -->
 									
-									<tr>
-										<td><a href="invoice-batch-detail.html">2018XXXX培训班</a></td>
-										<td>总部</td>
-										<td>陈特</td>
-										<td>2018-03-16</td>
-										<td>0</td>
-										<td>¥0</td>
-										<td>¥0</td>
-										<td>0%</td>
-										<td><a data-toggle="modal" href="#invalid">删除</a></td>
-									</tr>
 									</tbody>
 								</table>
 								<!-- else -->
 								<blockquote><p class="colGray">暂时没有培训班</p></blockquote>
 								<!-- endif -->
 							</div>
+							
 							<div class="clearfix">
-								<legend><!--<div class="fR"><a href="">查看更多</a></div>-->已完成入账培训班</legend>
+							<!-- if !empty({{itedList}}) -->
+								<legend>已完成入账培训班</legend>
 								<table class="table table-bordered table-condensed">
 									<tbody>
 									<tr><th class="taC">培训班名称</th><th class="taC">办事处</th><th class="taC">创建</th><th class="taC">开班时间</th><th class="taC" width="90">包含发票</th><th class="taC">开票金额合计</th><th class="taC">入账金额合计</th><th class="taC" width="90">入账完成度</th></tr>
+									<!-- loop itedList -->
 									<tr>
-										<td><a href="invoice-batch-detail.html">2018XX培训班</a></td>
-										<td>重庆办</td>
-										<td>李清学</td>
-										<td>2018-03-15</td>
-										<td>45</td>
-										<td>¥234,981.00</td>
-										<td>¥234,981.00</td>
-										<td>100%</td>
-									</tr>
-									<tr>
-										<td><a href="invoice-batch-detail.html">2018XXXX培训班</a></td>
-										<td>云南办</td>
-										<td>周洪波</td>
-										<td>2018-03-16</td>
-										<td>45</td>
-										<td>¥34,981.00</td>
-										<td>¥34,981.00</td>
-										<td>100%</td>
+										<td><a href="invoice-batch-detail.html">{{itList' value.trainName}}</a></td>
+										<td>{{itList' value.category.0.title}}</td>
+										<td>{{itList' value.staff.username}}</td>
+										<td>{{itList' value.trainDate}}</td>
+										<td>{{itList' value.invoiceTotal}}</td>
+										<td>¥{{itList' value.invoiceTotalAmount}}</td>
+										<td>¥{{itList' value.invoiceArriveAmount}}</td>
+										<td>{{itList' value.arriveSchedule}}%</td>
+										<td>
 									</tr>
+									<!-- endloop -->
 									</tbody>
 								</table>
+								<!-- else -->
 								<blockquote><p class="colGray">暂时没有已完成入账培训班</p></blockquote>
+								<!-- endif -->
 							</div>
 						</div>
 					</div>
@@ -153,6 +137,23 @@
 </div>
 </form>
 </div>
-		<!--创建培训班-->
+<!--创建培训班-->
+<div class="modal hide fade" id="invalid">
+<form action="invoiceTrainingDelDo"  method="post">
+<input type="hidden" name="trainingKey" value="">
+		<div class="modal-dialog ">
+			<div class="modal-content">
+				<div class="modal-header">
+					<h3>是否删除培训班</h3>
+				</div>
+				
+				<div class="modal-footer">
+				<input type="submit" class="button" value="是的">
+				<a href="#" class="button btn-gray" data-dismiss="modal" aria-hidden="true">关闭</a>
+				</div>
+			</div></div>
+			</form>
+</div>		
+		
 <script type="text/javascript">autoFlashHeight();</script>
 </body>