Fetch Data from Oracle:
echo "<br/>Self User data<br/>";
$curs = oci_new_cursor($conn);
$varin1 = "111"; //employee_id
$varin2 = "FEB-2015"; //month_year
$varin3 = "1";
$stid = oci_parse($conn, "begin WEEKLY_EMPLOYEE_DETAILS(:varIn1,:varIn2,:cursbv); end;");
oci_bind_by_name($stid, ":varIn1", $varin1);
oci_bind_by_name($stid, ":varIn2", $varin2);
oci_bind_by_name($stid, ":cursbv", $curs, -1, OCI_B_CURSOR);
oci_execute($stid);
oci_execute($curs);  // Execute the REF CURSOR like a normal statement id
echo "<pre>";
while (($row = oci_fetch_array($curs, OCI_ASSOC+OCI_RETURN_NULLS)) != false) {
    print_r($row) . "<br />\n";
}
oci_free_statement($stid);
oci_free_statement($curs);
Ouput of above code:
Self User data
Array
(
    [EMPLOYEEID] => 111
    [EMPLOYEENAME] => John Doe
    [TOTAL_HOURS] => 24
    [STATUS] => 1
    [WEEK_ID] => 2
)
Array
(
    [EMPLOYEEID] => 111
    [EMPLOYEENAME] => John Doe
    [TOTAL_HOURS] => 20
    [STATUS] => 2
    [WEEK_ID] => 3
)
Array
(
    [EMPLOYEEID] => 111
    [EMPLOYEENAME] => John Doe
    [TOTAL_HOURS] => 40
    [STATUS] => 2
    [WEEK_ID] => 4
)
Google Pie chart Code:
<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Work', 'Hours per Day'],
      ['Week 1',     25],
      ['Week 2',      25],
      ['Week 3',  25],
      ['Week 4', 25]
        ]);
        var options = {
          title: 'My Daily Activities'
        };
        var chart = new google.visualization.PieChart(document.getElementById('piechart'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="piechart" style="width: 900px; height: 500px;"></div>
  </body>
</html>
How can I show the data fetched in form of pie chart. If there are 5 weeks in a month it will display the pie chart slice likewise. Along with it, it should also display hours for that week which are coming in array.
 
     
    