function Novo()
 {
     $db = new clsBanco();
     $db->Consulta("INSERT INTO mailling_grupo (nm_grupo) VALUES ('{$this->nome_grupo}')");
     //$db->Consulta("SELECT LAST_INSERT_ID() FROM mailling_grupo");
     $last_id = $db->insertId('portal.mailling_grupo_cod_mailling_grupo_seq');
     //$db->ProximoRegistro();
     //list($last_id) = $db->Tupla();
     foreach ($_POST as $chave => $valor) {
         if (substr($chave, 0, 3) == "ch_") {
             $cod = substr($chave, 3);
             $db->Consulta("INSERT INTO mailling_grupo_email (ref_cod_mailling_email, ref_cod_mailling_grupo) VALUES ({$cod},{$last_id}) ");
         }
     }
     echo "<script>document.location='mailling_grupos_lst.php';</script>";
     return true;
 }
Exemplo n.º 2
0
 function Novo()
 {
     @session_start();
     $this->id_pessoa = @$_SESSION['id_pessoa'];
     session_write_close();
     $this->data_noticia = explode("%2F", $this->data_noticia);
     $this->data_noticia = "{$this->data_noticia[2]}/{$this->data_noticia[1]}/{$this->data_noticia[0]}";
     if (empty($this->id_pessoa) || empty($this->titulo) || empty($this->data_noticia) || empty($this->descricao)) {
         return false;
     } else {
         $temp_num = 1;
         $db = new clsBanco();
         $this->descricao = str_replace("?", "\\?", $this->descricao);
         $db->Consulta("INSERT INTO not_portal (ref_ref_cod_pessoa_fj, titulo, descricao , data_noticia) VALUES ({$this->id_pessoa}, '{$this->titulo}', '{$this->descricao}', NOW())");
         //$db->Consulta( "SELECT LAST_INSERT_ID() FROM not_portal" );
         $last_id = $db->insertId('not_portal_cod_not_portal_seq');
         $this->todas_fotos = unserialize(urldecode($this->todas_fotos));
         if (!empty($this->todas_fotos)) {
             foreach ($this->todas_fotos as $id => $foto) {
                 $db->Consulta("INSERT INTO not_vinc_portal (ref_cod_not_portal,vic_num,tipo, cod_vinc) VALUES ({$last_id},{$temp_num},'F', {$foto})");
                 $temp_num++;
             }
         }
         $this->todas_noticias = unserialize(urldecode($this->todas_noticias));
         if (!empty($this->todas_noticias)) {
             foreach ($this->todas_noticias as $id => $noticia) {
                 $db->Consulta("INSERT INTO not_vinc_portal (ref_cod_not_portal,vic_num,tipo, cod_vinc) VALUES ({$last_id},{$temp_num},'N', {$noticia})");
                 $temp_num++;
             }
         }
         $this->todos_arquivos = unserialize(urldecode($this->todos_arquivos));
         if (!empty($this->todos_arquivos)) {
             foreach ($this->todos_arquivos as $id => $caminho) {
                 $novo_caminho = "arquivos/" . $caminho[2];
                 copy($caminho[0], $novo_caminho);
                 $db->Consulta("INSERT INTO not_vinc_portal (ref_cod_not_portal,vic_num,tipo,caminho,nome_arquivo) VALUES ({$last_id},{$temp_num},'A','{$novo_caminho}' , '{$caminho['1']}')");
                 $temp_num++;
             }
         }
         $this->todos_tipos = unserialize(urldecode($this->todos_tipos));
         if (!empty($this->todos_tipos)) {
             foreach ($this->todos_tipos as $id => $tipo) {
                 $db->Consulta("INSERT INTO not_portal_tipo (ref_cod_not_portal,ref_cod_not_tipo) VALUES ({$last_id},{$tipo})");
             }
         }
         echo "<script>document.location='noticias_lst.php';</script>";
         return true;
     }
     return true;
 }
Exemplo n.º 3
0
 function Novo()
 {
     global $HTTP_POST_FILES;
     if (!empty($this->todos_arquivos)) {
         if (empty($this->data_final)) {
             $this->data_final = $this->data_inicial;
         }
         $data_final = explode("/", $this->data_final);
         $this->data_final = "{$data_final[2]}-{$data_final[1]}-{$data_final[0]}";
         $data_inicial = explode("/", $this->data_inicial);
         $this->data_inicial = "{$data_inicial[2]}-{$data_inicial[1]}-{$data_inicial[0]}";
         if (empty($this->edicao)) {
             $this->extra = 1;
             $this->edicao = 0;
         } else {
             $this->extra = 0;
             $this->edicao = $this->edicao;
         }
         $db = new clsBanco();
         $sql = "INSERT INTO jor_edicao (jor_ano_edicao, jor_edicao, jor_dt_inicial, jor_dt_final,ref_ref_cod_pessoa_fj, jor_extra) VALUES ('{$this->ano}', {$this->edicao}, '{$this->data_inicial}', '{$this->data_final}', {$this->cod_cad}, {$this->extra})";
         $db->Consulta($sql);
         $last_id = $db->insertId('portal.jor_edicao_cod_jor_edicao_seq');
         $temp = 1;
         $this->todos_arquivos = unserialize(urldecode($this->todos_arquivos));
         foreach ($this->todos_arquivos as $id => $caminho) {
             $continua = "true";
             $novo_caminho = "pdf/" . $caminho[1];
             copy($caminho[0], $novo_caminho);
             unlink($caminho[0]);
             $sql = "INSERT INTO jor_arquivo  (jor_arquivo,ref_cod_jor_edicao, jor_caminho) VALUES ({$temp}, {$last_id} , '{$novo_caminho}')";
             $db->Consulta($sql);
             $temp++;
         }
         echo "<script>document.location = 'jornal_lst.php';</script>";
     } else {
         return false;
     }
 }
Exemplo n.º 4
0
 function Novo()
 {
     @session_start();
     $this->pessoa_logada = $_SESSION['id_pessoa'];
     session_write_close();
     $campos = "";
     $values = "";
     $db = new clsBanco();
     if ($this->nm_agenda) {
         if (is_string($this->nm_agencia)) {
             $campos .= ", nm_agencia";
             $values .= ", '{$this->nm_agencia}'";
         }
         if (is_numeric($this->dono)) {
             if ($this->dono) {
                 $campos .= ", ref_ref_cod_pessoa_own";
                 $values .= ", '{$this->dono}'";
             } else {
                 $campos .= ", ref_ref_cod_pessoa_own";
                 $values .= ", NULL";
             }
         }
         if (is_numeric($this->publica)) {
             $campos .= ", publica";
             $values .= ", '{$this->publica}'";
         }
         if (is_numeric($this->envia_alerta)) {
             $campos .= ", envia_alerta";
             $values .= ", '{$this->envia_alerta}'";
         }
         $db->Consulta("INSERT INTO portal.agenda( ref_ref_cod_pessoa_cad, data_cad, nm_agenda {$campos}) VALUES( '{$this->pessoa_logada}', NOW(), '{$this->nm_agenda}' {$values})");
         $id_agenda = $db->insertId("portal.agenda_cod_agenda_seq");
         $db->Consulta("INSERT INTO portal.agenda_responsavel( ref_ref_cod_pessoa_fj, ref_cod_agenda ) VALUES( '{$this->pessoa_logada}', '{$id_agenda}' )");
         header("location: agenda_admin_lst.php");
         die;
         return true;
     } else {
         return false;
     }
 }