本文整理匯總了PHP中DOMNode::item方法的典型用法代碼示例。如果您正苦於以下問題:PHP DOMNode::item方法的具體用法?PHP DOMNode::item怎麽用?PHP DOMNode::item使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DOMNode
的用法示例。
在下文中一共展示了DOMNode::item方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: pItensDANFE
//.........這裏部分代碼省略.........
$w11 = round($w * 0.06, 0);
$texto = 'VALOR ICMS';
$aFont = array('font' => $this->fontePadrao, 'size' => 6, 'style' => '');
$this->pTextBox($x, $y, $w11, $h, $texto, $aFont, 'C', 'C', 0, '', false);
$this->pdf->Line($x + $w11, $y, $x + $w11, $y + $hmax);
//VALOR IPI
$x += $w11;
$w12 = round($w * 0.05, 0);
$texto = 'VALOR IPI';
$aFont = array('font' => $this->fontePadrao, 'size' => 6, 'style' => '');
$this->pTextBox($x, $y, $w12, $h, $texto, $aFont, 'C', 'C', 0, '', false);
$this->pdf->Line($x + $w12, $y, $x + $w12, $y + $hmax);
//ALÍQ. ICMS
$x += $w12;
$w13 = round($w * 0.035, 0);
$texto = 'ALÍQ. ICMS';
$aFont = array('font' => $this->fontePadrao, 'size' => 6, 'style' => '');
$this->pTextBox($x, $y, $w13, $h, $texto, $aFont, 'C', 'C', 0, '', false);
$this->pdf->Line($x + $w13, $y, $x + $w13, $y + $hmax);
//ALÍQ. IPI
$x += $w13;
$w14 = $w - ($w1 + $w2 + $w3 + $w4 + $w5 + $w6 + $w7 + $w8 + $w9 + $w10 + $w11 + $w12 + $w13);
$texto = 'ALÍQ. IPI';
$this->pTextBox($x, $y, $w14, $h, $texto, $aFont, 'C', 'C', 0, '', false);
$this->pdf->Line($oldX, $y + $h + 1, $oldX + $w, $y + $h + 1);
$y += 5;
//##################################################################################
// LOOP COM OS DADOS DOS PRODUTOS
$i = 0;
$hUsado = 4;
$aFont = array('font' => $this->fontePadrao, 'size' => 7, 'style' => '');
foreach ($this->det as $d) {
if ($i >= $nInicio) {
$thisItem = $this->det->item($i);
//carrega as tags do item
$prod = $thisItem->getElementsByTagName("prod")->item(0);
$imposto = $this->det->item($i)->getElementsByTagName("imposto")->item(0);
$ICMS = $imposto->getElementsByTagName("ICMS")->item(0);
$IPI = $imposto->getElementsByTagName("IPI")->item(0);
$textoProduto = $this->pDescricaoProduto($thisItem);
$linhaDescr = $this->pGetNumLines($textoProduto, $w2, $aFont);
$h = round($linhaDescr * $this->pdf->FontSize + $linhaDescr * 0.5, 2);
$hUsado += $h;
if ($pag != $totpag) {
if ($hUsado >= $hmax && $i < $totItens) {
//ultrapassa a capacidade para uma única página
//o restante dos dados serão usados nas proximas paginas
$nInicio = $i;
break;
}
}
$y_linha = $y + $h;
// linha entre itens
$this->pdf->DashedHLine($oldX, $y_linha, $w, 0.1, 120);
//corrige o x
$x = $oldX;
//codigo do produto
$texto = $prod->getElementsByTagName("cProd")->item(0)->nodeValue;
$this->pTextBox($x, $y, $w1, $h, $texto, $aFont, 'T', 'C', 0, '');
$x += $w1;
//DESCRIÇÃO
if ($this->orientacao == 'P') {
$this->pTextBox($x, $y, $w2, $h, $textoProduto, $aFont, 'T', 'L', 0, '', false);
} else {
$this->pTextBox($x, $y, $w2, $h, $textoProduto, $aFont, 'T', 'L', 0, '', false);
}