<style>
.table-header td{
width: 100px;
height: 40px;
line-height: 40px;
text-align: center;
}
</style>
<table class="table-header">
<tr>
<td rowspan="4" width="92" class="table-pic">
<div class="pic" style="width: 80px;">
<img src="__ADMIN__UPLOAD__/{$img.values}??null" onerror="this.src='/xinhui{$cimg}'" id="img_data1" on class="js-upload" alt="">
</div>
</td>
<td rowspan="2">名称</td>
<td style="width: 40%;" rowspan="2" colspan="2">{$data['6']}</td>
<td>编号</td>
<td style="width: 20%;">{$data['3']}</td>
</tr>
<tr>
<td>生效日期</td>
<td>{$data['2']}</td>
</tr>
<tr>
<td>类别</td>
<td colspan="2">{$data['5']}</td>
<td>修订日期</td>
<td>{$data['1']}</td>
</tr>
<tr>
<td>制定部门</td>
<td colspan="2">{$data['4']}</td>
<td>页码</td>
<td>{$data['0']}</td>
</tr>
</table>
//查询title和value的值
$wheres1['regulations_id'] = $id;
$wheres1['title'] = '名称';
$wheres1['version'] = $max;
$name =Db::name('regulationsdtl_header')->where($wheres1)->field('values')->select();
if (empty($name)){
$name[0]['values'] = '';
}
$wheres2['regulations_id'] = $id;
$wheres2['title'] = '类别';
$wheres2['version'] = $max;
$category =Db::name('regulationsdtl_header')->where($wheres2)->field('values')->select();
if (empty($category)){
$category[0]['values'] = '';
}
$wheres3['regulations_id'] = $id;
$wheres3['title'] = '制定部门';
$wheres3['version'] = $max;
$department =Db::name('regulationsdtl_header')->where($wheres3)->field('values')->select();
if (empty($department)){
$department[0]['values'] = '';
}
$wheres4['regulations_id'] = $id;
$wheres4['title'] = '编号';
$wheres4['version'] = $max;
$number =Db::name('regulationsdtl_header')->where($wheres4)->field('values')->select();
if (empty($number)){
$number[0]['values'] = '';
}
$wheres5['regulations_id'] = $id;
$wheres5['title'] = '生效日期';
$wheres5['version'] = $max;
$date =Db::name('regulationsdtl_header')->where($wheres5)->field('values')->select();
if (empty($date)){
$date[0]['values'] = '';
}
$wheres6['regulations_id'] = $id;
$wheres6['title'] = '修订日期';
$wheres6['version'] = $max;
$up_date =Db::name('regulationsdtl_header')->where($wheres6)->field('values')->select();
if (empty($up_date)){
$up_date[0]['values'] = '';
}
$wheres7['regulations_id'] = $id;
$wheres7['title'] = '页码';
$wheres7['version'] = $max;
$page =Db::name('regulationsdtl_header')->where($wheres7)->field('values')->select();
if (empty($page)){
$page[0]['values'] = '';
}
$data = array();
array_unshift($data,$name[0]['values']);
array_unshift($data,$category[0]['values']);
array_unshift($data,$department[0]['values']);
array_unshift($data,$number[0]['values']);
array_unshift($data,$date[0]['values']);
array_unshift($data,$up_date[0]['values']);
array_unshift($data,$page[0]['values']);
// var_dump($data);die();
$this->assign('data', $data);