formguide_stat.tpl.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <?php
  2. defined('IN_ADMIN') or exit('No permission resources.');
  3. $show_header = 1;
  4. include $this->admin_tpl('header', 'admin');
  5. ?>
  6. <div class="pad-10">
  7. <?php
  8. if(is_array($result)){
  9. foreach($result as $v){
  10. ?>
  11. <table width="100%" cellspacing="0" class="table-list">
  12. <thead>
  13. <tr>
  14. <th align="left"><strong><?php echo $fields[$v['field']]['name']?></strong></th>
  15. <th width="10%" align="center"><?php echo L('stat_num')?></th>
  16. <th width='30%' align="center"><?php echo L('thumb_shi')?></th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. <?php
  21. $i = 1;
  22. $setting = string2array($v['setting']);
  23. $setting = $setting['options'];
  24. $options = explode("\n",$setting);
  25. if(is_array($options)){
  26. foreach($options AS $_k=>$_v){
  27. $_key = $_kv = $_v;
  28. if (strpos($_v,'|')!==false) {
  29. $xs = explode('|',$_v);
  30. $_key =$xs[0];
  31. $_kv =$xs[1];
  32. }
  33. ?>
  34. <tr>
  35. <td> <?php echo intval($_k+1).' 、 '.$_key;?> </td>
  36. <td align="center"><?php
  37. $number = 0;
  38. foreach ($datas AS $__k=>$__v) {
  39. if(trim($__v[$v['field']])==trim($_kv)) $number++;
  40. }
  41. echo $number;
  42. ?></td>
  43. <td align="center">
  44. <?php if($total==0){
  45. $per=0;
  46. }else{
  47. $per=intval($number/$total*100);
  48. }?>
  49. <div class="vote_bar">
  50. <div style="width:<?=$per?>%"><span><?php echo $per;?> %</span> </div>
  51. </div>
  52. </td>
  53. </tr>
  54. <?php
  55. $i++;
  56. }
  57. }
  58. ?>
  59. </tbody>
  60. </table>
  61. <div class="bk10"></div>
  62. <?php
  63. }
  64. }
  65. ?>
  66. <div class="bk10"></div>
  67. </div>
  68. </body>
  69. </html>