表格内容太多,就用按钮来调用字段内容
//显示调用周次<=?$week?>
<?php
$userr=sys_ShowMemberInfo($myuserid,'');
$week=array('星期日','星期一','星期二','星期三','星期四','星期五','星期六');
$w=date("w",$navinfor['newstime']);
?>
//多值字段取值
<?php
$test=explode("||||||",$navinfor['k12']);//分割多值字段到列
$class1=explode("::::::",$test[0]); //再次分割列到行,然后取值$class1[0]等
$class2=explode("::::::",$test[1]); //这里class是班级的意思,class1,就是一班行的值,是一个数组
$class3=explode("::::::",$test[2]);
$class4=explode("::::::",$test[3]);
$class5=explode("::::::",$test[4]);
$class6=explode("::::::",$test[5]);
$class7=explode("::::::",$test[6]);
$class8=explode("::::::",$test[7]);
$class9=explode("::::::",$test[8]);
$class10=explode("::::::",$test[9]);
$class11=explode("::::::",$test[10]);
$class12=explode("::::::",$test[11]);
$class13=explode("::::::",$test[12]);
$class14=explode("::::::",$test[13]);
$class15=explode("::::::",$test[14]);
$class16=explode("::::::",$test[15]);
$class17=explode("::::::",$test[16]);
$class18=explode("::::::",$test[17])
?>
备注信息内容较多,放在表格内就撑破了,所以用按钮弹出显示备注内容,也就是字段$class1[5]的值。
下面是显示字段值的js
<script type="text/javascript">
function showMessage1(){alert('<?=$class1[5]?>'); };
function showMessage2(){alert('<?=$class2[5]?>'); };
function showMessage3(){alert('<?=$class3[5]?>'); };
function showMessage4(){alert('<?=$class4[5]?>'); };
function showMessage5(){alert('<?=$class5[5]?>'); };
function showMessage6(){alert('<?=$class6[5]?>'); };
function showMessage7(){alert('<?=$class7[5]?>'); };
function showMessage8(){alert('<?=$class8[5]?>'); };
function showMessage9(){alert('<?=$class9[5]?>'); };
function showMessage10(){alert('<?=$class10[5]?>'); };
function showMessage11(){alert('<?=$class11[5]?>'); };
function showMessage12(){alert('<?=$class12[5]?>'); };
function showMessage13(){alert('<?=$class13[5]?>'); };
function showMessage14(){alert('<?=$class14[5]?>'); };
function showMessage15(){alert('<?=$class15[5]?>'); };
function showMessage16(){alert('<?=$class16[5]?>'); };
function showMessage17(){alert('<?=$class17[5]?>'); };
function showMessage18(){alert('<?=$class18[5]?>'); };
function showMessage19(){alert('<?=$class19[5]?>'); };
function showMessage20(){alert('<?=$class20[5]?>'); };
</script>
<table style="text-align: center;" border="1" width="100%"cellpadding="0" cellspacing="0" class="title_info" border-radius="0px 0px 10px 0px" id="ulScores1">
<tr>
<td width='13%'>1班</td>
<td width='12%'>
<?=$class1[0]?>
</td>
<td width='12%'>
<?=$class1[1]?>
</td>
<td width='12%'>
<?=$class1[2]?>
</td>
<td width='12%'>
<?=$class1[3]?>
</td>
<td width='12%'>
<?=$class1[4]?>
</td>
<td width='12%'>
<script> var ulScores = document.getElementById('ulScores1');var tds = ulScores.getElementsByTagName('td');var sum = 0;for(var i=1;i<tds.length-1;i++){sum += parseFloat(tds[i].innerText);}document.write( sum);</script>
</td>
<td width='12%'>
<button style="font-size:8pt" onclick="showMessage1()" id="triggerBtn1">查看</button>
</td>
</tr>
</table>
这里计算分数就不记录了
按钮
<button style="font-size:8pt" onclick="showMessage1()" id="triggerBtn1">查看</button>
ok
|