Skip to content

Commit

Permalink
Multiplas etiquetas
Browse files Browse the repository at this point in the history
  • Loading branch information
NBO2001 committed Oct 7, 2019
1 parent 1e51088 commit d6ac8e8
Show file tree
Hide file tree
Showing 9 changed files with 353 additions and 69 deletions.
4 changes: 2 additions & 2 deletions Classes/Alunos.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ function getAev(){
function getSistema(){
return $this->sistema;
}
function pesquisa_banco(){
function pesquisa_banco($ma){
$pdo = new PDO( 'mysql:host=localhost;dbname=Al', 'root', '' );
$pdo -> query("SET NAMES UTF8");
$stmt = $pdo->prepare("SELECT *,COUNT(*) FROM Alunos WHERE Num_mat LIKE '$this->matricula%'");
$stmt = $pdo->prepare("SELECT *,COUNT(*) FROM Alunos WHERE Num_mat LIKE '$ma%'");
$stmt->execute(array('id','Cod_cur','Num_mat','Nome_civil','Nome_cur','Fin','Fev','Ain','Aev','sistema','Nome_social','COUNT(*)'));
$resultado = $stmt->fetchAll(PDO::FETCH_ASSOC);
foreach($resultado as $item){
Expand Down
43 changes: 43 additions & 0 deletions Classes/Etiquetas.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php
class Etiquetas{
private $a1,$a2,$a3,$a4,$a5,$a6,$a7,$a8,$res;
function getRes(){
return $this->res;
}
function getA1(){
return $this->a1;
}
function getA2(){
return $this->a2;
}
function getA3(){
return $this->a3;
}
function getA4(){
return $this->a4;
}
function getA5(){
return $this->a5;
}
function getA6(){
return $this->a6;
}
function getA7(){
return $this->a7;
}
function getA8(){
return $this->a8;
}
function etq($curso,$Nome_cur,$Num_mat,$Nome_civil,$Fin,$Ain,$Fev,$Aev,$sistema){
$this->a1 = "<td class='xl72' >$curso</td>
<td class='xl73' >$Nome_cur</td>";
$this->a2 ="<td class='xl74' colspan='2' >$Num_mat</td>";
$this->a3 ="<td class='xl76' colspan='2' >$Nome_civil</td>";
$this->a4 ="<td class='xl78' colspan='2' >$Fin</td>";
$this->a5 ="<td class='xl80' colspan='2' >$Ain</td>";
$this->a6 ="<td class='xl80' colspan='2'>$Fev</td>";
$this->a7 ="<td class='xl80' colspan='2'>$Aev</td>";
$this->a8 ="<td class='xl80' colspan='2'>$sistema</td>";
}
}
?>
111 changes: 47 additions & 64 deletions Etiqueta.html
Original file line number Diff line number Diff line change
@@ -1,76 +1,59 @@
<!DOCTYPE html><html lang='pt-br'>
<head><meta charset='utf-8'><style>#Modelo_body{
background-color: inherit;
}
#Modelo_body table{
padding:0px 0px;
width:8cm;
height:7cm;
border-collapse:collapse;
background-color: inherit;
}
#Modelo_body table{
padding:0px 0px;
width:16cm;
height:7cm;
border-collapse:collapse;
border:1px solid black;
}
#Modelo_body .xl72{
font-weight: bold;
font-size: 45px;
height:1.5cm;
width:3.5cm;
border:1px solid black;
}
#Modelo_body .xl73{
width:4.5cm;
font-size: 20px;
border:1px solid black;
}
#Modelo_body .xl72{
}
#Modelo_body td{
border-right:.5pt solid black;
border-bottom:.5pt solid black;
border-bottom-style:hairline;
}
#Modelo_body .xl74{
text-align:left;
height:1cm;
font-weight: bold;
font-size: 45px;
height:1.5cm;
width:3.5cm;
border:1px solid black;
}
#Modelo_body .xl73{
width:4.5cm;
font-size: 20px;
border:1px solid black;
}
#Modelo_body td{
border-right:.5pt solid black;
border-bottom:.5pt solid black;
border-bottom-style:hairline;
}
#Modelo_body .xl74{
text-align:left;
height:1cm;
font-weight: bold;
font-size: 30px;
font-size: 30px;


}
#Modelo_body .xl76{
height:1cm;
font-size:18px;
}
#Modelo_body .xl76{
height:1cm;
font-size:18px;

}
#Modelo_body .xl78{
height:1cm;
font-size:15px;
}
#Modelo_body .xl78{
height:1cm;
font-size:15px;

}
#Modelo_body .xl80{
font-size:11px;
height:0.5cm;
}
</style>
}
#Modelo_body .xl80{
font-size:11px;
height:0.5cm;
}
</style>
<title>Etiquetas</title>
</head>
<body id ='Modelo_body'>
<table><tbody><tr>
<td class='xl72' >FA01</td>
<td class='xl73' >Administração</td>
</tr>
<tr>
<td class='xl74' colspan='2' >19330059</td>
</tr>
<tr>
<td class='xl76' colspan='2' >LUCIANA SAMPAIO MARINHO</td>
</tr>
<tr>
<td class='xl78' colspan='2' >PSM - Processo Seletivo Macro</td>
</tr>
<tr >
<td class='xl80' colspan='2' >1993/ 2° Semestre</td></tr>
<tr >
<td class='xl80' colspan='2'>Formado</td></tr>
<tr >
<td class='xl80' colspan='2'>2007/ 2° Semestre</td></tr>
<tr>
<td class='xl80' colspan='2'>SIE</td></tr></tbody></table> </body>
<table><tbody><tr><td class='xl72' >FA01</td>
<td class='xl73' >Administração</td><td class='xl72' >FA01</td>
<td class='xl73' >Administração</td></tr><tr><td class='xl74' colspan='2' >21950147</td><td class='xl74' colspan='2' >20330269</td></tr><tr><td class='xl76' colspan='2' >ROSENELBE ARCANJO PINHEIRO</td><td class='xl76' colspan='2' >ROSEMARY GOMES NUNES</td></tr><tr><td class='xl78' colspan='2' >PSE - Portador de Diploma</td><td class='xl78' colspan='2' >PSM - Processo Seletivo Macro</td></tr><tr><td class='xl80' colspan='2' >2019/ 1° Semestre</td><td class='xl80' colspan='2' >2003/ 1° Semestre</td></tr><tr><td class='xl80' colspan='2'>Sem Evasão</td><td class='xl80' colspan='2'>Formado</td></tr><tr><td class='xl80' colspan='2'></td><td class='xl80' colspan='2'>2008/ 1° Semestre</td></tr><tr><td class='xl80' colspan='2'>SIE</td><td class='xl80' colspan='2'>SIE</td></tr><tr><td class='xl72' >AV01</td>
<td class='xl73' >Alunos avulsos</td></tr><tr><td class='xl74' colspan='2' >20270037</td></tr><tr><td class='xl76' colspan='2' >ELAINE ALMEIDA SANTOS BARROS</td></tr><tr><td class='xl78' colspan='2' >Aluno Avulso</td></tr><tr><td class='xl80' colspan='2' >2002/ 2° Semestre</td></tr><tr><td class='xl80' colspan='2'>Excluído</td></tr><tr><td class='xl80' colspan='2'>2004/ 2° Semestre</td></tr><tr><td class='xl80' colspan='2'>SIE</td></tr></tbody></table> </body>
</html>
45 changes: 45 additions & 0 deletions css/es.css
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,51 @@ border-radius:25px;
left:20%;
top:120px;
}
#estilo_mult_etq{
position: absolute;
top:340px;
left:20%;
height: 60px;
width:800px;
}
#adicinat{
position: absolute;
top:280px;
left:20%;
height: 60px;
width:760px;
}
#gerar_tqtas{
position: absolute;
top:480px;
left:20%;
height: 60px;
width:760px;
}
#gerar_tqtas input{
font-size: 25px;
text-align: center;
border: 1px solid black;
border-radius: 15px;
height: 50px;
width:100%;
}
#adicinat input{
font-size: 25px;
text-align: center;
border: 1px solid black;
border-radius: 15px;
height: 50px;
width:100%;
}
#estilo_mult_etq form input{
font-size: 25px;
text-align: center;
border: 1px solid black;
border-radius: 15px;
height: 50px;
width:95%;
}
#verificar_ad_uso form{
margin:5px;
width:100%;
Expand Down
2 changes: 0 additions & 2 deletions etq_uni.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,6 @@

$tabela ="<table><tbody>".$tabela."</tbody></table>";



?>

<?php
Expand Down
141 changes: 141 additions & 0 deletions gera_mult_etq.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<?php
require_once 'Classes/Alunos.php';
require_once 'Classes/Etiquetas.php';
$var = $_GET['etq'];
$var = explode(',',$var);
$contador = 0;
$tabela ="";
while (isset($var[$contador])) {
$al = new Aluno();
$al -> pesquisa_banco2($var[$contador]);
$et = new Etiquetas();
$et -> etq($al->getCod(),$al->getNome_cur(),$al->getNum_mat(),$al->getNome_civil(),$al->getFin(),$al->getAin(),$al->getFev(),$al->getAev(),$al->getSistema());
$a1="<tr>";
$a2="<tr>";
$a3="<tr>";
$a4="<tr>";
$a5="<tr>";
$a6="<tr>";
$a7="<tr>";
$a8="<tr>";
$a1 .=$et->getA1();
$a2 .=$et->getA2();
$a3 .=$et->getA3();
$a4 .=$et->getA4();
$a5 .=$et->getA5();
$a6 .=$et->getA6();
$a7 .=$et->getA7();
$a8 .=$et->getA8();
if(isset($var[$contador+1])){
$al2 = new Aluno();
$al2 -> pesquisa_banco2($var[1]);
$et2 = new Etiquetas();
$et2 -> etq($al2->getCod(),$al->getNome_cur(),$al2->getNum_mat(),$al2->getNome_civil(),$al2->getFin(),$al2->getAin(),$al2->getFev(),$al2->getAev(),$al2->getSistema());
$a1 .=$et2->getA1();
$a2 .=$et2->getA2();
$a3 .=$et2->getA3();
$a4 .=$et2->getA4();
$a5 .=$et2->getA5();
$a6 .=$et2->getA6();
$a7 .=$et2->getA7();
$a8 .=$et2->getA8();
}
$a1.="</tr>";
$a2.="</tr>";
$a3.="</tr>";
$a4.="</tr>";
$a5.="</tr>";
$a6.="</tr>";
$a7.="</tr>";
$a8.="</tr>";
$tabela .= $a1.$a2.$a3.$a4.$a5.$a6.$a7.$a8;
$contador = $contador+2;
}

$tabela ="<table><tbody>".$tabela."</tbody></table>";

$style = "#Modelo_body{
background-color: inherit;
}
#Modelo_body table{
padding:0px 0px;
width:16cm;
height:7cm;
border-collapse:collapse;
border:1px solid black;
}
#Modelo_body .xl72{
font-weight: bold;
font-size: 45px;
height:1.5cm;
width:3.5cm;
border:1px solid black;
}
#Modelo_body .xl73{
width:4.5cm;
font-size: 20px;
border:1px solid black;
}
#Modelo_body td{
border-right:.5pt solid black;
border-bottom:.5pt solid black;
border-bottom-style:hairline;
}
#Modelo_body .xl74{
text-align:left;
height:1cm;
font-weight: bold;
font-size: 30px;
}
#Modelo_body .xl76{
height:1cm;
font-size:18px;
}
#Modelo_body .xl78{
height:1cm;
font-size:15px;
}
#Modelo_body .xl80{
font-size:11px;
height:0.5cm;
}
";

$html = "<!DOCTYPE html><html lang='pt-br'>\n";
$html .= "\t<head><meta charset='utf-8'><style>$style</style>\n";
$html .= "\t\t<title>Etiquetas</title>\n";
$html .= "\t</head>\n";
$html .= "\t<body id ='Modelo_body'>\n";
$html .= "$tabela";
$html .= "\t</body>\n";
$html .= "</html>\n";



$arquivo = "Etiqueta.html";
// Configurações header para forçar o download
file_put_contents($arquivo, $html);

set_time_limit(0);
$arquivoLocal = '/opt/lampp/htdocs/Arq_V2/'.$arquivo;
if (!file_exists($arquivoLocal)) {
exit;
}
$novoNome = 'Etq_geradas.html';
header('Content-Description: File Transfer');
header('Content-Disposition: attachment; filename="'.$novoNome.'"');
header('Content-Type: application/octet-stream');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($arquivo));
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Expires: 0');
// Envia o arquivo para o cliente
readfile($arquivo);
exit;

?>
Loading

0 comments on commit d6ac8e8

Please sign in to comment.