görünen
date_default_timezone_set('Europe/Istanbul');
include "h.php";
include "d.php";
$db = mysql_connect($DBHost, $DBUser,$DBPass);
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET COLLATION_CONNECTION = 'utf8_general_ci'");
if (!mysql_select_db($DBName)) die(mysql_error());
$sql = ("SELECT Count urunler.urun_id AS urunler.urun_id,bayi.bayi_adi AS bayi_adi FROM urunler INNER JOIN bayi ON urunler.yapildigi_yer = bayi.bayi_id GROUP BY bayi.bayi_adi");
$q = mysql_query($sql);
?>
<script></script>
<script>
// Load the Visualization API and the corechart package.
google.charts.load('current', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.charts.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Topping');
data.addColumn('number', 'Slices');
data.addRows([
foreach($q as $row) {
echo "['".$row["bayi_adi"]."',".$row["urun_id"]."],";
}
?>
]);
// Set chart options
var options = {'Rapor':'Bayi Grafiği',
'width':800,
'height':500};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>