Example #1
0
 public static function view()
 {
     html_topo_pagina(ucfirst(self::$tabela));
     $metodo = get_op_modo();
     $conexao = new Conexao();
     $nova_t = empty($_GET['criar_tabela']) ? false : true;
     $verifica_tabela = $conexao->verifica_tabela(self::$tabela, self::cria_tebelas(), $nova_t);
     if ($verifica_tabela == false) {
         echo "<h3>A tabela " . self::$tabela . " não existe, deseja criar uma nova tabela</h3>";
         echo "<a href='" . adiciona_ao_get(array('criar_tabela' => 1)) . "' class='btn btn-default'><i class='glyphicon glyphicon-upload'></i> CRIAR TABELA</a>";
     } else {
         self::$metodo($conexao);
         self::scripts();
     }
 }
Example #2
0
                        $up_where = json_encode($where2);
                    } else {
                        $db_tex = $base->seleciona('textos', $where1, null);
                        $up_where = json_encode($where1);
                    }
                }
            }
            $ln = $db_tex[0];
        }
    }
} else {
    $tipo = false;
}
if (!empty($ln)) {
    html_lista_idiomas();
    html_topo_pagina('Texto:' . ucfirst($ln->tipo));
    $form = new WGform();
    $img_atual = !empty($ln->foto) ? "../uploads/textos/" . $ln->foto : "";
    $form::$nome = 'formulario';
    $form::$action = 'io/update.php';
    $form::$method = "POST";
    if ($img_atual) {
        $form::$html_botao = html_upload_foto($largura, $altura, $tamnaho_k_bytes, $img_atual) . "<br><button type='submit' class='btn btn-primary'> SALVAR </button>";
    } else {
        $form::$html_botao = "<br><button type='submit' class='btn btn-primary'> SALVAR </button>";
    }
    $form::$ajax = array('enviado_redireciona', 'erro', 'antes_enviar', 'completo');
    $paramtros_obj = array();
    /*CAMPOS*/
    /*campo 'tabela' obrigatorio */
    $paramtros_obj['tabela'] = $form::index(array('tipo' => 5, 'campo' => 'tabela', 'valor' => base64_encode('textos')));
Example #3
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 #4
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();
     }
 }