From : To:

TOLLFREE SERVICE PERFORMANCE TRACKER BETWEEN  AND 
Number of calls recieved by service provider as per action taken prepare("SELECT DATECREATED, USERINITIAL, sum( if( ACTIONTAKEN = 'REFER', RECORDCOUNTER, 0 ) ) AS RR, sum( if( ACTIONTAKEN = 'COUNSEL', RECORDCOUNTER, 0 ) ) AS CC, sum( if( ACTIONTAKEN = 'BOTH', RECORDCOUNTER, 0 ) ) AS BB FROM tollfree WHERE DATECREATED BETWEEN :a AND :b GROUP BY USERINITIAL ASC "); $result->bindParam(':a', $d1); $result->bindParam(':b', $d2); $result->execute(); for($i=0; $row = $result->fetch(); $i++){ ?>
SERVICE PROVIDER COUNSELLED REFFERED BOTH TOTAL
TOTAL: prepare("SELECT sum(RECORDCOUNTER) FROM tollfree WHERE ACTIONTAKEN = 'COUNSEL' AND DATECREATED BETWEEN :a AND :b"); $results->bindParam(':a', $d1); $results->bindParam(':b', $d2); $results->execute(); for($i=0; $rows = $results->fetch(); $i++){ $dsdsd=$rows['sum(RECORDCOUNTER)']; echo formatMoney($dsdsd, true); } ?> prepare("SELECT sum(RECORDCOUNTER) FROM tollfree WHERE ACTIONTAKEN = 'REFER' AND DATECREATED BETWEEN :c AND :d"); $resultia->bindParam(':c', $d1); $resultia->bindParam(':d', $d2); $resultia->execute(); for($i=0; $cxz = $resultia->fetch(); $i++){ $zxc=$cxz['sum(RECORDCOUNTER)']; echo formatMoney($zxc, true); } ?> prepare("SELECT sum(RECORDCOUNTER) FROM tollfree WHERE ACTIONTAKEN = 'BOTH' AND DATECREATED BETWEEN :c AND :d"); $resultia->bindParam(':c', $d1); $resultia->bindParam(':d', $d2); $resultia->execute(); for($i=0; $cxz = $resultia->fetch(); $i++){ $zxc=$cxz['sum(RECORDCOUNTER)']; echo formatMoney($zxc, true); } ?> prepare("SELECT sum(RECORDCOUNTER) FROM tollfree WHERE DATECREATED BETWEEN :c AND :d"); $resultia->bindParam(':c', $d1); $resultia->bindParam(':d', $d2); $resultia->execute(); for($i=0; $cxz = $resultia->fetch(); $i++){ $zxc=$cxz['sum(RECORDCOUNTER)']; echo formatMoney($zxc, true); } ?>

connect_error) { exit("There was an error with your connection: ".$dbhandle->connect_error); } ?> = '" . $from_date . "' AND DATECREATED <= '" . $to_date . "' GROUP BY USERINITIAL ASC"; // Execute the query, or else return the error message. $result = $dbhandle->query($strQuery) or exit("Error code ({$dbhandle->errno}): {$dbhandle->error}"); // If the query returns a valid response, prepare the JSON string if ($result) { // The `$arrData` array holds the chart attributes and data $arrData = array( "chart" => array( "caption" => "Tollfree services by action taken", "paletteColors" => "#3c8dbc", "bgColor" => "#ffffff", "borderAlpha"=> "20", "canvasBorderAlpha"=> "0", "usePlotGradientColor"=> "0", "plotBorderAlpha"=> "10", "showXAxisLine"=> "1", "xAxisLineColor" => "#000", "showValues" => "0", "divlineColor" => "#999999", "divLineIsDashed" => "1", "showAlternateHGridColor" => "0" ) ); $arrData["data"] = array(); // Push the data into the array while($row = mysqli_fetch_array($result)) { array_push($arrData["data"], array( "label" => $row["USERINITIAL"], "value" => $row["SUM(RECORDCOUNTER)"] ) ); } /*JSON Encode the data to retrieve the string containing the JSON representation of the data in the array. */ $jsonEncodedData = json_encode($arrData); $columnChart = new FusionCharts("column2D", "myFirstChart" , 1060, 290, "chart-1", "json", $jsonEncodedData); // Render the chart $columnChart->render(); // Close the database connection $dbhandle->close(); } ?>