public static function capturar($post)
 {
     self::$keys = self::getKeys();
     $out = parent::capturar($post);
     if (!isset($out['nome']) || !isset($out['cnpj']) || !isset($out['endereco']) || !isset($out['cep']) || !isset($out['cidade']) || !isset($out['estado'])) {
         die("Informe todos os dados do cliente: nome, cnpj, endereco, cep, cidade, estado");
     }
     $out['sacado'] = new Agente($out['nome'], $out['cnpj'], $out['endereco'], $out['cep'], $out['cidade'], $out['estado']);
     return $out;
 }
 public static function capturar($post)
 {
     self::$keys = self::getKeys();
     $out = parent::capturar($post);
     if (isset($out['dataVencimento'])) {
         $out['dataVencimento'] = new DateTime($out['dataVencimento']);
     }
     $out['dataProcessamento'] = new DateTime();
     if (!isset($out['numeroDocumento']) || !isset($out['valor']) || !isset($out['dataVencimento']) || !isset($out['descricaoDemonstrativo'])) {
         die("Informe os dados da compra: doc, valor, vencimento, descricao, mora(opcional)");
     }
     if (isset($out['descricaoDemonstrativo'])) {
         $out['descricaoDemonstrativo'] = explode(";", $out['descricaoDemonstrativo']);
     }
     $out['sequencial'] = $out['numeroDocumento'];
     return $out;
 }
Esempio n. 3
0
 /**
  * go forward one by one
  * @param $_tagArr
  */
 private function roundTagA(&$_tagArr)
 {
     if ($_tagArr == NULL) {
         return;
     }
     $_tagArrLength = count($_tagArr);
     for ($i = 0; $i < $_tagArrLength; $i++) {
         if (is_array($_tagArr[$i])) {
             $this->roundTagA($_tagArr[$i]);
         } else {
             if (stripos($_tagArr[$i], self::$_CapSite['domain_name']) === FALSE) {
                 continue;
             }
             if (in_array($_tagArr[$i], self::$_overURL)) {
                 continue;
             }
             self::$_overURL[] = $_tagArr[$i];
             if (count(self::$_overURL) % self::$_CapSite['serialize_url_size'] == 0) {
                 OperateFile::setText(self::$_Config['overURL'], serialize(self::$_overURL));
             }
             do {
                 $_tagA = $this->getCapInstance(Http::get($_tagArr[$i]));
                 sleep(self::$_CapSite['preform_page_time'] * self::$_markTime);
                 if ($this->_mark === TRUE) {
                     self::$_markTime = self::$_CapSite['preform_page_time'];
                     break;
                 }
                 self::$_markTime *= 2;
             } while (true);
             /* parse the main page and return next page */
             $this->roundTagA($_tagA);
         }
     }
 }
Esempio n. 4
0
<?php

set_time_limit(0);
require dirname(__FILE__) . DIRECTORY_SEPARATOR . 'include' . DIRECTORY_SEPARATOR . 'Capture.const.php';
require __Home__ . 'include' . __Os__ . 'Capture.class.php';
$_cfg = array('site' => __Home__ . 'config' . __Os__ . 'capture.site.php', 'preg' => __Home__ . 'config' . __Os__ . 'capture.preg.php', 'accompImg' => __Home__ . 'cache' . __Os__ . 'accompImg', 'overURL' => __Home__ . 'cache' . __Os__ . 'overURL');
$_parse = new Capture($_cfg);
$_parse->parseQuestUrl();
Esempio n. 5
0
 /**
  * @return null|string
  */
 protected function compileVariablesOptions()
 {
     $paperSize = ['orientation' => $this->getOrientation(), 'format' => $this->getFormat()];
     if ($margin = $this->getMargin()) {
         $paperSize['margin'] = $margin;
     }
     if ($this->getWidth() && $this->getHeight()) {
         $paperSize['width'] = $this->getWidth();
         $paperSize['height'] = $this->getHeight();
         unset($paperSize['format']);
     }
     $indents = '    ';
     $script = parent::compileVariablesOptions();
     $script .= 'page.paperSize = {' . PHP_EOL;
     foreach ($paperSize as $key => $value) {
         $script .= $indents . $key . ': ' . (is_scalar($value) ? '"' . $value . '"' : json_encode($value)) . ',' . PHP_EOL;
     }
     if ($header = $this->getHeader()) {
         $script .= $indents . 'header: {' . PHP_EOL;
         $script .= $indents . $indents . 'height: "' . $header['height'] . '",' . PHP_EOL;
         $script .= $indents . $indents . 'contents: ' . $header['contents'] . PHP_EOL;
         $script .= $indents . '},' . PHP_EOL;
     }
     if ($footer = $this->getFooter()) {
         $script .= $indents . 'footer: {' . PHP_EOL;
         $script .= $indents . $indents . 'height: "' . $footer['height'] . '",' . PHP_EOL;
         $script .= $indents . $indents . 'contents: ' . $footer['contents'] . PHP_EOL;
         $script .= $indents . '},' . PHP_EOL;
     }
     $script .= '};' . PHP_EOL;
     return $script;
 }