viewpage_nmsjsc2.html 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <div align="left" style="background-color:#F7FCFF;line-height:25px">
  2. <form name="wenjuan">
  3. <?php
  4. foreach($da['arr']['itemarr'] as $k1=>$rs1){
  5. ?>
  6. <div style="margin:5px 10px">
  7. <div style="font-weight:bold"><?=$k1+1?>、<?=$rs1['itemname']?></div>
  8. <div style="color:#888888;font-size:12px;"><?=$rs1['itemcont']?></div>
  9. <?php
  10. $str = '';
  11. $xuan= explode(',','a,b,c,d,e,f,g,h,i,k');
  12. $tyname = 'itemname_'.$rs1['id'].'';
  13. if($da['arr']['hlx']=='true'){
  14. if($rs1['itemtype']<='1'){
  15. $typess = 'radio';
  16. if($rs1['itemtype']=='1'){
  17. $typess = 'checkbox';
  18. $tyname.= '[]';
  19. }
  20. foreach($xuan as $xzm){
  21. if(!isempt(arrvalue($rs1,'item'.$xzm.''))){
  22. $bili = $rock->number(($rs1['daan'.$xzm.'']/$rs1['zong'])*100);
  23. $str .= '<div><input type="'.$typess.'" name="'.$tyname.'" value="'.$xzm.'">'.$rs1['item'.$xzm.''].'&nbsp;<span style="font-size:12px;color:#888888">'.$rs1['daan'.$xzm.''].'票('.$bili.'%)</font></div>';
  24. $str .= '<div style="margin-bottom:5px;border:1px #DCECF7 solid;height:8px;width:100%;overflow:hidden"><div style="background:#6CB0DD;width:'.$bili.'%;height:8px"></div></div>';
  25. }
  26. }
  27. }else{
  28. $str = $rs1['showcont'];
  29. }
  30. }else{
  31. if($rs1['itemtype']<='1'){
  32. $typess = 'radio';
  33. if($rs1['itemtype']=='1'){
  34. $typess = 'checkbox';
  35. $tyname.= '[]';
  36. }
  37. foreach($xuan as $xzm){
  38. if(!isempt(arrvalue($rs1,'item'.$xzm.''))){
  39. $chek = '';
  40. if(contain(','.$rs1['daan'].',',','.$xzm.','))$chek='checked';
  41. if($da['arr']['tjcount']>0)$chek.=' disabled';
  42. $str .= '<div><label><input type="'.$typess.'" '.$chek.' name="'.$tyname.'" value="'.$xzm.'">'.$rs1['item'.$xzm.''].'</label></div>';
  43. }
  44. }
  45. }
  46. if($rs1['itemtype']=='2'){
  47. $disa = ($da['arr']['tjcount']>0) ? 'disabled' : '';
  48. $str .= '<div><textarea class="inputs" '.$disa.' name="'.$tyname.'" style="width:90%;height:60px">'.$rs1['daan'].'</textarea></div>';
  49. }
  50. }
  51. echo $str;
  52. ?>
  53. </div>
  54. <?php }?>
  55. </form>
  56. <div style="margin:15px">
  57. <?php
  58. if($da['arr']['hlx']!='true'){
  59. if($da['arr']['tjcount']==0){
  60. echo '<input onclick="submittoupiao(this)" style="background:#800000" type="button" value="提交问卷" class="webbtn">';
  61. }else{
  62. echo '<font color=#888888>'.$da['arr']['showname'].' 已经提交过了</font>';
  63. }
  64. }
  65. ?>
  66. <span id="msgview"></span></div>
  67. </div>
  68. <script>
  69. function submittoupiao(o1){
  70. var da = js.getformdata('wenjuan');
  71. o1.disabled=true;
  72. js.setmsg('提交中...');
  73. da.mid = mid;
  74. js.ajax(geturlact('submitwenjian'),da,function(s){
  75. if(s=='ok'){
  76. js.setmsg('提交成功','green');
  77. js.reload();
  78. }else{
  79. js.setmsg(s);
  80. o1.disabled=false;
  81. }
  82. });
  83. }
  84. </script>