123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <?php
- /**
- * Created by PhpStorm.
- * User: Administrator
- * Date: 2017/3/17 0017
- * Time: 上午 10:52
- */
- use yii\helpers\Url;
- use yii\widgets\LinkPager;
- use yii\widgets\ActiveForm;
- use company\controllers\BuildingController;
- ?>
- <style>
- .color{
- color: red;
- }
- </style>
- <form id="myform"action="" method="get">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content form-horizontal">
- <div class="form-group">
- <label class="col-sm-2 control-label">建议:</label>
- <div class="col-sm-10" style="padding-left:0">
- <textarea style="width: 220px;height:150px;float: left;" name="content" class="form-control " rows="2" maxlength="120"></textarea>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-2 control-label">email:</label>
- <div class="col-sm-10" style="padding-left:0">
- <input style="width: 220px;float: left;" type="email" id="email" name="email" class="form-control " rows="2" maxlength="120" >
- </div>
- </div>
- <div class="form-group">
- <div class="col-sm-2"></div>
- <div class="col-sm-10">
- <a class="btn btn-primary" id="submit">反馈</a>
- </label>
- </div>
- </div>
- </div>
- </div>
- </div>
- </form>
- <div class="row">
- <div class="col-sm-12">
- <div class="ibox float-e-margins">
- <div class="ibox-content">
- <div class="table-responsive">
- <table class="table table-striped">
- <thead>
- <tr>
- <th>反馈意见</th>
- <th>联系方式</th>
- <th>创建时间</th>
- <th>状态</th>
- </tr>
- </thead>
- <tbody>
- <?php if(!empty($models)):?>
- <?php foreach($models as $mo):?>
- <tr class="">
- <td><?=$mo->content?></td>
- <td><?=$mo->contact?></td>
- <td><?=date('Y-m-d H:i:s',$mo->created_at)?></td>
- <td><?=$mo->state==0?"待处理":"已处理"?></td>
- </tr>
- <?php endforeach;?>
- <?php endif?>
- </tbody>
- </table>
- <?= LinkPager::widget(['pagination' => $pages]); ?>
- </div>
- </div>
- </div>
- </div>
- </div>
- <script>
- $('#submit').click(function(){
- var email = $('#email').val();
- var re = /^[0-9A-Za-z][\.-_0-9A-Za-z]*@[0-9A-Za-z]+(\.[0-9A-Za-z]+)+$/;
- if(email == ""){
- layer.msg("邮箱不能为空");return false;
- }else if(!re.test(email)){
- layer.msg("邮箱格式不正确 ");return false;
- }else{
- $.ajax({
- url:'<?=Url::toRoute(['feekback/create']);?>',
- type:'GET',
- dataType:'json',
- data:$('#myform').serialize(),
- success:function(data){
- layer.msg(data.msg);
- }
- })
- }
- });
- </script>
|