CMS  Version 3.9
report_table_navigator.inc
Go to the documentation of this file.
1 <?php
9 {
10  var $tables;
11 
13  {
14  $this->tables = $tables;
15  }
16 
17  function writeScript()
18  {
19  $script = <<<ENDSCRIPT
20 <script type='text/javascript'>
21 window.addEvent('domready', function() {
22  new ReportTableNavigator('custom_report');
23 });
24 </script>
25 ENDSCRIPT;
26 
27  return $script;
28  }
29 
30  function drawView()
31  {
32  echo "<div id='report_table_navigator'>\n";
33 
34  echo "<h2>Choose Your Data Fields</h2>";
35 
36  foreach($this->tables as $table)
37  {
38  $tableID = "table_{$table->class}";
39 
40  $tableID = "table_{$table->class}";
41  $selected = $table->selected ? " selected_table" : "";
42  $checked = $table->selected ? " checked='checked'" : "";
43 
44  echo "<div id='$tableID' class='report_table$selected'>\n";
45  echo "<input type='checkbox' style='display: none' name='$tableID' value='{$table->class}'$checked/>";
46  echo "<h3>";
47  if ($table->help) echo "<a href='#' class='report_table_help_icon'><img src='/fakoli/images/context_help.png' alt='Help'/></a><div class='report_table_help'>{$table->help}</div>";
48  echo $table->getTitle()."</h3>\n";
49  echo "<div class='columns'>";
50  echo "<div style='display: inline-block; width: 100%'><a class='select_all' id='{$tableID}_select_all'>Select All</a><a class='show_all' id='{$tableID}_show_all'>Show All Fields</a></div>\n";
51 
52  foreach($table->columns as $column)
53  {
54  $columnID = "column_".codify($column->title);
55 
56  $selected = $column->selected ? " selected_column" : "";
57  $checked = $column->selected ? " checked='checked'" : "";
58  $favorite = $column->favorite ? " favorite" : "";
59 
60  echo "<div class='column$selected$favorite'><input type='checkbox' class='checkbox' id='$columnID' name='$columnID' value='{$column->title}'$checked/>&nbsp;{$column->title}</div>\n";
61  }
62 
63  echo "</div></div>\n";
64  }
65 
66  echo "</div>";
67  }
68 }
69 
70 
71 
73 {
74  var $tables;
75 
77  {
78  $this->tables = $tables;
79  }
80 
81  function writeScript()
82  {
83  return "";
84  }
85 
86  function drawView()
87  {
88  echo "<div id='report_filter_navigator'>\n";
89 
90  echo "<h2>Filter Your Results</h2>";
91 
92  foreach($this->tables as $table)
93  {
94  $display = $table->selected ? "block" : "none";
95 
96  echo "<div class='report_filter' id='{$table->class}' style='display: $display'><h3>".$table->getTitle()."</h3>\n";
97 
98  echo "<div class='filter'>\n";
99  echo "<table ";
100  if ($this->formCSS) echo "class='{$this->formCSS}'";
101  echo ">\n";
102 
103  $script .= $table->form->writeScript();
104  $table->form->params->fromArray($this->request);
105  $table->form->renderSearchFields();
106 
107  echo "</table>\n";
108  echo "</div></div>";
109  }
110 
111  echo "</div>";
112  }
113 }?>
$spreadsheet formCSS