<html>
<head>
<script language="javascript" type="text/javascript"
src="js/jquery1.6.1.min.js"></script>
<script language="javascript" type="text/javascript"
src="js/jquery.barchart.min.js"></script>
<script language="javascript" type="text/javascript"
src="js/categoryAxisRenderer.min.js"></script>
<script language="javascript" type="text/javascript"
src="js/pointLabels.min.js"></script>
<script type="text/javascript">
<?php
$dataArray = array();
$con=mysqli_connect("localhost","root","","hotel_administration");
//1
$result = mysqli_query($con,"SELECT COUNT(*) FROM stock_details");
$row = mysqli_fetch_array($result);
$NumProducts = $row[0];
$dataArray[] = "['Products', ".$NumProducts."]";
//2
$result = mysqli_query($con,"SELECT COUNT(*) FROM stock_sales"); //edit sql
here
$row = mysqli_fetch_array($result);
$Numtemp = $row[0];
$dataArray[] = "['Sales Transactions', ".$Numtemp."]";
//2
$result = mysqli_query($con,"SELECT COUNT(*) FROM purchaseorder where
status='waiting'"); //edit sql here
$row = mysqli_fetch_array($result);
$NumSup = $row[0];
$dataArray[] = "['Purchase orders', ".$NumSup."]";
//2
$result = mysqli_query($con,"SELECT COUNT(*) FROM customer_details");
//edit sql here
$row = mysqli_fetch_array($result);
$NumCus = $row[0];
$dataArray[] = "['Customers', ".$NumCus."]";
$line = implode (", ", $dataArray);
?>
$(document).ready(function(){
$.jqplot.config.enablePlugins = true;
var line1 = [<?php echo $line;?>];
$('#chart1').jqplot([line1], {
title:' ',
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
varyBarColor: true
}
},
axes:{
xaxis:{
renderer: $.jqplot.CategoryAxisRenderer,
}
}
});
});
</script>
</head>
<body>
<div id="chart1"></div>
</body>
</html>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.