【发布时间】:2018-03-07 22:32:13
【问题描述】:
嗨堆栈我有一个不知道如何解决的问题。我想从客户订单中显示专用 IP,如下所示:
我做了一个简短的检查,发现需要在 viewinvoice.tpl 和 invoicepdf.tpl 文件中完成。我发现专用 ip 存储在数据库中的 tblhosting 表中。
我找到了这段代码:
{php}
$clienthosting = $this->get_template_vars(service);
$dbid = $clienthosting['id'];
$query = mysql_query("SELECT dedicatedip FROM tblhosting WHERE id = $dbid");
$result = mysql_fetch_array($query);
$dedicatedip = $result["dedicatedip"];
$this->assign("dedicatedip", $dedicatedip);
{/php}
最后打印出来:
<td>{if $dedicatedip gt 0} - {$dedicatedip}{/if}{/if}</td>
这是来自 invoice.tpl 的代码,其中打印来自客户购买的数据:
<tbody>
{foreach from=$invoiceitems item=item}
<tr>
<td>{$item.description}{if $item.taxed eq "true"} *{/if}</td>
<td class="text-center">{$item.amount}</td>
</tr>
{/foreach}
<tr>
<td class="total-row text-right"><strong>{$LANG.invoicessubtotal}</strong></td>
<td class="total-row text-center">{$subtotal}</td>
</tr>
{if $taxrate}
<tr>
<td class="total-row text-right"><strong>{$taxrate}% {$taxname}</strong></td>
<td class="total-row text-center">{$tax}</td>
</tr>
{/if}
{if $taxrate2}
<tr>
<td class="total-row text-right"><strong>{$taxrate2}% {$taxname2}</strong></td>
<td class="total-row text-center">{$tax2}</td>
</tr>
{/if}
<tr>
<td class="total-row text-right"><strong>{$LANG.invoicescredit}</strong></td>
<td class="total-row text-center">{$credit}</td>
</tr>
<tr>
<td class="total-row text-right"><strong>{$LANG.invoicestotal}</strong></td>
<td class="total-row text-center">{$total}</td>
</tr>
</tbody>
但这似乎只有在尝试执行时才会产生白屏。这里有什么帮助吗?
【问题讨论】:
标签: whmcs whmcs-invoice-template