按条件和值列查询指标列组

时间:2014-09-10 02:43:24

标签: html yii html-table builder

我有一张如下表格:

id | aspect | indicator  | condition     | value | description

1  | Aspek 1| indicator1 | condition A   | 1     | Poor
2  | Aspek 1| indicator1 | condition B   | 2     | Good
3  | Aspek 1| indicator1 | condition C   | 3     | Perfect

4  | Aspek 1| indicator2 | condition D   | 1     | Less
5  | Aspek 1| indicator2 | condition E   | 2     | More
6  | Aspek 1| indicator2 | condition F   | 3     | Full

7  | Aspek 2| indicator3 | condition G   | 1     | Poor
8  | Aspek 2| indicator3 | condition H   | 2     | Good
9  | Aspek 2| indicator3 | condition I   | 3     | Perfect

10  | Aspek 2| indicator4 | condition J  | 1     | Less
11  | Aspek 2| indicator4 | condition K  | 2     | More
12  | Aspek 2| indicator4 | condition L  | 3     | Full

我可以使用下面显示的代码迭代表行,但是我无法使用下面的单选按钮列出条件并基于指标列执行列分组。

<code>
    <table id="example1" class="table table-bordered table-hover">
    <thead>
    <tr>
    <th width="25">No.</th>
    <th>Indikator</th>
    <th colspan="3" nowrap="nowrap" style="text-align:center">Poin</th>
    </tr>
    </thead>
    <tbody>
    <tr>
    <td>1</td>
    <td>Pengurus</td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k1" class="flat-red" data-id="k01" /> 1 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k1" class="flat-red" data-id="k01" /> 2 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k1" class="flat-red" data-id="k01" /> 3 </td>
    </tr>
    <tr>
    <td>2</td>
    <td>Pembagian Tugas</td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k2" class="flat-red" data-id="k12" /> 1 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k2" class="flat-red" data-id="k12" /> 2 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k2" class="flat-red" data-id="k12" /> 3 </td>
    </tr>
    <tr>
    <td>3</td>
    <td>Admninistrasi Kelompok (Pembukuan lengkap)</td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k3" class="flat-red" data-id="k23" /> 1 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k3" class="flat-red" data-id="k23" /> 2 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k3" class="flat-red" data-id="k23" /> 3 </td>
    </tr>
    <tr>
    <td>4</td>
    <td>Kerjasama antar KUBE</td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k4" class="flat-red" data-id="k34" /> 1 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k4" class="flat-red" data-id="k34" /> 2 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k4" class="flat-red" data-id="k34" /> 3 </td>
    </tr>
    <tr>
    <td>5</td>
    <td>Proses pengambilan keputusan</td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k5" class="flat-red" data-id="k45" /> 1 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k5" class="flat-red" data-id="k45" /> 2 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k5" class="flat-red" data-id="k45" /> 3 </td>
    </tr>
    <tr>
    <td>6</td>
    <td>Pertemuan anggota</td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k6" class="flat-red" data-id="k56" /> 1 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k6" class="flat-red" data-id="k56" /> 2 </td>
    <td nowrap="nowrap" style="text-align:center"><input type="radio" name="k6" class="flat-red" data-id="k56" /> 3 </td>
    </tr>
    </tbody>
    <tfoot>
    <tr>
    <th></th>
    <th style="text-align:center">Sub Nilai Aspek Kelembagaan</th>
    <th width="6%">Poin</th>
    <th width="6%">Poin</th>
    <th width="6%">Poin</th>
    </tr>
    </tfoot>
    </table>
    </code>

请帮我按正确的顺序迭代指标列,并使用正确的条件和值。

0 个答案:

没有答案