예제 #1
0
 public function logar(Login $login)
 {
     $Sql = new Sql();
     $sb = new StringBuilder();
     $sb->append("SELECT *");
     $sb->append("FROM " . T_USUARIO);
     $sb->append(sprintf("WHERE login_usr = %s", $login->getLoginUsr()));
     $sb->append(sprintf("AND senha_usr = %s", $login->getSenhaUsr()));
     $sb->append("AND ativo_usr = 1");
     $retorno = $Sql->ExecutaSQL($sb->toString());
     if (count($retorno) > 0) {
         global $Sess;
         // Dados do Usuario Logado
         $Sess->usuario = $retorno[0];
         // Atualiza o usuário
         $usuario = new Usuarios();
         $usuario->setCodigoUsr(toNumero($retorno[0]['codigo_usr']));
         $usuario->setUltimoacessoUsr(toDateTime());
         $this->alterar($usuario);
         // inicia Sessao
         $Sess->logado_sys = true;
         $Sess->ultimoacesso_sys = time();
         return true;
     }
     return false;
 }
예제 #2
0
 function toString()
 {
     $builder = new StringBuilder();
     $builder->append($this->getHeader());
     $builder->append($this->_parse());
     $builder->append($this->getFooter());
     return $builder->toString();
 }
예제 #3
0
 public function consultaCodigo($_prCodigo)
 {
     $sb = new StringBuilder();
     $Sql = new Sql();
     $sb->append("SELECT *");
     $sb->append("FROM " . T_AGENDA);
     $sb->append(sprintf("WHERE codigo_age = %s", $_prCodigo));
     return $Sql->executaSQL($sb->toString());
 }
예제 #4
0
 public function listarElogio($_prElogio)
 {
     $Sql = new Sql();
     $sb = new StringBuilder();
     $sb->append("SELECT *");
     $sb->append("FROM " . T_ELOGIO);
     $sb->append(sprintf("WHERE codigo_elo =  %s", toNumero($_prElogio)));
     return $Sql->ExecutaSQL($sb->toString());
 }
예제 #5
0
 public static function readString(InputStream $stream)
 {
     $length = self::readShort($stream);
     $builder = new StringBuilder();
     for ($i = 0; $i != $length; ++$i) {
         $builder->append(chr(self::readShort($stream)));
     }
     self::readShort($stream);
     return $builder->toString();
 }
예제 #6
0
 function formatReminder()
 {
     $builder = new StringBuilder();
     if ($this->_reservation->reminder_minutes_prior != 0) {
         $reminder_time = $this->_reservation->start + $this->_reservation->start * 60 - $this->_reservation->reminder_minutes_prior * 60;
         $adjusted = Time::getAdjustedTime($reminder_time);
         $builder->append(sprintf("DALARM:%sT%sZ\r\n", date('Ymd', $adjusted), date('His', $adjusted)));
     }
     return $builder->toString();
 }
예제 #7
0
 public function existe(Usuarios $_prClasse)
 {
     $sb = new StringBuilder();
     $Sql = new Sql();
     $sb->append("SELECT 1 AS TOTAL");
     $sb->append("FROM " . T_USUARIO);
     $sb->append("WHERE UPPER(login_usr) = " . strtoupper($_prClasse->getLoginUsr()));
     $retorno = $Sql->ExecutaSQL($sb->toString());
     return $retorno[0]['TOTAL'] > 0 ? true : false;
 }
예제 #8
0
 public function ToString()
 {
     $builder = new StringBuilder();
     $builder->append("Command: {$this->_query}\n");
     $builder->append("Parameters ({$this->Parameters->Count()}): \n");
     for ($i = 0; $i < $this->Parameters->Count(); $i++) {
         $parameter = $this->Parameters->Items($i);
         $builder->append("{$parameter->Name} = {$parameter->Value}");
     }
     return $builder->toString();
 }
예제 #9
0
 public function listarSelecao($_prSelecao = 0)
 {
     $sb = new StringBuilder();
     $Sql = new Sql();
     $sb->append("SELECT *");
     $sb->append("FROM " . T_EMP);
     if ($_prSelecao > 0) {
         $sb->append(sprintf("WHERE codigo_emp IN (%s)", $_prSelecao));
     }
     return $Sql->executaSQL($sb->toString());
 }
예제 #10
0
 public function listaDestinatarios($_prComunicado)
 {
     $sb = new StringBuilder();
     $Sql = new Sql();
     $sb->append("SELECT *");
     $sb->append("FROM " . T_COMEMP);
     $sb->append("LEFT JOIN");
     $sb->append(T_EMP);
     $sb->append("ON codigo_emp = empregado_coe");
     $sb->append(sprintf("WHERE comunicado_coe = %s", $_prComunicado));
     return $Sql->executaSQL($sb->toString());
 }
예제 #11
0
 /**
  * <p>Capitalizes all the delimiter separated words in a String.
  * Only the first letter of each word is changed. To convert the
  * rest of each word to lowercase at the same time,
  * use {@link #capitalizeFully(String, char[])}.</p>
  *
  * <p>The delimiters represent a set of characters understood to separate words.
  * The first string character and the first non-delimiter character after a
  * delimiter will be capitalized. </p>
  *
  * <p>A <code>null</code> input String returns <code>null</code>.
  * Capitalization uses the unicode title case, normally equivalent to
  * upper case.</p>
  *
  * <pre>
  * WordUtils.capitalize(null, *)            = null
  * WordUtils.capitalize("", *)              = ""
  * WordUtils.capitalize(*, new char[0])     = *
  * WordUtils.capitalize("i am fine", null)  = "I Am Fine"
  * WordUtils.capitalize("i aM.fine", {'.'}) = "I aM.Fine"
  * </pre>
  *
  * @param string $str the string to capitalize, may be null
  * @param array $delimiters set of characters to determine capitalization,
  * 		<tt>null</tt> means whitespace
  * @return capitalized String, <code>null</code> if null String input
  * @see #uncapitalize(String)
  * @see #capitalizeFully(String)
  * @since 2.1
  */
 public static function capitalize($str, array $delimiters = array(' '))
 {
     //$delimLen = (delimiters == null ? -1 : delimiters.length);
     if (is_null($str) || is_empty($str) == 0 || $delimLen == 0) {
         return $str;
     }
     $strLen = strlen($str);
     $buffer = new StringBuilder(strLen);
     $capitalizeNext = true;
     for ($i = 0; $i < $strLen; $i++) {
         $ch = substr($str, $i, 1);
         if (WordUtils::isDelimiter($ch, $delimiters)) {
             $buffer->append($ch);
             $capitalizeNext = true;
         } else {
             if ($capitalizeNext) {
                 $buffer->append(strtoupper($ch));
                 $capitalizeNext = false;
             } else {
                 $buffer->append(ch);
             }
         }
     }
     return $buffer->toString();
 }
예제 #12
0
 /**
  * Returns string with style tags (html-like). 
  */
 public function getHTML($index)
 {
     $raw = $this->getRaw($index);
     if ($raw == null) {
         return $raw;
     }
     $style = $this->getStyle($index);
     if ($style == null) {
         return $raw;
     }
     $html = new StringBuilder(strlen($raw) + 32);
     $offset = 0;
     while (true) {
         $i = -1;
         for ($j = 0; $j != count($style); $j += 3) {
             if ($style[$j + 1] == -1) {
                 continue;
             }
             if ($i == -1 || $style[$i + 1] > $style[$j + 1]) {
                 $i = $j;
             }
         }
         $start = $i != -1 ? $style[$i + 1] : strlen($raw);
         for ($j = 0; j != $style . length; $j += 3) {
             $end = $style[$j + 2];
             if ($end == -1 || $end >= $start) {
                 continue;
             }
             if ($offset <= $end) {
                 $html->append($raw, $offset, $end + 1);
                 $offset = $end + 1;
             }
             $style[j + 2] = -1;
             $html->append('<');
             $html->append('/');
             $html->append($this->getRaw($style[$j]));
             $html->append('>');
         }
         if ($offset < $start) {
             $html->append($raw, $offset, $start);
             $offset = $start;
         }
         if ($i == -1) {
             break;
         }
         $html->append('<');
         $html->append($this->getRaw($style[i]));
         $html->append('>');
         $style[i + 1] = -1;
     }
     return $html->toString();
 }
예제 #13
0
 /**
  * @param StringBuilder $stringBuilder
  *
  * Appends the specified value to the sequence as a string.
  *
  * @return $this
  */
 public function merge(StringBuilder $stringBuilder)
 {
     $this->append($stringBuilder->toString());
     return $this;
 }
예제 #14
0
 private function montaAgendamento($_prAgenda)
 {
     $sb = new StringBuilder();
     $sb->append("<html>");
     $sb->append("<head></head>");
     $sb->append("<body>");
     $sb->append("Foi agendado uma entrevista com o Candidato <strong>");
     $sb->append($_prAgenda['candidato_age']);
     $sb->append("</strong> para ");
     $sb->append(format_date($_prAgenda['inicio_age']));
     $sb->append(" ate ");
     $sb->append(format_date($_prAgenda['final_age']));
     $sb->append("<br><br>");
     $sb->append("Observacoes: ");
     $sb->append($_prAgenda['observacao_age']);
     $sb->append("</body>");
     $sb->append("</html>");
     return $sb->toString();
 }
예제 #15
0
파일: CodeGen.php 프로젝트: JUkhan/jwt_php
 public function getEmptyDirective($name)
 {
     $sb = new StringBuilder();
     $sb->append("class " . $name);
     $sb->appendLine();
     $sb->append("{");
     $sb->appendLine()->appendTab()->append("constructor(){");
     $sb->appendLine()->appendTab2()->append("this.restrict='E';");
     $sb->appendLine()->appendTab2()->append("this.templateUrl='Scripts/Directives/{$name}/{$name}.html';");
     $sb->appendLine()->appendTab()->append("}");
     $sb->appendLine();
     $sb->appendTab()->append("static builder()");
     $sb->appendTab()->append("{");
     $sb->appendLine();
     $sb->appendTab2()->append("return new {$name}();");
     $sb->appendLine();
     $sb->appendTab()->append("}");
     $sb->appendLine();
     $sb->append("}");
     $sb->appendLine()->append("export default {$name};");
     return $sb->toString();
 }
예제 #16
0
 function formatResources()
 {
     $builder = new StringBuilder();
     $builder->append("RESOURCES:{$this->_reservation->resource->properties['name']}");
     for ($i = 0; $i < count($this->_reservation->resources); $i++) {
         $builder->append(",{$this->_reservation->resources[$i]['name']}");
     }
     $builder->append("\r\nLOCATION:{$this->_reservation->resource->properties['location']}\r\n");
     return $builder->toString();
 }