You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
information-system/webht/third_party/pay/views/income.php

213 lines
8.8 KiB
PHP

<?php
/**
* 账单结算
*/
?>
<!DOCTYPE html>
<html>
<head>
<title>在线支付统计</title>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta content="width=device-width, initial-scale=1.0, user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta name="referrer" content="always">
<link href="http://www.mycht.cn/css/webht/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="http://www.mycht.cn/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<!-- <?php // include 'flatpickr.css.php';
?> -->
<style type="text/css">
form {
border-bottom: 1px solid #ccc;
}
.navbar-header h1 {
display: inline-block;
margin-left: 30px;
margin-right: 30px;
}
label {
display: inline-block;
max-width: none;
margin-bottom: 5px;
font-weight: bold;
}
.form-check-label {
font-weight: normal;
margin-left: 5px;
}
thead th {
text-align: center;
}
tbody td {
text-align: right;
}
.bg-grey {
background-color: #f5f5f5;
}
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.text-bold {
font-weight: bold;
}
</style>
</head>
<body>
<div id="wrapper" class="chkVisible print-none">
<div class="navbar-header" style="float:none;border-bottom: 1px solid #ccc;">
<a class="navbar-brand text-muted" style="height: 52px;padding-top: 7px;padding-left: 30px;" href="http://www.mycht.cn/webht.php/index/index">
<img width="150" style="height:40px;" src="/css/nav/img/6000.png">
</a>
<h1>在线支付统计</h1>
<ul class="nav navbar-nav navbar-right pull-right" style="margin:7.5px 0;">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><?php $userdata = $this->session->userdata('admin_chtcdn');
echo $userdata['OPI_Name']; ?> <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="<?php echo site_url('login/logout'); ?>">退出</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="container-fluid">
<p></p>
<form action="/webht.php/apps/pay/paymentservice/income_statistics" method="POST" role="form">
<div class="form-group row">
<label for="" class="col-md-2">交易日期</label>
<div class="col-md-6">
<input type="text" class="form-control" name="date_range" id="date_range" placeholder="选择日期范围" required>
</div>
<div class="col-md-3">
<!-- <input type="text" class="form-control" id="end_date" placeholder="结束日期"> -->
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</div>
</form>
<p></p>
<?php foreach ($data as $key => $table) { ?>
<table class="table table-bordered table-hover">
<thead>
<?php switch ($key) {
case 'pay':
?>
<tr class="bg-info">
<th colspan="7"> 付款
</th>
</tr>
<?php break;
case 'refund': ?>
<tr class="bg-danger">
<th colspan="7"> 退款
</th>
</tr>
<?php break;
case 'income': ?>
<tr class="bg-success">
<th colspan="7"> 收入
</th>
</tr>
<?php
default:
break;
} ?>
<tr>
<th>付款方式</th>
<th>金额</th>
<th>
上期 ( 前 <?php echo $day_cnt ?> 天 )<br>
<?php echo $from_date_quarter ?> 至 <?php echo $to_date_quarter ?>
</th>
<th>环比</th>
<th>上年同期<br>
<?php echo $from_date_year ?> 至 <?php echo $to_date_year ?>
</th>
<th>同比</th>
<th>当年截止<br>
<?php echo $at_year ?> 至 <?php echo $to_date ?>
</th>
</tr>
</thead>
<tbody>
<?php
$sum_total_income = 0;
$sum_method_total_income_cmp = 0;
$sum_year_method_total_income = 0;
$sum_this_year_method_total_income = 0;
$sum_quarter_rate = 0;
$sum_year_rate = 0;
foreach ($table as $kt => $method) {
$sum_total_income += $method->method_total_income;
$sum_method_total_income_cmp += $method->method_total_income_cmp;
$sum_year_method_total_income += $method->year_method_total_income;
$sum_this_year_method_total_income += $method->this_year_method_total_income;
?>
<tr>
<td><?php echo $method->brand_name ?></td>
<td><?php echo number_format($method->method_total_income, 2, '.', ',') ?></td>
<td><?php echo number_format($method->method_total_income_cmp, 2, '.', ',') ?></td>
<td><?php echo number_format($method->quarter_rate, 2, '.', ',') . '%' ?></td>
<td><?php echo number_format($method->year_method_total_income, 2, '.', ',') ?></td>
<td><?php echo number_format($method->year_rate, 2, '.', ',') . '%' ?></td>
<td><?php echo number_format($method->this_year_method_total_income, 2, '.', ',') ?></td>
</tr>
<?php }
$sum_quarter_rate = $sum_method_total_income_cmp==0 ? 0 :
bcdiv(
bcsub($sum_total_income, $sum_method_total_income_cmp),
($sum_method_total_income_cmp)
)*100;
$sum_year_rate = $sum_year_method_total_income==0 ? 0 :
bcdiv(
bcsub($sum_total_income, $sum_year_method_total_income),
($sum_year_method_total_income)
)*100;
?>
<tr>
<td>合计</td>
<td><?php echo number_format($sum_total_income, 2, '.', ',') ?></td>
<td><?php echo number_format($sum_method_total_income_cmp, 2, '.', ',') ?></td>
<td><?php echo number_format($sum_quarter_rate, 2, '.', ',') . '%' ?></td>
<td><?php echo number_format($sum_year_method_total_income, 2, '.', ',') ?></td>
<td><?php echo number_format($sum_year_rate, 2, '.', ',') . '%' ?></td>
<td><?php echo number_format($sum_this_year_method_total_income, 2, '.', ',') ?></td>
</tr>
</tbody>
</table>
<?php } ?>
</body>
<script src="/js/jquery.min.js" type="text/javascript"></script>
<script src="/js/bootstrap.min.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#date_range").flatpickr({
dateFormat: 'Y-m-d',
mode: 'range',
allowInput: true,
defaultDate: ['<?php echo $from_date ?>', '<?php echo $to_date ?>']
});
})
</script>
</html>