Skip to content

Commit

Permalink
13-10-19
Browse files Browse the repository at this point in the history
  • Loading branch information
NBO2001 committed Oct 13, 2019
1 parent d6ac8e8 commit 061150f
Show file tree
Hide file tree
Showing 12 changed files with 54,479 additions and 21 deletions.
12 changes: 12 additions & 0 deletions Classes/Alunos.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,17 @@ function pesquisa_banco2($id){
}
function exibir(){
if($this->cont == 1){

$loc = substr($this->Num_mat, 0,3);
$data=date('Y')-11;
$rest = substr($data, 0,1).substr($data, 2,2);

if($loc<=$rest){
$loc = "PASTA FÍSICA LOCALIZADA NO ARQUIVO SUL";
}else{
$loc = "PASTA FÍSICA LOCALIZADA NO ARQUIVO NORTE";
}

echo "<div id='dadosal'>
<label style='color:#FE642E;' >Nome civil: &nbsp</label>
<label> $this->Nome_civil </label><br>
Expand All @@ -111,6 +122,7 @@ function exibir(){
<label>$this->Aev&nbsp&nbsp | &nbsp</label>
<label style='color:#FE642E';>Dados retirados do: &nbsp</label>
<label>$this->sistema</label><br>
<label style='font-size: 11px;'>$loc</label>
</div>";
}else{
echo "<script>window.location.href='psq_nome.php?nun=$this->matricula'</script>";
Expand Down
4 changes: 2 additions & 2 deletions chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
$res = $resubank['uso'].":".$resubank['msg'];
$res = explode('#',$res);
if(isset($res[1])){
$kval ="*".$res[1];
$res ="<a href='redir_mesn.php?texto=$kval'>". $resubank['uso'].":".$resubank['msg']."</a></n>";
$kval =$res[1];
$res ="<a href='pg_res_pes_mat.php?matri=$kval'>". $resubank['uso'].":".$resubank['msg']."</a></n>";
}else{
$res = $resubank['uso'].":".$resubank['msg']."<br>";
}
Expand Down
78 changes: 76 additions & 2 deletions css/es.css
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,7 @@ border-radius: 15px;
width: 100%;
margin:0 auto;
border:0;
text-align: left;
top:25px;
box-shadow: 0 5px 30px darkgrey;
border-spacing: 0;
Expand All @@ -722,7 +723,8 @@ border-radius: 15px;
#minhaTabela tr td{
font-size: 20px;
padding:5px 10px;
text-align: center;

text-align: left;

cursor: pointer; /**importante para não mostrar cursor de texto**/
}
Expand Down Expand Up @@ -861,7 +863,7 @@ font-size: 50px;
position: absolute;
text-align: center;
top:230px;
left:10%;
left:0%;
}
#formulario_envia_doc form{
font-size: 25px;
Expand All @@ -876,6 +878,15 @@ font-size: 50px;
border-radius: 25px;
padding: 5px 5px;
}
#formulario_envia_doc button{
width:90%;
height:40px;
font-size: 20px;
text-align: center;
border: 1px solid black;
border-radius: 25px;
padding: 5px 5px;
}
#formulario_envia_doc select{
width:90%;
height:50px;
Expand Down Expand Up @@ -957,6 +968,69 @@ padding: 5px 5px;



}
#upload-button {
width: 150px;
display: block;
margin: 20px auto;
}

#file-to-upload {
display: none;
}



#pdf-loader {
display: none;
text-align: center;
color: #999999;
font-size: 13px;
line-height: 100px;
height: 100px;
}

#pdf-contents {
display: none;
}

#pdf-meta {
overflow: hidden;
margin: 0 0 20px 0;
}
#page-count-container {
float: right;
}

#pdf-current-page {
display: inline;
}

#pdf-total-pages {
display: inline;
}

#pdf-canvas {
border: 1px solid rgba(0,0,0,0.2);
box-sizing: border-box;
position: absolute;
left: 0%;
}

#page-loader {
height: 100px;
line-height: 100px;
text-align: center;
display: none;
color: #999999;
font-size: 13px;
}
#pdf-main-container {
position: absolute;
left:830px;
top:0px;
width: 500px;
margin: 20px auto;
}

@media (max-width: 1000px) {
Expand Down
143 changes: 135 additions & 8 deletions enviar.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,20 @@
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="css/es.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="pdf.js"></script>
<script src="pdf.worker.js"></script>

<?php
if($_COOKIE["tema"] <> "a"){
echo "<link rel='stylesheet' type='text/css' href='css/$tema.css'>";
}

?>
<style type="text/css">


</style>
<title>Inserir</title>
<link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
</head>
Expand Down Expand Up @@ -88,11 +96,9 @@
</div>

<div id="formulario_envia_doc">

<button id="upload-button">Selecione o arquivo pdf</button>
<form method="Post" action="envia_banco.php" enctype="multipart/form-data">
<label>Selecione o arquivo:</label><br><br>
<input id="arq" type="file" name="pdf" required><br><br>

<input id="file-to-upload" type="file" accept="application/pdf" name="pdf" required>
<label>Tipo de documento:</label><br><br>
<select name="sele">
<option>Ficha Cadastral</option>
Expand All @@ -102,6 +108,7 @@
<option>Histórico Escolar</option>
<option>Outro tipo de Ficha</option>
<option>Ofício</option>
<option>Formulário de correção de notas e faltas</option>
</select><br><br>

<label>Classificação do documento:&nbsp;</label><br><br>
Expand All @@ -113,14 +120,28 @@


<label>Ano do documento:&nbsp;</label><br><br>
<input id="ano" name="ano" value="<?php $data=date('Y-m-d');$par = explode('-',$data); echo $par[0]; ?>" type="number" min="1900" max="<?php $data=date('Y-m-d');$par = explode('-',$data); echo $par[0]; ?>" required>
<input id="ano" name="ano" value="<?php $data=date('Y'); echo $data ?>" type="number" min="1900" max="<?php echo $data; ?>" required>

<br><br><input name="sand" type="submit" value="Cadastrar">

</form>
<form action="pg_res_pes_mat.php">
<input name="sand" type="submit" value="Voltar">
</form>


<div id="pdf-main-container">
<div id="pdf-loader">Carregando documento ...</div>
<div id="pdf-contents">
<div id="pdf-meta">
<div id="pdf-buttons">
<button id="pdf-prev">Voltar</button><br><br>
<button id="pdf-next">Avançar</button>
</div>
</div>
<canvas id="pdf-canvas" width="500"></canvas>
<div id="page-loader">Carregando pagina ...</div>
</div>
</div>

<button onclick="window.location.href='pg_res_pes_mat.php?alid=<?php echo $id;?>'">Voltar</button><br><br>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
Expand All @@ -131,6 +152,112 @@
source: 'proc_pesq_msg.php'
});
});
</script>
<script>

var __PDF_DOC,
__CURRENT_PAGE,
__TOTAL_PAGES,
__PAGE_RENDERING_IN_PROGRESS = 0,
__CANVAS = $('#pdf-canvas').get(0),
__CANVAS_CTX = __CANVAS.getContext('2d');

function showPDF(pdf_url) {
$("#pdf-loader").show();

PDFJS.getDocument({ url: pdf_url }).then(function(pdf_doc) {
__PDF_DOC = pdf_doc;
__TOTAL_PAGES = __PDF_DOC.numPages;

// Hide the pdf loader and show pdf container in HTML
$("#pdf-loader").hide();
$("#pdf-contents").show();
$("#pdf-total-pages").text(__TOTAL_PAGES);

// Show the first page
showPage(1);
}).catch(function(error) {
// If error re-show the upload button
$("#pdf-loader").hide();
$("#upload-button").show();

alert(error.message);
});;
}

function showPage(page_no) {
__PAGE_RENDERING_IN_PROGRESS = 1;
__CURRENT_PAGE = page_no;

// Disable Prev & Next buttons while page is being loaded
$("#pdf-next, #pdf-prev").attr('disabled', 'disabled');

// While page is being rendered hide the canvas and show a loading message
$("#pdf-canvas").hide();
$("#page-loader").show();

// Update current page in HTML
$("#pdf-current-page").text(page_no);

// Fetch the page
__PDF_DOC.getPage(page_no).then(function(page) {
// As the canvas is of a fixed width we need to set the scale of the viewport accordingly
var scale_required = __CANVAS.width / page.getViewport(1).width;

// Get viewport of the page at required scale
var viewport = page.getViewport(scale_required);

// Set canvas height
__CANVAS.height = viewport.height;

var renderContext = {
canvasContext: __CANVAS_CTX,
viewport: viewport
};

// Render the page contents in the canvas
page.render(renderContext).then(function() {
__PAGE_RENDERING_IN_PROGRESS = 0;

// Re-enable Prev & Next buttons
$("#pdf-next, #pdf-prev").removeAttr('disabled');

// Show the canvas and hide the page loader
$("#pdf-canvas").show();
$("#page-loader").hide();
});
});
}

// Upon click this should should trigger click on the #file-to-upload file input element
// This is better than showing the not-good-looking file input element
$("#upload-button").on('click', function() {
$("#file-to-upload").trigger('click');
});

// When user chooses a PDF file
$("#file-to-upload").on('change', function() {
// Validate whether PDF
if(['application/pdf'].indexOf($("#file-to-upload").get(0).files[0].type) == -1) {
alert('Error : Not a PDF');
return;
}
// Send the object url of the pdf
showPDF(URL.createObjectURL($("#file-to-upload").get(0).files[0]));
});

// Previous page of the PDF
$("#pdf-prev").on('click', function() {
if(__CURRENT_PAGE != 1)
showPage(--__CURRENT_PAGE);
});

// Next page of the PDF
$("#pdf-next").on('click', function() {
if(__CURRENT_PAGE != __TOTAL_PAGES)
showPage(++__CURRENT_PAGE);
});

</script>
</body>
</html>
19 changes: 15 additions & 4 deletions mensa_re.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@
<table style="position:absolute;top:0px;" id='minhaTabela'>
<thead>
<tr>
<th>ID</th>
<th style="display:none;">ID</th>
<th>Setor</th>
<th>Solicitante</th>
<th>Solicitação</th>
<th>Observação</th>
<th>Arquivo</th>

<tr>
</thead>
Expand All @@ -73,15 +74,25 @@
while($row_usuario = mysqli_fetch_array($resultado_usuario)){
?>
<tr>
<td><?php echo $row_usuario['id'];?></td>
<td style="display:none;"><?php echo $row_usuario['id'];?></td>
<td><?php echo $row_usuario['setor']; ?></td>
<td><?php echo $row_usuario['soli']; ?></td>
<td><?php echo $row_usuario['solicitacao']; ?></td>
<td><?php echo $row_usuario['obv']; ?></td>
<td><?php
$solicitacao = $row_usuario['solicitacao'];
$solicitacao = substr($solicitacao, 0,3);
$data=date('Y')-11;
$rest = substr($data, 0,1).substr($data, 2,2);
if($solicitacao<=$rest){
$loc="SUL";
}else{
$loc="NORTE";
}
echo $loc; ?></td>

</tr>
<?php } ?>

</tr>
</tbody>
</table>
</div>
Expand Down
Loading

0 comments on commit 061150f

Please sign in to comment.