Esempio n. 1
0
 public static function editar($base)
 {
     $idioma = "";
     $pode_img = true;
     $id = addslashes($_GET['id']);
     $where = array('ID' => $id);
     $tabela = self::$tabela;
     $db_serv = $base->seleciona(self::$tabela, $where, null);
     $where = json_encode($where);
     $ln = $db_serv[0];
     $img_atual = !empty($ln->foto) ? "../uploads/" . self::$tabela . "/" . $ln->foto : "";
     $form = new WGform();
     $form::$nome = 'formulario';
     $form::$action = 'io/update.php';
     $form::$method = "POST";
     $form::$html_botao = "<br>" . html_upload_foto(self::$largura, self::$altura, self::$tamnaho_k_bytes, $img_atual) . "<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($tabela)));
     $paramtros_obj['where'] = $form::index(array('tipo' => 5, 'campo' => 'where', 'valor' => base64_encode($where)));
     /* capos relativos ao metodo cria_tebelas */
     html_botao_add_refresh_lista(self::$tabela, adiciona_ao_get(array('op' => "novo")));
     echo $form::formulario($paramtros_obj);
 }
Esempio n. 2
0
 public static function editar($base)
 {
     $id = addslashes($_GET['id']);
     $where = array('ID' => $id);
     $tabela = self::$tabela;
     $db_serv = $base->seleciona(self::$tabela, $where, null);
     $where = json_encode($where);
     $ln = $db_serv[0];
     $form = new WGform();
     $form::$nome = 'formulario';
     $form::$action = 'io/update.php';
     $form::$method = "POST";
     $form::$html_botao = "<br><button type='submit' class='btn btn-primary botao' disabled> EDITAR </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($tabela)));
     $paramtros_obj['where'] = $form::index(array('tipo' => 5, 'campo' => 'where', 'valor' => base64_encode($where)));
     /* capos relativos ao metodo cria_tebelas */
     $paramtros_obj['tipo'] = $form::index(array('tipo' => 5, 'campo' => 'tipo', 'css_class' => 'tipo', 'valor' => ""));
     $paramtros_obj['url'] = $form::index(array('tipo' => 0, 'campo' => 'url', 'label' => true, 'titulo' => 'Nome', 'css_class' => 'form-control url', 'valor' => $ln->url, "html_depois" => "<hr><br><div class='embed-responsive embed-responsive-16by9'><iframe class='embed-responsive-item' src='" . $ln->url . "' allowfullscreen=''></iframe></div>"));
     html_botao_add_refresh_lista(self::$tabela, adiciona_ao_get(array('op' => "novo")));
     echo $form::formulario($paramtros_obj);
 }
Esempio n. 3
0
 public static function editar($base)
 {
     $idioma = "";
     $pode_img = true;
     if (!empty($_GET['lang'])) {
         $pode_img = false;
         $id = addslashes($_GET['id']);
         $lang = addslashes($_GET['lang']);
         $tabela = self::$tabela . "_traducao";
         $where = array('sigla_idioma' => $lang, 'id_' . self::$tabela => $id);
         $db_serv = $base->seleciona($tabela, $where, null);
         if ($db_serv) {
             $ln = $db_serv[0];
         } else {
             $db_idiom = $base->seleciona('idiomas', array('sigla' => $lang, 'status' => 1), null);
             if ($db_idiom) {
                 $base->inserir($tabela, $where);
                 $db_serv = $base->seleciona($tabela, $where, null);
             } else {
                 $db_serv = $base->seleciona($tabela, $where, null);
             }
             $ln = $db_serv[0];
         }
         $where = json_encode($where);
     } else {
         $id = addslashes($_GET['id']);
         $where = array('ID' => $id);
         $tabela = self::$tabela;
         $db_serv = $base->seleciona(self::$tabela, $where, null);
         $where = json_encode($where);
         $ln = $db_serv[0];
     }
     $img_atual = !empty($ln->foto) ? "../uploads/" . self::$tabela . "/" . $ln->foto : "";
     $form = new WGform();
     $form::$nome = 'formulario';
     $form::$action = 'io/update.php';
     $form::$method = "POST";
     if ($pode_img) {
         $form::$html_botao = html_upload_foto(self::$largura, self::$altura, self::$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($tabela)));
     $paramtros_obj['where'] = $form::index(array('tipo' => 5, 'campo' => 'where', 'valor' => base64_encode($where)));
     /* capos relativos ao metodo cria_tebelas */
     $paramtros_obj['nome_treinameto'] = $form::index(array('tipo' => 0, 'campo' => 'nome_treinameto', 'label' => true, 'titulo' => 'Nome do Treinamento', 'html_depois' => '<br>', 'valor' => $ln->nome_treinameto));
     $paramtros_obj['descricao'] = $form::index(array('tipo' => 1, 'campo' => 'descricao', 'label' => true, 'titulo' => 'Descricao', 'css_class' => 'form-control', 'id' => 'editor_area', 'valor' => $ln->descricao));
     html_botao_add_refresh_lista(self::$tabela, adiciona_ao_get(array('op' => "novo")));
     echo $form::formulario($paramtros_obj);
 }
Esempio n. 4
0
 public static function editar_categoria($base)
 {
     $id = addslashes($_GET['id']);
     $where = array('ID' => $id);
     $tabela = self::$tabela_categorias;
     $db_serv = $base->seleciona(self::$tabela_categorias, $where, null);
     $where = json_encode($where);
     $ln = $db_serv[0];
     $categorias = $base->seleciona(self::$tabela_categorias, null, array('ID', 'nome'));
     $lista_categorias = array();
     foreach ($categorias as $v) {
         if ($ln->id_cat_pai) {
             $lista_categorias['@' . $v->ID] = $v->nome;
         } else {
             $lista_categorias[$v->ID] = $v->nome;
         }
     }
     $form = new WGform();
     $form::$nome = 'formulario';
     $form::$action = 'io/update.php';
     $form::$method = "POST";
     $form::$html_botao = "<br><button type='submit' class='btn btn-primary'> EDITAR </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($tabela)));
     $paramtros_obj['where'] = $form::index(array('tipo' => 5, 'campo' => 'where', 'valor' => base64_encode($where)));
     /* capos relativos ao metodo cria_tebelas */
     $paramtros_obj['nome'] = $form::index(array('tipo' => 0, 'campo' => 'nome', 'label' => true, 'html_depois' => '<br>', 'titulo' => 'Nome', 'obrigatorio' => true, 'valor' => $ln->nome));
     $paramtros_obj['id_cat_pai'] = $form::index(array('tipo' => 2, 'opcoes' => array_merge(array('nao' => 'sem categoria'), $lista_categorias), 'campo' => 'id_cat_pai', 'valor' => $ln->id_cat_pai, 'label' => true, 'html_depois' => '<br>', 'titulo' => 'Categoria Pai'));
     html_botao_add_refresh_lista('loja&lista=categorias', adiciona_ao_get(array('op' => "novo", 'novo' => "categoria"), array('id' => "", 'editar' => "")));
     echo $form::formulario($paramtros_obj);
 }