类似文章列表编辑如何在弹出对应窗口中显示表格中的content信息,并且修改后点击确定保存到数据库

浏览:698 发布日期:2016/10/19 分类:求助交流 关键字: thinkphp3.2 列表编辑 获取数据库信息 修改数据库信息
 public function caozuo(){
        $User = M('Info');
        // 读取数据
        $aid=$_GET['aid'];
        $User->where("id=$aid")->find();
        if($vo){
            $this->vo =   $vo;// 模板变量赋值
            }else{
                    $this->error('数据错误');
                }
                $User->getLastSql();
                $this->display();}
<div class="am-modal am-modal-confirm" tabindex="-1" id="my-confirm">
  <div class="am-modal-dialog">
    <div class="am-modal-hd"><strong class="am-text-primary am-text-lg">客户信息</strong></div>
    <hr>
    <div class="am-modal-bd">
      <form action="<{:U('Index/caozuo')}>" method="post" class="am-form">
          <div class="am-g am-margin-top">
            <div class="am-u-sm-4 am-u-md-2 am-text-right">意向等级</div>
            <div class="am-u-sm-8 am-u-md-10">
              <select data-am-selected="{btnSize: 'sm'}" id="" name="">
                <option value="0" selected = "selected">___请选择___</option>
                <option value="A">选项A</option>
                <option value="B">选项B</option>
                <option value="C">选项C</option>
                <option value="D">选项D</option>
              </select>
            </div>
            <div class="am-hide-sm-only am-u-md-6">*必填,不可重复</div>
          </div>
            <div class="am-g am-margin-top-sm">
              <div class="am-u-sm-4 am-u-md-2 am-text-right">
                备注信息
              </div>
              <div class="am-u-sm-8 am-u-md-4 am-u-end">
                <textarea name="content" id='content' rows="4" placeholder="获取数据库表格qj_info中content内容"><{$vo.content}></textarea>
              </div>
              <div class="am-hide-sm-only am-u-md-6"><label for="content">(您还可以输入 <span id='font-num'>50</span> 个字)</label></div>
            </div> 
          <hr><div class="am-modal-footer">
               <span class="am-modal-btn" data-am-modal-confirm>确定</span> 
               <span class="am-modal-btn" data-am-modal-cancel>取消</span>
              </div>
      </form>
    </div>
  </div>
</div>
<!-- 弹出窗口内容 end -->
<div class="am-g">
        <div class="am-u-sm-12" style="overflow: auto;"></div>
        <div class="caption caption_1">
         <h2>客户数</h2>
          <table class="am-table am-table-bd am-table-striped admin-content-table">
            <thead>
            <tr>
              <th>ID</th><th>姓名</th><th>购买车型</th><th>贷款金额</th><th>还款周期</th><th>联系电话</th><th>dateline</th><th>备注</th><th>管理</th>
            </tr>
            </thead>
            <tbody>
            <volist name="clientInfo" id="vo">
            <tr>
              <td><a href="#"><{$vo.id}></a></td>
              <td><a href="#"><{$vo.name}></td>
              <td><span class="am-badge am-badge-success"><{$vo.product}></span></td>
              <td><a href="#"><{$vo.money}></a></td> 
              <td><a href="#"><{$vo.deadline}></a></td> 
              <td><span class="am-badge am-badge-success"><{$vo.phone}></span></td>
              <td><a href="#"><{$vo.dateline}></td>
              <td><span class="am-badge"><{$vo.remark}></span></td>
              <td>
                <div class="am-dropdown" data-am-dropdown>
                  <button class="am-btn am-btn-default am-btn-xs am-dropdown-toggle" data-am-dropdown-toggle>
                  <span class="am-icon-cog"></span> <span class="am-icon-caret-down"></span></button>
                   <ul class="am-dropdown-content">
<!--                     <li>
                    <a class="btn"  title="编辑" onClick="bianji(<{$vo.id}>)" href="<{:U('Index/handle',array('id'=>$vo['id']))}>">1. 编辑</a>
                    </li> -->
                    <li><button type="submit" class="am-btn am-btn-warning caozuo" onclick="<{:U('Index/caozuo',array('id'=>$vo['id']))}>">2. 操作</button></li>
                    <li><a id="xiugai" class="btn" onclick="return(confirm('确定要修改吗?'))" href="#" title="修改" >3. 查看</a></li>
                  </ul>
                </div>
              </td>
            </tr>
            </volist>
            </tbody>
          </table>
          </div>
最佳答案
评论() 相关
后面还有条评论,点击查看>>