【问题标题】:DOMPDF CalculationDOMPDF 计算
【发布时间】:2018-03-05 18:40:41
【问题描述】:

PHP Page 我不明白我必须做什么才能显示净值。

它没有显示任何价值。我该怎么办,请帮帮我。PDF File

这是表格代码。我在表尾看不到运费净值。

  <table width="100%">
                  <tr>
                    <td colspan="8" class="estilo4"><CENTER><strong> <h1>Payment</h1></strong></CENTER></td>
                  </tr>
                  <tr bgcolor="black" border="1" solid  #5D6975 cellspacing="0" cellpadding="0">
                    <th class="estilo1">'.$TRACK.'</th>
                    <th class="estilo1">'.$zones.'</th>
                    <th class="estilo1">'.$FECHA.'</th>
                    <th class="estilo1">'.$Mer.'</th>
                    <th class="estilo1">'.$DESTINA.'</th>
                    <th class="estilo1">'.$NUMBERPHONE.'</th>
                    <th class="estilo1">'.$ESTADO.'</th>
                    <th class="estilo1">'.$deliveryboy.'</th>
                  </tr>
                  </thead>
                <tbody>
                ';

                $sql=mysql_query("SELECT * FROM courier_online WHERE payment = 'OK' AND email='$qname' AND date   BETWEEN '$desde' AND '$hasta'");
                while($express=mysql_fetch_array($sql)){
                $initial = 0; // Empezar a contar desde 0
                $initial = $initial + $row['shipping_subtotal'];
                $codigoHTML.='  
                    <tr>
                        <td class="estilo3">'.$express['cons_no'].'</td>
                        <td class="estilo3">'.$express['shipping_subtotal'].'</td>
                        <td class="estilo3">'.$express['date'].'</td>
                        <td class="estilo3">'.$express['user'].'</td>
                        <td class="estilo3">'.$express['rev_name'].'</td>
                        <td class="estilo3">'.$express['r_phone'].'</td>
                        <td class="estilo3">'.$express['status'].'</td> 
                        <td class="estilo3"></td>                           
                    </tr>   
                </tbody>
<tfoot>
                                                    <tr>
                                                        <td colspan="2" style="text-align: right;" rowspan="1">
                                                            <b><?php echo $initial; ?></b>
                                                        </td>
                                                    </tr>
                                                </tfoot>                
                    ';

                }
        $codigoHTML.='

              </table>

【问题讨论】:

  • 请编辑您的问题以包含您的代码。而不是您的代码图片。
  • 也与创建 pdf 无关。
  • $initial +=$row[....];
  • @rtfm - 嗯?为什么要随机发布一行代码?
  • @DavidMakogon 不是随机的,请参阅 OP 的代码。

标签: php mysql pdf dompdf calculated-field


【解决方案1】:

我发现您的代码有两个问题:

1) 您正在 echoing $initial 的值,而不是将其连接到您的 $codigoHTML 变量的值。因此,它不包含在 HTML 文档中(如包含在变量中)。

2) 您生成的 HTML 无效。您应该将结束 TBODY 标记和整个 TFOOT 块移到 while 循环的结束大括号之外。

【讨论】:

  • 请更改代码?我请你了。我不明白。我需要小计值。
猜你喜欢
  • 2012-09-06
  • 1970-01-01
  • 1970-01-01
  • 2011-10-14
  • 1970-01-01
  • 2017-11-23
  • 1970-01-01
  • 1970-01-01
  • 2018-10-20
相关资源
最近更新 更多