viewpage_gong.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. //这个页面是显示投票的
  3. if($da['arr']['istoupiao']>0){
  4. $touarr = $da['arr']['touarr'];
  5. ?>
  6. <div align="center" style="background-color:#F7FCFF;margin:10px 0px">
  7. <table border="0" width="80%" cellspacing="0" cellpadding="0">
  8. <?php
  9. foreach($touarr['touitems'] as $k1=>$rs1){
  10. ?>
  11. <tr height="40">
  12. <?php
  13. if($touarr['toutype']==2){
  14. ?>
  15. <td width="10" align="center"><input type="<?=$touarr['type']?>" name="toupiaolaabcs" value="<?=$rs1['id']?>"></td>
  16. <?php
  17. }
  18. ?>
  19. <td align="left" style="padding:0px 5px" nowrap>
  20. <?php
  21. echo '<div>';
  22. echo ($k1+1).'. '.$rs1['touitems'];
  23. if($touarr['showtou']==1)echo '&nbsp;<span style="font-size:12px;color:#888888">'.$rs1['touci'].'票('.$rs1['bili'].'%)</span>';
  24. echo '</div>';
  25. if($touarr['showtou']==1){
  26. ?>
  27. <div style="border:1px #DCECF7 solid;height:8px;width:100%;overflow:hidden">
  28. <div style="background:#6CB0DD;width:<?=$rs1['bili']?>%;height:8px"></div>
  29. </div>
  30. <?php
  31. }
  32. ?>
  33. </td>
  34. </tr>
  35. <?php
  36. }
  37. ?>
  38. <tr>
  39. <td height="40" colspan="2">
  40. <?php
  41. if($touarr['toutype']==2)echo '<input onclick="submittoupiao(this)" type="button" value="提交投票" class="webbtn">';
  42. ?>
  43. &nbsp;<span id="msgview"><?=$da['arr']['toupiaostatus']?></span></td>
  44. </tr>
  45. </table>
  46. </div>
  47. <?php
  48. if($touarr['toutype']==2){
  49. ?>
  50. <script>
  51. function submittoupiao(o1){
  52. var mintou= <?=$touarr['mintou']?>,maxtou= <?=$touarr['maxtou']?>;
  53. var xu = 0,sid='';
  54. $('input[name=toupiaolaabcs]').each(function(){
  55. if(this.checked){
  56. xu++;
  57. sid+=','+this.value+'';
  58. }
  59. });
  60. if(xu<mintou){
  61. js.setmsg('至少要选'+mintou+'个');
  62. return;
  63. }
  64. if(maxtou>0 && xu>maxtou){
  65. js.setmsg('最多只能选'+maxtou+'个');
  66. return;
  67. }
  68. o1.disabled=true;
  69. js.setmsg('提交投票中...');
  70. sid = sid.substr(1);
  71. js.ajax(geturlact('submittoupiao'),{'mid':mid,'sid':sid,'modenum':modenum},function(s){
  72. if(s=='ok'){
  73. js.setmsg('投票成功','green');
  74. js.alert('投票成功','', function(){
  75. var url = location.href+'&rnd='+Math.random()+'';
  76. js.location(url);
  77. });
  78. }else{
  79. js.setmsg(s);
  80. o1.disabled=false;
  81. }
  82. });
  83. }
  84. </script>
  85. <?php
  86. }
  87. }
  88. ?>