<?php
use yii\helpers\Url;
use common\models\User;
use qcbase\models\ContractStatus;
use yii\widgets\ActiveForm;
use qcbase\models\Auth;

/* @var $this yii\web\View */


?>
<div class="nav">
	<ul class="cc">
		<li class="current"><a href="<?= Url::to(['payment-method/index']) ?>">付款类型</a></li>
		<li ><a href="<?= Url::to(['payment-method/create']) ?>">添加类型</a></li>
	</ul>
</div>

<?= $this->render('/site/_search', ['get' => $get, 'model' => $model]); ?>

<div class="table_list">
	<?php $mainForm = ActiveForm::begin([ 'id' => 'main-form', 'action' => '']); ?>
		<table width="100%">
			<thead>
				<tr>
					<td width="5%"><input type="checkbox" name="select_all" class="box-select-all" />全选</td>
                    <td width="5%">排序</td>
					<td width="5%">ID</td>
					<td width="10%">类型名称</td>
					<td width="21%">创建时间</td>
					<td width="5%">状态</td>
					<td width="20%" align="center">操作</td>
				</tr>
			</thead>
			<?php if (empty($models)) : ?>
				<tr><td colspan="10" class="tac red">还没有任何数据...</td></tr>
			<?php else : ?>
				<?php foreach ($models as $model) : ?>
              
				<tr>
					<td><input type="checkbox" name="delete[]" class="box-delete" value="<?= $model->method_id ?>" /></td>
                    <td><input type="text" size="4" value="<?= $model->sort ?>" class="input" name="sort[<?= $model->method_id ?>]" /></td>
                    <td><?= $model->method_id ?></td>
					<td><?= $model->name ?></td>
					<td><?=  date('Y-m-d H:i:s',$model->create_time)?></td>
                    <td><?= ($model->status == ContractStatus::STATUS_ENABLE) ? '<font color="green">启用</font>' : '<font color="red">禁用</font>' ?></td>
					<td align="center" >
						<a href="<?= Url::to(['payment-method/view', 'id' => $model->method_id]) ?>" >编辑</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="<?= Url::to(['payment-method/delete', 'id'=>$model->method_id]) ?>" class="link-delete" >删除</a>
					</td>
				</tr>
				<?php endforeach; ?>
			<?php endif; ?>
			
		</table>
	<?php ActiveForm::end(); ?>
</div>
<div class="pages">
<?= \yii\widgets\LinkPager::widget([
      'pagination' => $pages,
 ]); ?>
</div>

<div class="btn_wrap">
	<div class="btn_wrap_pd">
        <button class="btn btn_submit mr10 batch-delete" data-url="<?= Url::to(['payment-method/delete', 'id' => '']) ?>" type="submit" >删除</button>
        <button class="btn  mr10 batch-sort" data-url="<?= Url::to(['sort']) ?>" type="submit">排序</button>
	</div>
</div>

