예제 #1
0
 public function Atualizar($documento, $file_atual)
 {
     try {
         // preparo a query de update ��� Prepare Statement
         $stmt = $this->p->prepare("UPDATE " . MYSQL_BASE_TRADUCAO_ARQUIVOS . " SET nome=?, id_disciplina=?, id_obra=?, arquivo=?, id_usuario=?, editado=NOW() WHERE id=?");
         $this->p->beginTransaction();
         $stmt->bindValue(1, $documento->getNome());
         $stmt->bindValue(2, $documento->getDisciplina());
         $stmt->bindValue(3, $documento->getObra());
         $stmt->bindValue(4, $file_atual);
         $stmt->bindValue(5, userId());
         $stmt->bindValue(6, $documento->getId());
         // executo a query preparada e verificando se ocorreu bem.
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             $this->p->commit();
             return 1;
         }
         // fecho a conex���o
         $this->p->__destruct();
     } catch (PDOException $ex) {
         echo "Erro: " . $ex->getMessage();
     }
 }
예제 #2
0
 public function CriarUpload($id_lista, $titulo, $file, $grupo)
 {
     $uploadDir = '../../arquivos/remessa/';
     $name = $file['name'];
     $uploadFile = $uploadDir . $name;
     //Fazer o Upload do arquivo
     if (move_uploaded_file($file['tmp_name'], $uploadFile)) {
         $this->p->beginTransaction();
         //Inserindo o nome do arquivo na base de dados
         $query = "INSERT INTO " . MYSQL_BASE_REMESSA_ARQUIVOS . " (id, id_remessa_lista, titulo, id_usuario, criado, file, status, grupo)";
         $query .= " VALUES (NULL, ?, ?, ?, NOW(), ?, 'S', ?)";
         $stmt = $this->p->prepare($query);
         //$this->p->beginTransaction();
         $stmt->bindValue(1, $id_lista);
         $stmt->bindValue(2, $titulo);
         $stmt->bindValue(3, userId());
         $stmt->bindValue(4, $name);
         $stmt->bindValue(5, $grupo);
         // executo a query preparada e verificando se ocorreu bem.
         if (!$stmt->execute()) {
             return false;
         } else {
             $this->p->commit();
             return true;
         }
         $this->p->__destruct();
     } else {
         echo '<script language= "JavaScript">alert("Erro");</script>';
     }
 }
예제 #3
0
 public function Atualizar($pagamento)
 {
     try {
         // preparo a query de update � Prepare Statement
         $stmt = $this->p->prepare("UPDATE " . MYSQL_BASE_FINANCEIRO_PAGAMENTO . " \r\n\tSET cmat_real=?, vetec_real=?, cmat_iene=?, vetec_iene=?, cmat_fiscal=?, vetec_fiscal=?, cmat_pgmt=?, vetec_pgmt=?, chodai_iene=?, yec_iene=?, chodai_invoice=?, yec_invoice=?, id_taxa=?, editado=NOW(), id_usuario=? \r\n\t\t\t\t\t\t\t\t\t\tWHERE id=?");
         $this->p->beginTransaction();
         $stmt->bindValue(1, $pagamento->getCmat_real());
         $stmt->bindValue(2, $pagamento->getVetec_real());
         $stmt->bindValue(3, $pagamento->getCmat_iene());
         $stmt->bindValue(4, $pagamento->getVetec_iene());
         $stmt->bindValue(5, $pagamento->getCmat_fiscal());
         $stmt->bindValue(6, $pagamento->getVetec_fiscal());
         $stmt->bindValue(7, $pagamento->getCmat_pgmt());
         $stmt->bindValue(8, $pagamento->getVetec_pgmt());
         $stmt->bindValue(9, $pagamento->getChodai_iene());
         $stmt->bindValue(10, $pagamento->getYec_iene());
         $stmt->bindValue(11, $pagamento->getChodai_invoice());
         $stmt->bindValue(12, $pagamento->getYec_invoice());
         $stmt->bindValue(13, $pagamento->getTaxa());
         $stmt->bindValue(14, userId());
         $stmt->bindValue(15, $pagamento->getId());
         // executo a query preparada e verificando se ocorreu bem.
         if (!$stmt->execute()) {
             return false;
         } else {
             $this->p->commit();
             return true;
         }
         // fecho a conex�o
         $this->p->__destruct();
     } catch (PDOException $ex) {
         echo "Erro: " . $ex->getMessage();
     }
 }
예제 #4
0
 public function Gravar($desembolso)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_FINANCEIRO_DESEMBOLSO . " (id, credito_ienes_1, credito_ienes_2, chodai_iss, yec_iss, concremat_iss, vetec_iss, id_taxa, criado, status, id_usuario) ";
         $query .= "VALUES (NULL, ?, ?, ?, ?, ?, ?, ?, NOW(), 'S', ?)";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $desembolso->getCre_1_y());
         $stmt->bindValue(2, $desembolso->getCre_2_y());
         $stmt->bindValue(3, $desembolso->getCho_i_5());
         $stmt->bindValue(4, $desembolso->getYac_i_5());
         $stmt->bindValue(5, $desembolso->getCon_i_5());
         $stmt->bindValue(6, $desembolso->getVet_i_5());
         $stmt->bindValue(7, $desembolso->getTaxa());
         $stmt->bindValue(8, userId());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return true;
         }
         // fecho a conex�o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #5
0
function showPosts($dbCon)
{
    $uId = userId();
    //User Id Function from helpers
    $userName = userName();
    //Username Function from helpers
    //Select by DESC Time
    $sql = "SELECT * FROM posts WHERE u_id = '{$uId}' ORDER BY p_time DESC ";
    $result = $dbCon->query($sql);
    if (!$result) {
        die('Query failed: ' . $dbCon->error);
    }
    $userPost = array();
    while ($temp = $result->fetch_assoc()) {
        if ($temp['p_post']) {
            //Check if post is not empty
            $dateTime = date("H:i d/m/y", strtotime(str_replace('/', '-', $temp['p_time'])));
            echo '  <div class="post">
                    <div class="userTime">
                    <p class="userName">' . $userName . '</p>
                    <p class="pull-right">' . $dateTime . '</p>
                    </div>
                    <div class="postText">' . $temp['p_post'] . '</div>
                    </div>';
            $userPost[] = array('post' => $temp['p_post'], 'time' => $temp['p_time']);
        }
    }
}
 public function updateUser()
 {
     $user = User::find(userId());
     $user->displayName = Input::get('displayName', $user->displayName);
     $user->email = Input::get('email', $user->email);
     $user->save();
     $token = $this->createToken($user);
     return Response::json(array('token' => $token));
 }
예제 #7
0
function userArrRefresh($dbCon)
{
    $uId = userId();
    $sql = "SELECT * FROM users \n                        WHERE u_id ='{$uId}' LIMIT 1";
    $result = $dbCon->query($sql);
    if (!$result) {
        die('Query failed: ' . $dbCon->error);
    }
    $userArr = $result->fetch_assoc();
    $_SESSION['loggedUser'] = $userArr;
}
 public function store()
 {
     $job = new Job();
     $job->heading = Input::get('heading');
     $job->description = Input::get('description');
     $job->user_id = userId();
     $job->salary_max = Input::get('salary_max');
     $job->salary_min = Input::get('salary_min');
     $job->start_date = Input::get('start_date');
     $job->end_date = Input::get('end_date');
     $job->state = Input::get('state');
     $job->suburb = Input::get('suburb');
     $update = $job->save();
     return Response::json(['data' => $job], 200);
 }
예제 #9
0
파일: pro.php 프로젝트: shaugier/lloogg
function reqUserId()
{
    global $_COOKIE;
    $r = redisLink();
    if (!isset($_COOKIE['requser'])) {
        return userId();
    }
    $username = $_COOKIE['requser'];
    if (($id = getIdFromUsername($username)) == -1) {
        return userId();
    }
    if ($r->sismember("uid:{$id}:allowing", userId())) {
        return $id;
    } else {
        return userId();
    }
}
예제 #10
0
 function gravaTrimestre()
 {
     connectSQL();
     $query = mysql_query("SELECT * FROM " . MYSQL_BASE_MEDICAO . " WHERE finalizado = 'S' AND esta_trimestre = 'N' ORDER BY id ASC LIMIT 3");
     if (mysql_num_rows($query) == 3) {
         $q1 = "INSERT INTO " . MYSQL_BASE_MEDICAO_TRIMESTRE . " VALUES (NULL";
         while ($row = mysql_fetch_array($query)) {
             $q1 .= ", " . $row['id'];
             mysql_query("UPDATE " . MYSQL_BASE_MEDICAO . " SET esta_trimestre = 'S' WHERE id=" . $row['id']);
         }
         $q1 .= ", 'S', NOW(), NOW(), " . userId() . ")";
         $resultado = mysql_query($q1);
         $lastId = mysql_insert_id();
         $user = userId();
         mysql_query("INSERT INTO " . MYSQL_BASE_MEDICAO_TRIMESTRE_EMPRESA . " (id, id_medicao_trimestre, id_empresa, criado, status, id_usuario) VALUES \r\n\t\t\t\t\t(NULL, " . $lastId . ", 1, NOW(), 'S', " . $user . ")");
         mysql_query("INSERT INTO " . MYSQL_BASE_MEDICAO_TRIMESTRE_EMPRESA . " (id, id_medicao_trimestre, id_empresa, criado, status, id_usuario) VALUES\r\n\t\t\t\t\t(NULL, " . $lastId . ", 3, NOW(), 'S', " . $user . ")");
         mysql_query("INSERT INTO " . MYSQL_BASE_MEDICAO_TRIMESTRE_EMPRESA . " (id, id_medicao_trimestre, id_empresa, criado, status, id_usuario) VALUES \r\n\t\t\t\t\t(NULL, " . $lastId . ", 5, NOW(), 'S', " . $user . ")");
         mysql_query("INSERT INTO " . MYSQL_BASE_MEDICAO_TRIMESTRE_EMPRESA . " (id, id_medicao_trimestre, id_empresa, criado, status, id_usuario) VALUES \r\n\t\t\t\t\t(NULL, " . $lastId . ", 6, NOW(), 'S', " . $user . ")");
     }
 }
예제 #11
0
파일: CartaDAO.php 프로젝트: hexti/troncal
 public function GravarGRD($carta, $grd)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_CARTA_GRD . " (id, id_carta, id_grd, id_usuario, criado)";
         $query .= "VALUES (NULL, ?, ?, ?, NOW())";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $carta);
         $stmt->bindValue(2, $grd);
         $stmt->bindValue(3, userId());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return 1;
         }
         // fecho a conex���o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #12
0
 public function GravarGrupoPessoa($grupo, $pessoa)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_PROJETO_GRUPO_PESSOA . " (id, id_projeto_grupo, id_pessoa, criado, status, id_usuario)";
         $query .= "VALUES (NULL, ?, ?, NOW(), 'S', ?)";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $grupo);
         $stmt->bindValue(2, $pessoa);
         $stmt->bindValue(3, userId());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return 1;
         }
         // fecho a conex�o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #13
0
 public function Gravar($responsavel)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_RESPONSAVEIS . " (id, id_usuario, id_pessoa, id_setor, dat_criado ) ";
         $query .= "VALUES (NULL, ?, ?, ?, NOW())";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, userId());
         $stmt->bindValue(2, $responsavel->getResponsavel());
         $stmt->bindValue(3, $responsavel->getSetor());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return true;
         }
         // fecho a conex�o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #14
0
 public function Gravar($medicaoAcesso)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_MEDICAO_LIBERACAO . " (id, id_medicao, id_pessoa, status, criado, finalizado, id_usuario)";
         $query .= "VALUES (NULL, ?, ?, 'S', NOW(), '0000-00-00 00:00:00', ?)";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $medicaoAcesso->getMedicao());
         $stmt->bindValue(2, $medicaoAcesso->getPessoa());
         $stmt->bindValue(3, userId());
         if (!$stmt->execute()) {
             return false;
         } else {
             return $this->p->lastInsertId();
         }
         // fecho a conex������o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #15
0
 public function Gravar($produto)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_MEDICAO_PRODUTO . " (nome, nome_eng, id_usuario) ";
         $query .= "VALUES (?, ?, ?)";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $produto->getNome());
         $stmt->bindValue(2, $produto->getNomeEng());
         $stmt->bindValue(3, userId());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return 1;
         }
         // fecho a conex���o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #16
0
function showPosts($dbCon)
{
    $uId = userId();
    //User Id Function from helpers
    $userName = userName();
    //Username Function from helpers
    //Select by DESC Time
    $sql = "SELECT * FROM posts WHERE u_id = '{$uId}' ORDER BY p_time DESC";
    $result = $dbCon->query($sql);
    if (!$result) {
        die('Query failed: ' . $dbCon->error);
    }
    $userPost = array();
    while ($temp = $result->fetch_assoc()) {
        if ($temp['p_post']) {
            //Check if post is not empty
            $dateTime = date("H:i d/m/y", strtotime(str_replace('/', '-', $temp['p_time'])));
            $post = '    <div class="panel panel-default post" id="' . $temp['p_uniqid'] . '">
                        <div class="panel-heading">
                        
                        <div class="dropdown pull-right">
                            <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                <span class="caret"></span>
                            </button>
                            <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                                <li><a href="#" class="editPost">Edit</a></li>
                                <li><a href="#" class="deletePost">Delete</a></li>
                            </ul>
                        </div>
                        <a href="#" class="pull-right datePost">' . $dateTime . '</a> <h4>' . $userName . '</h4></div>
                        <div class="panel-body"><p class="postText">' . $temp['p_post'] . '</p>
                             <hr>
                            </form>
                            </div> 
                    </div>';
            echo $post;
            $userPost[] = array('post' => $post);
        }
    }
}
예제 #17
0
 public function Gravar($pedidoInformacao)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_PEDIDO_INFORMACAO . " (id, id_responsavel, assunto, id_usuario, criado, status, id_empresa) ";
         $query .= "VALUES (NULL, ?, ?, ?, NOW(), 'S', ?)";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $pedidoInformacao->getResponsavel());
         $stmt->bindValue(2, $pedidoInformacao->getAssunto());
         $stmt->bindValue(3, userId());
         $stmt->bindValue(4, $pedidoInformacao->getEmpresa());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return $this->p->lastInsertId();
         }
         // fecho a conex���o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #18
0
 public function Gravar($grupoFuncionalidade)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_USUARIO_GRUPOS . " (id, id_pessoa, id_grupo, id_funcionalidade, criado, id_usuario, ativo) ";
         $query .= "VALUES (NULL, ?, ?, ?, NOW(), ?, 'S')";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $grupoFuncionalidade->getPessoa());
         $stmt->bindValue(2, $grupoFuncionalidade->getIdGrupo());
         $stmt->bindValue(3, $grupoFuncionalidade->getIdFuncionalidade());
         $stmt->bindValue(4, userId());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return true;
         }
         // fecho a conex�o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #19
0
 public function Gravar($documento, $file, $file_ing)
 {
     $uploadDir = '../../arquivos/plano_trabalho/';
     $name = sha1(date("d-m-Y H:i:s"));
     $uploadFile = $uploadDir . $name;
     $extension = pathinfo($file['name'], PATHINFO_EXTENSION);
     $uploadFile = $uploadFile . '.' . $extension;
     $name = $name . '.' . $extension;
     $name_ing = sha1(date("d-m-Y H:i:s") . "_ing");
     $uploadFile_ing = $uploadDir . $name_ing;
     $extension = pathinfo($file_ing['name'], PATHINFO_EXTENSION);
     $uploadFile_ing = $uploadFile_ing . '.' . $extension;
     $name_ing = $name_ing . '.' . $extension;
     try {
         if (move_uploaded_file($file['tmp_name'], $uploadFile) && move_uploaded_file($file_ing['tmp_name'], $uploadFile_ing)) {
             $query = "INSERT INTO " . MYSQL_BASE_PLANO_TRABALHO . " (id, data, versao, file, file_ing, status, dat_criado, id_usuario)";
             $query .= " VALUES (NULL, ?, ?, ?, ?, 'S', NOW(), ?)";
             $stmt = $this->p->prepare($query);
             $stmt->bindValue(1, $documento->getData());
             $stmt->bindValue(2, $documento->getVersao());
             $stmt->bindValue(3, $name);
             $stmt->bindValue(4, $name_ing);
             $stmt->bindValue(5, userId());
             if (!$stmt->execute()) {
                 return $stmt->errorInfo();
             } else {
                 return 1;
             }
         } else {
             echo '<script language= "JavaScript">alert("Erro");</script>';
         }
         // fecho a conex���o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #20
0
파일: BancoDAO.php 프로젝트: hexti/troncal
 public function Gravar($banco)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_FINANCEIRO_BANCO_CONTA . " (id, agencia, agencia_digito, conta, conta_digito, criado, editado, status, id_usuario) ";
         $query .= "VALUES (NULL, ?, ?, ?, ?, NOW(), NOW(), 'S', ?)";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $banco->getAgencia());
         $stmt->bindValue(2, $banco->getAgenciaDigito());
         $stmt->bindValue(3, $banco->getConta());
         $stmt->bindValue(4, $banco->getContaDigito());
         $stmt->bindValue(5, userId());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return true;
         }
         // fecho a conex�o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #21
0
 public function Gravar($trimestre)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_MEDICAO_TRIMESTRE . " (id, id_medicao1, id_medicao2, id_medicao3, status, criado, editado, id_usuario)";
         $query .= "VALUES (NULL, ?, ?, ?, 'S', NOW(), NOW(), ?)";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $trimestre->getMedicao1());
         $stmt->bindValue(2, $trimestre->getMedicao2());
         $stmt->bindValue(3, $trimestre->getMedicao3());
         $stmt->bindValue(4, $trimestre->getMedicao4());
         $stmt->bindValue(5, userId());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return true;
         }
         // fecho a conex������������o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #22
0
 public function Aprovacao($anexoItem)
 {
     try {
         // preparo a query de update ������������ Prepare Statement
         $stmt = $this->p->prepare("UPDATE " . MYSQL_BASE_MEDICAO_ANEXO_ITENS . " SET consideracao_supervisor=?, status = ?, dat_aprovado=NOW(), id_superior=? WHERE id=?");
         $this->p->beginTransaction();
         $stmt->bindValue(1, $anexoItem->getDescricao());
         $stmt->bindValue(2, $anexoItem->getStatus());
         $stmt->bindValue(3, userId());
         $stmt->bindValue(4, $anexoItem->getId());
         // executo a query preparada e verificando se ocorreu bem.
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             $this->p->commit();
             return true;
         }
         // fecho a conex������������o
         $this->p->__destruct();
     } catch (PDOException $ex) {
         echo "Erro: " . $ex->getMessage();
     }
 }
예제 #23
0
 public function Atualizar($reajuste)
 {
     try {
         // preparo a query de update ��� Prepare Statement
         $stmt = $this->p->prepare("UPDATE " . MYSQL_BASE_MEDICAO_REAJUSTE . " SET inicio=?, fim=?, reajuste=?, id_usuario=? WHERE id=?");
         $this->p->beginTransaction();
         $stmt->bindValue(1, $reajuste->getInicio());
         $stmt->bindValue(2, $reajuste->getFim());
         $stmt->bindValue(3, $reajuste->getReajuste());
         $stmt->bindValue(4, userId());
         $stmt->bindValue(5, $reajuste->getId());
         // executo a query preparada e verificando se ocorreu bem.
         if (!$stmt->execute()) {
             return false;
         } else {
             $this->p->commit();
             return true;
         }
         // fecho a conex���o
         $this->p->__destruct();
     } catch (PDOException $ex) {
         echo "Erro: " . $ex->getMessage();
     }
 }
예제 #24
0
파일: TaxaDAO.php 프로젝트: hexti/troncal
 public function Gravar($taxa)
 {
     try {
         $query = "INSERT INTO " . MYSQL_BASE_FINANCEIRO_TAXA . " (id, taxa_ptax_d2, taxa_casada_iene, taxa_usd1, taxa_usd2, criado, editado, status, id_usuario, data) ";
         $query .= "VALUES (NULL, ?, ?, ?, ?, NOW(), NOW(), 'S', ?, ?)";
         $stmt = $this->p->prepare($query);
         $stmt->bindValue(1, $taxa->getTaxaPTAX());
         $stmt->bindValue(2, $taxa->getTaxaCasadaIene());
         $stmt->bindValue(3, $taxa->getTaxaUSD1());
         $stmt->bindValue(4, $taxa->getTaxaUSD2());
         $stmt->bindValue(5, userId());
         $stmt->bindValue(6, $taxa->getData());
         if (!$stmt->execute()) {
             return $stmt->errorInfo();
         } else {
             return true;
         }
         // fecho a conex�o
         $this->p->__destruct();
         // caso ocorra um erro, retorna o erro;
     } catch (PDOException $ex) {
         echo "Mensagem de erro: " . $ex->getMessage();
     }
 }
예제 #25
0
파일: new.php 프로젝트: hexti/troncal
include_once '../../includes.sys/metodos.php';
include_once '../DAO/TrechoDAO.php';
include_once '../Trecho.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(120, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/projeto/documentos/fase_projeto.php";</script>';
}
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $trecho = new Trecho();
    $DAO = new TrechoDAO();
    $trecho->setNome(limpaTexto($_POST['nome']));
    $trecho->setCodigo(strtoupper(limpaTexto($_POST['codigo'])));
    $trecho->setUsuario(userId());
    //Verifica se o nome foi preenchido
    if ($trecho->getCodigo() != "") {
        if ($trecho->getNome() != "" && $trecho->getCodigo() != "") {
            $retorno = $DAO->Gravar($trecho);
            if ($retorno == true) {
                echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
                echo '<script language= "JavaScript">location.href="new.php";</script>';
            }
        } else {
            echo '<script language= "JavaScript">alert("Preencha o(s) campo(s)");</script>';
        }
    } else {
        $msg = utf8_encode("O Código deve ser informado");
        echo '<script language= "JavaScript">alert("' . $msg . '");</script>';
    }
예제 #26
0
파일: new.php 프로젝트: hexti/troncal
include_once '../../includes.sys/ini.php';
include_once INTERNAL_ROOT_PORTAL . '/includes.sys/metodos.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/DAO/NaoReembolsavelDAO.php';
include_once INTERNAL_ROOT_PORTAL . '/medicao/NaoReembolsavel.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once INTERNAL_ROOT_PORTAL . '/head.php';
if (!in_array(269, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/modulos.php";</script>';
}
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'salvar') {
    $DAO = new NaoReembolsavelDAO();
    $naoreembolsavel = new NaoReembolsavel();
    $naoreembolsavel->setNome($_POST['nome']);
    $naoreembolsavel->setUsuario(userId());
    $resultado = $DAO->Gravar($naoreembolsavel);
    if ($resultado == 1) {
        echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="index.php";</script>';
    } else {
        echo '<script language= "JavaScript">alert("Erro ao gravar o registro, favor entrar em contato com a TI.");</script>';
    }
}
?>
<!-- topbar ends -->
<div class="container-fluid">
	<div class="row-fluid">

		<!-- left menu starts -->
		<div class="span2 main-menu-span">
예제 #27
0
파일: new.php 프로젝트: hexti/adv
<?php

include_once '../head.php';
include_once '../includes.sys/faxada.class.php';
if (!empty($_POST) && $_POST['cmd'] == 'salvar') {
    $faxada = new Faxada();
    $data = array('nome' => $_POST['nome'], 'id_usuario' => userId());
    $retorno = $faxada->salvar(MYSQL_BASE_AREAS, $data);
    if ($retorno['validacao'] == 1) {
        echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="new.php";</script>';
    } else {
        echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
    }
}
?>

<div class="container">

	<!-- Main component for a primary marketing message or call to action -->
	<div class="table-responsive">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h4>Cadastro de Área </h4>
			</div>
			<div class="panel-body">
				<form action="new.php" method="post">
					<div class="form-group">
						<label for="exampleInputEmail1">Nome</label> 
						<input type="text" class="form-control" id="exampleInputEmail1" placeholder="Nome" name="nome" required="required">
					</div>
예제 #28
0
파일: new.php 프로젝트: hexti/troncal
include_once '../DAO/ResponsavelDisciplinaDAO.php';
include_once '../ResponsavelDisciplina.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
$acesso = listarAcesso();
if (!in_array(258, $acesso)) {
    echo '<script language= "JavaScript">location.href="' . EXTERNAL_ROOT_PORTAL . '/projeto/documentos/fase_projeto.php";</script>';
}
$disciplina = new Disciplina();
$DAO = new DisciplinaDAO();
//Verifica se a opcao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $disciplina->setDisciplina(limpaTexto($_POST['disciplina']));
    $disciplina->setVerificador(strtoupper(limpaTexto($_POST['responsavel'])));
    $disciplina->setAprovadorVerificador($_POST['aprovador_1']);
    $disciplina->setUsuario(userId());
    //Verifica se o nome foi preenchido
    if ($disciplina->getDisciplina() == 0 || $disciplina->getVerificador() == 0) {
        $msg = utf8_encode("Preencha todos os campos!");
        echo '<script language= "JavaScript">alert("' . $msg . '");</script>';
    } else {
        foreach ($disciplina->getDisciplina() as $produto => $value) {
            $retorno = $DAO->Gravar($disciplina, $value);
        }
        if ($retorno == 1) {
            echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
            echo '<script language= "JavaScript">location.href="new.php";</script>';
        } else {
            $msg = utf8_encode("Erro ao salvar!");
            echo '<script language= "JavaScript">alert("' . $msg . '");</script>';
        }
예제 #29
0
파일: new.php 프로젝트: hexti/troncal
include_once '../../includes.sys/ini.php';
include_once '../../includes.sys/metodos.php';
include_once '../DAO/MaoDeObraDAO.php';
include_once '../MaoDeObra.class.php';
checkUserAuth(EXTERNAL_ROOT_PORTAL . '/index.php?error=true');
include_once '../../head.php';
if (!in_array(294, listarAcesso())) {
    echo '<script language= "JavaScript">location.href="index.php";</script>';
}
$mao_de_obra = new MaoDeObra();
$DAO = new MaoDeObraDAO();
//Verifica se a acao de salvar foi iniciada
if (!empty($_POST['cmd']) && $_POST['cmd'] == 'inserir') {
    $mao_de_obra->setNome(limpaTexto($_POST['nome']));
    $mao_de_obra->setTipo($_POST['mao_de_obra']);
    $mao_de_obra->setIdUsuario(userId());
    $resultado = $DAO->Gravar($mao_de_obra);
    if ($resultado == 1) {
        echo '<script language= "JavaScript">alert("Registro cadastrado com sucesso");</script>';
        echo '<script language= "JavaScript">location.href="new.php";</script>';
    } else {
        echo '<script language= "JavaScript">alert("Erro ao cadastrar o documento");</script>';
    }
}
?>
<!-- topbar ends -->
<div class="container-fluid">
	<div class="row-fluid"> 

		<!-- left menu starts -->
		<div class="span2 main-menu-span">
예제 #30
0
파일: metodos.php 프로젝트: hexti/casamento
function isUserNTGM()
{
    connectSQL();
    // 	$query = mysql_query("SELECT g.id FROM ".MYSQL_BASE_USUARIO_GRUPOS." ug, ".MYSQL_BASE_GRUPOS." g WHERE g.id=ug.id_grupo AND (g.nome LIKE '%NTGM%' OR g.nome LIKE '%NGTM%') AND ug.ativo = 'S' AND ug.id_pessoa=".userId());
    $query = mysql_query("SELECT B.id_empresa \r\n\t\t\t\t\t\t\tFROM tb_pessoa A \r\n\t\t\t\t\t\t\tINNER JOIN tb_cargo B ON B.id = A.id_cargo\r\n\t\t\t\t\t\tWHERE B.id_empresa = 7 AND A.id = " . userId());
    if (mysql_num_rows($query) > 0) {
        return true;
    } else {
        return false;
    }
}