Example #1
0
    /**
     * print a period selector
     *
     * @param string $p_control_name
     */
    function period_selector($p_control_name)
    {
        $t_periods = array(0 => plugin_lang_get('period_none'), 7 => plugin_lang_get('period_this_week'), 8 => plugin_lang_get('period_last_week'), 9 => plugin_lang_get('period_two_weeks'), 1 => plugin_lang_get('period_this_month'), 2 => plugin_lang_get('period_last_month'), 3 => plugin_lang_get('period_this_quarter'), 4 => plugin_lang_get('period_last_quarter'), 5 => plugin_lang_get('period_year_to_date'), 6 => plugin_lang_get('period_last_year'), 10 => plugin_lang_get('period_select'));
        $t_default = gpc_get_int($p_control_name, 0);
        $t_formatted_start = $this->get_start_formatted();
        $t_formatted_end = $this->get_end_formatted();
        $t_ret = '<div id="period_menu">';
        $t_ret .= get_dropdown($t_periods, $p_control_name, $t_default, false, false, 'setDisplay(\'dates\', document.getElementById(\'' . $p_control_name . '\').value == 10)');
        $t_ret .= '</div><div id="dates">' . lang_get('from_date') . '&nbsp;' . '<input type="text" id="start_date" name="start_date" size="10" value="' . $t_formatted_start . '" />' . '<img src="images/calendar-img.gif" id="f_trigger_s" style="cursor: pointer; border: 1px solid red;" ' . ' title="Date selector" alt="Date" onmouseover="this.style.background=\'red\';"' . ' onmouseout="this.style.background=\'white\'" />' . "\n" . '<br />' . lang_get('to_date') . '&nbsp;&nbsp;&nbsp;&nbsp;' . '<input type="text" id="end_date" name="end_date" size="10" value="' . $t_formatted_end . '" />' . '<img src="images/calendar-img.gif" id="f_trigger_e" style="cursor: pointer; border: 1px solid red;" ' . ' alt="Date" title="Date selector" onmouseover="this.style.background=\'red\';"' . ' onmouseout="this.style.background=\'white\'" />' . "\n" . '<script type="text/javascript">
			<!--
			Calendar.setup({ inputField : "start_date", ifFormat : "%Y-%m-%d", button : "f_trigger_s",
			    align : "cR", singleClick : false,  showTime : false });
    		Calendar.setup({ inputField : "end_date", ifFormat : "%Y-%m-%d", button : "f_trigger_e",
    			    align : "cR", singleClick : false,  showTime : false });
    		var t = document.getElementById(\'' . $p_control_name . '\').value;
    		setDisplay(\'' . $p_control_name . '\',true);
    		setDisplay(\'dates\', document.getElementById(\'' . $p_control_name . '\').value == 10);
    			//-->
    		</script>' . "\n" . '</div>';
        return $t_ret;
    }
			<table class="width100" cellspacing="1">

				<tr>
					<td>
						<?php 
echo get_dropdown($t_types, 'graph_type', $f_type);
?>
					</td>
					<td>
						<?php 
echo $t_period->period_selector('interval');
?>
					</td>
					<td>
						<?php 
echo get_dropdown($t_show, 'show_table', $f_show_as_table ? 1 : 0);
?>
					</td>
					<td>
						<input type="submit" class="button" name="show" value="<?php 
echo plugin_lang_get('show_graph');
?>
"/>
					</td>
				</tr>
			</table>
		</form>
<?php 
# build the graphs if both an interval and graph type are selected
if (0 != $f_type && $f_interval > 0 && gpc_get('show', '') != '') {
    $t_width = plugin_config_get('window_width');
Example #3
0
 /**
  * print a period selector
  *
  * @param string $p_control_name
  */
 function period_selector($p_control_name)
 {
     $t_periods = array(0 => plugin_lang_get('period_none'), 7 => plugin_lang_get('period_this_week'), 8 => plugin_lang_get('period_last_week'), 9 => plugin_lang_get('period_two_weeks'), 1 => plugin_lang_get('period_this_month'), 2 => plugin_lang_get('period_last_month'), 3 => plugin_lang_get('period_this_quarter'), 4 => plugin_lang_get('period_last_quarter'), 5 => plugin_lang_get('period_year_to_date'), 6 => plugin_lang_get('period_last_year'), 10 => plugin_lang_get('period_select'));
     $t_default = gpc_get_int($p_control_name, 0);
     $t_formatted_start = $this->get_start_formatted();
     $t_formatted_end = $this->get_end_formatted();
     $t_ret = '<div id="period_menu">';
     $t_ret .= get_dropdown($t_periods, $p_control_name, $t_default, false, false);
     $t_ret .= "</div>\n";
     $t_ret .= "<div id=\"dates\">\n";
     $t_ret .= '<label for="start_date">' . lang_get('from_date') . '</label><input type="text" id="start_date" name="start_date" size="20" value="' . $t_formatted_start . '" class="datetime" disabled="disabled" />' . "<br />\n";
     $t_ret .= '<label for="end_date">' . lang_get('to_date') . '</label><input type="text" id="end_date" name="end_date" size="20" value="' . $t_formatted_end . '" class="datetime" disabled="disabled" />' . "\n";
     $t_ret .= "</div>\n";
     return $t_ret;
 }