<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>EHONGMD</title>
  <?php
  error_reporting(0);
  // error_reporting(E_ALL);
  include '_plugin.php';
  include '_connect.php';
?>
</head>
<body class="hold-transition skin-red sidebar-mini">
<div class="wrapper">

<?php
include '_header.php';
include '_menu.php';
?>
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
      <!-- ค้นหา -->
      <!-- ตาราง -->
      <?php include 'act_search_2.php' ?>

      <div class="col-md-12">
        <div class="box box-success">
          <div class="box-header">
            <h3 class="box-title"><p class="text-success">ออกค่าใช้จ่ายที่ใช้จด พ.ร.บ.</p></h3>
            <p class="text-warning">วันที่ <?php echo $calcdate; ?> ถึงวันที่ <?php echo $calcdate25; ?></p>
          </div>
          <div class="box-body">
            <div class="form-group">
              <table id="example" class="table table-striped table-bordered" style="width:100%">
                <thead style="white-space: nowrap">
                  <tr>
                    <th rowspan="2" style="background-color:black; color:#fff; text-align:center;"><b>No.</b></th>
                    <th rowspan="2" style="background-color:black; color:#fff; text-align:center;"><b>บริษัทที่จำหน่าย</b></th>
                    <th colspan="5" style="background-color:yellow; color:#000; text-align:center;"><b>จำนวนคัน</b></th>
                    <th rowspan="2" style="background-color:black; color:#fff; text-align:center;"><b>ค่าใช้จ่ายพรบที่เบิก (บาท)</b></th>
                    <th rowspan="2" style="background-color:black; color:#fff; text-align:center;"><b>ใบรับรองแทนใบเสร็จรับเงิน</b></th>
                  </tr>
                  <tr>
                    <th rowspan="" style="background-color:yellow; color:#000; text-align:center;"><b>พ.ร.บ.</b></th>
                    <th colspan="" style="background-color:yellow; color:#000; text-align:center;"><b>ยกเลิกใบเสร็จ</b></th>
                    <th colspan="" style="background-color:yellow; color:#000; text-align:center;"><b>ตีกลับจากขนส่ง</b></th>
                    <th colspan="" style="background-color:yellow; color:#000; text-align:center;"><b>รถประมูล</b></th>
                    <th colspan="" style="background-color:yellow; color:#000; text-align:center;"><b>รถตีเทิร์น</b></th>
                  </tr>
                </thead>
                <tbody style="white-space: nowrap">
                  <?php
                  $sql = "SELECT a.bill_no as xbill_no,a.bill_date as xbill_date,*,a.rectime as xrectime from [EHONGDB].[dbo].[reg_billdata] a
                  left outer join(SELECT * FROM [EHONGDB].[dbo].[reg_bill]) b on(a.bill_no=b.bill_no)
                  left outer join(SELECT * FROM [EHONGDB].[dbo].[BRANCH]) c on (a.BR_ID=c.BR_ID)
                  left outer join(SELECT * FROM [EHONGDB].[dbo].[REG_GWORK]) d on(b.g_id=d.G_ID)
                  left outer join(SELECT BILL_NO as EBILL_NO,ACT_DATE FROM [CONFIG].[dbo].[ACT_EXPOST]) e on(a.bill_no=e.EBILL_NO)
                  left outer JOIN(SELECT BILL_NO as sBILL_NO,ACT_STATUS,ACT_USDATE FROM CONFIG.dbo.ACT_STATUSEXPOST) dx on(a.bill_no=dx.sBILL_NO)
                  left outer JOIN(SELECT FEE_PRICE AS EDITFEE_PRICE, BILL_NO AS EDITBILL_NO,NOTE FROM CONFIG.dbo.ACT_EDIT) edit on(a.bill_no=edit.EDITBILL_NO)
                  where a.status<>'V' and fee_no='11' and a.bill_date between '$DMY_1' and '$DMY_2'
                  and ACT_DATE is NULL
                  order by a.rectime,a.br_id,a.bill_date";
                    // echo $sql;
                    $select=$conn->prepare($sql);
                    $select->execute();
                    $item = 1;
                    $B10 = '0.00';
                    $B10x = '10.00';
                    $SUMFEE_SUMPRICE = '0';
                    $SUMFEE_PRICE = '0';
                    $SUMB10 = '0';
                    $SUM_x1 = '0';
                    $SUM_x2 = '0';
                    $SUM1_FEE_SUMPRICE = '0'; $SUM2_FEE_SUMPRICE = '0'; $SUM3_FEE_SUMPRICE = '0'; $SUM4_FEE_SUMPRICE = '0'; $SUM5_FEE_SUMPRICE = '0'; $SUM6_FEE_SUMPRICE = '0'; $SUM7_FEE_SUMPRICE = '0'; $SUM8_FEE_SUMPRICE = '0'; $SUM9_FEE_SUMPRICE = '0';
                    $SUM1_FEE_PRICE = '0'; $SUM2_FEE_PRICE = '0'; $SUM3_FEE_PRICE = '0'; $SUM4_FEE_PRICE = '0'; $SUM5_FEE_PRICE = '0'; $SUM6_FEE_PRICE = '0'; $SUM7_FEE_PRICE = '0'; $SUM8_FEE_PRICE = '0'; $SUM9_FEE_PRICE = '0';
                    $SUM1_B10 = '0'; $SUM2_B10 = '0'; $SUM3_B10 = '0'; $SUM4_B10 = '0'; $SUM5_B10 = '0'; $SUM6_B10 = '0'; $SUM7_B10 = '0'; $SUM8_B10 = '0'; $SUM9_B10 = '0';
                    $SUM1_SUM_1 = '0'; $SUM2_SUM_1 = '0'; $SUM3_SUM_1 = '0'; $SUM4_SUM_1 = '0'; $SUM5_SUM_1 = '0'; $SUM6_SUM_1 = '0'; $SUM7_SUM_1 = '0'; $SUM8_SUM_1 = '0'; $SUM9_SUM_1 = '0';
                    $SUM1_SUM_2 = '0'; $SUM2_SUM_2 = '0'; $SUM3_SUM_2 = '0'; $SUM4_SUM_2 = '0'; $SUM5_SUM_2 = '0'; $SUM6_SUM_2 = '0'; $SUM7_SUM_2 = '0'; $SUM8_SUM_2 = '0'; $SUM9_SUM_2 = '0';
                    while($fetch=$select->fetch()){
                      if ($fetch['BILL_DATE'] != '') {
                        $BILL_DATE1 = substr($fetch['BILL_DATE'],0,4)+543; $BILL_DATE2 = substr($fetch['BILL_DATE'],5,2); $BILL_DATE3 = substr($fetch['BILL_DATE'],8,2);
                        $BILL_DATE = $BILL_DATE3."/".$BILL_DATE2."/".$BILL_DATE1;
                      } else {
                        $BILL_DATE = '';
                      }
                    // $FEE_PRICE = number_format($fetch['FEE_PRICE']-$B10x,2);
                    // $FEE_SUMPRICE = number_format($fetch['FEE_SUMPRICE'],2);
                    // $FEE_SUMPRICE = number_format(350,2);
                    if ($fetch['EDITFEE_PRICE'] == "") {
                      $FEE_PRICE = number_format($fetch['FEE_PRICE']-$B10x,2);
                      $NOTE = "";
                      $CL = "blue";
                      $EDIT = "แก้ไข";
                    }
                    else {
                      $FEE_PRICE = number_format($fetch['EDITFEE_PRICE'],2);
                      $NOTE = $fetch['NOTE'];
                      $CL = "green";
                      $EDIT = "แก้ไขแล้ว";
                    }
                    if ($fetch['FEE_SUMPRICE'] != '0') {
                      if ($fetch['CC_SIZE'] < '75') {
                        $FEE_SUMPRICE = number_format(190,2);
                      }
                      if ($fetch['CC_SIZE'] >= '75') {
                        $FEE_SUMPRICE = number_format(350,2);
                      }
                      if ($fetch['CC_SIZE'] > '125') {
                        $FEE_SUMPRICE = number_format(450,2);
                      }
                      if ($fetch['CC_SIZE'] > '150') {
                        $FEE_SUMPRICE = number_format(700,2);
                      }
                      $SUM_1 = number_format(($FEE_SUMPRICE-$B10-$FEE_PRICE)/1.07,2);
                      $SUM_2 = number_format(($SUM_1*0.07),2);
                      $SUMFEE_SUMPRICE += $FEE_SUMPRICE;
                      $SUM_x1 += $SUM_1;
                      $SUM_x2 += $SUM_2;
                    }
                    else {
                      $FEE_SUMPRICE = '';
                      $SUM_1 = '';
                      $SUM_2 = '';
                    }
                    include 'act_sum_1.php';
                    $SUMB10X += $B10x;
                    // echo $CROP_NAME;
                    if ($CROP_NAME == "บริษัท มดแดงลิสซิ่ง จำกัด") {
                      $SUM1_FEE_SUMPRICE += str_replace(',','',$FEE_SUMPRICE);
                      $SUM1_FEE_PRICE += str_replace(',','',$FEE_PRICE);
                      $SUM1_B10 += str_replace(',','',$B10);
                      $SUM1_SUM_1 += str_replace(',','',$SUM_1);
                      $SUM1_SUM_2 += str_replace(',','',$SUM_2);
                      $icar1 = array($CROP_NAME);
                      $icar1x = COUNT($icar1);
                      $icar1c += $icar1x;
                    }
                    if ($CROP_NAME == "บริษัท อีฮงฮอนด้า จำกัด") {
                      $SUM2_FEE_SUMPRICE += str_replace(',','',$FEE_SUMPRICE);
                      $SUM2_FEE_PRICE += str_replace(',','',$FEE_PRICE);
                      $SUM2_B10 += str_replace(',','',$B10);
                      $SUM2_SUM_1 += str_replace(',','',$SUM_1);
                      $SUM2_SUM_2 += str_replace(',','',$SUM_2);
                      $icar2 = array($CROP_NAME);
                      $icar2x = COUNT($icar2);
                      $icar2c += $icar2x;
                    }
                    if ($CROP_NAME == "บริษัท อีฮงมดแดงยามาฮ่า จำกัด") {
                      $SUM3_FEE_SUMPRICE += str_replace(',','',$FEE_SUMPRICE);
                      $SUM3_FEE_PRICE += str_replace(',','',$FEE_PRICE);
                      $SUM3_B10 += str_replace(',','',$B10);
                      $SUM3_SUM_1 += str_replace(',','',$SUM_1);
                      $SUM3_SUM_2 += str_replace(',','',$SUM_2);
                      $icar3 = array($CROP_NAME);
                      $icar3x = COUNT($icar3);
                      $icar3c += $icar3x;
                    }
                    if ($CROP_NAME == "บริษัท อีฮงมดแดงคาวาซากิ จำกัด") {
                      $SUM4_FEE_SUMPRICE += str_replace(',','',$FEE_SUMPRICE);
                      $SUM4_FEE_PRICE += str_replace(',','',$FEE_PRICE);
                      $SUM4_B10 += str_replace(',','',$B10);
                      $SUM4_SUM_1 += str_replace(',','',$SUM_1);
                      $SUM4_SUM_2 += str_replace(',','',$SUM_2);
                      $icar4 = array($CROP_NAME);
                      $icar4x = COUNT($icar4);
                      $icar4c += $icar4x;
                    }
                    if ($CROP_NAME == "บริษัท อีฮงพยัคฆ์") {
                      $SUM5_FEE_SUMPRICE += str_replace(',','',$FEE_SUMPRICE);
                      $SUM5_FEE_PRICE += str_replace(',','',$FEE_PRICE);
                      $SUM5_B10 += str_replace(',','',$B10);
                      $SUM5_SUM_1 += str_replace(',','',$SUM_1);
                      $SUM5_SUM_2 += str_replace(',','',$SUM_2);
                      $icar5 = array($CROP_NAME);
                      $icar5x = COUNT($icar5);
                      $icar5c += $icar5x;
                    }
                    if ($CROP_NAME == "บริษัท อีฮงมดแดงมอเตอร์ไบค์ จำกัด") {
                      $SUM6_FEE_SUMPRICE += str_replace(',','',$FEE_SUMPRICE);
                      $SUM6_FEE_PRICE += str_replace(',','',$FEE_PRICE);
                      $SUM6_B10 += str_replace(',','',$B10);
                      $SUM6_SUM_1 += str_replace(',','',$SUM_1);
                      $SUM6_SUM_2 += str_replace(',','',$SUM_2);
                      $icar6 = array($CROP_NAME);
                      $icar6x = COUNT($icar6);
                      $icar6c += $icar6x;
                    }
                    if ($CROP_NAME == "บริษัท มดแดงมอเตอร์เมค จำกัด") {
                      $SUM7_FEE_SUMPRICE += str_replace(',','',$FEE_SUMPRICE);
                      $SUM7_FEE_PRICE += str_replace(',','',$FEE_PRICE);
                      $SUM7_B10 += str_replace(',','',$B10);
                      $SUM7_SUM_1 += str_replace(',','',$SUM_1);
                      $SUM7_SUM_2 += str_replace(',','',$SUM_2);
                      $icar7 = array($CROP_NAME);
                      $icar7x = COUNT($icar7);
                      $icar7c += $icar7x;
                    }
                    if ($CROP_NAME == "บริษัท อีฮงมดแดงมอเตอร์ ลิส จำกัด") {
                      $SUM8_FEE_SUMPRICE += str_replace(',','',$FEE_SUMPRICE);
                      $SUM8_FEE_PRICE += str_replace(',','',$FEE_PRICE);
                      $SUM8_B10 += str_replace(',','',$B10);
                      $SUM8_SUM_1 += str_replace(',','',$SUM_1);
                      $SUM8_SUM_2 += str_replace(',','',$SUM_2);
                      $icar8 = array($CROP_NAME);
                      $icar8x = COUNT($icar8);
                      $icar8c += $icar8x;
                    }
                    if ($CROP_NAME == "บริษัท มีสติมอเตอร์ จำกัด") {
                      $SUM9_FEE_SUMPRICE += str_replace(',','',$FEE_SUMPRICE);
                      $SUM9_FEE_PRICE += str_replace(',','',$FEE_PRICE);
                      $SUM9_B10 += str_replace(',','',$B10);
                      $SUM9_SUM_1 += str_replace(',','',$SUM_1);
                      $SUM9_SUM_2 += str_replace(',','',$SUM_2);
                      $icar9 = array($CROP_NAME);
                      $icar9x = COUNT($icar9);
                      $icar9c += $icar9x;
                    }
                  }

                  include 'act_sum_2.php';

                  $Sumicar = $icar1c+$icar2c+$icar3c+$icar4c+$icar5c+$icar6c+$icar7c+$icar8c+$icar9c;
                  $SUM_FEEPRICEX = $SUM1_FEE_PRICE+$SUM2_FEE_PRICE+$SUM3_FEE_PRICE+$SUM4_FEE_PRICE+$SUM5_FEE_PRICE+$SUM6_FEE_PRICE+$SUM7_FEE_PRICE+$SUM8_FEE_PRICE+$SUM9_FEE_PRICE;
                  $SUM_FEEPRICEX1 = $SUM_FEEPRICEX+$Sumicar;
                  ?>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">1.</td>
                    <td style="background-color:; color:; text-align:;">บริษัท มดแดงลิสซิ่ง จำกัด</td>
                    <td style="background-color:; color:red; text-align:center;"> <a class="text-red" href="act_index_7.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME1=บริษัท มดแดงลิสซิ่ง จำกัด&STATUSXS=&G04=" target="_blank"><?php echo $icar1c; ?></a></td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic_1x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic2_1x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic3_1x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ictx_1x; ?></a> </td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUM1_FEE_PRICE+$sum_sp1+$sum_tx1,2); ?></td>
                    <td style="background-color:; color:; text-align:center;">
                      <script type="text/javascript">
                        function newPopup(url) { popupWindow = window.open( url,'popUpWindow','height=600,width=400,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')}
                      </script>
                        <a href="JavaScript:newPopup('act_print1.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME=บริษัท มดแดงลิสซิ่ง จำกัด&icar=<?php echo $icar1c+$ic_1x+$ic2_1x+$ic3_1x+$ictx_1x;?>');"  onClick="javascript:return confirm('คุณต้องการพิมพ์ใบรับรองแทนใบเสร็จรับเงินใช่หรือไม่?');"><i class="fa fa-print" aria-hidden="true" style="color:green;"></i></a>
                    </td>
                  </tr>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">2.</td>
                    <td style="background-color:; color:; text-align:;">บริษัท อีฮงฮอนด้า จำกัด</td>
                    <td style="background-color:; color:red; text-align:center;"> <a class="text-red" href="act_index_7.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME1=บริษัท อีฮงฮอนด้า จำกัด&STATUSXS=&G04=" target="_blank"><?php echo $icar2c; ?></a></td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic_2x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic2_2x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic3_2x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ictx_2x; ?></a> </td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUM2_FEE_PRICE+$sum_sp2+$sum_tx2,2); ?></td>
                    <td style="background-color:; color:; text-align:center;"><a href="act_print.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME=บริษัท อีฮงฮอนด้า จำกัด&icar=<?php echo $icar2c+$ic_2x+$ic2_2x+$ic3_2x+$ictx_2x; ?>&SUM_PAPER=&SUM_PANCIL=" onClick="javascript:return confirm('คุณต้องการพิมพ์ใบรับรองแทนใบเสร็จรับเงินใช่หรือไม่?');" class="text-red" target="_blank"><i class="fa fa-print" style="color:green;" aria-hidden="true"></i></a></td>
                  </tr>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">3.</td>
                    <td style="background-color:; color:; text-align:;">บริษัท อีฮงมดแดงยามาฮ่า จำกัด</td>
                    <td style="background-color:; color:red; text-align:center;"> <a class="text-red" href="act_index_7.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME1=บริษัท อีฮงมดแดงยามาฮ่า จำกัด&STATUSXS=&G04=" target="_blank"><?php echo $icar3c; ?></a></td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic_3x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic2_3x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic3_3x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ictx_3x; ?></a> </td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUM3_FEE_PRICE+$sum_sp3+$sum_tx3,2); ?></td>
                    <td style="background-color:; color:; text-align:center;"><a href="act_print.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME=บริษัท อีฮงมดแดงยามาฮ่า จำกัด&icar=<?php echo $icar3c+$ic_3x+$ic2_3x+$ic3_3x+$ictx_3x; ?>&SUM_PAPER=&SUM_PANCIL=" onClick="javascript:return confirm('คุณต้องการพิมพ์ใบรับรองแทนใบเสร็จรับเงินใช่หรือไม่?');" class="text-red" target="_blank"><i class="fa fa-print" style="color:green;" aria-hidden="true"></i></a></td>
                  </tr>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">4.</td>
                    <td style="background-color:; color:; text-align:;">บริษัท อีฮงมดแดงคาวาซากิ จำกัด</td>
                    <td style="background-color:; color:red; text-align:center;"> <a class="text-red" href="act_index_7.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME1=บริษัท อีฮงมดแดงคาวาซากิ จำกัด&STATUSXS=&G04=" target="_blank"><?php echo $icar4c; ?></a></td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic_4x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic2_4x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic3_4x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ictx_4x; ?></a> </td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUM4_FEE_PRICE+$sum_sp4+$sum_tx4,2); ?></td>
                    <td style="background-color:; color:; text-align:center;"><a href="act_print.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME=บริษัท อีฮงมดแดงคาวาซากิ จำกัด&icar=<?php echo $icar4c+$ic_4x+$ic2_4x+$ic3_4x+$ictx_4x; ?>&SUM_PAPER=&SUM_PANCIL=" onClick="javascript:return confirm('คุณต้องการพิมพ์ใบรับรองแทนใบเสร็จรับเงินใช่หรือไม่?');" class="text-red" target="_blank"><i class="fa fa-print" style="color:green;" aria-hidden="true"></i></a></td>
                  </tr>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">5.</td>
                    <td style="background-color:; color:; text-align:;">บริษัท อีฮงพยัคฆ์</td>
                    <td style="background-color:; color:red; text-align:center;"> <a class="text-red" href="act_index_7.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME1=บริษัท อีฮงพยัคฆ์&STATUSXS=&G04=" target="_blank"><?php echo $icar5c; ?></a></td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic_5x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic2_5x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic3_5x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"></a> </td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUM5_FEE_PRICE+$sum_sp5+$sum_tx5,2); ?></td>
                    <td style="background-color:; color:; text-align:center;"><a href="act_print.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME=บริษัท อีฮงพยัคฆ์&icar=<?php echo $icar5c+$ic_5x+$ic2_5x+$ic3_5x+$ictx_5x; ?>&SUM_PAPER=&SUM_PANCIL=" onClick="javascript:return confirm('คุณต้องการพิมพ์ใบรับรองแทนใบเสร็จรับเงินใช่หรือไม่?');" class="text-red" target="_blank"><i class="fa fa-print" style="color:green;" aria-hidden="true"></i></a></td>
                  </tr>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">6.</td>
                    <td style="background-color:; color:; text-align:;">บริษัท อีฮงมดแดงมอเตอร์ไบค์ จำกัด</td>
                    <td style="background-color:; color:red; text-align:center;"> <a class="text-red" href="act_index_7.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME1=บริษัท อีฮงมดแดงมอเตอร์ไบค์ จำกัด&STATUSXS=&G04=" target="_blank"><?php echo $icar6c; ?></a></td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic_6x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic2_6x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic3_6x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ictx_6x; ?></a> </td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUM6_FEE_PRICE+$sum_sp6+$sum_tx6,2); ?></td>
                    <td style="background-color:; color:; text-align:center;"><a href="act_print.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME=บริษัท อีฮงมดแดงมอเตอร์ไบค์ จำกัด&icar=<?php echo $icar6c+$ic_6x+$ic2_6x+$ic3_6x+$ictx_6x; ?>&SUM_PAPER=&SUM_PANCIL=" onClick="javascript:return confirm('คุณต้องการพิมพ์ใบรับรองแทนใบเสร็จรับเงินใช่หรือไม่?');" class="text-red" target="_blank"><i class="fa fa-print" style="color:green;" aria-hidden="true"></i></a></td>
                  </tr>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">7.</td>
                    <td style="background-color:; color:; text-align:;">บริษัท มดแดงมอเตอร์เมค จำกัด</td>
                    <td style="background-color:; color:red; text-align:center;"> <a class="text-red" href="act_index_7.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME1=บริษัท มดแดงมอเตอร์เมค จำกัด&STATUSXS=&G04=" target="_blank"><?php echo $icar7c; ?></a></td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic_7x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic2_7x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic3_7x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ictx_7x; ?></a> </td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUM7_FEE_PRICE+$sum_sp7+$sum_tx7,2); ?></td>
                    <td style="background-color:; color:; text-align:center;"><a href="act_print.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME=บริษัท มดแดงมอเตอร์เมค จำกัด&icar=<?php echo $icar7c+$ic_7x+$ic2_7x+$ic3_7x+$ictx_7x; ?>&SUM_PAPER=&SUM_PANCIL=" onClick="javascript:return confirm('คุณต้องการพิมพ์ใบรับรองแทนใบเสร็จรับเงินใช่หรือไม่?');" class="text-red" target="_blank"><i class="fa fa-print" style="color:green;" aria-hidden="true"></i></a></td>
                  </tr>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">8.</td>
                    <td style="background-color:; color:; text-align:;">บริษัท อีฮงมดแดงมอเตอร์ ลิส จำกัด</td>
                    <td style="background-color:; color:red; text-align:center;"> <a class="text-red" href="act_index_7.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME1=บริษัท อีฮงมดแดงมอเตอร์ ลิส จำกัด&STATUSXS=&G04=" target="_blank"><?php echo $icar8c; ?></a></td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic_8x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic2_8x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic3_8x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ictx_8x; ?></a> </td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUM8_FEE_PRICE+$sum_sp8+$sum_tx8,2); ?></td>
                    <td style="background-color:; color:; text-align:center;"><a href="act_print.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME=บริษัท อีฮงมดแดงมอเตอร์ ลิส จำกัด&icar=<?php echo $icar8c+$ic_8x+$ic2_8x+$ic3_8x+$ictx_8x; ?>&SUM_PAPER=&SUM_PANCIL=" onClick="javascript:return confirm('คุณต้องการพิมพ์ใบรับรองแทนใบเสร็จรับเงินใช่หรือไม่?');" class="text-red" target="_blank"><i class="fa fa-print" style="color:green;" aria-hidden="true"></i></a></td>
                  </tr>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">9.</td>
                    <td style="background-color:; color:; text-align:;">บริษัท มีสติมอเตอร์ จำกัด</td>
                    <td style="background-color:; color:red; text-align:center;"> <a class="text-red" href="act_index_7.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME1=บริษัท มีสติมอเตอร์ จำกัด&STATUSXS=&G04=" target="_blank"><?php echo $icar9c; ?></a></td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic_9x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic2_9x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ic3_9x; ?></a> </td>
                    <td style="background-color:; color:red; text-align:center;"> <a href="#"><?php echo $ictx_9x; ?></a> </td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUM9_FEE_PRICE+$sum_sp9+$sum_tx9,2); ?></td>
                    <td style="background-color:; color:; text-align:center;"><a href="act_print.php?DMY_1=<?php echo $DMY_1; ?>&DMY_2=<?php echo $DMY_2; ?>&CROP_NAME=บริษัท มีสติมอเตอร์ จำกัด&icar=<?php echo $icar9c+$ic_9x+$ic2_9x+$ic3_9x+$ictx_9x; ?>&SUM_PAPER=&SUM_PANCIL=" onClick="javascript:return confirm('คุณต้องการพิมพ์ใบรับรองแทนใบเสร็จรับเงินใช่หรือไม่?');" class="text-red" target="_blank"><i class="fa fa-print" style="color:green;" aria-hidden="true"></i></a></td>
                  </tr>
                  <tr>
                    <td style="background-color:; color:; text-align:right;">10.</td>
                    <td style="background-color:; color:; text-align:;">ค่านายหน้า</td>
                    <td style="background-color:; color:; text-align:;"></td>
                    <td style="background-color:; color:; text-align:;"></td>
                    <td style="background-color:; color:; text-align:;"></td>
                    <td style="background-color:; color:; text-align:;"></td>
                    <td style="background-color:; color:red; text-align:center;"><?php //echo number_format($fetch['BX']); ?></td>
                    <td style="background-color:; color:blue; text-align:right;"><?php echo number_format($SUMB10X+$sumbx+$sum_btx,2); ?></td>
                    <td style="background-color:; color:; text-align:center;"><a href="#" class="text-red"></a></td>
                  </tr>
                </tbody>
                <tfoot>
                  <td colspan="2" style="background-color:black; color:#fff; text-align:center;"><b>รวม</b></td>
                  <td colspan="" style="background-color:black; color:#fff; text-align:center;"><b><?php echo $Sumicar; ?></b></td>
                  <td style="background-color:black; color:#fff; text-align:center;"><b><?php echo $sum_icx; ?></b></td>
                  <td style="background-color:black; color:#fff; text-align:center;"><b><?php echo $sum_icx2; ?></b></td>
                  <td style="background-color:black; color:#fff; text-align:center;"><b><?php echo $sum_icx3; ?></b></td>
                  <td style="background-color:black; color:#fff; text-align:center;"><b><?php echo $sum_icxtx; ?></b></td>
                  <td colspan="" style="background-color:black; color:#fff; text-align:right;"><b><?php echo number_format($SUM_FEEPRICEX+$NEWSUMFEE_PRICE+$NEWSUMFEE_PRICE_TX,2); ?></b></td>
                  <td colspan="" style="background-color:black; color:#fff; text-align:;"><b></b></td>
                </tfoot>
            </table>
            </div>
          </div>
        </div>
      </div>

      </div>
    </section>
  </div>
</div>

<?php
// include '_footer.php';
// include '_form.php';
?>
<div class="control-sidebar-bg"></div>
<?php include '_script_2.php'; ?>
<?php include 'scroll0.php' ?>
</body>
</html>
