Merge branch 'dev' into finance-statistics-total

dev
zhaocheng 5 years ago
commit 20bd9ce864
  1. 4
      common/models/CarT.php
  2. 1
      common/models/SysIpT.php
  3. 20
      frontend/controllers/DatabaseController.php
  4. 16
      frontend/controllers/FinanceController.php
  5. 2
      frontend/controllers/InsurerController.php
  6. 35
      frontend/controllers/MarketingStrategyController.php
  7. 42
      frontend/controllers/SystemController.php
  8. 2
      frontend/views/insurer-type/index.php
  9. 4
      frontend/views/insurer/my-list-info.php
  10. 6
      frontend/views/insurer/office-mng-edit.php
  11. 4
      frontend/views/insurer/original-mng-edit.php
  12. 2
      frontend/views/marketing-strategy/index.php
  13. 2
      frontend/views/pay-type/edit.php
  14. 48
      frontend/views/system/edit.php
  15. 68
      frontend/views/system/ip-edit.php
  16. 152
      frontend/views/system/ip.php

@ -175,11 +175,7 @@ class CarT extends \common\models\Base
switch($this->location) { switch($this->location) {
case 1: case 1:
$car=CarT::findOne(['id'=>$this->id]); $car=CarT::findOne(['id'=>$this->id]);
if($car->qiyong==2){
$name = 'A库(永不启用)';
}else{
$name = 'A库'; $name = 'A库';
}
break; break;
case 2: case 2:
$carb=CarBT::findOne(['id'=>$this->id]); $carb=CarBT::findOne(['id'=>$this->id]);

@ -57,7 +57,6 @@ class SysIpT extends \common\models\Base
static public function getIpArray(){ static public function getIpArray(){
$list = self::find() $list = self::find()
->where('status = 1')
->orderBy('id ASC') ->orderBy('id ASC')
->all(); ->all();

@ -647,10 +647,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $user_id; $order_row->user_id = $user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $b_info->car->car_man; $order_row->id_man = $b_info->car->car_man;
$order_row->id_man_number = $b_info->car->id_number; $order_row->id_man_number = $b_info->car->id_man_number;
$order_row->link_man = $b_info->car->car_man; $order_row->link_man = $b_info->car->car_man;
$order_row->link_man_phone = $b_info->car->car_man_phone; $order_row->link_man_phone = $b_info->car->car_man_phone;
$order_row->link_man_number = $b_info->car->id_number; $order_row->link_man_number = $b_info->car->id_man_number;
if(!$order_row->save()) { if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true)); throw new \Exception(print_r($order_row->getErrors(),true));
} }
@ -824,7 +824,7 @@ class DatabaseController extends BaseController
$order_row->id_man = $b_info->car->car_man; $order_row->id_man = $b_info->car->car_man;
$order_row->link_man = $b_info->car->car_man; $order_row->link_man = $b_info->car->car_man;
$order_row->link_man_phone = $b_info->car->car_man_phone; $order_row->link_man_phone = $b_info->car->car_man_phone;
$order_row->link_man_number = $b_info->car->id_number; $order_row->link_man_number = $b_info->car->id_man_number;
$order_row->return_status_id = 0; $order_row->return_status_id = 0;
$order_row->return_remark = ''; $order_row->return_remark = '';
if(!$order_row->save()) { if(!$order_row->save()) {
@ -1214,10 +1214,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $user_id; $order_row->user_id = $user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $c_info->car->car_man; $order_row->id_man = $c_info->car->car_man;
$order_row->id_man_number = $c_info->car->id_number; $order_row->id_man_number = $c_info->car->id_man_number;
$order_row->link_man = $c_info->car->car_man; $order_row->link_man = $c_info->car->car_man;
$order_row->link_man_phone = $c_info->car->car_man_phone; $order_row->link_man_phone = $c_info->car->car_man_phone;
$order_row->link_man_number = $c_info->car->id_number; $order_row->link_man_number = $c_info->car->id_man_number;
if(!$order_row->save()) { if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true)); throw new \Exception(print_r($order_row->getErrors(),true));
} }
@ -1388,10 +1388,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $c_info->user_id; $order_row->user_id = $c_info->user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $c_info->car->car_man; $order_row->id_man = $c_info->car->car_man;
$order_row->id_man_number = $c_info->car->id_number; $order_row->id_man_number = $c_info->car->id_man_number;
$order_row->link_man = $c_info->car->car_man; $order_row->link_man = $c_info->car->car_man;
$order_row->link_man_phone = $c_info->car->car_man_phone; $order_row->link_man_phone = $c_info->car->car_man_phone;
$order_row->link_man_number = $c_info->car->id_number; $order_row->link_man_number = $c_info->car->id_man_number;
if(!$order_row->save()) { if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true)); throw new \Exception(print_r($order_row->getErrors(),true));
} }
@ -1889,10 +1889,10 @@ class DatabaseController extends BaseController
$order_row->user_id = $user_id; $order_row->user_id = $user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $d_info->car->car_man; $order_row->id_man = $d_info->car->car_man;
$order_row->id_man_number = $d_info->car->id_number; $order_row->id_man_number = $d_info->car->id_man_number;
$order_row->link_man = $d_info->car->car_man; $order_row->link_man = $d_info->car->car_man;
$order_row->link_man_phone = $d_info->car->car_man_phone; $order_row->link_man_phone = $d_info->car->car_man_phone;
$order_row->link_man_number = $d_info->car->id_number; $order_row->link_man_number = $d_info->car->id_man_number;
if(!$order_row->save()) { if(!$order_row->save()) {
throw new \Exception(print_r($order_row->getErrors(),true)); throw new \Exception(print_r($order_row->getErrors(),true));
} }
@ -2060,7 +2060,7 @@ class DatabaseController extends BaseController
$order_row->user_id = $d_info->user_id; $order_row->user_id = $d_info->user_id;
$order_row->status_id = 1; $order_row->status_id = 1;
$order_row->id_man = $d_info->car->car_man; $order_row->id_man = $d_info->car->car_man;
$order_row->id_man_number = $d_info->car->id_number; $order_row->id_man_number = $d_info->car->id_man_number;
$order_row->link_man = $d_info->car->car_man; $order_row->link_man = $d_info->car->car_man;
$order_row->link_man_phone = $d_info->car->car_man_phone; $order_row->link_man_phone = $d_info->car->car_man_phone;
$order_row->link_man_number = $d_info->car->id_man_number; $order_row->link_man_number = $d_info->car->id_man_number;

@ -3271,18 +3271,18 @@ class FinanceController extends \frontend\controllers\UserBaseController
for ($i = 7; $i <= $rowCount; $i++) { for ($i = 7; $i <= $rowCount; $i++) {
$cell = $currentSheet->getCellByColumnAndRow(1, $i); $cell = $currentSheet->getCellByColumnAndRow(1, $i);
$insurer_no = $cell->getValue();//$data[$i][1]; $insurer_no = $cell->getFormattedValue();//$data[$i][1];
// var_dump($insurer_no); // var_dump($insurer_no);
$cell = $currentSheet->getCellByColumnAndRow(2, $i); $cell = $currentSheet->getCellByColumnAndRow(2, $i);
$policy_man = $cell->getValue();//$data[$i][2]; $policy_man = $cell->getFormattedValue();//$data[$i][2];
$cell = $currentSheet->getCellByColumnAndRow(3, $i); $cell = $currentSheet->getCellByColumnAndRow(3, $i);
$total_real = $cell->getValue();//$data[$i][3]; $total_real = $cell->getFormattedValue();//$data[$i][3];
$cell = $currentSheet->getCellByColumnAndRow(4, $i); $cell = $currentSheet->getCellByColumnAndRow(4, $i);
$total_rate = $cell->getValue();//$data[$i][4]; $total_rate = $cell->getFormattedValue();//$data[$i][4];
$cell = $currentSheet->getCellByColumnAndRow(5, $i); $cell = $currentSheet->getCellByColumnAndRow(5, $i);
$pay_total = $cell->getValue();//$data[$i][5]; $pay_total = $cell->getFormattedValue();//$data[$i][5];
$cell = $currentSheet->getCellByColumnAndRow(6, $i); $cell = $currentSheet->getCellByColumnAndRow(6, $i);
$insurer_total = $cell->getValue();//$data[$i][6]; $insurer_total = $cell->getFormattedValue();//$data[$i][6];
$cell = $currentSheet->getCellByColumnAndRow(7, $i); $cell = $currentSheet->getCellByColumnAndRow(7, $i);
$insurer_date = $cell->getFormattedValue(); $insurer_date = $cell->getFormattedValue();
// var_dump($insurer_date); // var_dump($insurer_date);
@ -7618,10 +7618,6 @@ class FinanceController extends \frontend\controllers\UserBaseController
$query->offset($offset)->limit($limit); $query->offset($offset)->limit($limit);
$items = $query->all(); $items = $query->all();
$page_info = MyLib::getPageInfo($pagination);
$group_items = GroupT::getTree();
$data = []; $data = [];
$data['total'] = $total; $data['total'] = $total;
$data['rows'] = []; $data['rows'] = [];

@ -737,7 +737,7 @@ class InsurerController extends BaseController
$total1_rate = $request->post('total1_rate','0.00'); $total1_rate = $request->post('total1_rate','0.00');
$total2_rate = $request->post('total2_rate','0.00'); $total2_rate = $request->post('total2_rate','0.00');
$pay_no = $request->post('pay_no',0); $pay_no = $request->post('pay_no',0);
$company2_id = $request->post('company2_id',0); $company2_id = $request->post('company_id',0);
if($total1_rate == '') { if($total1_rate == '') {
$result['msg'] = '请输入商业跟单手续费!'; $result['msg'] = '请输入商业跟单手续费!';

@ -110,6 +110,31 @@ class MarketingStrategyController extends UserBaseController
return $result; return $result;
} }
public function actionDelete() {
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request;
$result = array();
$result['success'] = false;
$result['msg'] = '删除失败';
$id = $request->post('id',0);
if($id == 0)
return $result;
$tichengTypeT = ZhongjiYingxiao::findOne(['id'=>$id]);
if($tichengTypeT) {
$tichengTypeT->is_delete = 1;
$tichengTypeT->save();
}
$result['success'] = true;
$result['msg'] = '删除成功';
return $result;
}
public function actionUsers() { public function actionUsers() {
$request = Yii::$app->request; $request = Yii::$app->request;
$id = $request->get('id'); $id = $request->get('id');
@ -493,7 +518,7 @@ class MarketingStrategyController extends UserBaseController
} }
$items = ZhongjiTiaojian::find() $items = ZhongjiTiaojian::find()
->where('celuo_id=:celuo_id and type=1',[':celuo_id'=>$yingxiao_item->id]) ->where('celuo_id=:celuo_id and type=1',[':celuo_id'=>$yingxiao_item->id])
->andWhere(['<','baofei', $total1_clear]) ->andWhere(['<=','baofei', $total1_clear])
->all(); ->all();
$ids = []; $ids = [];
foreach($items as $item) { foreach($items as $item) {
@ -506,6 +531,8 @@ class MarketingStrategyController extends UserBaseController
$tmp_type_id = 2; $tmp_type_id = 2;
if(in_array($tmp_type_id, $car_type_ids)) { if(in_array($tmp_type_id, $car_type_ids)) {
$flag = true; $flag = true;
} else {
$flag = false;
} }
} }
//保险公司 //保险公司
@ -513,6 +540,8 @@ class MarketingStrategyController extends UserBaseController
$company_ids = explode(',',$item->company_ids); $company_ids = explode(',',$item->company_ids);
if(in_array($company2_id, $company_ids)) { if(in_array($company2_id, $company_ids)) {
$flag = true; $flag = true;
} else {
$flag = false;
} }
} }
//车辆使用类型 //车辆使用类型
@ -520,6 +549,8 @@ class MarketingStrategyController extends UserBaseController
$car_use_ids = explode(',',$item->car_use_id); $car_use_ids = explode(',',$item->car_use_id);
if(in_array($car_use_id, $car_use_ids)) { if(in_array($car_use_id, $car_use_ids)) {
$flag = true; $flag = true;
} else {
$flag = false;
} }
} }
//新保、续保 //新保、续保
@ -530,6 +561,8 @@ class MarketingStrategyController extends UserBaseController
$tmp_type_id = 2; $tmp_type_id = 2;
if(in_array($tmp_type_id, $type_ids)) { if(in_array($tmp_type_id, $type_ids)) {
$flag = true; $flag = true;
} else {
$flag = false;
} }
} }
if($flag) { if($flag) {

@ -19,7 +19,8 @@ class SystemController extends \yii\web\Controller
{ {
public $my = null; public $my = null;
public $web = null; public $web = null;
private $_STATE = 1; public $enableCsrfValidation = false;
public $layout = 'blue-main';
public function init() public function init()
{ {
@ -95,20 +96,26 @@ class SystemController extends \yii\web\Controller
* *
*/ */
public function actionIp() { public function actionIp() {
return $this->render('ip');
}
public function actionIpJson(){
Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
$name = $request->get('name');
$ips = SysIpT::find(); $ips = SysIpT::find()->orderBy('id ASC');
if($name != ''){ $total = $ips->count();
$ips = $ips->andWhere(['like','city_name',$name]); $items = $ips->all();
$data = [];
$data['total'] = $total;
$data['rows'] = [];
foreach($items as $item) {
$row = $item->toArray();
$data['rows'][] = $row;
} }
$ips = $ips->andWhere('status ='.$this->_STATE);
$data = $ips->orderBy('id ASC')->all();
return $this->render('ip',[ return $data;
'info' => $data,
'name' => $name,
]);
} }
/** /**
@ -119,7 +126,7 @@ class SystemController extends \yii\web\Controller
* @author liukangle * @author liukangle
* *
*/ */
public function actionEdit() public function actionIpEdit()
{ {
$request = Yii::$app->request; $request = Yii::$app->request;
@ -129,7 +136,7 @@ class SystemController extends \yii\web\Controller
} else { } else {
$info = new SysIpT(); $info = new SysIpT();
} }
return $this->render('edit',[ return $this->render('ip-edit',[
'info' => $info, 'info' => $info,
]); ]);
} }
@ -181,7 +188,7 @@ class SystemController extends \yii\web\Controller
* @author liukangle * @author liukangle
* *
*/ */
public function actionDel() public function actionIpDelete()
{ {
Yii::$app->response->format = Response::FORMAT_JSON; Yii::$app->response->format = Response::FORMAT_JSON;
$request = Yii::$app->request; $request = Yii::$app->request;
@ -194,11 +201,12 @@ class SystemController extends \yii\web\Controller
$id = $request->post('id'); $id = $request->post('id');
if($id > 0){ if($id > 0){
$row = SysIpT::findOne(['id'=>$id]); $row = SysIpT::findOne(['id'=>$id]);
$row->status = 0; if($row) {
$row->save(); $row->delete();
}
$result['success'] = true; $result['success'] = true;
$result['msg'] = '保存成功'; $result['msg'] = '删除成功';
} }
return $result; return $result;

@ -47,12 +47,14 @@ use \common\libs\MyLib;
<script> <script>
function opFormatter(value, row, index) { function opFormatter(value, row, index) {
var opStr = []; var opStr = [];
if(row.id > 12) {
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">'); opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
opStr.push('<i class="fa fa-edit" title="编辑"></i>'); opStr.push('<i class="fa fa-edit" title="编辑"></i>');
opStr.push('</a>'); opStr.push('</a>');
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">'); opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
opStr.push('<i class="fa fa-trash" title="删除"></i>'); opStr.push('<i class="fa fa-trash" title="删除"></i>');
opStr.push('</a>'); opStr.push('</a>');
}
return opStr.join(' '); return opStr.join(' ');
} }

@ -264,7 +264,7 @@ use common\models\PriceT;
html += '</div>'; html += '</div>';
$('#gifts').html(html); $('#gifts').html(html);
} else { } else {
parent.layer.msg(obj.msg); //parent.layer.msg(obj.msg);
} }
}, 'json'); }, 'json');
$.get('/marketing-strategy/get-gifts?type=2&order_id=<?=$order_info->id?>&fanxian_id=' + fanxian_id, function(obj){ $.get('/marketing-strategy/get-gifts?type=2&order_id=<?=$order_info->id?>&fanxian_id=' + fanxian_id, function(obj){
@ -303,7 +303,7 @@ use common\models\PriceT;
html += '</div>'; html += '</div>';
$('#quans').html(html); $('#quans').html(html);
} else { } else {
parent.layer.msg(obj.msg); //parent.layer.msg(obj.msg);
} }
}, 'json'); }, 'json');
} }

@ -225,7 +225,7 @@ use common\models\PriceT;
<select name="company_id" id="company_id" class="form-control"> <select name="company_id" id="company_id" class="form-control">
<option value="0">---请选择---</option> <option value="0">---请选择---</option>
<?php <?php
foreach($insurer_company_items as $item) { foreach($insurer_company2_items as $item) {
echo '<option value="'.$item->id.'"'; echo '<option value="'.$item->id.'"';
if($item->id == $order_info->company_id) if($item->id == $order_info->company_id)
echo ' selected '; echo ' selected ';
@ -293,7 +293,7 @@ use common\models\PriceT;
$.post('/insurer/office-mng-save',params,function(obj){ $.post('/insurer/office-mng-save',params,function(obj){
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
if(obj.success && status_id>2) { if(obj.success && status_id>2) {
$('.btn-back') $('.back-btn').click();
} }
},'json'); },'json');
} }
@ -312,7 +312,7 @@ use common\models\PriceT;
},function(obj){ },function(obj){
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
$('#back-btn').click(); $('.back-btn').click();
} }
},'json'); },'json');
}); });

@ -398,7 +398,7 @@ use common\models\PriceT;
$.post('/insurer/original-mng-save',params,function(obj){ $.post('/insurer/original-mng-save',params,function(obj){
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
if(obj.success && status_id>5) { if(obj.success && status_id>5) {
$('.btn-back') $('.btn-back').click();
} }
},'json'); },'json');
} }
@ -417,7 +417,7 @@ use common\models\PriceT;
},function(obj){ },function(obj){
parent.layer.msg(obj.msg); parent.layer.msg(obj.msg);
if(obj.success) { if(obj.success) {
$('#back-btn').click(); $('.btn-back').click();
} }
},'json'); },'json');
}); });

@ -71,7 +71,9 @@ use \common\libs\MyLib;
}, function(){ }, function(){
$.post('/marketing-strategy/delete',{id:id},function(data) { $.post('/marketing-strategy/delete',{id:id},function(data) {
parent.layer.msg(data.msg); parent.layer.msg(data.msg);
if(data.success) {
refreshList(); refreshList();
}
}, 'json'); }, 'json');
}, function(){ }, function(){
// //

@ -50,7 +50,7 @@ use \common\libs\MyLib;
parent.refreshList(); parent.refreshList();
layer_close(); layer_close();
} else { } else {
parent.layer.msg(data.msg); parent.layer.msg(obj.msg);
} }
},'json'); },'json');
}, function(){ }, function(){

@ -1,48 +0,0 @@
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table">
<form id="theFrm">
<input type="hidden" name="id" value="<?=$info->id?>">
<tr>
<td width="100" height="25" class="td_bg">城市</td>
<td height="25" class="td_bg">
<input name="city_name" type="text" id="city_name" value="<?= $info->city_name ?>" style="width:400px;"/>
</td>
</tr>
<tr>
<td width="100" height="25" class="td_bg">IP</td>
<td height="25" class="td_bg">
<input name="ip" type="text" id="ip" value="<?= $info->ip ?>" style="width:400px;"/>
</td>
</tr>
</form>
<tr>
<td height="22" colspan="2" align="center" class="td_bg">
<input id="submit-btn" type=button class="ACT_btn" name=Submit1 value=" 提交 "/>
&nbsp;&nbsp;
<input id="back-btn" type="button" class="ACT_btn" name="Submit2" value=" 返回 ">
</td>
</tr>
</table>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script>
<script type="text/javascript" language="javascript" src="/js/func.js"></script>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$("#submit-btn").click(function(){
if(confirm('是否确认提交?')) {
var params = $("#theFrm").serialize();
$.post('/system/ip-save',params,function(obj){
alert(obj.msg);
if(obj.success) {
$('#back-btn').click();
}
},'json');
}
});
//返回按钮
$('#back-btn').click(function(){
window.location.href='/system/ip';
});
})
</script>

@ -0,0 +1,68 @@
<?php
use \common\libs\MyLib;
?>
<?php $this->beginBlock('header_css'); ?>
<link href="/assets/css/plugins/iCheck/custom.css" rel="stylesheet">
<?php $this->endBlock(); ?>
<div class="wrapper wrapper-content animated fadeInRight">
<div class="ibox float-e-margins">
<div class="ibox-content">
<div class="row">
<div class="col-sm-12">
<form role="form" class="form-horizontal data-from" id="theFrm">
<input type="hidden" name="id" value="<?=intval($info->id)?>">
<div class="form-group">
<label class="col-sm-1 control-label">城市</label>
<div class="col-sm-6">
<input type="text" name="city_name" value="<?=$info->city_name?>" class="form-control">
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">IP</label>
<div class="col-sm-6">
<input type="text" name="ip" value="<?=$info->ip?>" class="form-control">
</div>
</div>
<div>
<div class="row">
<div class="col-sm-5 col-sm-offset-5">
<button class="btn btn-primary btn-save" type="button">
<strong><?=$info ? '保 存':'添 加'?></strong>
</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script type="text/javascript" language="javascript">
$(function () {
//提交按钮
$(".btn-save").click(function(){
parent.layer.confirm('是否确认提交?', {
btn: ['确认','取消'], //按钮
shade: false //不显示遮罩
}, function(){
var params = $("#theFrm").serialize();
$.post('/system/ip-save',params,function(obj){
if(obj.success) {
parent.layer.msg('保存成功');
parent.refreshList();
layer_close();
} else {
parent.layer.msg(obj.msg);
}
},'json');
}, function(){
//
});
});
})
</script>
<?php $this->endBlock('footer_js'); ?>

@ -1,76 +1,98 @@
<?php <?php
use \common\libs\MyLib; use \common\libs\MyLib;
?> ?>
<script type="text/javascript" language="javascript" src="/js/jquery-1.8.3.js"></script> <?php $this->beginBlock('header_css'); ?>
<script type="text/javascript" language="javascript" src="/js/ajax.js"></script> <link href="/assets/css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
<script type="text/javascript" language="javascript" src="/js/func.js"></script> <?php $this->endBlock(); ?>
<script type="text/javascript" language="javascript">
$(function(){ <div class="wrapper wrapper-content animated fadeInRight">
$('#add-btn').click(function(){ <div class="ibox float-e-margins">
edit(0); <div class="ibox-title">
}); <h5>外网IP管理</h5>
$("#search-btn").click(function(){ <div class="ibox-tools">
var params = $('#searchForm').serialize(); <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="create(0)">
window.location.href = "/system/ip?" + params; <i class="fa fa-plus"></i> 添加
}); </a>
}); <a class="btn btn-primary btn-xs edit-btn" data-id="0" href="javascript:void(0);" onclick="$('#listTable').bootstrapTable('refresh');">
//编辑 <i class="fa fa-refresh"></i> 刷新
</a>
</div>
</div>
<div class="ibox-content">
<div class="row">
<div class="col-md-12">
<table id="listTable">
<thead>
<tr>
<th width="50" data-field="id">ID</th>
<th data-field="city_name">城市</th>
<th data-field="ip">IP</th>
<th data-formatter="opFormatter">操作</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>
</div>
<?php $this->beginBlock('footer_js'); ?>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/bootstrap-table-mobile.min.js"></script>
<script src="/assets/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.min.js"></script>
<script>
function opFormatter(value, row, index) {
var opStr = [];
opStr.push('<a href="javascript:void(0);" onclick="edit(' + row.id + ')">');
opStr.push('<i class="fa fa-edit" title="编辑"></i>');
opStr.push('</a>');
opStr.push('<a href="javascript:void(0);" onclick="del(' + row.id + ')">');
opStr.push('<i class="fa fa-trash" title="删除"></i>');
opStr.push('</a>');
return opStr.join(' ');
}
function create() {
title = '新增IP';
layer_show(title, '/system/ip-edit?id=0');
}
function edit(id) { function edit(id) {
window.location.href = '/system/edit?id=' + id; var title = '编辑IP';
layer_show(title, '/system/ip-edit?id=' + id);
} }
//删除
function del(id) { function del(id) {
if(confirm('是否确认删除?')) { parent.layer.confirm('是否确认删除?', {
$.post('/system/del',{id:id},function(obj){ btn: ['删除','取消'], //按钮
alert(obj.msg); shade: false //不显示遮罩
if(obj.success) { }, function(){
window.location.reload(); $.post('/system/ip-delete',{id:id},function(data) {
} parent.layer.msg(data.msg);
refreshList();
}, 'json'); }, 'json');
}, function(){
//
});
} }
function refreshList() {
$('#listTable').bootstrapTable('refresh');
} }
</script>
<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" class="table"> function search() {
<form id="searchForm"> $('#listTable').bootstrapTable('destroy');
<tr> $('#listTable').bootstrapTable({
<td class="td_bg"> url: "/system/ip-json",
名称:<input name="name" type="text" value="<?= $name ?>"> pagination: false,
<input type="button" class="act_btn" id="search-btn" name="search-btn" value="搜索"> sidePagination: 'server',
<input type="button" class="act_btn" id="add-btn" name="add-btn" value="添加"> queryParams: function(params) {
</td> return params;
</tr>
</form>
</table>
<table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
<?php
if($info){
?>
<tr>
<td width="10%" align="center" align="center" class="bg_tr" nowrap>序列号</td>
<td width="30%" align="center" align="center" class="bg_tr">城市</td>
<td width="20%" align="center" align="center" class="bg_tr">IP</td>
<td width="40%" align="center" class="bg_tr">操作</td>
</tr>
<?php
foreach($info as $index => $item){
?>
<tr onMouseOver=overColor(this) onMouseOut=outColor(this)>
<td align="center" class="td_bg" nowrap ><?= $index+1 ?></td>
<td align="left" class="td_bg" nowrap ><?= $item->city_name ?></td>
<td align="left" class="td_bg" nowrap ><?= $item->ip ?></td>
<td align="center" class="td_bg" nowrap>
[<a href="javascript:void(0);" onclick="edit(<?= $item->id ?>)">修改</a>]
[<a href="javascript:void(0);" onclick="del(<?= $item->id ?>)">删除</a>]
</td>
</tr>
<?php
} }
?> });
<?php
}else{
?>
<tr>没有查到数据</tr>
<?php
} }
?>
</table> $(function() {
search();
});
</script>
<?php $this->endBlock(); ?>

Loading…
Cancel
Save