=500) ORDER BY R_TIME SQL; //echo $sql_position; ?> $sql"; $tbl_h1.="แสดงยอดขายร้านค้าใน Route

"; $tbl_h1.=""; $tbl_h1.=""; $tbl_h1.=""; $tbl_h1.=""; $tbl_h1.=""; $tbl_h1.=""; $tbl_h1.=""; //Next Link to Route //http://192.168.0.99:9815/ProjectReportRoute/Detail.php?myDay=2&custArea=$area&mn=09&yr=2016 while($dat = @mysql_fetch_array($rs)){ $tbl_l1.=""; $tbl_l1.=""; $tbl_l1.=""; $tbl_l1.=""; $tbl_l1.=""; $tbl_l1.=""; $tot_amt+=$dat[1]; $tot_cust+=1; } $tbl_s1.=""; $tbl_s1.=""; $tbl_s1.=""; $tbl_s1.=""; $tbl_s1.=""; $tbl_s1.=""; $tbl_s1.="

เลขที่ Invoice

รหัสร้านค้า

ชื่อร้านค้า

ที่อยู่

Route

Bill Amount

$dat[7]$dat[2] $dat[4] $dat[5]$dat[6]".number_format($dat[1],2)."
รวม $tot_cust ราย".number_format($tot_amt,2)."
"; //** ------------------------------------------------- แสดงยอดขาย ที่เป็นร้านค้าเปิดใหม่ ------------------------------------------------------**// $sql3 = <<$sql3"; $tbl_h2.="

แสดงยอดขายร้านค้าใหม่

"; $tbl_h2.=""; $tbl_h2.=""; $tbl_h2.=""; $tbl_h2.=""; $tbl_h2.=""; $tbl_h2.=""; $tbl_h2.=""; while($dat3 = @mysql_fetch_array($rs3)){ $tbl_l2.=""; $tbl_l2.=""; $tbl_l2.=""; $tbl_l2.=""; $tbl_l2.=""; $tbl_l2.=""; $tot_amt3+=$dat3[1]; $tot_cust3+=1; } $tbl_s2.=""; $tbl_s2.=""; $tbl_s2.=""; $tbl_s2.=""; $tbl_s2.=""; $tbl_s2.=""; $tbl_s2.="

เลขที่ Invoice

รหัสร้านค้า

ชื่อร้านค้า

ที่อยู่

Route

Bill Amount

$dat3[5]$dat3[2] $dat3[7] $dat3[8]$dat3[4]".number_format($dat3[1],2)."
รวม $tot_cust3 ราย".number_format($tot_amt3,2)."
"; //** ------------------------------------------------- แสดงยอดขาย ที่เป็นร้านค้าทั่วไป/ขาจร ------------------------------------------------------**// $sql2 = <<$sql"; $tbl_h3.="

แสดงยอดขายร้านค้าขาจร

"; $tbl_h3.=""; $tbl_h3.=""; $tbl_h3.=""; $tbl_h3.=""; $tbl_h3.=""; $tbl_h3.=""; $tbl_h3.=""; while($dat2 = @mysql_fetch_array($rs2)){ $tbl_l3.=""; $tbl_l3.=""; $tbl_l3.=""; $tbl_l3.=""; $tbl_l3.=""; $tbl_l3.=""; $tot_amt2+=$dat2[1]; $tot_cust2+=1; } $tbl_s3.=""; $tbl_s3.=""; $tbl_s3.=""; $tbl_s3.=""; $tbl_s3.=""; $tbl_s3.=""; $tbl_s3.="

เลขที่ Invoice

รหัสร้านค้า

ชื่อร้านค้า

ที่อยู่

Route

Bill Amount

$dat2[7]$dat2[2]$dat2[4]$dat2[5]$dat2[6]".number_format($dat2[1],2)."
รวม $tot_cust2 ราย".number_format($tot_amt2,2)."
"; //***************************************** Summary **********************************************/ $all_cust = $tot_cust+$tot_cust2+$tot_cust3; $all_amount = $tot_amt+$tot_amt2+$tot_amt3; @$in_route = @($tot_cust*100)/$all_cust; @$new_cust = @($tot_cust3 *100)/$all_cust; @$out_route = @($tot_cust2*100)/$all_cust; $tbsum="

สรุปข้อมูลการขายเขต : $area วันที่ทำการขาย : $dt (Route : R$routeDay)

"; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.=""; $tbsum.="

จำแนกเป็น

ร้านค้า

มูลค่า

สัดส่วนร้านค้า (%)

 ร้านค้าใน Route".$tot_cust."".number_format($tot_amt,2)."".number_format($in_route,2)."%
 ร้านค้าใหม่".$tot_cust3."".number_format($tot_amt3,2)."".number_format($new_cust,2)."%
 ร้านค้าทั่วไป/ขาจร".$tot_cust2."".number_format($tot_amt2,2)."".number_format($out_route,2)."%
 รวม".$all_cust."".number_format($all_amount,2)."100.00%
"; $tbl_h4.="

[รายละเอียดการเข้าเยี่ยมเส้นทาง R$routeDay]

"; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $tbl_h4.=""; $sql_visit = "select custno,custname,custaddr,custday,orderno,is_buy,price_buy,reason,visit_date "; $sql_visit.="from cust_route where mn='$ymn' and custArea='$area' and custDay='$routeDay' order by visit_date desc"; //echo "$sql_visit"; $rs_visit =@mysql_query($sql_visit); $cust_in_route = 1; $is_buy = 0; $not_buy = 0; $not_visit = 0; $bgcolor= 'white'; while($datv = @mysql_fetch_array($rs_visit)){ if(($datv[5]=="N") AND ($datv[7]<>"")){ $datv[5] = "เยี่ยมแล้ว"; $amt = ""; $not_buy++; }else if(($datv[5]=="Y") AND ($datv[4]<>"")){ $datv[5] = "ขายแล้ว"; $amt = $datv[6]." บาท "; $is_buy++; }else{ $datv[5] = "ยังไม่เข้าเยี่ยม"; $not_visit++; } if($bgcolor=="white"){$bgcolor="#FFFFE0";}else{$bgcolor="white";} $tbl_l4.=""; $tbl_l4.=""; $tbl_l4.=""; $tbl_l4.=""; $tbl_l4.=""; $tbl_l4.=""; $tbl_l4.=""; $tbl_l4.=""; $tbl_l4.=""; $tbl_l4.=""; $amt = ""; $cust_in_route++; } $tbl_h5.="

No.

Day

Visit Date

รหัสร้านค้า

ชื่อร้านค้า

ที่อยู่

Order Number

มูลค่าบิล

สถานะ

สาเหตุที่ไม่ซื้อ

$cust_in_route$datv[3]$datv[8]$datv[0] $datv[1] $datv[2]$datv[4]$amt   $datv[5] $datv[7]
"; $tbl_h5.=""; $tbl_h5.=""; $tbl_h5.=""; $tbl_h5.=""; $tbl_h5.=""; $all_cust_route = $cust_in_route-1; $all_visit = $not_buy+$is_buy; $per_visit = @number_format(($not_buy+$is_buy)*100/$all_cust_route,2); $per_effective = @number_format(($is_buy*100)/$all_visit,2); $tbl_l5.=""; $tbl_l5.=""; $tbl_l5.=""; $tbl_l5.=""; $tbl_l5.=""; echo $tbsum."


"; ?>เส้นทางการเดินทาง (GPS) : SIM No


"; echo $tbl_h5.$tbl_l5; echo $tbl_h4.$tbl_l4; //echo "

จำนวนร้านค้าทั้งหมดใน Route : $cust_in_route ราย"; //echo "
จำนวนร้านค้าที่ซื้อ : $is_buy ราย "; //echo "
จำนวนร้านค้าที่ไม่ซื้อ : $not_buy ราย"; //echo "
จำนวนร้านค้าที่ยังไม่เข้าเยี่ยม : $not_visit ราย

"; echo "

"; ?>

จำนวนลูกค้าเป้าหมาย

จำนวนลูกค้าที่เยี่ยม

จำนวนลูกค้าที่ซื้อ

Visit (%)

Effective (%)

$all_cust_route$all_visit$is_buy$per_visit $per_effective