/themes/mobile/instructor/statistics/course_stats.tmpl.php

https://github.com/cindyli/ATutor · PHP · 167 lines · 151 code · 16 blank · 0 comment · 13 complexity · d4256ee316ae1160dae800db6ff97ec4 MD5 · raw file

  1. <?php if ($this->mobile_device_type == IPAD_DEVICE): ?>
  2. <table cellspacing="1" cellpadding="1" border="0" class="bodyline" summary="course statistics" align="center">
  3. <tr>
  4. <th colspan="2" class="cyan"><small class="bigspacer"><?php
  5. echo '<a href="'.$_SERVER['PHP_SELF'].'?month='.($this->last_month).SEP.'year='.$this->last_year.'">';
  6. echo ' '.AT_date('%F', $this->last_month, AT_DATE_INDEX_VALUE ); ?></a> |</small>
  7. <?php echo AT_date('%F', $this->month, AT_DATE_INDEX_VALUE ); ?> <small class="bigspacer">| <?php
  8. echo '<a href="'.$_SERVER['PHP_SELF'].'?month='.$this->next_month.SEP.'year='.$this->next_year.'">';
  9. echo AT_date('%F', $this->next_month, AT_DATE_INDEX_VALUE); ?> </a></small></th>
  10. </tr>
  11. <?php
  12. if (($this->num_days == 0) || ($this->empty)) {
  13. echo sprintf('<tr><td class="row1" colspan="2">%s</td></tr>', _AT('no_month_data'));
  14. echo '</table>';
  15. } else {
  16. ?>
  17. <tr>
  18. <td class="row1" valign="top" align="right"><strong><?php echo _AT('total'); ?>:</strong></td>
  19. <td class="row1"><?php echo $this->total_logins; ?></td>
  20. </tr>
  21. <tr><td height="1" class="row2" colspan="2"></td></tr>
  22. <tr>
  23. <td class="row1" valign="top" align="right"><strong><?php echo _AT('maximum'); ?>:</strong></td>
  24. <td class="row1"><?php echo $this->max_total_logins; ?></td>
  25. </tr>
  26. <tr><td height="1" class="row2" colspan="2"></td></tr>
  27. <tr>
  28. <td class="row1" valign="top" align="right"><strong><?php echo _AT('minimum'); ?>:</strong></td>
  29. <td class="row1"><?php echo ($this->min_total_logins < 99999999) ? $this->min_total_logins : '0'; ?></td>
  30. </tr>
  31. <tr><td height="1" class="row2" colspan="2"></td></tr>
  32. <tr>
  33. <td class="row1" valign="top" align="right"><strong><?php echo _AT('average'); ?>:</strong></td>
  34. <td class="row1"><?php echo number_format($this->avg_total_logins, 1); ?> <?php echo _AT('per_day'); ?></td>
  35. </tr>
  36. <tr><td height="1" class="row2" colspan="2"></td></tr>
  37. <tr>
  38. <td class="row1" valign="top" align="right"> <strong><?php echo _AT('graph'); ?>:</strong></td>
  39. <td class="row1">
  40. <table border="0" cellspacing="0" cellpadding="0">
  41. <tr>
  42. <td valign="top" class="graph1"><small><?php echo $this->max_total_logins; ?></small></td>
  43. <?php
  44. foreach ($this->days as $day => $logins) {
  45. $dd++;
  46. echo '<td valign="bottom" class="graph"><img src="images/clr.gif" height="'.(($this->max_total_logins*$this->multiplyer_height) % $this->block_height + $this->block_height).'" width="10" alt="" /><br /><img src="images/blue.gif" height="'.($logins[0]*$this->multiplyer_height).'" width="9" alt="'.$logins[0].' '._AT('guests').' ('.($logins[0]+$logins[1]).' '._AT('total').')" /><br /><img src="images/red.gif" height="'.($logins[1]*$this->multiplyer_height).'" width="9" alt="'.$logins[1].' '._AT('members').' ('.($logins[1]+$logins[0]).' '._AT('total').')" /><br /><small>'.$dd.'&nbsp;</small></td>';
  47. }
  48. ?>
  49. </tr>
  50. <tr>
  51. <td valign="top"><small>0</small></td>
  52. </tr>
  53. </table>
  54. <small><?php echo _AT('legend'); ?>: <img src="images/red.gif" height="10" width="10" alt="<?php echo _AT('red_members'); ?>" /> <?php echo _AT('members'); ?>,
  55. <img src="images/blue.gif" height="10" width="10" alt="<?php echo _AT('blue_guests'); ?>" /> <?php echo _AT('guests'); ?>.</small>
  56. </td>
  57. </tr>
  58. <tr><td height="1" class="row2" colspan="2"></td></tr>
  59. <tr>
  60. <td class="row1" valign="top" align="right"><strong><?php echo _AT('raw_data'); ?>:</strong></td>
  61. <td class="row1" align="center">
  62. <table class="data static" summary="">
  63. <thead>
  64. <tr>
  65. <th scope="col"><?php echo _AT('date'); ?></th>
  66. <th scope="col"><?php echo _AT('guests'); ?></th>
  67. <th scope="col"><?php echo _AT('members'); ?></th>
  68. </tr>
  69. </thead>
  70. <tbody>
  71. <?php $short_name = $month_name_con['en'][$month-1]; ?>
  72. <?php foreach ($this->days as $day => $logins):?>
  73. <tr>
  74. <td><?php echo $short_name.' '.$day; ?></td>
  75. <td><?php echo $logins[0]; ?></td>
  76. <td><?php echo $logins[1]; ?></td>
  77. </tr>
  78. <?php endforeach; ?>
  79. <tbody>
  80. </table>
  81. </td>
  82. </tr>
  83. </table>
  84. <?php
  85. }
  86. endif;?>
  87. <?php if ($this->mobile_device_type != IPAD_DEVICE): ?>
  88. <table style="width: 100%" cellspacing="1" cellpadding="1" border="0" class="bodyline" summary="course statistics" align="center" frame="box" >
  89. <tr>
  90. <th colspan="2" class="cyan"><small class="bigspacer"><?php
  91. echo '<a href="'.$_SERVER['PHP_SELF'].'?month='.($this->last_month).SEP.'year='.$this->last_year.'">';
  92. echo ' '.AT_date('%F', $this->last_month, AT_DATE_INDEX_VALUE ); ?></a> |</small>
  93. <?php echo AT_date('%F', $this->month, AT_DATE_INDEX_VALUE ); ?> <small class="bigspacer">| <?php
  94. echo '<a href="'.$_SERVER['PHP_SELF'].'?month='.$this->next_month.SEP.'year='.$this->next_year.'">';
  95. echo AT_date('%F', $this->next_month, AT_DATE_INDEX_VALUE); ?> </a></small></th>
  96. </tr>
  97. <?php
  98. if (($this->num_days == 0) || ($this->empty)) {
  99. echo sprintf('<tr><td class="row1" colspan="2">%s</td></tr>', _AT('no_month_data'));
  100. echo '</table>';
  101. } else if {
  102. ?>
  103. <tr>
  104. <td class="row1" valign="top" align="right"><strong><?php echo _AT('total'); ?>:</strong></td>
  105. <td class="row1"><?php echo $this->total_logins; ?></td>
  106. </tr>
  107. <tr><td height="1" class="row2" colspan="2"></td></tr>
  108. <tr>
  109. <td class="row1" valign="top" align="right"><strong><?php echo _AT('maximum'); ?>:</strong></td>
  110. <td class="row1"><?php echo $this->max_total_logins; ?></td>
  111. </tr>
  112. <tr><td height="1" class="row2" colspan="2"></td></tr>
  113. <tr>
  114. <td class="row1" valign="top" align="right"><strong><?php echo _AT('minimum'); ?>:</strong></td>
  115. <td class="row1"><?php echo ($this->min_total_logins < 99999999) ? $this->min_total_logins : '0'; ?></td>
  116. </tr>
  117. <tr><td height="1" class="row2" colspan="2"></td></tr>
  118. <tr>
  119. <td class="row1" valign="top" align="right"><strong><?php echo _AT('average'); ?>:</strong></td>
  120. <td class="row1"><?php echo number_format($this->avg_total_logins, 1); ?> <?php echo _AT('per_day'); ?></td>
  121. </tr>
  122. <tr><td height="1" class="row2" colspan="2"></td></tr>
  123. <tr><td height="1" class="row2" colspan="2"></td></tr>
  124. <tr>
  125. <td class="row1" valign="top" align="right"><strong><?php echo _AT('raw_data'); ?>:</strong></td>
  126. <td class="row1" align="center">
  127. <table class="data static" summary="" frame="box">
  128. <thead>
  129. <tr>
  130. <th scope="col"><?php echo _AT('date'); ?></th>
  131. <th scope="col"><?php echo _AT('guests'); ?></th>
  132. <th scope="col"><?php echo _AT('members'); ?></th>
  133. </tr>
  134. </thead>
  135. <tbody>
  136. <?php $short_name = $month_name_con['en'][$month-1]; ?>
  137. <?php foreach ($this->days as $day => $logins):?>
  138. <tr>
  139. <td><?php echo $short_name.' '.$day; ?></td>
  140. <td><?php echo $logins[0]; ?></td>
  141. <td><?php echo $logins[1]; ?></td>
  142. </tr>
  143. <?php endforeach; ?>
  144. <tbody>
  145. </table>
  146. </td>
  147. </tr>
  148. </table>
  149. <?php
  150. }
  151. endif;?>