 <!-- <i><b>สรุปยอดรวมทั้งหมด</b></i><br><br> -->
  <table class="table table-bordered">
    <thead>
      <tr class="success">
        <th><center>รวมเลข 2 ตัว</th>
        <th><center>รวมเลข 3 ตัว</th>
        <th><center>รวมเลขวิ่ง</th>
        <th><center>รวมเลขใบ</th>
        <th><center>ยอดรวมทั้งหมด</th>
      </tr>
    </thead>
    <tbody>

    <?php

    $sql = "select * from tb_number where acc_id='$acc_id' and num_clear='No' and num_payment ='No'"; 
    $Query = mysqli_query($link,$sql);
    $num_rows = mysqli_num_rows($Query);

    $payment_status = "ไม่มีข้อมูล";

    if($num_rows){

        $payment_status = "<a href='payment_save.php?id=$acc_id&type=0&status=payall' class='btn btn-danger btn-xs'><span class='glyphicon glyphicon-usd'></span> ลูกค้าชำระเงินทั้งหมดแล้ว</a>

        <a href='payment_save.php?id=$acc_id&type=0&status=nextall' class='btn btn-warning btn-xs'><span class='glyphicon glyphicon-remove'></span> ข้ามรายการทั้งหมด</a>
        ";

    }else{
         $payment_status = "<a href='payment_save.php?id=$acc_id&type=0&status=unpayall' class='btn btn-success btn-xs'><span class='glyphicon glyphicon-usd'></span> ทำรายการเสร็จสมบูรณ์</a>";

    }

    $num5 = $num1+$num2+$num3+$num4;
    $num5 = number_format($num5);

    $num1 = number_format($num1);
    $num2 = number_format($num2);
    $num3 = number_format($num3);
    $num4 = number_format($num4);

    echo"<tr>
        <td align='center'>$num1</td>
        <td align='center'>$num2</td>
        <td align='center'>$num3</td>
        <td align='center'>$num4</td>
        <td align='center'>$num5</td>
      </tr>";

    ?>

    </tbody>
  </table>

  <?php echo "$payment_status"; ?>