83 lines
3.8 KiB
PHP
Executable File
83 lines
3.8 KiB
PHP
Executable File
<?php
|
|
use yii\helpers\Html;
|
|
use yii\helpers\Url;
|
|
use yii\bootstrap\ActiveForm;
|
|
use yii\widgets\LinkPager;
|
|
|
|
$this->title = '城市列表';
|
|
$this->params['breadcrumbs'][] = $this->title;
|
|
?>
|
|
<div class="wrapper wrapper-content">
|
|
<div class="row">
|
|
<div class="col-xs-12">
|
|
<div class="ibox float-e-margins">
|
|
<div class="ibox-title">
|
|
<h5>搜索</h5>
|
|
</div>
|
|
<div class="ibox-content">
|
|
<div class="row">
|
|
<div class="table-responsive">
|
|
<form class="form-search" method="get" action="<?=Url::current(['pid' => Yii::$app->session->get('pid')], false);?>" role="form">
|
|
<input type="hidden" name="_csrf-backend" value="<?= Yii::$app->getRequest()->getCsrfToken();?>" />
|
|
<div class="form-group draggable">
|
|
<div class="col-sm-5">
|
|
<div class="input-group">
|
|
<input type="text" class="form-control" name="title" value="<?=isset($search['title']) ? $search['title']:''?>" placeholder="输入城市名称;支持模糊检索" autocomplete="off">
|
|
<span class="input-group-btn"> <button type="button" class="btn btn-primary">搜索
|
|
</button> </span>
|
|
<span class="hidden input-group-btn"> <a class="btn btn-info" href="<?=Url::toRoute('city/new')?>" target="_blank">去新增一个
|
|
</a> </span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-sm-12">
|
|
<div class="ibox float-e-margins">
|
|
<div class="ibox-title">
|
|
<h1><?= Html::encode($this->title) ?></h1>
|
|
</div>
|
|
<div class="ibox-content">
|
|
<div class="table-responsive">
|
|
<table class="table table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>城市</th>
|
|
<th>操作</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php foreach($citys as $vo):?>
|
|
<tr>
|
|
<td><?=$vo['id']?></td>
|
|
<td><?=$vo['name']?></td>
|
|
<td>
|
|
<a onclick="parent.selectCity('<?=$vo['name']?>','<?=$vo['id']?>','<?=$callback?>');" href="javascript:void(0);" class="btn btn-xs btn-info">选择</a>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach;?>
|
|
</tbody>
|
|
</table>
|
|
<!--分页-->
|
|
<div class="f-r">
|
|
<?= LinkPager::widget([
|
|
'pagination'=>$pager,
|
|
'firstPageLabel' => '首页',
|
|
'nextPageLabel' => '下一页',
|
|
'prevPageLabel' => '上一页',
|
|
'lastPageLabel' => '末页',
|
|
]) ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|