|
|
@@ -0,0 +1,161 @@
|
|
|
+
|
|
|
+<?php
|
|
|
+/**
|
|
|
+ * Created by PhpStorm.
|
|
|
+ * User: Administrator
|
|
|
+ * Date: 2017/12/5/005
|
|
|
+ * Time: 10:16
|
|
|
+ */
|
|
|
+?>
|
|
|
+<div class="row wrapper border-bottom white-bg page-heading">
|
|
|
+ <div class="col-lg-12">
|
|
|
+ <h2>系统设置</h2>
|
|
|
+ <ol class="breadcrumb">
|
|
|
+ <li>
|
|
|
+ <a href="<?= \yii\helpers\Url::to(['/admin/dashboard'])?>">管理首页</a>
|
|
|
+ </li>
|
|
|
+ <li class="active">
|
|
|
+ <strong>对公设置</strong>
|
|
|
+ </li>
|
|
|
+ </ol>
|
|
|
+ </div>
|
|
|
+</div>
|
|
|
+
|
|
|
+<div class="wrapper wrapper-content animated fadeInRight">
|
|
|
+ <button id="add" class="btn btn-default">添加新的对私账户</button>
|
|
|
+ <form id="form" class="form-horizontal">
|
|
|
+ <div class="row">
|
|
|
+ <div class="col-lg-12">
|
|
|
+ <div class="ibox">
|
|
|
+ <div class="ibox-title">
|
|
|
+ <button class="btn btn-link">对私账户设置</button>
|
|
|
+ </div>
|
|
|
+ <div class="ibox-content">
|
|
|
+
|
|
|
+
|
|
|
+ <table class="table table-bordered">
|
|
|
+ <?php foreach ($config as $key => $row) :?>
|
|
|
+ <tr>
|
|
|
+ <th <?php if($row['is_close'] == 1): ?>style="background: #eee;"<?php endif;?>>
|
|
|
+ <button onclick="viewpage(this)" type="button" class="btn btn-primary" style="float:right;" data-key="<?= $row['id'] ?>">修改当前配置</button>
|
|
|
+ <input name="<?= $row['id'] ?>" type="hidden" value="<?= $key ?>">
|
|
|
+ <div class="div_padding">收款地址:<?= $row['account'] ?></div>
|
|
|
+ <div class="div_padding">
|
|
|
+ <span>启用:</span>
|
|
|
+ <input type="radio" name="<?= $key ?>_is_close" value="0" <?php if($row['is_close'] == 0): ?>checked<?php endif;?> /> 开启
|
|
|
+ <input type="radio" name="<?= $key ?>_is_close" value="1" <?php if($row['is_close'] == 1): ?>checked<?php endif;?> /> 关闭
|
|
|
+ </div>
|
|
|
+ <div class="div_padding">添加时间:<?= date('Y-m-d H:m:s',$row['add_time'])?></div>
|
|
|
+ </th>
|
|
|
+ </tr>
|
|
|
+ <?php endforeach;?>
|
|
|
+ </table>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <?php if($config==null){?>
|
|
|
+
|
|
|
+ <?php }else{?>
|
|
|
+ <div class="ibox-footer">
|
|
|
+ <button id="submit" type="button" class="btn btn-primary"> 点我更新 ← 请谨慎设置</button>
|
|
|
+ </div>
|
|
|
+ <?php }?>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </form>
|
|
|
+</div>
|
|
|
+
|
|
|
+<?php $this->beginBlock('footer_script'); ?>
|
|
|
+<script>
|
|
|
+ KindEditor.ready(function(K) {});
|
|
|
+</script>
|
|
|
+
|
|
|
+
|
|
|
+<style>
|
|
|
+
|
|
|
+.div_padding{
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|
|
|
+
|
|
|
+
|
|
|
+<!-- Page-Level Scripts -->
|
|
|
+<script>
|
|
|
+
|
|
|
+ //添加新品种页面
|
|
|
+ var table;
|
|
|
+ $(document).ready(function() {
|
|
|
+
|
|
|
+ table = $('#datatables').DataTable({});
|
|
|
+ $('#add').click(function() {
|
|
|
+ $("#modal").removeData();
|
|
|
+ var url="/admin/privateaccount/clear?t="+new Date().getTime();
|
|
|
+ $("#modal").modal({
|
|
|
+ remote:url,
|
|
|
+ show:true
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ //点击更新
|
|
|
+ $("#submit").on("click", function() {
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "/admin/privateaccount/update",
|
|
|
+ data: $('#form').serialize(),
|
|
|
+ dataType: "json",
|
|
|
+ beforeSend: function() {},
|
|
|
+ success: function(data) {
|
|
|
+ if(data.code) {
|
|
|
+ toastr.success(data.message, "提示");
|
|
|
+ window.location.reload();
|
|
|
+ } else {
|
|
|
+ toastr.error(data.message, "提示");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ complete: function(XMLHttpRequest, textStatus) {},
|
|
|
+ error: function() {}
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ //点击删除
|
|
|
+ function delpage(that) {
|
|
|
+ console.log(11111);
|
|
|
+ var key = $(that).attr('data-key');
|
|
|
+ var data = {
|
|
|
+ key:key
|
|
|
+ };
|
|
|
+ $.ajax({
|
|
|
+ type: "POST",
|
|
|
+ url: "/admin/privateaccount/delpage",
|
|
|
+ data:data ,
|
|
|
+ dataType: "json",
|
|
|
+ beforeSend: function() {},
|
|
|
+ success: function(data) {
|
|
|
+ if(data.code) {
|
|
|
+ toastr.success(data.message, "提示");
|
|
|
+ window.location.reload();
|
|
|
+ } else {
|
|
|
+ toastr.error(data.message, "提示");
|
|
|
+ }
|
|
|
+ },
|
|
|
+ complete: function(XMLHttpRequest, textStatus) {},
|
|
|
+ error: function() {}
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function viewpage(that){
|
|
|
+ $("#modal").removeData();
|
|
|
+ var key = $(that).attr('data-key'); //获取展示的id
|
|
|
+ var url="/admin/privateaccount/view?id="+key+"&t="+new Date().getTime();
|
|
|
+ $("#modal").modal({
|
|
|
+ remote:url,
|
|
|
+ show:true
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+</script>
|
|
|
+<?php $this->endBlock(); ?>
|