本文整理汇总了PHP中userId函数的典型用法代码示例。如果您正苦于以下问题:PHP userId函数的具体用法?PHP userId怎么用?PHP userId使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了userId函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: 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'])));
$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);
}
}
}
开发者ID:valeri4,项目名称:semiProjectNew,代码行数:40,代码来源:showPosts.php
示例17: Gravar
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();
}
}
开发者ID:hexti,项目名称:troncal,代码行数:22,代码来源:PedidoInformacaoDAO.php
示例18: Gravar
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();
}
}
开发者ID:hexti,项目名称:troncal,代码行数:22,代码来源:UsuarioGrupoDAO.php
示例19: Gravar
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();
}
}
开发者ID:hexti,项目名称:troncal,代码行数:38,代码来源:PlanoTrabalhoDAO.php
示例20: Gravar
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();
}
}
开发者ID:hexti,项目名称:troncal,代码行数:23,代码来源:BancoDAO.php
注:本文中的userId函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论