Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Alterar em seu php.ini
- ; Maximum allowed size for uploaded files.
- ; http://php.net/upload-max-filesize
- upload_max_filesize = 10M
- */
- $dataPDF = filter_input_array(INPUT_POST, FILTER_DEFAULT);
- if(isset($dataPDF) && $dataPDF['enviar']){
- unset($dataPDF['enviar']);
- if($_FILES['pdffile']['error'] == 0){
- $uploaddir = __DIR__.DIRECTORY_SEPARATOR.'foto'.DIRECTORY_SEPARATOR.'os.pdf';
- if(move_uploaded_file($_FILES['pdffile']['tmp_name'], $uploaddir)){
- //Enviado
- }else{
- header('Location: index.php');
- };
- }else{
- header('Location: index.php');
- };
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title>Exibindo - Ordem De Servi&ccecil;o</title>
- <style>
- body {
- text-align: center;
- margin: 0;
- font-size: 30pt;
- width: 1240px;
- height: 1700px;
- overflow: none;
- display: block;
- }
- #header {
- width: 100%;
- height: 7%;
- padding: 3%;
- display: block;
- margin: 0 auto;
- }
- #imagem {
- width: 100%;
- height: 70%;
- padding: 3%;
- display: block;
- }
- object{
- width:100%;
- height:100%;
- }
- #rodape {
- width: 100%;
- height: 10%;
- padding: 3%;
- display: block;
- margin: 0 auto;
- }
- </style>
- </head>
- <body>
- <div id="header">
- <?php echo $dataPDF["material"]; ?><br />
- Peça <?php echo $dataPDF["tamanho"]; ?>mm<br />
- <?php echo $dataPDF["op"]; ?><br />
- <?php echo $dataPDF["quantfolha"]; ?> X <?php echo $dataPDF["tamfolha"]; ?> mm<br />
- </div>
- <div id="imagem">
- <object data="foto/os.pdf" type="application/pdf" heigth="100%">
- <a href="foto/os.pdf">PDF</a>
- </object>
- </div>
- <div id="rodape">
- <?php echo $dataPDF["unifolha"]; ?> Unidades por Página<br />
- Total <?php echo $dataPDF["unifolha"] * $dataPDF["quantfolha"]; ?><br />
- </div>
- <div><a href="index.php">Voltar</a></div>
- </body>
- </html>
- <?php }else{ ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <title>Ordem De Serviço</title>
- <style type="text/css" media="screen">
- form{width:500px; margin:10px auto;}
- label, input{display:block;width:90%;padding:5px;}
- label{margin-top:10px;}
- #enviar{width:auto; padding:10px;margin-top:10px;}
- </style>
- </head>
- <body>
- <form action="" method="post" enctype="multipart/form-data" name="file-form">
- <label for="material">Material:</label>
- <input type="text" name="material" id="material" />
- <label for="tamanho">Tamanho:</label>
- <input type="text" name="tamanho" id="tamanho" />
- <label for="op">R, 2R, E, D:</label>
- <input type="text" name="op" id="op" />
- <label for="quantfolha">Quantas Folhas:</label>
- <input type="text" name="quantfolha" />
- <label for="tamfolha">Tamanho da folha:</label>
- <input type="text" name="tamfolha" />
- <label for="arquivo">Arquivo:</label>
- <input type="file" name="pdffile" id="arquivo" />
- <label for="unifolha">Quantas unidades por folha:</label>
- <input type="text" name="unifolha" id="unifolha" />
- <input type="submit" name="enviar" id="enviar" value="Enviar" />
- </form>
- </body>
- </html>
- <?php }; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement