当前位置: 首页>>代码示例>>PHP>>正文


PHP userId函数代码示例

本文整理汇总了PHP中userId函数的典型用法代码示例。如果您正苦于以下问题:PHP userId函数的具体用法?PHP userId怎么用?PHP userId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了userId函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: Atualizar

 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();
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:25,代码来源:DocumentoDAO.php

示例2: CriarUpload

 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>';
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:30,代码来源:Doc_PendenteDAO.php

示例3: Atualizar

 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();
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:34,代码来源:PagamentoDAO.php

示例4: Gravar

 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();
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:26,代码来源:DesembolsoDAO.php

示例5: showPosts

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']);
        }
    }
}
开发者ID:valeri4,项目名称:semiProject,代码行数:28,代码来源:showPosts.php

示例6: updateUser

 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));
 }
开发者ID:paulstefanday,项目名称:HumbleCommunity,代码行数:9,代码来源:UserController.php

示例7: userArrRefresh

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;
}
开发者ID:valeri4,项目名称:semiProject,代码行数:11,代码来源:helpers.php

示例8: store

 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);
 }
开发者ID:paulstefanday,项目名称:HumbleCommunity,代码行数:15,代码来源:JobsController.php

示例9: reqUserId

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();
    }
}
开发者ID:shaugier,项目名称:lloogg,代码行数:17,代码来源:pro.php

示例10: gravaTrimestre

 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 . ")");
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:20,代码来源:Trimestre.class.php

示例11: GravarGRD

 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();
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:21,代码来源:CartaDAO.php

示例12: GravarGrupoPessoa

 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();
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:21,代码来源:GrupoPessoaDAO.php

示例13: Gravar

 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();
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:21,代码来源:ResponsavelDAO.php

示例14: Gravar

 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();
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:21,代码来源:MedicaoAcessoDAO.php

示例15: Gravar

 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();
     }
 }
开发者ID:hexti,项目名称:troncal,代码行数:21,代码来源:ProdutoDAO.php


注:本文中的userId函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。