[trick] Membuat Aplikasi Sederhana Dengan PHP dan SQL SERVER Bag-3

bismillah…

Trick kali ini yaitu membuat grafik dengan php dan sql server >>

OK siapkan databasenya >>

data_grafik

lanjut ke kodingnya y >>


<?php
mssql_connect("localhost","sa","sa");
mssql_select_db("shoping");

include"FusionCharts/FC_Colors.php";
include"FusionCharts/FusionCharts_Gen.php";
include"FusionCharts/FusionCharts.php";

echo"<div><SCRIPT LANGUAGE='Javascript' SRC='FusionCharts/FusionCharts.js'></SCRIPT>";

$FC = new FusionCharts("Column3D","500","300");
$FC->setSWFPath("FusionCharts/");

$strParam="caption=Grafik Penjualan ; subcaption=PerTahun; xAxisName=Produk & tahun ; yAxisName=Jumlah; numberPrefix=; decimalPrecision=0";

$FC->setChartParams($strParam);
$qr=mssql_query("select* from grafik");
while($data=mssql_fetch_array($qr)){
$FC->addChartData("$data[jumlah]","name=$data[nama]");
}

$FC->renderChart();

echo"</div>";

?>

nanti di include aja ke file yang sql_server.php yang pernah kita bikin pada tahap kedua ..

dan hasilnya seperti ini jadinya >>

grafik_sql

Ok selesai Y…

untuk download bisa disini >>  http://www.4shared.com/zip/nIb303mn/sql_server_grafik.html

Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: