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


PHP sbr_meta::getReservedSbr方法代码示例

本文整理汇总了PHP中sbr_meta::getReservedSbr方法的典型用法代码示例。如果您正苦于以下问题:PHP sbr_meta::getReservedSbr方法的具体用法?PHP sbr_meta::getReservedSbr怎么用?PHP sbr_meta::getReservedSbr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sbr_meta的用法示例。


在下文中一共展示了sbr_meta::getReservedSbr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: parseContent

 /**
  * Обрабатываем данные документа и изменяем их если нужно
  * 
  */
 public function parseContent()
 {
     if ($this->opened) {
         $this->_sharedIndex = $this->zip->locateName($this->_sharedStrings, ZIPARCHIVE::FL_NOCASE);
         $this->_sheetIndex = $this->zip->locateName($this->_workSheet, ZIPARCHIVE::FL_NOCASE);
         $this->_calcIndex = $this->zip->locateName($this->_calcChain, ZIPARCHIVE::FL_NOCASE);
         //            $this->_styleIndex  = $this->zip->locateName($this->_styles, ZIPARCHIVE::FL_NOCASE);
         $this->initDOMDocument('shared', $this->_sharedIndex);
         $this->initDOMDocument('sheet', $this->_sheetIndex);
         //            $this->initDOMDocument('style',  $this->_styleIndex);
         $this->initDOMDocument('calc', null);
         // По формулам создадим новый документ
         $pskb = sbr_meta::getReservedSbr($this->period);
         $count_rows = count($pskb);
         $from_date = date('d.m.Y', strtotime($this->period[0]));
         $to_date = date('d.m.Y', strtotime($this->period[1]));
         $period = "за период с {$from_date} по {$to_date}";
         $this->replaceSharedString(4, $period);
         $this->moveFooter($count_rows);
         foreach ($pskb as $i => $data) {
             $this->setOneRowTable($i, $data);
         }
         $this->generateFormulaData();
         $this->setContentFile($this->_sharedStrings, $this->dom['shared']->saveXML());
         $this->setContentFile($this->_workSheet, $this->dom['sheet']->saveXML());
         $this->setContentFile($this->_calcChain, $this->dom['calc']->saveXML());
         // Все гуд закрываемся
         $this->zip->close();
     }
 }
开发者ID:Nikitian,项目名称:fl-ru-damp,代码行数:34,代码来源:XLSXDocument.php

示例2: parseContent

 /**
  * Парсим данные документа и изменяем их если нужно.
  * 
  * @param string $content Данные документа (обычно это content.xml из шаблона документа ODT)
  * 
  * @return type
  */
 public function parseContent($content)
 {
     $this->dom = new DOMDocument('1.0');
     $this->dom->loadXML($content);
     $this->xpath = new DOMXPath($this->dom);
     $this->setStyleTable();
     $period = $this->xpath->query('//text:p[@text:style-name= "period"]', $this->dom->documentElement)->item(0);
     if ($period) {
         $from_date = date('d.m.Y', strtotime($this->period[0]));
         $to_date = date('d.m.Y', strtotime($this->period[1]));
         $new_period = $this->dom->createElement('text:p', iconv('windows-1251', 'utf-8', "за период с {$from_date} по {$to_date}"));
         $new_period->setAttribute('text:style-name', 'period');
         $period->parentNode->replaceChild($new_period, $period);
     }
     $table = $this->xpath->query('//table:table[@table:name= "table_test"]', $this->dom->documentElement)->item(0);
     $pskb = sbr_meta::getReservedSbr($this->period);
     $i = 1;
     $sum = 0;
     if ($pskb) {
         foreach ($pskb as $data) {
             $table_row = $this->dom->createElement('table:table-row');
             $name_emp = $this->_enc($data['nameCust']);
             $sbr_id = $this->_enc("№ {$data['sbr_id']}, " . date('d.m.Y H:i', strtotime($data['covered'])));
             $lc_id = $this->_enc("№ {$data['lc_id']}");
             $cost = $this->_enc(number_format($data['cost'], 2, ',', ' '));
             $table_row->appendChild($this->createTableCell($i));
             // п/п
             $table_row->appendChild($this->createTableCell($name_emp));
             // Наименование Заказчика
             $table_row->appendChild($this->createTableCell($sbr_id));
             // Соглашение (№, дата)
             $table_row->appendChild($this->createTableCell($lc_id));
             // Идентификатор аккредитива
             $table_row->appendChild($this->createTableCell($cost));
             // Сумма резервирования
             ++$i;
             $sum += $data['cost'];
             $table->appendChild($table_row);
         }
     }
     // Добавляем Итого
     $table_row = $this->dom->createElement('table:table-row');
     $table_row->appendChild($this->createTableCell($this->_enc('Итого за отчетный период:'), 4, 'p_1'));
     $table_row->appendChild($this->dom->createElement('table:covered-table-cell'));
     // Наименование Заказчика
     $table_row->appendChild($this->dom->createElement('table:covered-table-cell'));
     // Соглашение (№, дата)
     $table_row->appendChild($this->dom->createElement('table:covered-table-cell'));
     // Идентификатор аккредитива
     $table_row->appendChild($this->createTableCell(number_format($sum, 2, ',', ' ')));
     // Итого
     $table->appendChild($table_row);
     return $this->dom->saveXML();
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:61,代码来源:ODTDocument.php


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