From : To:

DAILY SERVICE REPORT FOR BETWEEN  AND 
Number of clients served by service type and gender prepare("SELECT DATECREATED, SERVICETYPE,USERINITIAL, sum( if( SERVICETYPE = 'MEDICAL SERVICES', RECORDCOUNTER, 0 ) ) AS medic, sum( if( SERVICETYPE = 'COUNSELLING SERVICES', RECORDCOUNTER, 0 ) ) AS counsel, sum( if( SERVICETYPE = 'PREGNANCY RELATED SERVICES', RECORDCOUNTER, 0 ) ) AS preg, sum( if( SEX = 'FEMALE', RECORDCOUNTER, 0 ) ) AS FEMALE, sum( if( SEX = 'MALE', RECORDCOUNTER, 0 ) ) AS MALE FROM cmpatientsregistration WHERE DATECREATED BETWEEN :a AND :b AND USERINITIAL = '$nameofuser' GROUP BY DATECREATED ASC "); $result->bindParam(':a', $d1); $result->bindParam(':b', $d2); $result->execute(); for($i=0; $row = $result->fetch(); $i++){ ?>
SERVICE DATE REGISTRATION DESK SERVICE TYPE -- GENDER -- TOTAL
MEDICAL SERVICES COUNSELLING SERVICES PREGNANCY RELATED FEMALE MALE
TOTAL: prepare("SELECT sum(RECORDCOUNTER) FROM cmpatientsregistration WHERE SERVICETYPE = 'MEDICAL SERVICES' AND DATECREATED BETWEEN :a AND :b AND USERINITIAL = '$nameofuser'"); $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 cmpatientsregistration WHERE SERVICETYPE = 'COUNSELLING SERVICES' AND DATECREATED BETWEEN :c AND :d AND USERINITIAL = '$nameofuser'"); $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 cmpatientsregistration WHERE SERVICETYPE = 'PREGNANCY RELATED SERVICES' AND DATECREATED BETWEEN :c AND :d AND USERINITIAL = '$nameofuser'"); $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 cmpatientsregistration WHERE SEX = 'FEMALE' AND DATECREATED BETWEEN :c AND :d AND USERINITIAL = '$nameofuser'"); $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 cmpatientsregistration WHERE SEX = 'MALE' AND DATECREATED BETWEEN :c AND :d AND USERINITIAL = '$nameofuser'"); $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 cmpatientsregistration WHERE DATECREATED BETWEEN :c AND :d AND USERINITIAL = '$nameofuser'"); $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" => "General registration desk service performance as by the above period", "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(); } ?>