Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > ASP > ASP Forum > xml +asp...ถ้าเราต้องการ write ค่าในฐานข้อมูลออกมาแสดงคะทำอย่างไรคะ



 

xml +asp...ถ้าเราต้องการ write ค่าในฐานข้อมูลออกมาแสดงคะทำอย่างไรคะ

 



Topic : 037750

Guest




ถ้าเราต้องการ write ค่าในฐานข้อมูลออกมาแสดงคะทำอย่างไรคะ
ช่วยแปลงโค๊ตด้านล่าง php เป็น asp หน่อยคะ

ที่ทำแต่โค๊ตที่เขียนเป็น php
$data = '<?xml version="1.0" encoding="TIS-620"?>'."\n";
$data .= '<chart caption="สรุปสถานที่สำคัญ จำแนกตาม '.rtrim($p->fields[0]["RegONCB"]).'" palette="2" animation="1" numberPrefix="" formatNumberScale="0" pieSliceDepth="30" startingAngle="60" showPercentageValues="0" >'."\n";

for($i=0; $i<$p->numrows; $i++) {
//$data .= '<dataset seriesName="'.rtrim($p->fields[$i]["reg_name"]).'">'."\n";
$data .= '<set value="'.$p->fields[$i]["cntplace_type"].'" name= "'.rtrim($p->fields[$i]["PLACE_TYPENAME"]).'" />'."\n";
}
$data.= "<styles><definition><style type='font' name='CaptionFont' size='15' color='666666' /><style type='font' name='SubCaptionFont' bold='0' /><style name='myLabelsFont' type='font' font='Arial' size='14'
color='666666' bold='1' underline='1'/></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /><apply toObject='DataLabels' styles='myLabelsFont' /></application></styles>";
$data .= '</chart>'."\n";
$f = fopen( '../graph/xml/grapimportant_oncb.xml' , 'w' ); //ส่วนของการสร้างไฟล์ XML
fputs( $f , $data );
fclose( $f );

ผลที่ได้จากการทำงานโปรแกรมด้านบน

<?xml version="1.0" encoding="TIS-620"?>
<chart caption="สรุปสถานที่สำคัญ จำแนกตาม " palette="2" animation="1" numberPrefix="" formatNumberScale="0" pieSliceDepth="30" startingAngle="60" showPercentageValues="0" >
<styles><definition><style type='font' name='CaptionFont' size='15' color='666666' /><style type='font' name='SubCaptionFont' bold='0' /><style name='myLabelsFont' type='font' font='Arial' size='14'
color='666666' bold='1' underline='1'/></definition><application><apply toObject='caption' styles='CaptionFont' /><apply toObject='SubCaption' styles='SubCaptionFont' /><apply toObject='DataLabels' styles='myLabelsFont' /></application></styles></chart>

pie



Tag : - - - -







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2010-01-26 14:41:34 By : jyp View : 3243 Reply : 22
 

 

No. 1



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


DBConn.asp
<%
	'In this page, we open the connection to the Database
	'Our Access database is contained in ../DB/FactoryDB.mdb
	'It's a very simple database with just 2 tables (for the sake of demo)	
	Dim oConn
	'If not already defined, create object
	if not isObject(oConn) then
		Dim strConnQuery
		Set oConn = Server.CreateObject("ADODB.Connection")		
		oConn.Mode = 3
		'Create the path to database
		strConnQuery = "DBQ=" & server.mappath("../DB/FactoryDB.mdb") 
		'Connect
		oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; " & strConnQuery)		
	end if
%>


FusionCharts.asp
<%
'Page: FusionCharts.asp
'Author: InfoSoft Global (P) Ltd.

'This page contains functions that can be used to render FusionCharts.

'encodeDataURL function encodes the dataURL before it's served to FusionCharts.
'If you've parameters in your dataURL, you necessarily need to encode it.
'Param: strDataURL - dataURL to be fed to chart
'Param: addNoCacheStr - Whether to add aditional string to URL to disable caching of data
Function encodeDataURL(strDataURL, addNoCacheStr)
	'Add the no-cache string if required
	if addNoCacheStr=true then
		'We add ?FCCurrTime=xxyyzz
		'If the dataURL already contains a ?, we add &FCCurrTime=xxyyzz
		'We replace : with _, as FusionCharts cannot handle : in URLs
		if Instr(strDataURL,"?")<>0 then
			strDataURL = strDataURL & "&FCCurrTime=" & Replace(Now(),":","_")
		else
			strDataURL = strDataURL & "?FCCurrTime=" & Replace(Now(),":","_")
		end if
	end if	
	'URL Encode it
	encodeDataURL = Server.URLEncode(strDataURL)
End Function

'renderChart renders the JavaScript + HTML code required to embed a chart.
'This function assumes that you've already included the FusionCharts JavaScript class
'in your page.

' chartSWF - SWF File Name (and Path) of the chart which you intend to plot
' strURL - If you intend to use dataURL method for this chart, pass the URL as this parameter. Else, set it to "" (in case of dataXML method)
' strXML - If you intend to use dataXML method for this chart, pass the XML data as this parameter. Else, set it to "" (in case of dataURL method)
' chartId - Id for the chart, using which it will be recognized in the HTML page. Each chart on the page needs to have a unique Id.
' chartWidth - Intended width for the chart (in pixels)
' chartHeight - Intended height for the chart (in pixels)
' debugMode - Whether to start the chart in debug mode
' registerWithJS - Whether to ask chart to register itself with JavaScript
Function renderChart(chartSWF, strURL, strXML, chartId, chartWidth, chartHeight, debugMode, registerWithJS)
	'First we create a new DIV for each chart. We specify the name of DIV as "chartId"Div.			
	'DIV names are case-sensitive.
%>
	<!-- START Script Block for Chart <%=chartId%> -->
	<div id='<%=chartId%>Div' align='center'>
		Chart.
		<%
		'The above text "Chart" is shown to users before the chart has started loading
		'(if there is a lag in relaying SWF from server). This text is also shown to users
		'who do not have Flash Player installed. You can configure it as per your needs.
		%>
	</div>
		<%
		'Now, we render the chart using FusionCharts Class. Each chart's instance (JavaScript) Id 
		'is named as chart_"chartId".		
		%>
	<script type="text/javascript">	
		//Instantiate the Chart	
		var chart_<%=chartId%> = new FusionCharts("<%=chartSWF%>", "<%=chartId%>", "<%=chartWidth%>", "<%=chartHeight%>", "<%=boolToNum(debugMode)%>", "<%=boolToNum(registerWithJS)%>");
		<% 
		'Check whether we've to provide data using dataXML method or dataURL method
		if strXML="" then %>
		//Set the dataURL of the chart
		chart_<%=chartId%>.setDataURL("<%=strURL%>");
		<% else %>
		//Provide entire XML data using dataXML method 
		chart_<%=chartId%>.setDataXML("<%=strXML%>");
		<% end if %>		
		//Finally, render the chart.
		chart_<%=chartId%>.render("<%=chartId%>Div");
	</script>	
	<!-- END Script Block for Chart <%=chartId%> -->
	<%
End Function

'renderChartHTML function renders the HTML code for the JavaScript. This
'method does NOT embed the chart using JavaScript class. Instead, it uses
'direct HTML embedding. So, if you see the charts on IE 6 (or above), you'll
'see the "Click to activate..." message on the chart.
' chartSWF - SWF File Name (and Path) of the chart which you intend to plot
' strURL - If you intend to use dataURL method for this chart, pass the URL as this parameter. Else, set it to "" (in case of dataXML method)
' strXML - If you intend to use dataXML method for this chart, pass the XML data as this parameter. Else, set it to "" (in case of dataURL method)
' chartId - Id for the chart, using which it will be recognized in the HTML page. Each chart on the page needs to have a unique Id.
' chartWidth - Intended width for the chart (in pixels)
' chartHeight - Intended height for the chart (in pixels)
' debugMode - Whether to start the chart in debug mode
Function renderChartHTML(chartSWF, strURL, strXML, chartId, chartWidth, chartHeight, debugMode)
	'Generate the FlashVars string based on whether dataURL has been provided
	'or dataXML.
	Dim strFlashVars
	if strXML="" then
		'DataURL Mode
		strFlashVars = "&chartWidth=" & chartWidth & "&chartHeight=" & chartHeight & "&debugMode=" & boolToNum(debugMode) & "&dataURL=" & strURL
	else
		'DataXML Mode
		strFlashVars = "&chartWidth=" & chartWidth & "&chartHeight=" & chartHeight & "&debugMode=" & boolToNum(debugMode) & "&dataXML=" & strXML 		
	end if
	%>
	<!-- START Code Block for Chart <%=chartId%> -->
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="<%=chartWidth%>" height="<%=chartHeight%>" id="<%=chartId%>">
		<param name="allowScriptAccess" value="always" />
		<param name="movie" value="<%=chartSWF%>"/>		
		<param name="FlashVars" value="<%=strFlashVars%>" />
		<param name="quality" value="high" />
		<embed src="<%=chartSWF%>" FlashVars="<%=strFlashVars%>" quality="high" width="<%=chartWidth%>" height="<%=chartHeight%>" name="<%=chartId%>" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
	</object>
	<!-- END Code Block for Chart <%=chartId%> -->
	<%
End Function

'boolToNum function converts boolean values to numeric (1/0)
Function boolToNum(bVal)
	Dim intNum
	if bVal=true then
		intNum = 1
	else
		intNum = 0
	end if
	boolToNum = intNum
End Function
%>


Default.asp
<%@ Language=VBScript %>
<HTML>
<HEAD>
	<TITLE>
	FusionCharts - Database and Drill-Down Example
	</TITLE>
	<%
	'You need to include the following JS file, if you intend to embed the chart using JavaScript.
	'Embedding using JavaScripts avoids the "Click to Activate..." issue in Internet Explorer
	'When you make your own charts, make sure that the path to this JS file is correct. Else, you would get JavaScript errors.
	%>	
	<SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT>
	<style type="text/css">
	<!--
	body {
		font-family: Arial, Helvetica, sans-serif;
		font-size: 12px;
	}
	.text{
		font-family: Arial, Helvetica, sans-serif;
		font-size: 12px;
	}
	-->
	</style>
</HEAD>
	<%
	'We've included ../Includes/FusionCharts.asp, which contains functions
	'to help us easily embed the charts.
	%>
	<!-- #INCLUDE FILE="../Includes/FusionCharts.asp" -->
	<!-- #INCLUDE FILE="../Includes/DBConn.asp" -->
<BODY>

<CENTER>
<h2>FusionCharts Database and Drill-Down Example</h2>
<h4>Click on any pie slice to see detailed data.</h4>
<p class='text'>Or, right click on any pie to enable slicing or rotation mode. </p>
<%
	'In this example, we show how to connect FusionCharts to a database.
	'For the sake of ease, we've used an Access database which is present in
	'../DB/FactoryDB.mdb. It just contains two tables, which are linked to each
	'other. 
		
	'Database Objects - Initialization
	Dim oRs, oRs2, strQuery
	'strXML will be used to store the entire XML document generated
	Dim strXML
	
	'We also keep a flag to specify whether we've to animate the chart or not.
	'If the user is viewing the detailed chart and comes back to this page, he shouldn't
	'see the animation again.
	Dim animateChart
	animateChart = Request.QueryString("animate")
	'Set default value of 1
	if animateChart="" then
		animateChart = "1"
	end if
	
	'Create the recordset to retrieve data
	Set oRs = Server.CreateObject("ADODB.Recordset")

	'Generate the chart element
	strXML = "<chart caption='Factory Output report' subCaption='By Quantity' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix=' Units' animation=' " & animateChart & "'>"
	
	'Iterate through each factory
	strQuery = "select * from Factory_Master"
	Set oRs = oConn.Execute(strQuery)
	
	While Not oRs.Eof
		'Now create second recordset to get details for this factory
		Set oRs2 = Server.CreateObject("ADODB.Recordset")
		strQuery = "select sum(Quantity) as TotOutput from Factory_Output where FactoryId=" & ors("FactoryId")
		Set oRs2 = oConn.Execute(strQuery)				
		'Generate <set label='..' value='..' link='..' />
		'Note that we're setting link as Detailed.asp?FactoryId=<<FactoryId>>
		strXML = strXML & "<set label='" & ors("FactoryName") & "' value='" & ors2("TotOutput") & "' link='" & Server.URLEncode("Detailed.asp?FactoryId=" & ors("FactoryId")) & "'/>"
		'Close recordset
		Set oRs2 = Nothing
		oRs.MoveNext
	Wend
	'Finally, close <chart> element
	strXML = strXML & "</chart>"
	Set oRs = nothing
	
	'Create the chart - Pie 3D Chart with data from strXML
	Call renderChart("../../FusionCharts/Pie3D.swf", "", strXML, "FactorySum", 600, 300, false, false)	
%>
<BR><BR>
<a href='../NoChart.html' target="_blank">Unable to see the chart above?</a>
</CENTER>
</BODY>
</HTML>


Detailed.asp
<%@ Language=VBScript %>
<HTML>
<HEAD>
	<TITLE>
	FusionCharts - Database and Drill-Down Example
	</TITLE>
	<%
	'You need to include the following JS file, if you intend to embed the chart using JavaScript.
	'Embedding using JavaScripts avoids the "Click to Activate..." issue in Internet Explorer
	'When you make your own charts, make sure that the path to this JS file is correct. Else, you would get JavaScript errors.
	%>	
	<SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT>
	<style type="text/css">
	<!--
	body {
		font-family: Arial, Helvetica, sans-serif;
		font-size: 12px;
	}
	.text{
		font-family: Arial, Helvetica, sans-serif;
		font-size: 12px;
	}
	-->
	</style>
</HEAD>
	<%
	'We've included ../Includes/FusionCharts.asp, which contains functions
	'to help us easily embed the charts.
	%>
	<!-- #INCLUDE FILE="../Includes/FusionCharts.asp" -->
	<!-- #INCLUDE FILE="../Includes/DBConn.asp" -->
<BODY>

<CENTER>
<h2>FusionCharts Database and Drill-Down Example</h2>
<h4>Detailed report for the factory</h4>
<%
	'This page is invoked from Default.asp. When the user clicks on a pie
	'slice in Default.asp, the factory Id is passed to this page. We need
	'to get that factory id, get information from database and then show
	'a detailed chart.
	
	'First, get the factory Id
	Dim FactoryId
	'Request the factory Id from Querystring
	FactoryId = Request.QueryString("FactoryId")
	
	Dim oRs, strQuery
	'strXML will be used to store the entire XML document generated
	Dim strXML, intCounter	
	intCounter = 0
	
	Set oRs = Server.CreateObject("ADODB.Recordset")
	'Generate the chart element string
	strXML = "<chart palette='2' caption='Factory " & FactoryId &" Output ' subcaption='(In Units)' xAxisName='Date' showValues='1' labelStep='2' >"
	'Now, we get the data for that factory
	strQuery = "select * from Factory_Output where FactoryId=" & FactoryId
	Set oRs = oConn.Execute(strQuery)
	While Not oRs.Eof		
		'Here, we convert date into a more readable form for set label.
		strXML = strXML & "<set label='" & datePart("d",ors("DatePro")) & "/" & datePart("m",ors("DatePro")) & "' value='" & ors("Quantity") & "'/>"		
		Set oRs2 = Nothing
		oRs.MoveNext
	Wend
	'Close <chart> element
	strXML = strXML & "</chart>"
	Set oRs = nothing
	
	'Create the chart - Column 2D Chart with data from strXML
	Call renderChart("../../FusionCharts/Column2D.swf", "", strXML, "FactoryDetailed", 600, 300, false, false)
%>
<BR>
<a href='Default.asp?animate=0'>Back to Summary</a>
<BR><BR>
<a href='../NoChart.html' target="_blank">Unable to see the chart above?</a>
</CENTER>
</BODY>
</HTML>







Date : 2010-01-26 14:57:51 By : tungman
 


 

No. 2



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


เป่าคะไม่ได้เขียน .net อยากได้ asp ก่อน แต่ก็จะลองเอาไปห้อง .net ก็ได้คะ
Date : 2010-01-26 15:01:23 By : jpy
 

 

No. 3



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


พอดีไปหาดู มันมีตัวอย่าง asp อยู่

ว่าแต่มี .js แล้วใช่ไหม
Date : 2010-01-26 15:11:38 By : tungman
 


 

No. 4



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณมากเลยนะคะ
เดี๋ยวลองดูกอ่นถ้าได้ผลอย่างไรจะมาแชร์ให้คะ
Date : 2010-01-26 15:13:09 By : jyp
 


 

No. 5

Guest


เสร็จและคะดังภาพเยยนะคะข้อมูลมีแค่ 3 ตัวเองคะ

xml2
Date : 2010-01-26 15:59:54 By : jyp
 


 

No. 6



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


ต้องใช้ swf ของตัว enterprise ครับ

ทิ้ง mail ไว้เดี๋ยวจะส่งไปให้ (เฉพาะ swf)
Date : 2010-01-26 16:27:50 By : tungman
 


 

No. 7



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


[email protected]

เอ้อมีปัญหาตรงที่ ตอนแสดงค่าคะ มันผิดนะคะดูดีๆซิตรงรุปทั้งๆที่เอา sql ไปเช็ตและนะคะถูกต้อง
แต่ทำไมเวลามาแสดงใน swf มันผิดละ
Date : 2010-01-26 17:21:12 By : jyp
 


 

No. 8



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


ถ้าเป็นกราฟวงกลม ปกติผมจะส่งไปเป็นเปอร์เซนต์เลยครับ สมมุติมี 3 ค่า ผมก็จะส่ง 30% 50% 20% ไป

ค่าทั้งหมดที่ส่งจะต้อง บวกกันได้ 100 พอดี แล้วให้มันแสดงผลอย่างเดียว


ปล. e-mail address น่าส่งให้มากครับ
Date : 2010-01-26 19:56:21 By : tungman
 


 

No. 9



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


เอ่อถามนิดนึงคะและนี่ต้องแก้อย่างไรถึงจะส่งค่าได้ถูกต้องละคะ
ช่วยบอกหน่อยคะรีบใช้มากเยย เคยทำแต่ php เจอ asp งงมาก
นี่คลำทางมาได้เยอะแต่ยังไม่พบไงช่วยแนะนำหน่อยนคะ
Date : 2010-01-28 09:17:16 By : jyp
 


 

No. 10



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


คือว่าจากที่อ่านจากฐานข้อมูล แล้วเอามาส่งไปให้ fusion charts เลย ผมก็เอาค่าพวกนั้นไปคำนวณเป็น เปอร์เซ็นต์ ก่อน

แล้วค่อยวนลูป เขียนเป็น string ส่งให้ fusion charts ทีหลัง

ที่ผมเคยทำมีแต่แบบ asp.net C# น่ะ
Date : 2010-01-28 09:33:03 By : tungman
 


 

No. 11



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


มีตัวอย่างไหมคะ คนไม่เก่งต้องขอคำแนะนำจากคนเก่งจะได้มีประสบการณ์ที่ดี
ว่าอย่างน้อยคนไทยด้วยกันก็ช่วยเหลือกันได้ คะ ขอบคุณล่วงหน้านะคะ
Date : 2010-01-28 09:41:15 By : jyp
 


 

No. 12



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


จะเข้าใจไหมเนี่ย

ของผมใช้ dll ของ fusion charts แล้วก็อ่านข้อมูลมาคำนวณเป็นไว้ใน array แล้วค่อยวนลูปเขียนเป็น xml string ส่งไปให้ fusion charts (Code โบราณสมัยเริ่มหัด .net ใหม่ๆ โปรดทำใจนิดนึง)

Code (C#)
    public string PieChart3D(string OfficeName)
    {
        //In this example, we plot a single series chart from data contained
        //in an array. The array will have two columns - first one for data label
        //and the next one for data values.

        //Let's store the sales data for 6 products in our array). We also store
        //the name of products.
        List<string> arrDataName = new List<string>();
        List<string> arrDataValue = new List<string>();
        List<string> arrDataTooltip = new List<string>();

        //Store Name of Products
        DataTable DtName = new DataTable();
        if (Request.QueryString["div"] != null)
        {
            DtName = KA.KeyAccountByOfficeCode(Request.QueryString["div"].ToString(), DateTime.Parse(SelectMonth.Text).Month, AD);

            foreach (DataRow Dr in DtName.Rows)
            {
                arrDataName.Add(Dr["name_t"].ToString());
            }
        }
        else if (Request.QueryString["dep"] != null)
        {
            DtName = MyOffice.GetOfficeByRelation(Request.QueryString["dep"].ToString(), true);

            foreach (DataRow Dr in DtName.Rows)
            {
                arrDataName.Add(Dr["OfficeShortName"].ToString());
            }
        }
        else
        {
            DtName = MyOffice.GetOfficeByRelation("D0005", true);

            foreach (DataRow Dr in DtName.Rows)
            {
                arrDataName.Add(Dr["OfficeShortName"].ToString());
            }
        }

        //Store sales data
        float Value = 100 / DtName.Rows.Count;

        if (Request.QueryString["div"] != null)
        {
            int AllActivity = 0;

            foreach (DataRow Dr in DtName.Rows)
            {
                AllActivity += Activity.AllActivity(Dr["USerID"].ToString(), DateTime.Parse(SelectMonth.Text).Month, AD).Rows.Count;
            }

            if (AllActivity > 0)
            {
                foreach (DataRow Dr in DtName.Rows)
                {
                    int Act = Activity.AllActivity(Dr["USerID"].ToString(), DateTime.Parse(SelectMonth.Text).Month, AD).Rows.Count;
                    float ActPersent = (100 * Act) / AllActivity;

                    arrDataValue.Add(ActPersent.ToString());
                    arrDataTooltip.Add(Dr["name_t"].ToString() + ", " + Act.ToString() + " ครั้ง");
                }
            }
            else
            {
                foreach (DataRow Dr in DtName.Rows)
                {
                    arrDataValue.Add(Value.ToString());
                    arrDataTooltip.Add(Dr["name_t"].ToString() + ", 0" + " ครั้ง");
                }
            }
        }
        else if (Request.QueryString["dep"] != null)
        {
            int AllActivity = 0;
            List<int> AllAct = new List<int>();

            foreach (DataRow Dr in DtName.Rows)
            {
                int aAct = Activity.AllActivityByOfficeCode(KA.KeyAccountByOfficeCode(Dr["OfficeID"].ToString()), DateTime.Parse(SelectMonth.Text).Month, AD).Rows.Count;

                AllAct.Add(aAct);

                AllActivity += aAct;
            }

            if (AllActivity > 0)
            {
                int i = 0;

                foreach (DataRow Dr in DtName.Rows)
                {
                    float Act = (100 * AllAct[i]) / AllActivity;

                    arrDataValue.Add(Act.ToString());
                    arrDataTooltip.Add(Dr["OfficeShortName"].ToString() + ", " + AllAct[i].ToString() + " ครั้ง");
                    i++;
                }
            }
            else
            {
                foreach (DataRow Dr in DtName.Rows)
                {
                    arrDataValue.Add(Value.ToString());
                    arrDataTooltip.Add(Dr["OfficeShortName"].ToString() + ", 0" + " ครั้ง");
                }
            }
        }
        else
        {
            int AllActivity = 0;
            List<int> AllAct = new List<int>();

            foreach (DataRow Dr in DtName.Rows)
            {
                int aAct = 0;

                foreach (DataRow Drr in MyOffice.GetOfficeByRelation(Dr["OfficeID"].ToString(), true).Rows)
                {
                    aAct += Activity.AllActivityByOfficeCode(KA.KeyAccountByOfficeCode(Drr["OfficeID"].ToString()), DateTime.Parse(SelectMonth.Text).Month, AD).Rows.Count;
                }

                AllAct.Add(aAct);

                AllActivity += aAct;
            }

            if (AllActivity > 0)
            {
                int i = 0;

                foreach (DataRow Dr in DtName.Rows)
                {
                    float Act = (100 * AllAct[i]) / AllActivity;

                    arrDataValue.Add(Act.ToString());
                    arrDataTooltip.Add(Dr["OfficeShortName"].ToString() + ", " + AllAct[i].ToString() + " ครั้ง");
                    i++;
                }
            }
            else
            {
                foreach (DataRow Dr in DtName.Rows)
                {
                    arrDataValue.Add(Value.ToString());
                    arrDataTooltip.Add(Dr["OfficeShortName"].ToString() + ", 0" + " ครั้ง");
                }
            }
        }
        //Now, we need to convert this data into XML. We convert using StringBuilder concatenation.
        StringBuilder xmlData = new StringBuilder();
        //Initialize <chart> element
        xmlData.AppendFormat("<chart caption='แสดงกิจกรรมการขายในภาพรวมของ {0}' subcaption='เดือน{1} {2}' decimals='0' enableSmartLabels='1' enableRotation='0' bgColor='99CCFF,FFFFFF' bgAlpha='40,100' bgRatio='0,100' bgAngle='360' showBorder='1' startingAngle='70' showPercentValues='1' baseFont='Tahoma' baseFontSize ='12' baseFontColor ='000000'>", OfficeName, DateTime.Parse(SelectMonth.Text).ToString("MMMM"), DateTime.Parse(SelectMonth.Text).ToString("yyyy"));
        //Convert data to XML and append
        for (int i = 0; i < arrDataName.Count; i++)
        {
            if (i == 0)
                xmlData.AppendFormat("<set label='{0}' value='{1}' tooltext='{2}' isSliced='1' />", arrDataName[i], arrDataValue[i], arrDataTooltip[i]);
            else
                xmlData.AppendFormat("<set label='{0}' value='{1}' tooltext='{2}' />", arrDataName[i], arrDataValue[i], arrDataTooltip[i]);
        }
        //Close <chart> element
        xmlData.Append("</chart>");

        //Create the chart - Column 3D Chart with data contained in xmlData
        return FusionCharts.RenderChart("Charts/Pie3D.swf", "", xmlData.ToString(), "productSales", "450", "350", false, false, true);
    }

Date : 2010-01-28 09:48:42 By : tungman
 


 

No. 13



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


ทำตาม algoritm ที่บอกดีกว่าไหมครับ จะดูโค้ดผมงงตาย asp กับ asp.net ไม่เหมือนกันนะ แถมเป็น c# ด้วย
Date : 2010-01-28 09:56:31 By : tungman
 


 

No. 14



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


เอ่อเอาโค๊ด แก้วไปดูไหมคะเผื่อแบบดูแล้วเผื่อแบบจะช่วยวนลูปได้คะ

connect.asp
<%
set con =server.CreateObject("adodb.connection")
con.ConnectionString ="Provider=SQLOLEDB.1;Initial Catalog=Test;Data Source=Test;user id=Test;PASSWORD=Test"
con.Open

%>

Report_device.asp

<!-- #INCLUDE FILE="FusionCharts.asp" -->
<!-- #INCLUDE FILE="connect.asp" -->Code (VB.NET)
Code (ASP)

<link href="style.css" rel="stylesheet" type="text/css">
<title>MedicalAppliance รายงานจำนวนอุปกรณ์ที่ถือครอง</title>
<SCRIPT LANGUAGE="Javascript" SRC="App/FusionCharts/FusionCharts.js"></SCRIPT>
<style type="text/css">
<!--
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
.text{
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
-->
</style>

<%
div_id=session("div_id")
set rs1 =server.CreateObject("adodb.recordset")
sql1= " SELECT Test_Typedevice.Device_Name, COUNT(Test_Typedevice.Device_ID) AS CountDevice_ID, Test_detail.div_name "
sql1 = sql1+"FROM Test_Typedevice INNER JOIN "
sql1 = sql1+" Test_Test ON Test_Typedevice.Device_ID = Test_Test.Device_ID AND "
sql1 = sql1+" Test_Typedevice.div_id = Test_Test.div_id INNER JOIN "
sql1 = sql1+"Test_detail ON Test_Typedevice.div_id = Test_detail.div_id AND "
sql1 = sql1+"Test_Test.div_id = Test_detail.div_id "
sql1 = sql1+"GROUP BY Test_Typedevice.Device_Name, Test_detail.div_name, Test_detail.div_name"
rs1.Open sql1,con,1,3
if not rs1.eof then

<table width="90%" border="0" cellspacing="0" cellpadding="0" class="thgreen">

<tr>
<td align="center"><h1>รายงาน จำนวนอุปกรณ์ที่ถือครอง (หน่วยงาน) </h1></td>
</tr>
<tr>
<td background="Templates/img/line2.jpg" style="background-repeat:repeat-x"><img src="Templates/img/line2.jpg"></td>
</tr>
<tr>

<td align="center"> </td>
</tr>
<tr>
<td><table width="74%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="30%"><h3 align="center">ชื่ออุปกรณ์</h3></td>
<td width="24%"><h3 align="center">จำนวนอุปกรณ์ที่ถือครอง</h3></td>
<td width="46%"><h3 align="center">หน่วยงาน</h3></td>
</tr>
<tr>
<%
while not rs1.eof and rowcount<rs1.pagesize
if bg="tdblue-2" then
bg="tdblue-1"
else
bg="tdblue-2"
end if
%>
<td><div align="center"><%=rs1("Device_Name")%></div></td>
<td><div align="center"><%=rs1("CountDevice_ID")%></div></td>
<td><div align="center"><%=rs1("div_name")%></div></td>
</tr>
<tr>

<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<%
rowcount=rowcount+1
rs1.movenext
wend
%>
</table></td>
</tr>
</table>
<%end if%>
<%
'ส่วนของการแสดงกราฟ
Dim oRs, oRs2, strQuery
'strXML will be used to store the entire XML document generated
Dim strXML

'We also keep a flag to specify whether we've to animate the chart or not.
'If the user is viewing the detailed chart and comes back to this page, he shouldn't
'see the animation again.
Dim animateChart
animateChart = Request.QueryString("animate")
'Set default value of 1
if animateChart="" then
animateChart = "1"
end if

'Create the recordset to retrieve data
Set oRs = Server.CreateObject("ADODB.Recordset")

'Generate the chart element
strXML = "<chart caption='กราฟรายงาน จำนวนอุปกรณ์ที่ถือครอง' pieSliceDepth='30' showBorder='5' formatNumberScale='0' numberSuffix=' ' startingAngle='125' animation=' " & animateChart & "'>"
'คำอธิบาย
'pieSliceDepth = ความสูง
'showBorder =ขอบเส้น
'numberSuffix=หน่วยของตัวเลข

'Iterate through each factory
'strQuery = "select * from Factory_Master"
strQuery= " SELECT Test_Typedevice.Device_Name, Test_detail.div_name "
strQuery = strQuery+"FROM Test_Typedevice INNER JOIN "
strQuery = strQuery+" Test_Test ON Test_Typedevice.Device_ID = Test_Test.Device_ID AND "
strQuery = strQuery+" Test_Typedevice.div_id = Test_Test.div_id INNER JOIN "
strQuery = strQuery+"Test_detail ON Test_Typedevice.div_id = Test_detail.div_id AND "
strQuery = strQuery+"Test_Test.div_id = Test_detail.div_id "
strQuery = strQuery+"GROUP BY Test_Typedevice.Device_Name, Test_detail.div_name, Test_detail.div_name"
Set oRs = Con.Execute(strQuery)

While Not oRs.Eof
'Now create second recordset to get details for this factory
Set oRs2 = Server.CreateObject("ADODB.Recordset")
'strQuery = "select sum(Quantity) as TotOutput from Factory_Output where FactoryId=" & ors("FactoryId")
strQuery= " SELECT Test_Typedevice.Device_Name, COUNT(Test_Typedevice.Device_ID) AS CountDevice_ID, Test_detail.div_name "
strQuery = strQuery+"FROM Test_Typedevice INNER JOIN "
strQuery = strQuery+" Test_Test ON Test_Typedevice.Device_ID = Test_Test.Device_ID AND "
strQuery = strQuery+" Test_Typedevice.div_id = Test_Test.div_id INNER JOIN "
strQuery = strQuery+"Test_detail ON Test_Typedevice.div_id = Test_detail.div_id AND "
strQuery = strQuery+"Test_Test.div_id = Test_detail.div_id "
strQuery = strQuery+"GROUP BY Test_Typedevice.Device_Name, Test_detail.div_name, Test_detail.div_name"
Set oRs2 = Con.Execute(strQuery)
'Generate <set label='..' value='..' link='..' />
'Note that we're setting link as Detailed.asp?FactoryId=<<FactoryId>>
strXML = strXML & "<set label='" & ors("Device_Name") & "' value='" & ors2("CountDevice_ID") & "' />"
'Close recordset
Set oRs2 = Nothing
oRs.MoveNext
Wend
'Finally, close <chart> element

strXML = strXML & "</chart>"

Set oRs = nothing

'Create the chart - Pie 3D Chart with data from strXML
Call renderChart("App/FusionCharts/Column3D.swf", "", strXML, "FactorySum", 600, 300, false, false)
%>
Date : 2010-01-28 10:12:00 By : jyp
 


 

No. 15



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


พอดีชอบแกล้งคนเล่นมากกว่า อนุญาตหายเข้ากลีบเมฆเลยแล้วกัน
Date : 2010-01-28 11:11:18 By : tungman
 


 

No. 16



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


โอ่ใจร้ายอะ เราเดือดร้อนจริงๆนะ อยากจะร้องไห้
ส่งไปที่เมล์ได้ไหม นะนะนนะนะนะนะ
Date : 2010-01-28 11:34:50 By : jyp
 


 

No. 17



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


สงสัยไม่ช่วยจริงๆ ไม่เป็นไร อย่างไรก็ขอบคุณมากนะคะ

Date : 2010-01-28 13:59:35 By : jyp
 


 

No. 18



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


ช่วยกันนิดนะคะไม่ได้จริงๆหาจนไม่รุ้จะหาอย่างไรแล้ว
Date : 2010-02-04 10:32:38 By : jpy
 


 

No. 19



โพสกระทู้ ( 3,144 )
บทความ ( 1 )

สมาชิกที่ใส่เสื้อไทยครีเอท

สถานะออฟไลน์


Connection.asp
<%
connstr = "Driver={SQL Server};Server=10.0.102.9;Database=MGSI;UID=mgsi;Pwd=mgsi"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConnStr
%>

CloseConnection.asp
<%
Conn.Close
Set Conn = Nothing
%>

แก้ให้แล้วนะ ถ้าไม่ได้ลองดูที่ sql command

PieChart3D.asp
<%@ Language=VBScript %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<!-- #include file="Includes/Connection.asp" -->
<!-- #include file="Includes/FusionCharts.asp" -->

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>Pie Chart 3D Example</title>
    <meta http-equiv="content-Type" content="text/html; charset=windows-874" />
    <script language="javascript" type="text/javascript" src="FusionCharts/FusionCharts.js"></script>
    
	<style type="text/css">
	    body {
		    font-family: Arial, Helvetica, sans-serif;
		    font-size: 12px;
	    }
	    .text {
		    font-family: Arial, Helvetica, sans-serif;
		    font-size: 12px;
	    }
	</style>
</head>
<body>
<%
    Dim div_id
    Dim strQuery1
    Dim RS1
    
    div_id = session("div_id")
    
    strQuery1 = "Select Count([Test_Typedevice].[Device_ID]) As [CountDevice_ID], [Test_Typedevice].[Device_Name], [Test_detail].[div_name] " &_
        "From [Test_Typedevice] " &_
        "Inner Join [Test_Test] " &_
        "On ([Test_Typedevice].[Device_ID] = [Test_Test].[Device_ID] And [Test_Typedevice].[div_id] = [Test_Test].[div_id]) " &_
        "Inner Join [Test_detail] " &_
        "On ([Test_Typedevice].[div_id] = [Test_detail].[div_id] And [Test_Test].[div_id] = [Test_detail].[div_id]) " &_
        "Group By [Test_Typedevice].[Device_Name], [Test_detail].[div_name], [Test_detail].[div_name]" 
        
    Set RS1 = Conn.Execute(strQuery1)
    
    If Not RS1.Eof Then
%>
    <table width="90%" border="0" cellspacing="0" cellpadding="0" class="thgreen">
        <tr>
            <td align="center"><h1>รายงาน จำนวนอุปกรณ์ที่ถือครอง (หน่วยงาน)</h1></td>
        </tr>
        <tr>
            <td style="background-repeat:repeat-x; background-image: url('Templates/img/line2.jpg');">
                <img alt="" src="Templates/img/line2.jpg" />
            </td>
        </tr>
        <tr>
            <td align="center">&nbsp;</td>
        </tr>
        <tr>
            <td>
                <table width="74%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="30%"><h3 align="center">ชื่ออุปกรณ์</h3></td>
                        <td width="24%"><h3 align="center">จำนวนอุปกรณ์ที่ถือครอง</h3></td>
                        <td width="46%"><h3 align="center">หน่วยงาน</h3></td>
                    </tr>
<%
        Dim bg
        bg = "tdblue-2"

        Do While Not RS1.Eof
            If bg = "tdblue-2" Then
                bg = "tdblue-1"
            Else
                bg = "tdblue-2"
            End If
            
            Response.Write("<tr>" & VbCrLf)
            Response.Write("<td class='" & bg & "'><div align='center'>" & RS1("Device_Name") & "</div></td>" & VbCrLf)
            Response.Write("<td class='" & bg & "'><div align='center'>" & RS1("CountDevice_ID") & "</div></td>" & VbCrLf)
            Response.Write("<td class='" & bg & "'><div align='center'>" & RS1("div_name") & "</div></td>" & VbCrLf)
            Response.Write("</tr>" & VbCrLf)
            
            RS1.MoveNext
        Loop
        
	    RS1.Close
	    Set RS1 = Nothing
	End If  
 %>                    
                </table>
            </td>
        </tr>
        <tr>
            <td>&nbsp;</td>
        </tr>
        <tr>
            <td>
<%
    'ส่วนของการแสดงกราฟ 
    'Dim strQuery2
    Dim strQuery3
    Dim RS2
    'Dim RS3
    Dim strXML
    
    strXML = "<chart caption='กราฟรายงาน จำนวนอุปกรณ์ที่ถือครอง' pieSliceDepth='30' showBorder='5' formatNumberScale='0' numberSuffix=' ' startingAngle='125' animation='1'>"
    
    'strQuery2 = "Select * From [Factory_Master]"
    'strQuery2 = "Select [Test_Typedevice].[Device_Name], [Test_detail].[div_name] " &_
        '"From [Test_Typedevice] " &_
        '"Inner Join [Test_Test] " &_
        '"On ([Test_Typedevice].[Device_ID] = [Test_Test].[Device_ID] And [Test_Typedevice].[div_id] = [Test_Test].[div_id]) " &_
        '"Inner Join [Test_detail] " &_
        '"On ([Test_Typedevice].[div_id] = [Test_detail].[div_id] And [Test_Test].[div_id] = [Test_detail].[div_id]) " &_
        '"Group By [Test_Typedevice].[Device_Name], [Test_detail].[div_name], [Test_detail].[div_name]"
    
    'Set RS2 = Conn.Execute(strQuery2)
    strQuery3 = "Select [Test_Typedevice].[Device_Name], Count([Test_Typedevice].[Device_ID]) As [CountDevice_ID], [Test_detail].[div_name] " &_
        "From [Test_Typedevice] " &_
        "Inner Join [Test_Test] " &_
        "On ([Test_Typedevice].[Device_ID] = [Test_Test].[Device_ID] And [Test_Typedevice].[div_id] = [Test_Test].[div_id]) " &_
        "Inner Join [Test_detail] " &_ 
        "On ([Test_Typedevice].[div_id] = [Test_detail].[div_id] And [Test_Test].[div_id] = [Test_detail].[div_id]) " &_
        "Group By [Test_Typedevice].[Device_Name], [Test_detail].[div_name], [Test_detail].[div_name]"
        
    Set RS2 = Conn.Execute(strQuery3)

    Do While Not RS2.Eof
        'strQuery3 = "Select Sum([Quantity]) As [TotOutput] From [Factory_Output] Where [FactoryId]=" & RS("FactoryId")
        'strQuery3 = "Select [Test_Typedevice].[Device_Name], Count([Test_Typedevice].[Device_ID]) As [CountDevice_ID], [Test_detail].[div_name] " &_
            '"From [Test_Typedevice] " &_
            '"Inner Join [Test_Test] " &_
            '"On ([Test_Typedevice].[Device_ID] = [Test_Test].[Device_ID] And [Test_Typedevice].[div_id] = [Test_Test].[div_id]) " &_
            '"Inner Join [Test_detail] " &_ 
            '"On ([Test_Typedevice].[div_id] = [Test_detail].[div_id] And [Test_Test].[div_id] = [Test_detail].[div_id]) " &_
            '"Group By [Test_Typedevice].[Device_Name], [Test_detail].[div_name], [Test_detail].[div_name]"
            
            'Set RS3 = Conn.Execute(strQuery3)
            
            strXML = strXML & "<set label='" & RS2("Device_Name") & "' value='" & RS2("CountDevice_ID") & "' />"
            
            'RS3.Close
	        'Set RS3 = Nothing
        RS2.MoveNext
    Loop
       
    strXML = strXML & "</chart>"   
       
	RS2.Close
	Set RS2 = Nothing
    
    Call renderChart("FusionCharts/Pie3D.swf", "", strXML, "FactorySum", 600, 300, false, false)
%>            
            </td>
        </tr>
    </table>  
</body>
</html>

<!-- #include file="Includes/CloseConnection.asp" -->

Date : 2010-02-04 17:00:00 By : tungman
 


 

No. 20



โพสกระทู้ ( 64 )
บทความ ( 0 )



สถานะออฟไลน์


ขอบคุณมากมายคะ
Date : 2010-02-05 11:18:15 By : jyp
 


 

No. 21



โพสกระทู้ ( 1 )
บทความ ( 0 )



สถานะออฟไลน์


อยากได้ swf Enterp. มั่งพอจะเอื้อเฟื้อได้บ้างไหมครับคุณ tungman ครับ ขอบคุณล่วงหน้ามากๆครับ
stationlink at hotmail.com
Date : 2011-06-10 15:58:18 By : msnadmin
 


 

No. 22

Guest


goto: มาทำ chart controls for asp.net ด้วย fusioncharts v3.1 กันนะตะเอง
Date : 2011-09-29 10:24:24 By : พี่หมี
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : xml +asp...ถ้าเราต้องการ write ค่าในฐานข้อมูลออกมาแสดงคะทำอย่างไรคะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 05
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่