// $data is an array.
    if (count($data) > 0) {
        constructTable($data);
        echo "<br>";
    } else {
        print "<h3>(No match.)</h3>\n";
    }
    print "<h1>After Dice</h1>\n";
    //echo "<h4>Query :&nbsp$query</h4><br>";
    $ps1 = $con->prepare($query2);
    // Fetch the matching row.
    $ps1->execute(array(':id' => $id));
    $data1 = $ps1->fetchAll(PDO::FETCH_ASSOC);
    // $data is an array.
    if (count($data1) > 0) {
        constructTable($data1);
    } else {
        print "<h3>(No match.)</h3>\n";
    }
} catch (PDOException $ex) {
    echo 'ERROR: ' . $ex->getMessage();
} catch (Exception $ex) {
    echo 'ERROR: ' . $ex->getMessage();
}
?>
    <br><button onclick="location.href='Analytical.php'">Go Back</button>
    </div> 
       </div> 
       </div> 
    </div>
</body>
print "<h3>Drill Up and Drill Down Operations</h3>\n";
print "<h1>Drill Operations</h1>\n";
try {
    if ($second == "month") {
        //echo "harsha";
        $query = "Select employee.Name, calender.month, sum(sales_fact_table.DollarsSold) as Revenue_Generated FROM calender, sales_fact_table, employee where calender.calenderKey = sales_fact_table.CalenderKey and sales_fact_table.EmployeeKey = employee.EmployeeKey and calender.year= '{$first}' group by calender.month";
    } else {
        $query = "Select employee.Name, calender.Quarter, sum(sales_fact_table.DollarsSold) as Revenue_Generated FROM calender, sales_fact_table, employee where calender.calenderKey = sales_fact_table.CalenderKey and sales_fact_table.EmployeeKey = employee.EmployeeKey and calender.year= '{$first}' group by calender.quarter";
    }
    $ps = $con->prepare($query);
    // Fetch the matching row.
    $ps->execute(array(':id' => $id));
    $data = $ps->fetchAll(PDO::FETCH_ASSOC);
    // $data is an array.
    if (count($data) > 0) {
        constructTable($data);
        echo "<br>";
    } else {
        print "<h3>(No match.)</h3>\n";
    }
} catch (PDOException $ex) {
    echo 'ERROR: ' . $ex->getMessage();
}
?>
    <br><button onclick="location.href='drill.php'">Go Back</button>
    </div> 
       </div> 
       </div> 
    </div>
</body>
</html>