Esempio n. 1
0
 echo "<td>";
 $widconn->query_class($dbname2, $_SESSION[cat], $_SESSION[ques]);
 echo "<br><br>";
 if (isset($_SESSION[ques]) || $_POST[q_submit]) {
     unset($_SESSION["arr_px_labels"]);
     $widconn->query_cat($dbname, $dbname2, $_POST[sdate], $_POST[edate], $_POST[sel_brgy], $_POST[sel_hidden_value]);
 }
 echo "</td>";
 //echo "<td valign=\"top\">";
 /*if(isset($_SESSION[ques]) || $_POST[q_submit]):
 	 $widconn->query_cat($dbname,$dbname2,$_POST[sdate],$_POST[edate],$_POST[sel_brgy]);
       endif; */
 echo "<td>";
 //upon setting filters, set the necessary sessions here
 if ($_POST[q_submit]) {
     $queryconn->clean_db();
     // set the session for start date and end date
     if ($_SESSION[filter] == 1) {
         $queryconn->querycrit($dbname, $dbname2, $_POST[sdate], $_POST[edate], $_POST[sel_brgy], $_POST[sel_fp_method]);
     } elseif ($_SESSION[filter] == 2) {
         //summary tables
         $_SESSION[smonth] = $_POST[smonth];
         $_SESSION[emonth] = $_POST[emonth];
         $sdate = strftime("%m/%d/%Y", mktime(0, 0, 0, $_POST[smonth], 1, $_POST[year]));
         $edate = strftime("%m/%d/%Y", mktime(0, 0, 0, $_POST[emonth] + 1, 0, $_POST[year]));
         $queryconn->querycrit($dbname, $dbname2, $sdate, $edate, $_POST[brgy], 0);
         //the fifth argument when set to zero, means that there is no form present in the query box
     } elseif ($_SESSION[filter] == 3) {
         //quarterly tables
         $arr_start_end = array('1' => array('01/01', '03/31'), '2' => array('04/01', '06/30'), '3' => array('07/01', '09/30'), '4' => array('10/01', '12/31'));
         $sdate = $arr_start_end[$_POST[sel_quarter]][0] . '/' . $_POST[year];