|
 |
|
ไม่รู้จะเริ่มยังไง กับการออก Report แนะนำหน่อยคับ มืดแปดด้าน - -* |
|
 |
|
|
 |
 |
|
การค้นหา แบบ มี Option ด้วยนะครับ ขอบคุณมากครับ
|
 |
 |
 |
 |
Date :
2012-03-14 23:25:38 |
By :
BigGulp[32oz] |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ใช่แบบนี้ไหมครับ

|
ประวัติการแก้ไข 2012-03-15 10:47:54
 |
 |
 |
 |
Date :
2012-03-15 10:47:25 |
By :
time.toon |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เรียน คุณ time.toon แบบ นี้เลยครับ O.o ตัว WorkSpce นี่ เป็น ตัวแสดง สถานะ อะไรครับ ได้แบบนี้ ยิ่งดีครับ รบกวน ขอโค้ด ไม่ก็แนว ทางแบบละเอียดด้วยครับ เวลากระชั้นชิดจริงๆ จริงๆ อยากเข้าใจตัวโปรแกรมมากกว่า แต่ตอนนี้ไม่มีเวลาศึกษาแล้ว T_T
|
 |
 |
 |
 |
Date :
2012-03-15 11:51:04 |
By :
BigGulp[32oz] |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
หลัง ตัว X ที่เป็นตัวลบ นี้ ถ้าเป็น Check Box ไว้ติดหลายๆ ตัวแล้วลบ ทีเดียว แล้ว มีปุ่ม Print ใบเสร็จ ออกมาจะดีมาก ครับ ตรงขอบเขต งานเลยครับ
|
 |
 |
 |
 |
Date :
2012-03-15 11:52:14 |
By :
BigGulp[32oz] |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ออก Report ก็คือการ select ข้อมูลมาแสดงผลปกตินี่แหละครับ ขึ้นอยู่กับว่าจะ Query จาก table หรือ ตารางไหนมาแสดงครับ

อย่างตัวนี้แค่เพิ่มหัวว่าเป็น Report ก็สามารถเป็น Report ได้แล้วครับ
Go to : PHP MySQL List Record
|
 |
 |
 |
 |
Date :
2012-03-15 12:51:52 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เรียน พี่ วินครับ แล้วตัวนี้ จะ Print ออกมาแบบไหนครับ อยากได้ แบบไม่มี ชื่อหัวไฟล์ แบบ FPDF ครับ พอดีเข้าไปโหลดมา แล้ว ไม่รู้จะต้องปรับตรงไหนบ้าง
|
 |
 |
 |
 |
Date :
2012-03-15 12:57:15 |
By :
BigGulp[32oz] |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
หน้าจอว่างๆ เรย ครับ
Code (PHP)
<html>
<head>
<title>NetworkCare Print </title>
</head>
<body>
<?php
require('fpdf.php');
class PDF extends FPDF
{
//Load data
function LoadData($file)
{
//Read file lines
$lines=file($file);
$data=array();
foreach($lines as $line)
$data[]=explode(';',chop($line));
return $data;
}
//Simple table
function BasicTable($header,$data)
{
//Header
$w=array(30,30,55,25,20,20);
//Header
for($i=0;$i<count($header);$i++)
$this->Cell($w[$i],7,$header[$i],1,0,'C');
$this->Ln();
//Data
foreach ($data as $eachResult)
{
$this->Cell(30,6,$eachResult["CustomerID"],1);
$this->Cell(30,6,$eachResult["Name"],1);
$this->Cell(55,6,$eachResult["Email"],1);
$this->Cell(25,6,$eachResult["CountryCode"],1,0,'C');
$this->Cell(20,6,$eachResult["Budget"],1);
$this->Cell(20,6,$eachResult["Budget"],1);
$this->Ln();
}
}
//Better table
function ImprovedTable($header,$data)
{
//Column widths
$w=array(20,30,55,25,25,25);
//Header
for($i=0;$i<count($header);$i++)
$this->Cell($w[$i],7,$header[$i],1,0,'C');
$this->Ln();
//Data
foreach ($data as $eachResult)
{
$this->Cell(20,6,$eachResult["CustomerID"],1);
$this->Cell(30,6,$eachResult["Name"],1);
$this->Cell(55,6,$eachResult["Email"],1);
$this->Cell(25,6,$eachResult["CountryCode"],1,0,'C');
$this->Cell(25,6,number_format($eachResult["Budget"],2),1,0,'R');
$this->Cell(25,6,number_format($eachResult["Budget"],2),1,0,'R');
$this->Ln();
}
//Closure line
$this->Cell(array_sum($w),0,'','T');
}
//Colored table
function FancyTable($header,$data)
{
//Colors, line width and bold font
$this->SetFillColor(255,0,0);
$this->SetTextColor(255);
$this->SetDrawColor(128,0,0);
$this->SetLineWidth(.3);
$this->SetFont('','B');
//Header
$w=array(20,30,55,25,25,25);
for($i=0;$i<count($header);$i++)
$this->Cell($w[$i],7,$header[$i],1,0,'C',true);
$this->Ln();
//Color and font restoration
$this->SetFillColor(224,235,255);
$this->SetTextColor(0);
$this->SetFont('');
//Data
$fill=false;
foreach($data as $row)
{
$this->Cell($w[0],6,$row[0],'LR',0,'L',$fill);
$this->Cell($w[1],6,$row[1],'LR',0,'L',$fill);
$this->Cell($w[2],6,$row[2],'LR',0,'L',$fill);
$this->Cell($w[3],6,$row[3],'LR',0,'C',$fill);
$this->Cell($w[4],6,number_format($row[4]),'LR',0,'R',$fill);
$this->Cell($w[5],6,number_format($row[5]),'LR',0,'R',$fill);
$this->Ln();
$fill=!$fill;
}
$this->Cell(array_sum($w),0,'','T');
}
}
$pdf=new PDF();
//Column titles
$header=array('Cus_ID','Cus_Name','Cus_Address','Cus_Tel');
//Data loading
//*** Load MySQL Data ***//
$objConnect = mysql_connect("localhost","root","1234") or die("Error Connect to Database");
$objDB = mysql_select_db("networkcare");
$strSQL = "SELECT * FROM customer";
$objQuery = mysql_query($strSQL);
$resultData = array();
for ($i=0;$i<mysql_num_rows($objQuery);$i++) {
$result = mysql_fetch_array($objQuery);
array_push($resultData,$result);
}
//************************//
$pdf->SetFont('Arial','',10);
//*** Table 1 ***//
$pdf->AddPage();
$pdf->Image('logo.png',80,8,33);
$pdf->Ln(35);
$pdf->BasicTable($header,$resultData);
//*** Table 2 ***//
$pdf->AddPage();
$pdf->Image('logo.png',80,8,33);
$pdf->Ln(35);
$pdf->ImprovedTable($header,$resultData);
//*** Table 3 ***//
$pdf->AddPage();
$pdf->Image('logo.png',80,8,33);
$pdf->Ln(35);
$pdf->FancyTable($header,$resultData);
$pdf->Output("MyPDF/MyPDF.pdf","F");
?>
PDF Created Click <a href="MyPDF/MyPDF.pdf">here</a> to Download
</body>
</html>

|
 |
 |
 |
 |
Date :
2012-03-15 13:36:03 |
By :
BigGulp[32oz] |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อันนี้ Report ของผม

ถ้า report แบบนี้ละก็...ต้องเริ่มลงมือทำ และใส่ plugin ที่ละอย่างตามที่ user ต้องการครับ
แต่ผมเชื่อ ว่า ที่ thaicreate ครบทุกสิ่ง....ที่คุณต้องการครับ  
เริ่มจากดึงข้อมูล ลงตาราง เลยครับ
ติดปัญหาอะไร ถาม พี่ๆ ในนี้ได้ครับ ผม...เอง...ก็ถามแหลก....เหมือนกันครับ
|
ประวัติการแก้ไข 2012-03-15 15:04:41
 |
 |
 |
 |
Date :
2012-03-15 15:02:52 |
By :
time.toon |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|