Esempio n. 1
0
 public function toLista($o)
 {
     $lista = new Lista();
     while ($row = $this->fetchArray($o)) {
         $lista->addElement($row);
     }
     return $lista;
 }
Esempio n. 2
0
 public function deletar(TicketPost $t)
 {
     parent::deletar($t);
     $where = "WHERE " . self::ID . " = '" . $t->getId() . "'";
     $t->getArquivo()->deleteArquivo();
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
 }
Esempio n. 3
0
 public function deletar(Mailing $t)
 {
     parent::deletar($t);
     $where = "WHERE " . self::ID . " = '" . $t->getId() . "'";
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
     $this->con->deletar(Sistema::$BDPrefixo . "mailing_pacotes_envio", "WHERE mailing = '" . $t->getId() . "'");
 }
 public function deletar(ProdutoMarca $m)
 {
     parent::deletar($m);
     $where = "WHERE " . self::ID . " = '" . $m->getId() . "'";
     Arquivos::__DeleteArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataProdutoMarcas . $m->getImagem()->nome . '.' . $m->getImagem()->extensao);
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
 }
Esempio n. 5
0
 function suorita()
 {
     parent::suorita();
     if ($this->order === 'oikeaaika') {
         $this->order = 'pvm';
     }
 }
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     //echo count($info);
     if (!empty($info)) {
         $end = new PedidoEnderecoEntrega($info[self::ID]);
         $end->logradouro = $info[self::LOGRADOURO];
         $end->numero = $info[self::NUMERO];
         $end->complemento = $info[self::COMPLEMENTO];
         $end->bairro = $info[self::BAIRRO];
         $end->tipo = $info[self::TIPO];
         $end->prazo = $info[self::PRAZO];
         $end->setValor($info[self::VALOR]);
         $end->setCep($info[self::CEP]);
         $lC = new ListaCidades();
         $lC->condicoes('', $info[self::CIDADE], ListaCidades::ID);
         if ($lC->getTotal() > 0) {
             $c = $lC->listar();
             $end->setCidade($c);
             $end->setEstado($c->getEstado());
             $end->setPais($c->getPais());
         }
         return $end;
     }
 }
Esempio n. 7
0
 public function deletar(Banner $t)
 {
     parent::deletar($t);
     $where = "WHERE " . self::ID . " = '" . $t->getId() . "'";
     Arquivos::__DeleteArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataBanners . $t->getImagem()->nome . "." . $t->getImagem()->extensao);
     Arquivos::__DeleteArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataBanners . $t->getFlash());
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
 }
Esempio n. 8
0
 public function deletar(Musica $t)
 {
     parent::deletar($t);
     $where = "WHERE " . self::ID . " = '" . $t->getId() . "'";
     $arquivo = $t->getMusica()->nome . "." . $t->getMusica()->extensao;
     Arquivos::__DeleteArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataDiscografia . $arquivo);
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
 }
 public function deletar(UploadDownloadArquivo $t)
 {
     parent::deletar($t);
     $where = "WHERE " . self::ID . " = '" . $t->getId() . "'";
     $arquivo = $t->getArquivo()->nome . "." . $t->getArquivo()->extensao;
     Arquivos::__DeleteArquivo(Sistema::$caminhoDiretorio . Sistema::$caminhoDataUploadsDownloads . $arquivo);
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
 }
Esempio n. 10
0
 public function json_pages(Lista $m)
 {
     $c = $this->comecando_em / $this->por_pagina + 1;
     $cur = "\"current\":\"" . $c . "\"";
     $pre = "\"previous\":false";
     if ($this->comecando_em > 0) {
         $pre = "\"previous\":true";
     }
     $nex = "\"next\":false";
     if ($m->getSize() > $this->por_pagina) {
         $nex = "\"next\":true";
     }
     $las = "\"last\":true";
     if ($m->getSize() > $this->maximo) {
         $las = "\"last\":false";
     }
     return "{ " . $cur . "," . $pre . "," . $nex . "," . $las . " }";
 }
Esempio n. 11
0
 public function listar($ordem = "ASC", $campo = 'id')
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $at = new Atividade($info['id']);
         $at->titulo = $info['titulo'];
         return $at;
     }
 }
Esempio n. 12
0
 public function deletar(Galeria $g)
 {
     parent::deletar($g);
     $where = "WHERE " . self::ID . " = '" . $g->getId() . "'";
     while ($img = $g->getImagens()->listar("ASC")) {
         $g->getImagens()->deletar($img);
         $g->getImagens()->setParametros(0);
     }
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
 }
 public function deletar(BannerCategoria $t)
 {
     if ($t->getBanners()->getTotal() > 0) {
         throw new Exception("Está categoria possui banners cadastrados, não foi possível removê-la!");
     } else {
         parent::deletar($t);
         $where = "WHERE " . self::ID . " = '" . $t->getId() . "'";
         $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
     }
 }
Esempio n. 14
0
 public function deletar(Ticket $t)
 {
     parent::deletar($t);
     $where = "WHERE " . self::ID . " = '" . $t->getId() . "'";
     while ($tP = $t->getPostagens()->listar()) {
         $t->getPostagens()->deletar($tP);
         $t->getPostagens()->setParametros(0);
     }
     $this->con->deletar(Sistema::$BDPrefixo . $this->tabela, $where);
 }
Esempio n. 15
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Pais($info[self::ID]);
         $temp->nome = $info[self::NOME];
         $temp->ddi = $info[self::DDI];
         return $temp;
     }
 }
Esempio n. 16
0
 public function Show_list_travel($empleado)
 {
     if ($_SESSION["perfil"] == 5) {
         $Lista = new Lista();
         $query = " select t_id,t_etiqueta,date(t_fecha_registro), (select concat(u_nombre,' ',u_paterno,' ',u_materno)  from usuario where u_id=t_iniciador)  as atiende, (select svi_fecha_salida from sv_itinerario where svi_solicitud = solicitud_viaje.sv_id group by svi_solicitud) as fechaSalida, sv_agente_travel from tramites inner join solicitud_viaje on (solicitud_viaje.sv_tramite= tramites.t_id)  where t_etapa_actual=4 and t_owner=" . $_SESSION["idusuario"] . " and t_cerrado=false and t_cancelado=false and t_flujo=3 order by t_id desc";
         $Lista->Herramientas("E", "./index.php?view=");
         $Lista->Cabeceras("Folio");
         $Lista->Cabeceras("Referencia");
         $Lista->Cabeceras("Fecha Registro");
         $Lista->Cabeceras("Iniciador");
         $Lista->Cabeceras("Fecha Salida");
         $Lista->Cabeceras("Agente");
         //$Lista->Cabeceras("$ Solc.","","number");
     }
     $Lista->muestra_lista($query, 0, false, -1, "", 15);
 }
Esempio n. 17
0
 public static function semana($data)
 {
     $semana = new Lista();
     $dom = $data->adddia(0 - $data->diadasemana());
     $seg = $dom->adddia(1);
     $ter = $seg->adddia(1);
     $qua = $ter->adddia(1);
     $qui = $qua->adddia(1);
     $sex = $qui->adddia(1);
     $sab = $sex->adddia(1);
     $semana->addElement($dom);
     $semana->addElement($seg);
     $semana->addElement($ter);
     $semana->addElement($qua);
     $semana->addElement($qui);
     $semana->addElement($sex);
     $semana->addElement($sab);
     $semana->paginar();
     return $semana;
 }
Esempio n. 18
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new ProdutoPedra($info[self::ID]);
         $temp->nome = $info[self::NOME];
         if (!empty($info[self::IMAGEM])) {
             $temp->setImagem(new Image(new Arquivos(Sistema::$caminhoURL . Sistema::$caminhoDataProdutoPedras . $info[self::IMAGEM])));
         }
         return $temp;
     }
 }
Esempio n. 19
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new URL($info[self::ID]);
         $temp->setURL($info[self::URL]);
         $temp->tabela = $info[self::TABELA];
         $temp->campo = $info[self::CAMPO];
         $temp->valor = $info[self::VALOR];
         return $temp;
     }
 }
Esempio n. 20
0
 public function enviarPacote($de = '', $html = false)
 {
     Email::$msg = $this->getTexto()->texto;
     if ($html) {
         Email::$html = $html;
     }
     if ($de) {
         Email::$de = $de;
     }
     Email::$assunto = $this->getTexto()->titulo;
     if ($this->getStatus() == self::PARADO) {
         self::criarListaParaEnvio($this);
     }
     $l = new Lista('mailing_pacotes_envio');
     $l->condicoes('', $this->getId(), 'mailing');
     $total = $l->getTotal();
     if ($total > Sistema::$emailsPorHora) {
         $l->setParametros(Sistema::$emailsPorHora, 'limite');
         $this->setStatus(self::ENVIANDO);
     } else {
         $this->setStatus(self::PARADO);
     }
     $lM = new ListaMailings();
     $lM->alterar($this);
     $con = BDConexao::__Abrir();
     while ($rs = $l->listar()) {
         Email::$para = $rs['email'];
         Email::enviar();
         $con->executar("DELETE FROM " . Sistema::$BDPrefixo . "mailing_pacotes_envio WHERE mailing = '" . $this->getId() . "' AND email = '" . $rs['email'] . "'");
         $l->setParametros(0);
         $l->setParametros($l->getParametros('limite') - 1, 'limite');
     }
 }
Esempio n. 21
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Traducao($info[self::ID]);
         $temp->conteudo = $info[self::CONTEUDO];
         $temp->traducao = $info[self::TRADUCAO];
         $temp->setIdIdioma($info[self::IDIOMA]);
         $temp->setIdConteudo($info[self::IDCONTEUDO]);
         $temp->setTabelaConteudo($info[self::TABELACONTEUDO]);
         return $temp;
     }
 }
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new ProdutoOpcaoValor($info[self::ID]);
         $temp->valor = $info[self::VALOR];
         $temp->cor = $info[self::COR];
         if (!empty($info[self::IMAGEM])) {
             $temp->setImagem(new Image(new Arquivos(Sistema::$caminhoURL . Sistema::$caminhoDataProdutoOpcoes . $info[self::IMAGEM])));
         }
         return $temp;
     }
 }
Esempio n. 23
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new ProdutoOpcao($info[self::ID]);
         $temp->nome = $info[self::NOME];
         $temp->tipo = $info[self::TIPO];
         $temp->multi = $info[self::MULTI] == self::VALOR_MULTI_TRUE ? true : false;
         $temp->filtro = $info[self::FILTRO] == self::VALOR_FILTRO_TRUE ? true : false;
         $temp->aberto = $info[self::ABERTO] == self::VALOR_ABERTO_TRUE ? true : false;
         return $temp;
     }
 }
Esempio n. 24
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Estado($info[self::ID]);
         $temp->nome = $info[self::NOME];
         $temp->uf = $info[self::UF];
         $lP = new ListaPaises();
         $lP->condicoes('', $info[self::PAIS], ListaPaises::ID);
         if ($lP->getTotal() > 0) {
             $temp->setPais($lP->listar());
         }
         return $temp;
     }
 }
Esempio n. 25
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Imagem($info[self::ID]);
         $temp->legenda = $info[self::LEGENDA];
         $temp->destaque = $info[self::DESTAQUE] == self::VALOR_DESTAQUE_TRUE ? true : false;
         $temp->setSessao($info[self::SESSAO], $info[self::IDSESSAO]);
         if (!empty($info[self::IMAGEM])) {
             $arquivo = new Arquivos($this->caminhoLeitura . $info[self::IMAGEM]);
             $img = new Image($arquivo);
             $temp->setImage($img);
         }
         return $temp;
     }
 }
Esempio n. 26
0
 public function listar($ordem = "ASC", $campo = self::ID)
 {
     $info = parent::listar($ordem, $campo);
     if (!empty($info)) {
         $temp = new Usuario($info[self::ID]);
         $temp->nivel = $info[self::NIVEL];
         $temp->nome = $info[self::NOME];
         $temp->login = $info[self::LOGIN];
         $temp->senha = $info[self::SENHA];
         $temp->texto = $info[self::TEXTO];
         $temp->ensino = $info[self::ENSINO];
         if (!empty($info[self::IMAGEM])) {
             $temp->setImagem(new Image(new Arquivos(Sistema::$caminhoDataUsuarios . $info[self::IMAGEM])));
         }
         return $temp;
     }
 }
Esempio n. 27
0
 function suorita()
 {
     $this->setOrder('desc');
     if (isset($_REQUEST['sort']) and $_REQUEST['sort'] == 'pisteet') {
         unset($_REQUEST['sort']);
         $_REQUEST['omasort'] = 'pisteet';
     }
     if (isset($_REQUEST['sort']) and $_REQUEST['sort'] == 'ppp') {
         unset($_REQUEST['sort']);
         $_REQUEST['omasort'] = 'ppp';
     }
     parent::suorita();
     if (isset($_REQUEST['omasort'])) {
         usort($this->data, array("JoukkueTilastot", "cmp"));
     }
     $this->joukkuetiedot->haeTiedot($_SESSION['defaultjoukkue']);
 }
Esempio n. 28
0
 function suorita()
 {
     D("<pre>");
     D($_REQUEST);
     D("</pre>");
     if (isset($_REQUEST['paivita'])) {
         $this->openConnection();
         foreach ($_REQUEST['toimihenkilo'] as $key => $henkilo) {
             $query = "UPDATE Toimi SET tehtava = '{$henkilo['toimi']}' " . " WHERE henkilo = {$key} and kaudenjoukkue = {$_SESSION['kaudenjoukkueid']} and kausi = {$_SESSION['kausi']}";
             $this->db->doQuery($query);
         }
         $this->db->close();
         if (!$this->db->error) {
             //tästa alkaa takaisinkytkennän toimintasarja
             $this->drawForm = false;
             $this->suoritaAutoRefresh();
             return;
         }
     } else {
         parent::suorita();
         // open connection to db
         $this->openConnection();
         $toimi = "toimenkuva";
         $result =& $this->db->doQuery("(SELECT ' ' as value, 'Ei tiedossa' as name) UNION (SELECT toimenkuva, toimenkuva as value FROM Toimenkuva)");
         $i = 0;
         foreach ($this->data as $henkilo) {
             D("<pre>");
             D($henkilo);
             D("</pre>");
             //$this->toimenkuva[$i] = new Select($result,"toimihenkilo[$henkilo[hloid]][toimi]",$henkilo['toimi']);
             $button = new Button('toimenlisays', 'toimenlisays', 'toimenlisays', false);
             $this->toimenkuva[$i] = new SelectLisaa("toimihenkilo[{$henkilo['hloid']}][toimi]", $result, $button, $henkilo['toimi']);
             //SelectLisaa( $toimi, $result, "toimihenkilo[$henkilo[hloid]][toimi]", 'toimenlisays');
             $i++;
         }
         $this->db->close();
     }
 }
Esempio n. 29
0
 /**
  * @todo renderiza a pagina da minha lista
  */
 public function minhaLista()
 {
     try {
         $this->addJs(array('js/minhaLista.init'));
         $token = null;
         $listaModel = new Lista();
         if (isset($_GET['param'])) {
             $token = $_GET['param'];
         }
         $record = $this->Evento->find('first', array('md5(id)' => $token));
         $record = array_shift($record);
         if (!empty($record)) {
             unset($_SESSION['Form']);
             $_SESSION['Form']['eventos_id'] = intval($record['Evento']['id']);
         }
         $lista = $listaModel->listaDisponivel($this->pessoas_id);
         $this->set('evento', $record);
         $this->set('lista', $lista);
         $this->render();
     } catch (Exception $ex) {
         echo $ex->getMessage();
     }
 }
Esempio n. 30
0
 function suorita()
 {
     if (isset($_REQUEST['poista']) and isset($_REQUEST['tunnus'])) {
         $query = "DELETE FROM Kayttajat WHERE tunnus = '{$_REQUEST['tunnus']}'";
         $this->openConnection();
         $result = $this->db->doQuery($query);
         /*  if( count($result) > 0 ) {
                 $this->poistaOikeus('omattiedotoikeudet',$_REQUEST[tunnus]);
                 $this->poistaOikeus('joukkueenalueoikeudet',$_REQUEST[tunnus]);
                 $this->poistaOikeus('lisaamuokkaaoikeudet',$_REQUEST[tunnus]);
                 $this->poistaOikeus('yllapitooikeudet',$_REQUEST[tunnus]);
             }
             */
         $this->db->close();
         if (!$this->db->error) {
             //tästa alkaa takaisinkytkennän toimintasarja
             $this->drawForm = false;
             $this->suoritaAutoRefresh();
             return;
         }
     } else {
         parent::suorita();
     }
 }