• 多年级勾选


        function updatenews(){
            $id=I("id");
            $data=M("series")->find($id);
            
            //调取年级
            $grade=M('activity_grade')->where("1")->order("id asc")->select();
            $this->assign("grade",$grade);
      
        
            $activity_inner= M('activity_grade_map')->field("grade_id")->where(array('activity_id' => $id,'type'=>'2'))->select();
            
     
            foreach($activity_inner as $key=>$value) {
                 $grades[] = $value["grade_id"];
            }
           
            
            $this->assign("grades",$grades);
            
            $this->assign("data",$data);
            $this->display();
        }

    <div class="control-group">
                        <label class="control-label">{:L('适合年级')}</label>
                        <div class="controls">
                          <label>
                          
                          
                          <volist name="grade" id="item" key="key" >
                            <input name="grade_id[]" type="checkbox" id="grade_id[]" value="{$item.id}" <?php if(in_array($item['id'], $grades)) { echo "checked";} ?> >
                        
                          {$item.name}&nbsp;&nbsp;
                            
                            </volist>
                            
                          </label>
                        
                        </div>
                    </div>

  • 相关阅读:
    4种xml解析器区别
    eclipse的快捷键(常用)
    eclipse修改项目访问前缀
    oracle创建用户
    导入安全证书到jdk
    laravel 命令行输出进度条
    sql 事务的四种隔离级别
    supervisor 通过图形界面管理
    supervisor "INFO spawnerr: unknown error making dispatchers for xxx" 错误
    linux expect 的使用
  • 原文地址:https://www.cnblogs.com/wlfozu/p/7905555.html
Copyright © 2020-2023  润新知