Ir para conteúdo

Deivid Santos

Members
  • Total de itens

    2
  • Registro em

  • Última visita

Reputação

0 Comum

Sobre Deivid Santos

  1. Deivid Santos

    Exportar para excel página php

    Galera preciso de uma ajuda, hoje eu já trabalho com exportação de arquivos em pdf, excel etc. Porém me surgiu uma situação de um relatório geral de um cliente, no caso ele vai listar todos os produtos com as configurações do mesmo. Hoje na planilha el carrega desta forma: Quando trago todos os itens deste cliente ele traz um embaixo do outro, e aí que gostaria de mudar, trazer ele em duas colunas exemplo: O cliente tem 10 produtos e ao inves de listar os dez um embaixo do outro traria duas colunas de 5 Se puderem me ajudar como devo formatar a página para gerar dessa forma agradeço muito. A configuração da página está desta forma: <table width="700px" border="1" align="center" cellspacing="0" bordercolor="#373737"> <tbody> <tr> <th colspan="4" nowrap bgcolor="#080476" width="700"><strong><font color="white">CONTROLE DE PALETIZAÇÃO HP - <?=$da?></font></strong></th> </tr> <tr> <td colspan="2" align="center"bgcolor="#73FF96"><strong>DTA: <?=$tb_dta;?></strong></td> <td colspan="2" align="center"bgcolor="#73FF96"><strong>DA: <?=$tb_documento;?></strong></td> </tr> <tr> <td>&nbsp;</td> <td align="center" bgcolor="#ABABAB"><strong>DATA:</strong></td> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><? echo $tb_data_dta ?></font></strong></td> <td>&nbsp;</td> </tr> <td colspan="4">&nbsp;</td> </tr> <tr> <td colspan="4" align="center" bgcolor="#ABABAB"><strong>MERCADORIA CONSOLIDADA</strong></td> </tr> <tr> <td align="center" bgcolor="#080476"><strong><font color="white">REFERÊNCIA</font></strong></td> <td align="center" bgcolor="#080476"><strong><font color="white">QUANT. PLTS</font></strong></td> <td align="center" bgcolor="#080476"><strong><font color="white">QUANT. CXS P/PLT</font></strong></td> <td align="center" bgcolor="#080476"><strong><font color="white">QUANT. PÇS P/CX</font></strong></td> </tr> <? if ($tb_qtdeplt!=FALSE) { ?> <tr> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_ref?></font></strong></td> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><? echo $tb_qtdeplt;?></font></strong></td> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_tqc?></font></strong></td> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_tqpp?></font></strong></td> </tr> <? } else { } ?> <? if ($tb_quebratqc!=FALSE) { ?> <tr> <td align="center" bgcolor="#C9FF26"><strong><?=$ref?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebraqtdeplt;?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebratqc;?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebratqpp;?></strong></td> </tr> <? } else { } ?> <? if($tb_quebratqc1!=FALSE) { ?> <tr> <td align="center" bgcolor="#C9FF26"><strong> <?=$ref?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebraqtdeplt1;?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebratqc1;?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebratqpp1;?></strong></td> </tr> <? } ?> <? if($tb_quebratqc2!=FALSE) { ?> <tr> <td align="center" bgcolor="#C9FF26"><strong> <?=$ref?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebraqtdeplt2;?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebratqc2;?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebratqpp2;?></strong></td> </tr> <? } ?> <? if($tb_quebratqc3!=FALSE) { ?> <tr> <td align="center" bgcolor="#C9FF26"><strong> <?=$ref?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebraqtdeplt3;?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebratqc3;?></strong></td> <td align="center" bgcolor="#C9FF26"><strong><? echo $tb_quebratqpp3;?></strong></td> </tr> <? } ?> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <? ?> <tr> <td align="center" bgcolor="#ABABAB"><strong>TOTAL GERAL</strong></td> <? if($total>ociresult($stmt,7)) { ?> <td align="center"><strong><?=$tb_totalplt;?></strong></td> <? } else { ?> <td align="center"><strong><?=$tb_totalplt;?></strong></td> <? } ?> <td align="center"><strong><?//=$tb_totalpcs;?></strong></td> <td align="center"><strong><font color="red"><?=$tb_totalpcs;?></font></strong></td> </tr> <? if($total>ociresult($stmt,7)) { ?> <td colspan="4" bgcolor="#080476">&nbsp;</td> <? } else { ?> <td colspan="4" bgcolor="#080476">&nbsp;</td> <? } ?> <tr> <td colspan="4">&nbsp;</td> </tr> <tr> <td align="center" bgcolor="#080476"><strong><font color="white">DIMENSÃO</font></strong></td> <td colspan="3" align="center" bgcolor="#080476"><strong><font color="white">PESO P/ PLT</font></strong></td> </tr> <tr> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_medidapadrao?></strong></td> <td colspan="3" align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_pesopadrao?> </font></strong></td> </tr> <? if ($tb_quebraqtdeplt!=FALSE) { ?> <tr> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_quuebramedida?></strong></td> <td colspan="3" align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_quebrapeso?> </font></strong></td> </tr> <? } else { } ?> <? if ($tb_quebratqc1!=FALSE) { ?> <tr> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_quuebramedida1?></strong></td> <td colspan="3" align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_quebrapeso1?> </font></strong></td> </tr> <? } ?> <? if($tb_quebratqc2!=FALSE) { ?> <tr> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_quuebramedida2?></strong></td> <td colspan="3" align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_quebrapeso2?> </font></strong></td> </tr> <? } ?> <? if($tb_quebratqc3!=FALSE) { ?> <tr> <td align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_quuebramedida3?></strong></td> <td colspan="3" align="center" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_quebrapeso3?> </font></strong></td> </tr> <? } ?> <tr> <td colspan="4">&nbsp;</td> </tr> <tr> <td align="center" bgcolor="#F8FF0F"><strong>CONHECIMENTO</strong></td> <td align="center" colspan="3" bgcolor="#F8FF0F"><strong><font color="red"><?=$tb_conhec?></font></strong></td> </tr> <tr> <td colspan="4">&nbsp;</td> </tr> <tr> <td bgcolor="#F8FF0F" align="center" font color="green"><strong>MÚLTIPLO</strong></td> <td colspan="3" bgcolor="#F8FF0F" align="center"><font color="red"><strong><?=$tb_multiplo?></font></strong></td> </tr> <tr> <td colspan="4">&nbsp;</td> </tr> </tbody> </table>
  2. Deivid Santos

    Binário para Hexadecimais

    Galera já procurei de tudo mas não está dando certo. Vou postar um script que estou utilizando para conversão de binário para Hexadecimais, quase todas as consultas dão certas porém acredito que ainda exista alguma correção a ser feita. Alguem poderia me dar uma ajuda? Segue script. <?php error_reporting(0); ini_set("display_errors", 0 ); ?> <html> <head> <meta name="viewport" content="width=480px,height=640px,inicial-scale=1" /> <meta name ="viewport" content="width=240px,inicial-scale=0.5" /> <meta name ="viewport" content="width=680px,user-scale=no" / > <style type="text/css"> strong { color: #F00; } </style> <style type="text/css"> <!-- .style4 {color: #FF0000; font-weight: bold; } --> </style> <style type="text/css"> body { background-color: #ECECEC; } strong { color: #F00; } c {color: #262121; font-weight: bold; padding: 11px;font: bold 11px/20px Arial, Helvetica;} k {color: #262121; font-weight: bold; padding: 22px;font: bold 20px/20px Arial, Helvetica;} kt {color: #FF4000; font-weight: bold; padding: 40px;font: bold 40px/40px Arial, Helvetica;} </style> </head> <body id="page2"> <!-- header --> <time datetime="2011-06-07" class="tdate-2 indent-bot"></time> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-8"> <script type="text/javascript" src="js/jquery-1.7.1.min.js"></script> <script type="text/javascript" src="js/jquery.easyui.min.js"></script> <script type="text/javascript"> $(function(){ //troca fundo de linhas pares $('table#dg body tr:even').css('background','#FFFF99'); //troca fundo de linhas impares $('table#dg body tr:odd').css('background','#FFFFCC'); }); </script> <script> var form = document.getElementById('binario'); form.reset();</script> <style type="text/css"> thead tr th { text-align:center; border-bottom:solid 2px #000000; border-left:solid 2px #000000; } tr td, tr th { border:dotted 1px #999999; } tfoot tr td { text-align:center; border-top:solid 2px #000000; } .cor{background:red;} .cor_{background:gold;} input[type=checkbox] { display:none; } input[type=checkbox] + label { background-size:cover; background-position:center; background-repeat: no-repeat; height: 30px; width: 30px; display:inline-block; } input#input_1_0 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_0:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_1 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_1:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_2 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_2:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_3 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_3:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_4 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_4:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_5 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_5:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_6 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_6:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_7 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_7:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_8 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_8:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_9 + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_9:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_a + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_a:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_b + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_b:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_c + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_c:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_d + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_d:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_e + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_e:checked + label { background-image: url('hexa_image/imagen_black.png'); } input#input_1_f + label { background-image: url('hexa_image/imagen_green.png'); } input#input_1_f:checked + label { background-image: url('hexa_image/imagen_black.png'); } .button { background-color: #4CAF50; /* Green */ border: none; color: white; padding: 15px 32px; text-align: center; text-decoration: none; display: inline-block; font-size: 16px; } table.comBordaSimples { border-collapse: collapse; /* CSS2 */ } table.comBordaSimples td { border: 1px solid black; } table.comBordaSimples th { border: 1px solid black; } </style> </head> <?php if(isset($_POST['cbox0'])) { $cbox0 = $_POST['cbox0'] ; $cbox0 = '1'; $checkbox0 = 'checked'; } else { $cbox0 = $_POST['cbox0'] ; $cbox0 = '0'; } if(isset($_POST['cbox1'])) { $cbox1 = $_POST['cbox1'] ; $cbox1 = '1'; $checkbox1 = 'checked'; } else { $cbox1 = $_POST['cbox1'] ; $cbox1 = '0'; } if(isset($_POST['cbox2'])) { $cbox2 = $_POST['cbox2'] ; $cbox2 = '1'; $checkbox2 = 'checked'; } else { $cbox2 = $_POST['cbox2'] ; $cbox2= '0'; } if(isset($_POST['cbox3'])) { $cbox3 = $_POST['cbox3'] ; $cbox3 = '1'; $checkbox3 = 'checked'; } else { $cbox3 = $_POST['cbox3'] ; $cbox3= '0'; } if(isset($_POST['cbox4'])) { $cbox4 = $_POST['cbox4'] ; $cbox4 = '1'; $checkbox4 = 'checked'; } else { $cbox4 = $_POST['cbox4'] ; $cbox4= '0'; } if(isset($_POST['cbox5'])) { $cbox5 = $_POST['cbox5'] ; $cbox5 = '1'; $checkbox5 = 'checked'; } else { $cbox5 = $_POST['cbox5'] ; $cbox5= '0'; } if(isset($_POST['cbox6'])) { $cbox6 = $_POST['cbox6'] ; $cbox6 = '1'; $checkbox6 = 'checked'; } else { $cbox6 = $_POST['cbox6'] ; $cbox6= '0'; } if(isset($_POST['cbox7'])) { $cbox7 = $_POST['cbox7'] ; $cbox7= '1'; $checkbox7 = 'checked'; } else { $cbox7 = $_POST['cbox7'] ; $cbox7= '0'; } if(isset($_POST['cbox8'])) { $cbox8 = $_POST['cbox8'] ; $cbox8= '1'; $checkbox8 = 'checked'; } else { $cbox8 = $_POST['cbox8'] ; $cbox8= '0'; } if(isset($_POST['cbox9'])) { $cbox9 = $_POST['cbox9'] ; $cbox9 = '1'; $checkbox9 = 'checked'; } else { $cbox9 = $_POST['cbox9'] ; $cbox9= '0'; } if(isset($_POST['cboxa'])) { $cboxa= $_POST['cboxa'] ; $cboxa = '1'; $checkboxa = 'checked'; } else { $cboxa = $_POST['cboxa'] ; $cboxa= '0'; } if(isset($_POST['cboxb'])) { $cboxb= $_POST['cboxb'] ; $cboxb = '1'; $checkboxb = 'checked'; } else { $cboxb = $_POST['cboxb'] ; $cboxb= '0'; } if(isset($_POST['cboxc'])) { $cboxc = $_POST['cboxc'] ; $cboxc = '1'; $checkboxc = 'checked'; } else { $cboxc = $_POST['cboxc'] ; $cboxc= '0'; } if(isset($_POST['cboxd'])){ $cboxd = $_POST['cboxd'] ; $cboxd = '1'; $checkboxd = 'checked'; } else { $cboxd = $_POST['cboxd'] ; $cboxd= '0'; } if(isset($_POST['cboxe'])) { $cboxe = $_POST['cboxe'] ; $cboxe = '1'; $checkboxe = 'checked'; } else { $cboxe = $_POST['cboxe'] ; $cboxe= '0'; } if(isset($_POST['cboxf'])) { $cboxf = $_POST['cboxf'] ; $cboxf = '1'; $checkboxf = 'checked'; } else { $cboxf = $_POST['cboxf'] ; $cboxf= '0'; } ?> <body> <table width="200" height="195" class="combordasimples"> <tbody> <tr> <td><form id="binario" name="binario" method="POST" action=""> <input type='checkbox' name='cboxf' <?=$checkboxf?> id="input_1_f"/> <label for="input_1_f"> </label> <br> <input type='checkbox' name='cboxe' <?=$checkboxe?> id="input_1_e"/> <label for="input_1_e"></label> <br> <input type='checkbox' name='cboxd' <?=$checkboxd?> id="input_1_d"/> <label for="input_1_d"></label> <br> <input type='checkbox' name='cboxc' <?=$checkboxc?> id="input_1_c"/> <label for="input_1_c"></label> <br> <input type='checkbox' name='cboxb' <?=$checkboxb?> id="input_1_b"/> <label for="input_1_b"></label> <br> <input type='checkbox' name='cboxa' <?=$checkboxa?> id="input_1_a"/> <label for="input_1_a"></label> <br> <input type='checkbox' name='cbox9' <?=$checkbox9?> id="input_1_9"/> <label for="input_1_9"></label> <br> <input type='checkbox' name='cbox8' <?=$checkbox8?> id="input_1_8"/> <label for="input_1_8"></label> <br> <input type='checkbox' name='cbox7' <?=$checkbox7?> id="input_1_7"/> <label for="input_1_7"></label> <br> <input type='checkbox' name='cbox6' <?=$checkbox6?> id="input_1_6"/> <label for="input_1_6"></label> <br> <input type='checkbox' name='cbox5' <?=$checkbox5?> id="input_1_5"/> <label for="input_1_5"></label> <br> <input type='checkbox' name='cbox4' <?=$checkbox4?> id="input_1_4"/> <label for="input_1_4"></label> <br> <input type='checkbox' name='cbox3' <?=$checkbox3?> id="input_1_3"/> <label for="input_1_3"></label> <br> <input type='checkbox' name='cbox2' <?=$checkbox2?> id="input_1_2"/> <label for="input_1_2"></label> <br> <input type='checkbox' name='cbox1' <?=$checkbox1?> id="input_1_1"/> <label for="input_1_1"></label> <br> <input type='checkbox' name='cbox0' <?=$checkbox0?> id="input_1_0"/> <label for="input_1_0"></label> <br> <a href="index.php"><button><img src="hexa_image/converter.png" /></button></a> </form> <a href="index.php"><button><img src="hexa_image/limparconsulta.png" /></button></a> </td> <td><? $binary = "$cbox0$cbox1$cbox2$cbox3$cbox4$cbox5$cbox6$cbox7$cbox8$cbox9$cboxa$cboxb$cboxc$cboxd$cboxe$cboxf"; $binary1 = ltrim($binary,0); $hex = dechex(bindec($binary1)); echo "<h3 align='center'><kt>" .$hex."<kt></h3>"; ?> </td> </tr> </tbody> </table> </body> </html>
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.