当前位置: 首页>>代码示例>>PHP>>正文


PHP DOMNode::item方法代码示例

本文整理汇总了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);
             }
开发者ID:JulianoAmaralChaves,项目名称:nfephp,代码行数:67,代码来源:Danfe.php


注:本文中的DOMNode::item方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。