function stats_draw_date_range_form

7.x stats.module stats_draw_date_range_form($path, $start_date = "", $end_date = "", $additional_form_elements = "")
6.x stats.module stats_draw_date_range_form($path, $start_date = "", $end_date = "", $additional_form_elements = "")
4.x stats.module stats_draw_date_range_form($path, $start_date = "", $end_date = "")
5.x stats.module stats_draw_date_range_form($path, $start_date = "", $end_date = "")

Displays the HTML for the date range form used by several reports. $path is what is the form's ACTION sending to.

start and end date expected in YYYY-MM-DD format

2 calls to stats_draw_date_range_form()
stats_report_advisor_use in modules/stats/stats.module
This report shows which advisors are using FlightPath most often.
stats_report_flightpath_use_summary in modules/stats/stats.module
This report shows common usages in FlightPath by all users.

File

modules/stats/stats.module, line 1173
This module displays statistics and reports for FlightPath

Code

function stats_draw_date_range_form($path, $start_date = "", $end_date = "", $additional_form_elements = "") {
  $rtn = "";

  $rtn .= "<form action='" . fp_url($path) . "' method='GET' >
            " . t("Select a date range to begin:") . "
            <br>
            " . t("Start date:") . " 
              <span class='form-element element-type-date element-size-smaller'>
                <input type='date' name='start_date' value='$start_date' id='start_date'>
              </span>
            &nbsp; &nbsp;
            " . t("End date:") . "
            <span class='form-element element-type-date'> 
              <input type='date' name='end_date' value='$end_date' id='end_date'>
            </span>
            &nbsp; &nbsp;";


  if ($additional_form_elements != "") {
    $rtn .= $additional_form_elements;
  }

  fp_add_css(fp_get_module_path("system") . "/css/style.css");
  fp_add_js(fp_get_module_path("system") . "/js/spinner.js");

  $name = fp_get_machine_readable($path);

  $rtn .= "
            
            <span class='buttons form-element element-type-submit'>
              <input type='submit' value='" . t("Submit") . "' onclick='$(\".loading-spinner\").show();'>
            </span>
  
            <span class='loading-spinner loading-spinner-$name' style='display:none;'></span>
            
          </form> <hr>
          ";


  return $rtn;
}