Esempio n. 1
0
 public static function getBanco()
 {
     if (!isset($_SESSION['senhaBanco'])) {
         $arquivo = fopen("pass.txt", "r");
         $aux = fscanf($arquivo, "%s\t%s");
         $_SESSION['chave'] = $aux[1];
         $texto = Atalhos::decode($aux[0]);
         $tm = strlen($texto);
         //conta a quantidade de caracteres do texto
         $x = 0;
         $buf = "";
         for ($i = 1; $i <= $tm; $i++) {
             $letra[$i] = substr($texto, $x, 1);
             //isola cada caractere da string
             $cod[$i] = ord($letra[$i]);
             //converte cada caractere em seu respectivo codigo ascii
             $bin[$i] = decbin($cod[$i]);
             //converte cada codigo ascii em seu respectivo codigo binario
             if ($bin[$i] == 0) {
                 break;
             }
             $buf = $buf . $letra[$i];
             $x++;
         }
         $_SESSION['senhaBanco'] = $buf;
     }
     $db = new mysqli('localhost', 'root', $_SESSION['senhaBanco'], 'lcad');
     $db->set_charset("utf8");
     return $db;
 }
Esempio n. 2
0
<?php

//header( "Content-type: image/jpeg");
include 'sessao.php';
$db = Atalhos::getBanco();
if ($query = $db->prepare("SELECT imagem FROM tbImagem WHERE idUser = ?")) {
    $query->bind_param('i', $_GET["idUser"]);
    $query->execute();
    $query->bind_result($imagem);
    if ($query->fetch()) {
        echo $imagem;
    } else {
        echo file_get_contents("img/sem-imagem-avatar.jpg");
    }
    $query->close();
    $db->close();
}
Esempio n. 3
0
				                  <hr>
				                  <strong><i class="fa fa-envelope margin-r-5"></i>  E-mail</strong>
				                  <p class="text-muted">
				                    ' . $email . '
				                  </p>
				                </div><!-- /.box-body -->
				              </div><!-- /.box -->
				            </div><!-- /.col -->';
            break;
        case 2:
            $comite = '<div class="col-md-2">
				              <!-- Profile Image -->
				              <div class="box box-primary">
				                <div class="box-body box-profile">
				                  <img class="profile-user-img img-responsive img-circle" src="getImagem.php?idUser='******'" style="height: 100px;" alt="User profile picture">
				                  <h3 class="profile-username text-center">' . Atalhos::nome($nome) . '</h3>
				                  <p class="text-muted text-center">Membro do Comitê</p>
				                  <hr>
				                  <strong><i class="fa fa-bank margin-r-5"></i>  Centro</strong>
				                  <p class="text-muted">
				                    ' . $nucleo . '
				                  </p>
				                  <hr>
				                  <strong><i class="fa fa-envelope margin-r-5"></i>  E-mail</strong>
				                  <p class="text-muted">
				                    ' . $email . '
				                  </p>
				                </div><!-- /.box-body -->
				              </div><!-- /.box -->
				            </div><!-- /.col -->';
            break;
Esempio n. 4
0
 public static function excluirPubli()
 {
     $db = Atalhos::getBanco();
     if ($query = $db->prepare("DELETE FROM tbPublicacao WHERE idPubli = ?")) {
         $query->bind_param('i', $_POST['req1']);
         $query->execute();
         $query->close();
         $_SESSION['publiExc'] = 1;
     }
     shell_exec('cd publicacoes/ && rm ' . $_POST['req1'] . '.pdf');
 }
Esempio n. 5
0
    ?>
                        <span class="hidden-xs"><?php 
    echo Atalhos::nome($_SESSION['nome']);
    ?>
</span>
                      </a>
                      <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-body">
                          <?php 
    echo "<img height='160' width='160' src='getImagem.php?idUser="******"' class='img-responsive center-block'>";
    ?>
                          <div style="text-align: center;">
                            <strong>
                              <?php 
    echo '<span style="font-size: 12pt;">' . Atalhos::nome($_SESSION['nome']) . '</span>';
    ?>
                            </strong>
                          </div>
                        </li>
                        <!-- Menu Footer-->
                        <li class="user-footer">
                          <div class="pull-left">
                            <a href="/configuracao" class="btn btn-default">Configurações</a>
                          </div>
                          <div class="pull-right">
                            <form action = "post.php" method = "post">
                              <input type="hidden" name="numPost" value="2"><!-- Número correspodente ao post -->
                              <button type="submit" class="btn btn-default">Sair</button>
                            </form>
                          </div>