Bladeren bron

培训班文件

caipin 7 jaren geleden
bovenliggende
commit
825c15f964
3 gewijzigde bestanden met toevoegingen van 270 en 0 verwijderingen
  1. 21 0
      protected/model/department.php
  2. 91 0
      protected/model/invoiceTraining.php
  3. 158 0
      protected/view/admin/invoiceTraining.html

+ 21 - 0
protected/model/department.php

@@ -0,0 +1,21 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+class department extends DooModel {
+	public $did;
+	public $cid;
+	public $departmentName;
+	public $_table = 'CLD_department';
+	public $_primarykey = 'did';
+	public $_fields = array (
+			'cid',
+			'departmentName',
+			'did' 
+	);
+	public function getDepartmentBycid($cid = 0) {
+		return $this->find ( array (
+				'where' => "cid= '" . $cid . "' ",
+				'asArray' => TRUE 
+		) );
+	}
+}
+?>

+ 91 - 0
protected/model/invoiceTraining.php

@@ -0,0 +1,91 @@
+<?php
+Doo::loadCore ( 'db/DooModel' );
+/**
+ * 发票培训班相关信息及其操作业务逻辑
+ * @author CP.
+ * @version 1.0
+ * @namespace invoice
+ * @package invoiceModel
+ */
+class invoiceTraining extends DooModel {
+	public $itid;
+	public $status;
+	public $trainName;
+	public $cid;
+	public $categoryName;
+	public $creator;
+	public $trainDate;
+	public $invoiceTotal;
+	public $invoiceTotalAmount;
+	public $invoiceArriveAmount;
+	public $arriveSchedule;
+	public $creatorDate;
+	public $_table = 'CLD_invoiceTraining';
+	public $_primarykey = 'itid';
+	public $_fields = array (
+			'itid',
+			'status',
+			'trainName',
+			'cid',
+			'categoryName',
+			'creator',
+			'trainDate',
+			'invoiceTotal',
+			'invoiceTotalAmount',
+			'invoiceArriveAmount',
+			'arriveSchedule',
+			'creatorDate' 
+	);
+	
+	/**
+	 * 添加一个培训班
+	 * @param array $item 培训班相关数据
+	 * @return number 返回培训班ID
+	 */
+	public function addInvoiceTraining($item = array()) {
+		$itid = 0;
+		if (is_array ( $item ) && ! empty ( $item )) {
+			foreach ( $item as $key => $value ) {
+				$this->$key = $value;
+			}
+			$itid = $this->insert ();
+		}
+		return $itid;
+	}
+	
+	/**
+	 * 根据状态获取培训班
+	 * @param number $status
+	 */
+	function getInvoiceTrainingByStatus($status = 0, $select = "") {
+		Doo::loadModel ( 'staff' );
+		$staff = new staff ();
+		Doo::loadModel ( 'L_category' );
+		$lCategory = new L_category ();
+		
+		$condition = array (
+			'where' => "status= '" . $status . "' ",
+			'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;
+	}
+}
+
+?>

+ 158 - 0
protected/view/admin/invoiceTraining.html

@@ -0,0 +1,158 @@
+<!-- include 'header' -->
+<link rel=stylesheet href="<?= WEB_SITE_GLOBAL ?>css/jquery.validator.css">
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/jquery.validator.min.js"></script>
+<script type="text/javascript" src="<?= WEB_SITE_GLOBAL ?>js/zh-CN.js"></script>
+<script src="<?= WEB_SITE_GLOBAL ?>js/invoice.validator.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">
+					<!-- include 'invoiceMenu' -->
+				</div>
+			</div>
+			<div class="adminContent autoHeight">
+				<div class="saea-borad">
+					<div class="borad-menu">
+						<a data-toggle="modal" href="#add-batch" class="invoice">创建培训班</a>
+					</div>
+					<div class="borad-news">
+						<div class="saeaList">
+							<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>
+									</tbody>
+								</table>
+							</div>
+							
+							<div class="clearfix">
+								<!-- if !empty({{itList}}) -->
+								<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 -->
+									<tr>
+										<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>
+										<!-- if {{itList' value.arriveSchedule}}==0 -->
+										<a data-toggle="modal" href="#invalid">删除</a>
+										<!-- endif -->
+										</td>
+									</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>
+								<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>
+									<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>
+									</tr>
+									</tbody>
+								</table>
+								<blockquote><p class="colGray">暂时没有已完成入账培训班</p></blockquote>
+							</div>
+						</div>
+					</div>
+				</div>
+			</div>
+		</div>
+	</div>
+	
+	<!--创建培训班-->
+<div class="modal hide fade" id="add-batch">
+
+<form action="/invoiceTrainingAdd" method="post" name="invoiceTraining">
+
+	<div class="modal-dialog">
+		<div class="modal-content">
+		<div class="modal-header">
+		<h3>创建培训班</h3>
+		</div>
+		<div class="modal-body saeaList">
+			<table class="table table-bordered table-condensed">
+				<tr><th class="taC" width="150">培训班名称</th>
+				<td><input type="text" name="trainName" value=""></td>
+				</tr>
+				<tr><th class="taC" width="150">所在办事处</th>
+				<td>
+				<select name="cid" >
+					<!-- loop category -->
+					<option <!-- if {{category' value.cid}} == {{staff.0.cid}}  --> selected <!-- endif --> post-data="{{category' value.cid}}" value="{{category' value.cid}}" >{{category' value.title}}</option>
+					<!-- endloop -->
+				</select>
+				</td></tr>
+				<tr><th class="taC" width="150">开班时间</th>
+				<td><input type="date" name="trainDate"></td>
+				</tr>
+			</table>
+		</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>