1<?php
2  /**
3   * This is the HTML template for the doodle table.
4   *
5   * I am utilizing the PHP parser as a templating engine:
6   * doodle_tempalte.php is simply included and evaled from syntax.php
7   * The variable  $template   will be inherited from syntax.php and can be used here.
8   */
9  global $ID;
10
11  $template = $this->template;
12  $c = count($template['choices']);
13?>
14
15<!-- Doodle Plugin -->
16<div class="doodle3_scrollcontainer">
17<form action="<?php echo wl() ?>" method="post" name="doodle__form" id="<?php echo $template['formId'] ?>" accept-charset="utf-8" >
18
19<input type="hidden" name="sectok" value="<?php echo getSecurityToken() ?>" />
20<input type="hidden" name="do" value="show" >
21<input type="hidden" name="id" value="<?php echo $ID ?>" >
22<input type="hidden" name="formId" value="<?php echo $template['formId'] ?>" >
23<input type="hidden" name="edit__entry"   value="">
24<input type="hidden" name="delete__entry" value="">
25
26
27 <table class="inline">
28   <tbody>
29     <tr class="row0">
30       <th class="centeralign" colspan="<?php echo ($c+1) ?>">
31         <?php echo $template['title'] ?>
32       </th>
33     </tr>
34     <tr class="row1">
35         <th class="col0"><?php echo $lang['fullname'] ?></th>
36<?php foreach ($template['choices'] as $choice) {  ?>
37         <td class="centeralign" style="width:<?php echo $template['fieldwidth'] ?>"><?php echo $choice ?></td>
38<?php } ?>
39     </tr>
40
41<?php foreach ($template['doodleData'] as $fullname => $userData) { ?>
42     <tr>
43         <td class="rightalign">
44           <?php echo $userData['editLinks'].$fullname.$userData['username'] ?>
45         </td>
46         <?php for ($col = 0; $col < $c; $col++) {
47             echo $userData['choice'][$col];
48         } ?>
49     </tr>
50<?php } ?>
51
52     <!-- Results / sum per column -->
53     <tr>
54         <th class="rightalign"><b><?php echo $template['result'] ?></b></th>
55<?php for ($col = 0; $col < $c; $col++) { ?>
56         <th class="centeralign"><b><?php echo $template['count'][$col] ?></b></th>
57<?php } ?>
58     </tr>
59
60<?php
61     /* Input fields, if allowed. */
62 	echo $template['inputTR']
63?>
64
65<?php if (!empty($template['msg'])) { ?>
66     <tr>
67       <td colspan="<?php echo $c+1 ?>">
68         <?php echo $template['msg'] ?>
69       </td>
70     </tr>
71<?php } ?>
72
73   </tbody>
74 </table>
75
76
77</form>
78</div>
79