Example #1
0
 public static function listar($base)
 {
     $ln = $base->seleciona(self::$tabela, null, null, array('DESC' => 'ID'));
     html_botao_add_refresh(adiciona_ao_get(array('op' => "novo")));
     if (empty($ln)) {
         html_lista_vazia(adiciona_ao_get(array('op' => "novo")));
     } else {
         foreach ($ln as $valor) {
             $camp_id = $valor->ID;
             $d = array('id' => $camp_id);
             $where_del = json_encode($d);
             $onclick = "apagar('" . base64_encode(self::$tabela) . "','" . base64_encode($where_del) . "','')";
             self::html_item($valor, null, $onclick, $camp_id);
         }
     }
 }
Example #2
0
 public static function listar($base)
 {
     $ln = $base->seleciona(self::$tabela, null, null);
     html_botao_add_refresh(adiciona_ao_get(array('op' => "novo")));
     if (empty($ln)) {
         html_lista_vazia();
     } else {
         foreach ($ln as $valor) {
             $camp_id = $valor->ID;
             $d = array('id' => $camp_id);
             $where_del = json_encode($d);
             $url_imagem = "thumb.php?tipo=red&img=../uploads/" . self::$tabela . "/" . $valor->foto . "&w=260&h=150";
             $onclick = "apagar('" . base64_encode(self::$tabela) . "','" . base64_encode($where_del) . "','')";
             self::html_item($valor, $url_imagem, $onclick, $camp_id);
         }
     }
 }
Example #3
0
 public static function listar($base)
 {
     $idioma = "";
     if (!empty($_GET['lang'])) {
         $idioma = addslashes($_GET['lang']);
         $ln = $base->seleciona(self::$tabela . "_traducao", array('sigla_idioma' => $idioma), null);
     } else {
         $ln = $base->seleciona(self::$tabela, null, null);
     }
     html_botao_add_refresh(adiciona_ao_get(array('op' => "novo")));
     if (empty($ln)) {
         html_lista_vazia();
     } else {
         foreach ($ln as $valor) {
             $camp_id = $valor->ID;
             $d = array('id' => $camp_id);
             $where_del = json_encode($d);
             $tambem = array("tabela" => self::$tabela . "_traducao", "where" => array('id_' . self::$tabela => $camp_id));
             $tembem = json_encode($tambem);
             if (!empty($idioma)) {
                 $original = $base->seleciona(self::$tabela, array('ID' => $valor->{'id_' . self::$tabela}), array("foto", "ID"));
                 $foto = isset($original[0]->foto) ? $original[0]->foto : "";
                 $camp_id = isset($original[0]->ID) ? $original[0]->ID : "";
                 $url_imagem = "thumb.php?tipo=red&img=../uploads/" . self::$tabela . "/" . $foto . "&w=160&h=150";
                 $onclick = "apagar('" . base64_encode(self::$tabela . "_traducao") . "','" . base64_encode($where_del) . "','')";
             } else {
                 $url_imagem = "thumb.php?tipo=red&img=../uploads/" . self::$tabela . "/" . $valor->foto . "&w=160&h=150";
                 $onclick = "apagar('" . base64_encode(self::$tabela) . "','" . base64_encode($where_del) . "','" . base64_encode($tembem) . "')";
             }
             self::html_item($valor, $url_imagem, $onclick, $camp_id);
         }
     }
 }
Example #4
0
 public static function lista_clientes($base)
 {
     $ln = $base->seleciona(self::$tabela_clientes, null, null);
     html_topo_pagina(ucfirst(self::$tabela_clientes));
     if (empty($ln)) {
         html_lista_vazia();
     } else {
         self::estrutura_header(array('#codigo', 'Nome', 'Email', 'Telefone', 'Cidade', 'Opções'));
         foreach ($ln as $valor) {
             $camp_id = $valor->ID;
             $d = array('id' => $camp_id);
             $where_del = json_encode($d);
             $onclick = "apagar('" . base64_encode(self::$tabela_clientes) . "','" . base64_encode($where_del) . "','')";
             self::html_item_cliente($valor, $onclick, $camp_id);
         }
         self::estrutura_footer();
     }
 }
Example #5
0
 public static function lista_categorias($base)
 {
     $ln = $base->seleciona(self::$tabela_categorias, null, null);
     html_topo_pagina(ucfirst(self::$tabela_categorias));
     html_botao_add_refresh(adiciona_ao_get(array('op' => "novo", 'novo' => 'categoria'), array('lista' => "")));
     if (empty($ln)) {
         html_lista_vazia();
     } else {
         self::estrutura_header(array('#ID', 'Nome', 'Opções'));
         foreach ($ln as $valor) {
             $camp_id = $valor->ID;
             $d = array('id' => $camp_id);
             $where_del = json_encode($d);
             $onclick = "apagar('" . base64_encode(self::$tabela_categorias) . "','" . base64_encode($where_del) . "','')";
             self::html_item_categoria($valor, $onclick, $camp_id);
         }
         self::estrutura_footer();
     }
 }