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,038

HOME > PHP > PHP Forum > ช่วยดูให้หน่อยค่ะทำเกี่ยวกับเรื่อง ระบบจัดเก็บสถิติอุบัติเหตุผ่าน google map


[PHP] ช่วยดูให้หน่อยค่ะทำเกี่ยวกับเรื่อง ระบบจัดเก็บสถิติอุบัติเหตุผ่าน google map

 
Topic : 078413



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



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



ประมาณว่าพอคลิกที่อำเภอนี้ แล้วก็เข้าคลิกปุ่มเพื่มเติม

แสดงผล google map

ก็จะเข้ามาดูสถิติของ ชาย และ หญิง ของเฉพาะอำเภอนี้เลย แต่หนูไม่รุว่าจะ ใส่ค่าออกมายังงัยให้ออกมาเเฉพาะของแต่ละอำเภอที่เราเลือกค่ะรบกวนพี่ช่วยหน่อยนะคะ

รูปจำแนกสถิติตามเพศ <-- ตัวอย่างที่อยากแสดงแบบรูปนี้คะ

อันนี้โค๊ดของกราฟที่แสดงผลของ สถิติ ชาย,หญิง คะ

Code (PHP)
01.<?php
02.//We've included ../Includes/FusionCharts.php and ../Includes/DBConn.php, which contains
03.//functions to help us easily embed the charts and connect to a database.
04.include("../Includes/FusionCharts.php");
05.include("../Includes/DBConn.php");
06.?>
07.<HTML>
08.<HEAD>
09.    <TITLE>
10.    สถิติจำแนกตามเพศ
11.    </TITLE>
12.    <?php
13.    //You need to include the following JS file, if you intend to embed the chart using JavaScript.
14.    //Embedding using JavaScripts avoids the "Click to Activate..." issue in Internet Explorer
15.    //When you make your own charts, make sure that the path to this JS file is correct. Else, you would get JavaScript errors.
16.    ?>  
17.    <SCRIPT LANGUAGE="Javascript" SRC="../../FusionCharts/FusionCharts.js"></SCRIPT>
18.    <style type="text/css">
19.    <!--
20.    body {
21.        font-family: Arial, Helvetica, sans-serif;
22.        font-size: 12px;
23.    }
24.    .text{
25.        font-family: Arial, Helvetica, sans-serif;
26.        font-size: 12px;
27.    }
28..style1 {font-size: 16px}
29.    -->
30.    </style>
31.</HEAD>
32.<BODY>
33.<form name="form1" method="post" action="">
34.  <table width="627" height="266" border="0" align="center">
35.    <tr>
36.      <td height="27" colspan="3" bgcolor="#FFCCFF"><div align="center">
37.        <p>สถิติอุบัติเหตุ จ. ลพบุรี</p>
38.        </div></td>
39.    </tr>
40.    <tr>
41.      <td width="104">&nbsp;</td>
42.      <td width="339" rowspan="3"><p align="center" class="style1">&nbsp;</p>
43.        <p align="center">
44.          <?php
45.    //In this example, we show how to connect FusionCharts to a database.
46.    //For the sake of ease, we've used an MySQL databases containing two
47.    //tables.
48. 
49.    // Connect to the DB
50.    $link = connectToDB();
51. 
52.    //We also keep a flag to specify whether we've to animate the chart or not.
53.    //If the user is viewing the detailed chart and comes back to this page, he shouldn't
54.    //see the animation again.
55.    $animateChart = $_GET['animate'];
56.    //Set default value of 1
57.    if ($animateChart=="")
58.        $animateChart = "1";
59. 
60.    //$strXML will be used to store the entire XML document generated
61.    //Generate the chart element
62.    $strXML = "<chart caption=' ' subCaption=' ' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix='  ' animation=' " . $animateChart . "'>";
63. 
64.    // Fetch all factory records
65.//    $strQuery = "select * from Factory_Master";  
66. //   $result = mysql_query($strQuery) or die(mysql_error());
67.            $strQuery = "select t1.*,t2.women
68.FROM (SELECT dt_district, count(dt_district) as man FROM detail where dt_sex='ชาย' group by dt_district) as t1
69.left join
70.(SELECT dt_district, count(dt_district) as women FROM detail  where dt_sex='หญิง' group by dt_district) as t2
71.on t1.dt_district=t2.dt_district";
72.      $result2 = mysql_query($strQuery) or die(mysql_error());
73.    //Iterate through each factory
74.  if ($result2) {
75.        while($ors2 = mysql_fetch_array($result2)) {
76.            $strXML .= "<set label='" . $ors2['dt_sex'] . "' value='" . $ors2['   '] . "' />"; // ตรงนี่ไม่รุจะใส่ค่ายังไงให้แสดงในแท่งกราฟคะ
77.        }
78.    }
79.    mysql_close($link);
80. 
81.    //Finally, close <chart> element
82.    $strXML .= "</chart>";
83. 
84.    //Create the chart - Pie 3D Chart with data from strXML
85.    echo renderChart("../../FusionCharts/Column3D.swf", "", $strXML, "FactorySum", 450, 250, false, false);
86.?>




Tag : PHP



ประวัติการแก้ไข
2012-05-15 08:22:01
2012-05-15 08:23:05
2012-05-15 10:20:17
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-05-15 08:05:50 By : Duangrawee View : 1244 Reply : 4
 

 

No. 1



โพสกระทู้ ( 74,059 )
บทความ ( 838 )

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

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

Code (PHP)
1.$strXML .= "<set label='" . $ors2['dt_sex'] . "' value='" . $ors2['man'] . "' />"; // ตรงนี่ไม่รุจะใส่ค่ายังไงให้แสดงในแท่งกราฟคะ


แบบนี้หรือเปล่าครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-05-15 11:21:45 By : mr.win
 

 

No. 2



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



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


ลองทำแล้วค่ะมันออกแต่ค่า ชายทั้งหมด แต่หนูต้องการให้ออกผลรวม เป็นแค่หญิงกับชาย ของเฉพาะอำเภออะค่ะ
เหมือนตัวอย่างรูปกราฟที่แสดงอะคะ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-05-15 12:17:10 By : Duangrawee
 

 

No. 3



โพสกระทู้ ( 74,059 )
บทความ ( 838 )

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

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

มันมีให้โยนค่า parameters แบบ 2 ตัวได้หรือเปล่าครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-05-15 12:35:29 By : mr.win
 

 

No. 4



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



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


ทำยังไงอะค่ะรบกวนพี่ช่วยดูให้หน่อยนะ ขอบคุณค่ะ


ประวัติการแก้ไข
2012-05-15 14:09:00
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-05-15 12:41:55 By : Duangrawee
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : ช่วยดูให้หน่อยค่ะทำเกี่ยวกับเรื่อง ระบบจัดเก็บสถิติอุบัติเหตุผ่าน google map
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)





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