ผู้เขียน หัวข้อ: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ  (อ่าน 11843 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ admin30

  • Sr. Member
  • ****
  • กระทู้: 352
  • Respect: 0
    • ดูรายละเอียด
    • ioffer resume
มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« เมื่อ: ธันวาคม 29, 2010, 15:46:47 PM »
0
ไม่รู้ว่าจะเขียนในหมวดไหน

ก็เลยลงในหมวดนี้ก็แล้วกันครับ

มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
ตอนนี้ผมเขียน PHP เชื่อมได้แล้ว

ได้ Query ออกมาโชว์ตามภาพแล้ว อยากโชว์แบบกราฟ ไม่ท่ราบว่า อาจารย์ท่านใด ถนัดเรื่อง PHP Foxpro Chart รบกวนด้วยนะครับ
HOSxP Server Master : MariaDb 10.1.19
ขึ้นระบบ 24 พ.ค.2550 โดย BMS Team
http://ikstudioytchannel.blogspot.com/
https://iofferresumer.blogspot.com/

ออฟไลน์ admin30

  • Sr. Member
  • ****
  • กระทู้: 352
  • Respect: 0
    • ดูรายละเอียด
    • ioffer resume
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #1 เมื่อ: ธันวาคม 29, 2010, 21:35:05 PM »
0
ขออนุญาติ ดันนะครับ

ไม่มีท่านใดพอจะทราบเลยหรอ
HOSxP Server Master : MariaDb 10.1.19
ขึ้นระบบ 24 พ.ค.2550 โดย BMS Team
http://ikstudioytchannel.blogspot.com/
https://iofferresumer.blogspot.com/

ออฟไลน์ NrohtaS

  • Full Member
  • ***
  • กระทู้: 179
  • Respect: 0
    • ดูรายละเอียด
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #2 เมื่อ: ธันวาคม 30, 2010, 00:11:50 AM »
0
ไม่แน่ใจว่าเชื่อม php ถึงขั้นไหน เลยแนะนำตามนี้ครับ
GraPHPite > http://graphpite.sourceforge.net/
jpgraph > http://jpgraph.net/?gclid=CJXrv4f6kaYCFUUa6wodZyjpLg
Mr. Sathorn.S

รพสต.บึงพระ อ.เมือง จ.พิษณุโลก
Oracle Linux 6.4 X86_64  MySQL Percona 55-5.5.33 X86_64  HosxP_PCU 3.56.X.YZ
Start HosXP_PCU 1 November 2009 (ขี้นระบบเอง)

รับทำแผนที่ Google Map

ออฟไลน์ udomchok

  • Hero Member
  • *****
  • กระทู้: 8,347
  • Respect: +589
    • ดูรายละเอียด
    • ร.พ.สมเด็จพระสังฆราช องค์ที่ 17
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #3 เมื่อ: ธันวาคม 30, 2010, 01:24:56 AM »
0
ลองหา fusion chart มาใช้ครับ
ทำด้วยหัวใจร.พ.สมเด็จพระสังฆราช องค์ที่ 17 อ.สองพี่น้อง จ.สุพรรณบุรี
อบรมโดย BMS Team เมื่อ พ.ย. 49 ขึ้นระบบห้องบัตรเมื่อ X'Mas 2007
2008 : X-Ray กายภาพบำบัด แพทย์แผนไทย กิจกรรมบำบัด OPD ตา
2009 : ทันตกรรม ห้องตรวจตา OPD (พยาบาลและห้องตรวจแพทย์บางห้อง)

ออฟไลน์ admin30

  • Sr. Member
  • ****
  • กระทู้: 352
  • Respect: 0
    • ดูรายละเอียด
    • ioffer resume
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #4 เมื่อ: มกราคม 04, 2011, 11:53:46 AM »
0
ไม่แน่ใจว่าเชื่อม php ถึงขั้นไหน เลยแนะนำตามนี้ครับ
GraPHPite > http://graphpite.sourceforge.net/
jpgraph > http://jpgraph.net/?gclid=CJXrv4f6kaYCFUUa6wodZyjpLg

ลองหา fusion chart มาใช้ครับ

ผมลองมาทั้ง 3 ตัวครับ แต่มันสำหรับฐานข้อมูล SQL แต่ตัวที่ผมต้องการคือ dbf ครับ ของ Foxpro
HOSxP Server Master : MariaDb 10.1.19
ขึ้นระบบ 24 พ.ค.2550 โดย BMS Team
http://ikstudioytchannel.blogspot.com/
https://iofferresumer.blogspot.com/

ออฟไลน์ aei_ou

  • Newbie
  • *
  • กระทู้: 39
  • Respect: 0
    • ดูรายละเอียด
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #5 เมื่อ: มกราคม 04, 2011, 13:09:02 PM »
0
convert dbf เป็น mysql แล้วค่อยเขียน script php ง่ายกว่าไหมครับ

ใช้ Navicat for MySQL convert สบายๆเลย
.

ออฟไลน์ Bordin

  • Hero Member
  • *****
  • กระทู้: 1,089
  • อย่าคิดว่าทำไม่ได้ ถ้ายังไม่ลองทำ
  • Respect: +1
    • ดูรายละเอียด
    • ADMIN PCB. sz
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #6 เมื่อ: มกราคม 04, 2011, 13:34:26 PM »
0
ทำไมใช้ DBF ครับ  ;D

เป็นข้อมูลที่ส่งออกมา(ข้อมูลไม่ได้เปลี่ยนแปลงทุกวัน) หรือ เป็นข้อมูลที่บันทึกทุก ๆ วัน ครับ

ถ้าเป็นกรณีแรก Convert เป็น MySQL เลยครับง่ายสุด ไม่ต้องปวดหัว

ว่าแต่เอา php ดึงข้อมูลมาอย่างไรครับ ทำไมดึงข้อมูลมาแสดงได้

จริง ๆ ถ้าดึงข้อมูลมาแสดงได้ ก็น่าจะใช้กับ Graph Framework ที่ด้านบนบอกได้สิครับ

Database ทุกรูปแบบสามารถใช้ ภาษา SQL ได้อยู่แล้วครับ...

doramon

  • บุคคลทั่วไป
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #7 เมื่อ: มกราคม 04, 2011, 13:37:26 PM »
0
<?
$SqlCmd = "SELECT * FROM Product ";
$product_conn = new COM("ADODB.Connection") or die("Cannot start ADO");
$product_conn->Open("Provider=vfpoledb.1;Data Source=C:\DATA\;Collating Sequence=machine");
$product_rs = $Mproduct_conn->Execute($SqlCmd); // Recordset
while (!$product_rs->EOF) {
   print $product_rs->fields['code'].value;
}
?>



doramon

  • บุคคลทั่วไป
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #8 เมื่อ: มกราคม 04, 2011, 13:38:05 PM »
0
ลองแบบ Odbc และ Free table
<?php
$db = 'c:\\repmain\\data\\';
$dsn = "Driver={Microsoft Visual Foxpro Driver};SourceType=DBF;SourceDB=$db";

$cn = odbc_connect($dsn,'','') or die("ติดต่อฐานข้อมูลไม่ได้");
$sql = 'SELECT * FROM pt ';
$rs = odbc_exec($cn,$sql) or die("รัน SQL ไม่ผ่าน");
if ($rs) {
echo "Rs Complete";
} else {
echo "Rs Not Complete";
}
echo "<br>";

echo "<table border=1>";
$fields = odbc_num_fields($rs);
while( odbc_fetch_row($rs) ) {
echo "<tr>";
for ($j=1; $j < $fields+1; $j++) {
    echo "<td>". odbc_result($rs, $j) . "</td>";
}
echo "</tr>";
}
echo "</table>";
odbc_close($cn);
?>


doramon

  • บุคคลทั่วไป
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #9 เมื่อ: มกราคม 04, 2011, 13:40:09 PM »
0
vfpoledb

ต้องลงตัวนี้เพิ่มเติมด้วยครับ 

แต่ว่า server ต้อง  windows นะครับ


ถ้าจะใช้ linux 

ต้อง unixodbc


doramon

  • บุคคลทั่วไป
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #10 เมื่อ: มกราคม 04, 2011, 13:41:56 PM »
0


รูปนี้ทำได้แล้วก็ทำกราฟ ต่อได้เลยครับ

โดยส่งค่านี้ไปให้ตัวทำกราฟ ครับ


dusit

  • บุคคลทั่วไป
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #11 เมื่อ: มกราคม 04, 2011, 15:52:37 PM »
0
แบบที่ทุกท่านด้านบนแจ้งไว้ครับ

ตัวอย่างสอนfusion charts

http://phpdream.blogspot.com/2008/05/fusionchartphpmysql-step.html

เราตัดส่วนเชื่อมต่อ mysql ออก ครับ ใช้ fox ที่ อ.อ๊อด ให้ไว้ หรือ ที่คุณทำไว้แล้ว

เอาข้อความไปใส่ใน XML แล้วให้ script ที่เขาทำมาให้ run ก็เสร็จแล้วครับ

ประมาณนี้ครับ

โค๊ด: [Select]
<?php
    
//In this example, we show how to connect FusionCharts to a database.
    //For the sake of ease, we've used an MySQL databases containing two
    //tables.

    // Connect to the DB
    //$link = connectToDB();

    //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.
    
$animateChart $_GET['animate'];
    
//Set default value of 1
    
if ($animateChart=="")
        
$animateChart "1";

    
//$strXML will be used to store the entire XML document generated
    //Generate the chart element
    
$strXML "<chart caption='จำนวนผู้ป่วยใน (คน)' subCaption='แยกตาม ปี ' pieSliceDepth='30' showBorder='1' formatNumberScale='0' numberSuffix='' animation=' " $animateChart "'>";

    
// Fetch all factory records
//    $strQuery = "select * from Factory_Master";
 //   $result = mysql_query($strQuery) or die(mysql_error());
    
$strXML .= "<set label='2542' value='5251' />";
$strXML .= "<set label='2543' value='5607' />";
$strXML .= "<set label='2544' value='6670' />";
$strXML .= "<set label='2545' value='6499' />";
$strXML .= "<set label='2546' value='6848' />";
$strXML .= "<set label='2547' value='7297' />";
$strXML .= "<set label='2548' value='8726' />";
$strXML .= "<set label='2549' value='7675' />";
$strXML .= "<set label='2550' value='8795' />";
$strXML .= "<set label='2551' value='8954' />";
$strXML .= "<set label='2552' value='8735' />";
$strXML .= "<set label='2553' value='7817' />";
 

//Finally, close <chart> element
    
$strXML .= "</chart>";
echo $strXML;

    
//Create the chart - Pie 3D Chart with data from strXML
    
echo renderChart("FusionCharts/Column2D.swf"""$strXML"FactorySum"700400falsefalse);
?>





ออฟไลน์ admin30

  • Sr. Member
  • ****
  • กระทู้: 352
  • Respect: 0
    • ดูรายละเอียด
    • ioffer resume
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #12 เมื่อ: มกราคม 04, 2011, 15:54:36 PM »
0
ขอบคุณ อ. ทุกท่านมากครับ

ตอนนี้สามารถทำกราฟ ได้แล้วครับ

โดยประยุกต์ใช้รูปแทน ก็ Ok ดีครับ

เป็นข้อมูลที่บันทึกทุก ๆ วัน ครับ ก็เลยต้องใช้ DBF  ส่วน Graph Framework สารภาพครับ ว่าเขียนเป็นเฉพาะ PHP + SQL ครับ กับ Fox ไม่เป็น
HOSxP Server Master : MariaDb 10.1.19
ขึ้นระบบ 24 พ.ค.2550 โดย BMS Team
http://ikstudioytchannel.blogspot.com/
https://iofferresumer.blogspot.com/

ออฟไลน์ usa0823

  • Hero Member
  • *****
  • กระทู้: 773
  • Respect: +9
    • ดูรายละเอียด
Re: มี script ทำ กราฟ จาก dbf foxpro ไหมครับ
« ตอบกลับ #13 เมื่อ: มกราคม 04, 2011, 16:26:46 PM »
0
ผมใช้ กราฟที่เขียนกับ flash แต่จำชื่อไม่ได้
จะลองหาให้ก่อนครับ  ;D
***************************************
นายศรัญญู  ชูเมือง
จพ.เภสัชกรรมชำนาญงาน
ดูแลระบบ โรงพยาบาลลานสกา
E-mail  Sarunyu0823@hotmail.com
..............................................................................
** HOSxP ver. 3.56.11.19d
** MySQL 5.6.17
** Activated 2560