Jump to content

empirerock

Members
  • Content count

    97
  • Joined

  • Last visited

Community Reputation

0 Comum

About empirerock

  1. Pessoal, após muita pesquisa, descobri no Mysql, que existe o Pivot Table. Estou pesquisando sobre, para aprender. Assim que eu conseguir, eu posto aqui como ficou o código. Abraço!
  2. Pessoal, boa tarde. Estou com uma dúvida no qual nunca me deparei antes com php e mysql. Tenho a seguinte tabela exemplo no mysql: ITEM : DEP : QTD ======================== 1 : T01 : 1000 2 : T02 : 2000 3 : T03 : 3000 4 : T01 : 4000 5 : T03 : 5000 ======================== Tendo esta tabela no mysql, eu preciso exibir uma página com uma tabela HTML e PHP dessa maneira abaixo: TABELA HTML PARA EXIBIR ================================ ITEM : T01 : T02 : T03 1 : 1000 : 0 : 0 2 : 0 : 2000 : 0 3 : 0 : 0 : 3000 4 : 4000 : 0 : 0 5 : 0 : 0 : 5000 ================================ Explicando: Preciso exibir uma query que me filtre em colunas a qtd de cada depósito. Pesquisei e não sei como fazer isso. Tentei fazer um select para cada depósito e while dentro de while e não consegui. Alguma forma de fazer isso? Segue abaixo meu script, só que não faço idéia de como fazer isso, quem tiver uma idéia de como fazer, ficarei muito grato. <? $sql = mysql_query ("SELECT item, dep, qtd FROM estoque "); ?> <table> <thead> <tr> <th>Item</th> <th>T01</th> <th>T02</th> <th>T03</th> </tr> </thead> <tbody> <? while($r = mysql_fetch_array($sql)){ ?> <tr> <td><? echo $r['item']; ?></td> <td></td> <td></td> </tr> <? } ?> </tbody> </table>
  3. empirerock

    onclick=window.open não funciona

    Bom dia. Estou usando datatable em server processing, e uma das colunas não funciona o window.open, ele simplesmente carrega na mesma página, não abre em nova janela. Alguém poderia me ajudar? Justamente a linha $('td:eq(6)', nRow).html(...... não funciona. "fnRowCallback": function( nRow, aData, iDisplayIndex ) { $('td:eq(1)', nRow).html('<a href="pdf/componente/'+aData[5]+ '" onclick="window.open(\'pdf/componente/'+aData[1]+'\', \'newwindow4\', \'width=900, height=570\', \'left=30, top=10\', \'scrollbars=1\'); return false;">'+aData[1]+'</a>'); $('td:eq(0)', nRow).html('<a href="pdf/cabo/'+aData[6]+ '" onclick="window.open(\'pdf/cabo/'+aData[0]+'\', \'newwindow4\', \'width=900, height=570\', \'left=30, top=10\', \'scrollbars=1\'); return false;">'+aData[0]+'</a>'); $('td:eq(5)', nRow).html('<a href="pdf/fotos/'+aData[7]+ '" onclick="window.open(\'pdf/fotos/'+aData[7]+'\', \'newwindow4\', \'width=900, height=570\', \'left=30, top=10\', \'scrollbars=1\'); return false;">'+aData[7]+'</a>'); $('td:eq(6)', nRow).html('<a href="pdf/fotos/'+aData[8]+ '" onclick="window.open(\'pdf/fotos/'+aData[8]+'\', \'newwindow4\', \'width=900, height=570\', \'left=30, top=10\', \'scrollbars=1\'); return false;">'+aData[8]+'</a>'); return nRow; },
  4. Boa tarde. Estou com dificuldades com esse javascript. Esse script abaixo, quando eu digito o código, e pressiono a tecla ENTER, ele busca no banco através do arquivo 'get_descricao.php', a descrição do do produto relacionado ao código digitado e em seguida o cursor pula para o campo quantidade. Até aqui, tudo certo. O que eu queria é que se não encontrar o item na busca, dê um alerta e não deixe o cursor ir para o campo quantidade. Somente quando for digitado um código que exista no banco. Más não sei fazer isso em javascript. Se algum souber como me ajudar, agradeço muito. <?php include "topo.php"; ?> <!-- *********************** CSS **************************--> <style type="text/css" class="init"> .container { width: 75%; margin-top: 5px; } </style> <!-- ******************************************************--> <script language="JavaScript" type="text/javascript"> //************************************************************* function showUser(str) { if (str == "") { document.getElementById("txtHint").innerHTML = ""; return; } else { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("txtHint").innerHTML = this.responseText; } }; xmlhttp.open("GET","get_descricao.php?it_codigo="+str,true); xmlhttp.send(); } } //************************************************************* //************************************************************* function jumpNext (fromFld, toFld){ if(event.keyCode == 13) { document.forms[fromFld].elements[toFld].focus(); document.forms[fromFld].elements[toFld].select(); } } //************************************************************* </script> <div class="container well"> <div class="row-fluid"> <form name="form1" method="post" action=""> <table class="table table-bordered table-condensed"> <tr> <td align="center"><b>Item: </b><input type="text" name="it_codigo" size="9" maxlength="10" required="required" autocomplete="off" onchange="showUser(this.value)" onKeyUp="jumpNext(0,'quantidade')" autofocus="" > <b>Descrição: </b><span id="txtHint">Digite o Código do Item</span> </td> </tr> <tr> <td align="center"><b>Quantidade: </b><input type="text" name="quantidade" id="quantidade" size="5" maxlength="5" required="required" autocomplete="off" ></td> </tr> </table> </form> </div> </div> Arquivo: get_descricao.php <? $it_codigo = $_GET['it_codigo']; $desc_item = ""; $conexao = odbc_connect("Webems206ofic","root","root",SQL_CUR_USE_ODBC) or die ("Não foi possivel conectar com o Banco!!!"); if($conexao) $sql = odbc_exec($conexao,"SELECT it_codigo, desc_item, cod_segto, cla_abciks FROM PUB.EXT_ITEM WHERE it_codigo = '$it_codigo' "); else{ echo "Erro de conexao"; } while($r = odbc_fetch_array($sql)){ $desc_item = $r['desc_item']; } if ($desc_item == "") { echo "ITEM NÃO ENCONTRADO!"; }else{ echo $desc_item; } ?>
  5. empirerock

    Select. Obter o valor desejado

    Boa tarde. Preciso de ajuda. Não consigo resolver esta situação. Neste código, o retorno está se baseando somente no primeiro item da lista. O que preciso é que se em alguma linha, o Volume_Restante for maior que zero e menor que Volume_Total, o status seja 'P'. E se todas as linhas de Volume_Restante forem iguais a zero, então status = 'T'. E se todas as linhas de Volume_Restante forem iguais a Volume_Total, então status = 'N'. Só que nesse caso, ele viu a primeira linha que volume_restante era zero, e jogou no status 'T', ignorando a outra linha que tem valor 1. Abaixo print da tela da lista de produtos para entrega. Script include "topop.php"; include "mysql.php"; $ped_venda_id = 13; $sql = mysql_query ("SELECT pvi.ped_venda_id, IF(pvi.volume_restante = 0, 'T', IF(pvi.volume_total = pvi.volume_restante, 'N', 'P')) as 'status' FROM ped_vendas_item as pvi WHERE ped_venda_id = '$ped_venda_id' ") or die(mysql_error()); while($r = mysql_fetch_array($sql)){ $status = $r['status']; } echo $status;
  6. empirerock

    if com listagem de array

    Pessoal, boa tarde. Estou apanhando com uso de array, preciso verificar valores e tomar decisões dependendo do que encontrar na listagem. id | volume_total | volume_entregue | volume_restante 1 15 10 5 2 10 10 0 Meu problema é o seguinte nesta listagem: Se todas as linhas de volume_restante for (zero), então $status = 'Todos Entregues' Se todas as linhas de volume_restante forem iguais a volume_total, então $status = 'nenhum entregue' Se em uma linha volume_restante tiver (zero) e em outra linha volume_restante tiver um valor igual ou menor que volume_total, então $status ='Entrega Parcial' Não consigo formular if´s nesse esquema. <?php include "mysql.php"; $id = 13; $sql = mysql_query ("SELECT * FROM ped_vendas_item WHERE id = '$id' "); while($r = mysql_fetch_array($sql)){ $volume_entregue = array($r['volume_entregue']); $volume_total = array($r['volume_total']); $volume_restante = array($r['volume_restante']); } Alguém pode me dar uma ajuda com isso?
  7. empirerock

    HTML e PHP dentro de um echo. Não consigo fechar o while com }

    Obrigado pela dica. Vou testar aqui e depois retorno avisando se consegui. Valeu
  8. Boa tarde. Coloquei um script dentro de um echo, porém não consigo fechar um while que está dentro do echo. Tento colocar '.}.' más não vai. o erro, está na linha 139. Parse error: syntax error, unexpected '}' in /var/www/santa/print.php on line 139 Alguém pode me ajudar? <?php include "tabelas/cadastro/topo_ped_compras_item_print.php"; include "mysql.php"; include("mpdf60/mpdf.php"); //************************************************************************************************** //RECEBE VIA GET $pcid = $_GET['pcid']; $fid = $_GET['fid']; //************************************************************************************************** //setlocale(LC_MONETARY,"pt_BR", "ptb"); $geral = 0; //************************************************************************************************** //SELECT BASICO $sql = mysql_query ("SELECT * FROM ped_compras WHERE ped_compra_id = '$pcid' "); $r = mysql_fetch_assoc($sql); //@$fid = $r['fornecedor_id']; @$produto_id = $r['produto_id']; $status = $r['status']; $data = $r['data']; $odh = date( 'd/m/Y', strtotime($data)); //$trava = $r['trava']; $sql2 = mysql_query ("SELECT * FROM fornecedores WHERE fornecedor_id = '$fid' "); $r2 = mysql_fetch_assoc($sql2); $fornecedor = $r2['fornecedor']; $sql3 = mysql_query ("SELECT * FROM `ped_compras_item` `pci` INNER JOIN `produtos` `p` ON `p`.`produto_id` = `pci`.`produto_id` INNER JOIN `fornecedores` `f` ON `f`.`fornecedor_id` = `pci`.`fornecedor_id` WHERE `pci`.`ped_compras_id` = '$pcid' "); ?> <!-- *********************** CSS **************************--> <style type="text/css" class="init"> .container {width: 80%; margin-top: -15px; } .customHr { width: 95% font-size: 1px; color: rgba(0, 0, 0, 0); line-height: 1px; background-color: grey; margin-top: -6px; margin-bottom: 10px; } #topwell{ /* background-color: #d9edf7; */ } #posi { position: relative; left: 880px; } div.tres { width:105%; height:105%; border: 1px solid; } </style> <!-- ************************************************************************************************************ --> <br><br> <!-- ************************************************************************************************************ --> <? $html = ' <table class="table table-bordered table-inverse table-hover"> <thead> <tr> <th>Produto</th> <th>Quantidade</th> <th>V. Unitário</th> <th>Subtotal</th> </tr> </thead> <tbody>'. $teste=0; while($r3 = mysql_fetch_array($sql3)){ $unitario = $r3['unitario']; $unitario = number_format($unitario, 2, ',', ''); $total = $r3['unitario'] * $r3['quantidade']; $subtotal = number_format($total, 2, ',', ''); $geral += $total; $pci_id = $r3['ped_compras_item_id']; '<tr> <td>'.$r3['produto'].'</td> <td>'.$r3['quantidade'].'</td> <td>'.$unitario.'</td> <td>'.$subtotal.'</td> </tr>' .}. //linha 139 '</tbody> </table> '; $mpdf=new mPDF(); $mpdf->SetDisplayMode('fullpage'); $css = file_get_contents("css/estilo.css"); $mpdf->WriteHTML($css,1); $mpdf->WriteHTML($html); $mpdf->Output(); exit; ?>
  9. Jhess, puts era isso mesmo. Foi na mosca. Muito obrigado pela ajuda. Abraço!
  10. Boa tarde. Estou aprendendo a manipular arquivos txt com o PHP. Minha dúvida é a seguinte. Como faço para localizar em qual LINHA se encontra uma palavra específica? Agradeço muito quem puder me ajudar.
  11. Bruno, deu certo. Em vez da virgula, eu coloquei o <br> que já tinha, para fazer pular a linha. Aí coloquei dessa forma para conseguir capturar a data que precisava. Obrigado Bruno.
  12. opa, vou testar e já retorno. vlw
  13. Boa tarde. Tenho um texto dentro de um campo do tipo texto no banco mysql. Gostaria de caputrar a data que está na terceira linha, usando um script php que está mais abaixo, porém este código meu não dá certo, pois o nome pode ser diferente, sendo assim mudando o tamanho da string. Eu queria saber como capturar a string da terceira linha. Como mostrado abaixo: Script que estou utilizando:
  14. empirerock

    Ajuda com Select Count

    Bom dia. Na verdade uso 3 tabelas. Consegui fazer o que queria, porém utilizando vários Select. Ficou rápido, e o objetivo foi atingido, porém para efeito de aprendizagem e redução do código, gostaria de aprender uma forma para reduzir o código. Nesse caso, vejo que o fórum correto deveria ser o de SQL e não do PHP. Abaixo, código completo. <?php include "mysql.php"; include "nav.php"; //$sql = mysql_query ("SELECT *, DATEDIFF(now(), data_abertura) AS date_difference FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` INNER JOIN `curva` `udc` ON `u`.`codiks` = `udc`.`curva_codiks` WHERE `u`.`status` = 'A' GROUP BY `u`.`op` "); //***** IKS-0 ************************************************************************************ $sql0 = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-0' "); $r0 = mysql_query($sql0); $total0 = mysql_num_rows($r0); //------------------------- // CURVA A $sql0_A = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-0' AND `ud`.`abc` = 'A' GROUP BY `u`.`op` "); $r0_A = mysql_query($sql0_A); $total0_A = mysql_num_rows($r0_A); //------------------------- // CURVA B $sql0_B = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-0' AND `ud`.`abc` = 'B' GROUP BY `u`.`op` "); $r0_B = mysql_query($sql0_B); $total0_B = mysql_num_rows($r0_B); //--------------------------------- // CURVA C $sql0_C = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-0' AND `ud`.`abc` = 'C' GROUP BY `u`.`op` "); $r0_C = mysql_query($sql0_C); $total0_C = mysql_num_rows($r0_C); //--------------------------------- // CURVA D $sql0_D = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-0' AND `ud`.`abc` = 'D' GROUP BY `u`.`op` "); $r0_D = mysql_query($sql0_D); $total0_D = mysql_num_rows($r0_D); //--------------------------------- // CURVA E $sql0_E = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-0' AND `ud`.`abc` = 'E' GROUP BY `u`.`op` "); $r0_E = mysql_query($sql0_E); $total0_E = mysql_num_rows($r0_E); //--------------------------------- // CURVA S $sql0_S = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-0' AND `ud`.`abc` = 'S' GROUP BY `u`.`op` "); $r0_S = mysql_query($sql0_S); $total0_S = mysql_num_rows($r0_S); //************************************************************************************************** //------------------------- $sql0_so = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-0' AND situacao = 'SO' "); $r0_so = mysql_query($sql0_so); $total0_so = mysql_num_rows($r0_so); //------------------------- $sql0_fc = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-0' AND situacao = 'FC' "); $r0_fc = mysql_query($sql0_fc); $total0_fc = mysql_num_rows($r0_fc); //--------------------------------------------------- $sql0_pr = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-0' AND situacao = 'PR' "); $r0_pr = mysql_query($sql0_pr); $total0_pr = mysql_num_rows($r0_pr); //--------------------------------------------------- $sql0_mt = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-0' AND situacao = 'MT' "); $r0_mt = mysql_query($sql0_mt); $total0_mt = mysql_num_rows($r0_mt); //--------------------------------------------------- /* echo "IKS-0: ".$total0; echo "<br>"; echo "CURVA A: ".$total0_A."<br>"; echo "CURVA B: ".$total0_B."<br>"; echo "CURVA C: ".$total0_C."<br>"; echo "CURVA D: ".$total0_D."<br>"; echo "CURVA E: ".$total0_E."<br>"; echo "CURVA S: ".$total0_S."<br>"; echo "Separando(SO): ".$total0_so."<br>"; echo "Separando(FC): ".$total0_fc."<br>"; echo "Separando(PR): ".$total0_pr."<br>"; echo "Separando(MT): ".$total0_mt."<br>"; echo "<br>"; echo "************************************************************************* <br>"; //********************************************************************************************** */ //***** IKS-1 ************************************************************************************ $sql1 = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-1' "); $r1 = mysql_query($sql1); $total1 = mysql_num_rows($r1); //------------------------- // CURVA A $sql1_A = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-1' AND `ud`.`abc` = 'A' GROUP BY `u`.`op` "); $r1_A = mysql_query($sql1_A); $total1_A = mysql_num_rows($r1_A); //------------------------- // CURVA B $sql1_B = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-1' AND `ud`.`abc` = 'B' GROUP BY `u`.`op` "); $r1_B = mysql_query($sql1_B); $total1_B = mysql_num_rows($r1_B); //--------------------------------- // CURVA C $sql1_C = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-1' AND `ud`.`abc` = 'C' GROUP BY `u`.`op` "); $r1_C = mysql_query($sql1_C); $total1_C = mysql_num_rows($r1_C); //--------------------------------- // CURVA D $sql1_D = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-1' AND `ud`.`abc` = 'D' GROUP BY `u`.`op` "); $r1_D = mysql_query($sql1_D); $total1_D = mysql_num_rows($r1_D); //--------------------------------- // CURVA E $sql1_E = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-1' AND `ud`.`abc` = 'E' GROUP BY `u`.`op` "); $r1_E = mysql_query($sql1_E); $total1_E = mysql_num_rows($r1_E); //--------------------------------- // CURVA S $sql1_S = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-0' AND `ud`.`abc` = 'S' GROUP BY `u`.`op` "); $r1_S = mysql_query($sql1_S); $total1_S = mysql_num_rows($r1_S); //--------------------------------------- $sql1_so = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-1' AND situacao = 'SO' "); $r1_so = mysql_query($sql1_so); $total1_so = mysql_num_rows($r1_so); //------------------------- $sql1_fc = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-1' AND situacao = 'FC' "); $r1_fc = mysql_query($sql1_fc); $total1_fc = mysql_num_rows($r1_fc); //--------------------------------------------------- $sql1_pr = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-1' AND situacao = 'PR' "); $r1_pr = mysql_query($sql1_pr); $total1_pr = mysql_num_rows($r1_pr); //--------------------------------------------------- $sql1_mt = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-1' AND situacao = 'MT' "); $r1_mt = mysql_query($sql1_mt); $total1_mt = mysql_num_rows($r1_mt); //--------------------------------------------------- /* echo "IKS-1: ".$total1; echo "<br>"; echo "CURVA A: ".$total1_A."<br>"; echo "CURVA B: ".$total1_B."<br>"; echo "CURVA C: ".$total1_C."<br>"; echo "CURVA D: ".$total1_D."<br>"; echo "CURVA E: ".$total1_E."<br>"; echo "CURVA S: ".$total1_S."<br>"; echo "Separando(SO): ".$total1_so."<br>"; echo "Separando(FC): ".$total1_fc."<br>"; echo "Separando(PR): ".$total1_pr."<br>"; echo "Separando(MT): ".$total1_mt."<br>"; echo "<br>"; echo "************************************************************************* <br>"; */ //***** IKS-2 ************************************************************************************ $sql2 = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-2' "); $r2 = mysql_query($sql2); $total2 = mysql_num_rows($r2); //------------------------- // CURVA A $sql2_A = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-2' AND `ud`.`abc` = 'A' GROUP BY `u`.`op` "); $r2_A = mysql_query($sql2_A); $total2_A = mysql_num_rows($r2_A); //------------------------- //------------------------- // CURVA B $sql2_B = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-2' AND `ud`.`abc` = 'B' GROUP BY `u`.`op` "); $r2_B = mysql_query($sql2_B); $total2_B = mysql_num_rows($r2_B); //------------------------- //------------------------- // CURVA C $sql2_C = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-2' AND `ud`.`abc` = 'C' GROUP BY `u`.`op` "); $r2_C = mysql_query($sql2_C); $total2_C = mysql_num_rows($r2_C); //------------------------- //------------------------- // CURVA D $sql2_D = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-2' AND `ud`.`abc` = 'D' GROUP BY `u`.`op` "); $r2_D = mysql_query($sql2_D); $total2_D = mysql_num_rows($r2_D); //------------------------- //------------------------- // CURVA E $sql2_E = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-2' AND `ud`.`abc` = 'E' GROUP BY `u`.`op` "); $r2_E = mysql_query($sql2_E); $total2_E = mysql_num_rows($r2_E); //------------------------- //------------------------- // CURVA S $sql2_S = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-2' AND `ud`.`abc` = 'S' GROUP BY `u`.`op` "); $r2_S = mysql_query($sql2_S); $total2_S = mysql_num_rows($r2_S); //------------------------- //------------------------- $sql2_so = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-2' AND situacao = 'SO' "); $r2_so = mysql_query($sql2_so); $total2_so = mysql_num_rows($r2_so); //------------------------- $sql2_fc = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-2' AND situacao = 'FC' "); $r2_fc = mysql_query($sql2_fc); $total2_fc = mysql_num_rows($r2_fc); //--------------------------------------------------- $sql2_pr = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-2' AND situacao = 'PR' "); $r2_pr = mysql_query($sql2_pr); $total2_pr = mysql_num_rows($r2_pr); //--------------------------------------------------- $sql2_mt = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-2' AND situacao = 'MT' "); $r2_mt = mysql_query($sql2_mt); $total2_mt = mysql_num_rows($r2_mt); //--------------------------------------------------- /* echo "IKS-2: ".$total2; echo "<br>"; echo "CURVA A: ".$total2_A."<br>"; echo "CURVA B: ".$total2_B."<br>"; echo "CURVA C: ".$total2_C."<br>"; echo "CURVA D: ".$total2_D."<br>"; echo "CURVA E: ".$total2_E."<br>"; echo "CURVA S: ".$total2_S."<br>"; echo "Separando(SO): ".$total2_so."<br>"; echo "Separando(FC): ".$total2_fc."<br>"; echo "Separando(PR): ".$total2_pr."<br>"; echo "Separando(MT): ".$total2_mt."<br>"; echo "<br>"; echo "************************************************************************* <br>"; */ //***** IKS-3 ************************************************************************************ $sql3 = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-3' "); $r3 = mysql_query($sql3); $total3 = mysql_num_rows($r3); //------------------------- //------------------------- // CURVA A $sql3_A = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-3' AND `ud`.`abc` = 'A' GROUP BY `u`.`op` "); $r3_A = mysql_query($sql3_A); $total3_A = mysql_num_rows($r3_A); //------------------------- //------------------------- // CURVA B $sql3_B = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-3' AND `ud`.`abc` = 'B' GROUP BY `u`.`op` "); $r3_B = mysql_query($sql3_B); $total3_B = mysql_num_rows($r3_B); //------------------------- //------------------------- // CURVA C $sql3_C = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-3' AND `ud`.`abc` = 'C' GROUP BY `u`.`op` "); $r3_C = mysql_query($sql3_A); $total3_C = mysql_num_rows($r3_C); //------------------------- //------------------------- // CURVA D $sql3_D = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-3' AND `ud`.`abc` = 'D' GROUP BY `u`.`op` "); $r3_D = mysql_query($sql3_D); $total3_D = mysql_num_rows($r3_D); //------------------------- //------------------------- // CURVA E $sql3_E = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-3' AND `ud`.`abc` = 'E' GROUP BY `u`.`op` "); $r3_E = mysql_query($sql3_E); $total3_E = mysql_num_rows($r3_E); //------------------------- //------------------------- // CURVA S $sql3_S = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-3' AND `ud`.`abc` = 'S' GROUP BY `u`.`op` "); $r3_S = mysql_query($sql3_S); $total3_S = mysql_num_rows($r3_S); //------------------------- //-------------------------------------------------- $sql3_so = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-3' AND situacao = 'SO' "); $r3_so = mysql_query($sql3_so); $total3_so = mysql_num_rows($r3_so); //------------------------- $sql3_fc = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-3' AND situacao = 'FC' "); $r3_fc = mysql_query($sql3_fc); $total3_fc = mysql_num_rows($r3_fc); //--------------------------------------------------- $sql3_pr = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-3' AND situacao = 'PR' "); $r3_pr = mysql_query($sql3_pr); $total3_pr = mysql_num_rows($r3_pr); //--------------------------------------------------- $sql3_mt = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-3' AND situacao = 'MT' "); $r3_mt = mysql_query($sql3_mt); $total3_mt = mysql_num_rows($r3_mt); //--------------------------------------------------- /* echo "IKS-3: ".$total3; echo "<br>"; echo "CURVA A: ".$total3_A."<br>"; echo "CURVA B: ".$total3_B."<br>"; echo "CURVA C: ".$total3_C."<br>"; echo "CURVA D: ".$total3_D."<br>"; echo "CURVA E: ".$total3_E."<br>"; echo "CURVA S: ".$total3_S."<br>"; echo "Separando(SO): ".$total3_so."<br>"; echo "Separando(FC): ".$total3_fc."<br>"; echo "Separando(PR): ".$total3_pr."<br>"; echo "Separando(MT): ".$total3_mt."<br>"; echo "<br>"; echo "************************************************************************* <br>"; */ //***** IKS-4 ************************************************************************************ $sql4 = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-4' "); $r4 = mysql_query($sql4); $total4 = mysql_num_rows($r4); //------------------------- //------------------------- // CURVA A $sql4_A = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-4' AND `ud`.`abc` = 'A' GROUP BY `u`.`op` "); $r4_A = mysql_query($sql4_A); $total4_A = mysql_num_rows($r4_A); //------------------------- //------------------------- // CURVA B $sql4_B = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-4' AND `ud`.`abc` = 'B' GROUP BY `u`.`op` "); $r4_B = mysql_query($sql4_B); $total4_B = mysql_num_rows($r4_B); //------------------------- //------------------------- // CURVA C $sql4_C = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-4' AND `ud`.`abc` = 'C' GROUP BY `u`.`op` "); $r4_C = mysql_query($sql4_C); $total4_C = mysql_num_rows($r4_C); //------------------------- //------------------------- // CURVA D $sql4_D = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-4' AND `ud`.`abc` = 'D' GROUP BY `u`.`op` "); $r4_D = mysql_query($sql4_D); $total4_D = mysql_num_rows($r4_D); //------------------------- //------------------------- // CURVA E $sql4_E = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-4' AND `ud`.`abc` = 'E' GROUP BY `u`.`op` "); $r4_E = mysql_query($sql4_E); $total4_E = mysql_num_rows($r4_E); //------------------------- //------------------------- // CURVA S $sql4_S = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-4' AND `ud`.`abc` = 'S' GROUP BY `u`.`op` "); $r4_S = mysql_query($sql4_S); $total4_S = mysql_num_rows($r4_S); //------------------------- //------------------------------------------------ $sql4_so = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-4' AND situacao = 'SO' "); $r4_so = mysql_query($sql4_so); $total4_so = mysql_num_rows($r4_so); //------------------------- $sql4_fc = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-4' AND situacao = 'FC' "); $r4_fc = mysql_query($sql4_fc); $total4_fc = mysql_num_rows($r4_fc); //--------------------------------------------------- $sql4_pr = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-4' AND situacao = 'PR' "); $r4_pr = mysql_query($sql4_pr); $total4_pr = mysql_num_rows($r4_pr); //--------------------------------------------------- $sql4_mt = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-4' AND situacao = 'MT' "); $r4_mt = mysql_query($sql4_mt); $total4_mt = mysql_num_rows($r4_mt); //--------------------------------------------------- /* echo "IKS-4: ".$total4; echo "<br>"; echo "CURVA A: ".$total4_A."<br>"; echo "CURVA B: ".$total4_B."<br>"; echo "CURVA C: ".$total4_C."<br>"; echo "CURVA D: ".$total4_D."<br>"; echo "CURVA E: ".$total4_E."<br>"; echo "CURVA S: ".$total4_S."<br>"; echo "Separando(SO): ".$total4_so."<br>"; echo "Separando(FC): ".$total4_fc."<br>"; echo "Separando(PR): ".$total4_pr."<br>"; echo "Separando(MT): ".$total4_mt."<br>"; echo "<br>"; echo "************************************************************************* <br>"; */ //***** IKS-5 ************************************************************************************ $sql5 = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-5' "); $r5 = mysql_query($sql5); $total5 = mysql_num_rows($r5); //------------------------- //------------------------- // CURVA A $sql5_A = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-5' AND `ud`.`abc` = 'A' GROUP BY `u`.`op` "); $r5_A = mysql_query($sql5_A); $total5_A = mysql_num_rows($r5_A); //------------------------- //------------------------- // CURVA B $sql5_B = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-5' AND `ud`.`abc` = 'B' GROUP BY `u`.`op` "); $r5_B = mysql_query($sql5_B); $total5_B = mysql_num_rows($r5_B); //------------------------- //------------------------- // CURVA C $sql5_C = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-5' AND `ud`.`abc` = 'C' GROUP BY `u`.`op` "); $r5_C = mysql_query($sql5_C); $total5_C = mysql_num_rows($r5_C); //------------------------- //------------------------- // CURVA D $sql5_D = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-5' AND `ud`.`abc` = 'D' GROUP BY `u`.`op` "); $r5_D = mysql_query($sql5_D); $total5_D = mysql_num_rows($r5_D); //------------------------- //------------------------- // CURVA E $sql5_E = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-5' AND `ud`.`abc` = 'E' GROUP BY `u`.`op` "); $r5_E = mysql_query($sql5_E); $total5_E = mysql_num_rows($r5_E); //------------------------- //------------------------- // CURVA S $sql5_S = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-5' AND `ud`.`abc` = 'S' GROUP BY `u`.`op` "); $r5_S = mysql_query($sql5_S); $total5_S = mysql_num_rows($r5_S); //------------------------- //-------------------------------------------- $sql5_so = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-5' AND situacao = 'SO' "); $r5_so = mysql_query($sql5_so); $total5_so = mysql_num_rows($r5_so); //------------------------- $sql5_fc = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-5' AND situacao = 'FC' "); $r5_fc = mysql_query($sql5_fc); $total5_fc = mysql_num_rows($r5_fc); //--------------------------------------------------- $sql5_pr = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-5' AND situacao = 'PR' "); $r5_pr = mysql_query($sql5_pr); $total5_pr = mysql_num_rows($r5_pr); //--------------------------------------------------- $sql5_mt = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-5' AND situacao = 'MT' "); $r5_mt = mysql_query($sql5_mt); $total5_mt = mysql_num_rows($r5_mt); //--------------------------------------------------- /* echo "IKS-5: ".$total5; echo "<br>"; echo "CURVA A: ".$total5_A."<br>"; echo "CURVA B: ".$total5_B."<br>"; echo "CURVA C: ".$total5_C."<br>"; echo "CURVA D: ".$total5_D."<br>"; echo "CURVA E: ".$total5_E."<br>"; echo "CURVA S: ".$total5_S."<br>"; echo "Separando(SO): ".$total5_so."<br>"; echo "Separando(FC): ".$total5_fc."<br>"; echo "Separando(PR): ".$total5_pr."<br>"; echo "Separando(MT): ".$total5_mt."<br>"; echo "<br>"; echo "************************************************************************* <br>"; */ //***** IKS-6 ************************************************************************************ $sql6 = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-6' "); $r6 = mysql_query($sql6); $total6 = mysql_num_rows($r6); //------------------------- //------------------------- // CURVA A $sql6_A = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-6' AND `ud`.`abc` = 'A' GROUP BY `u`.`op` "); $r6_A = mysql_query($sql6_A); $total6_A = mysql_num_rows($r6_A); //------------------------- //------------------------- // CURVA B $sql6_B = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-6' AND `ud`.`abc` = 'B' GROUP BY `u`.`op` "); $r6_B = mysql_query($sql6_B); $total6_B = mysql_num_rows($r6_B); //------------------------- //------------------------- // CURVA C $sql6_C = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-6' AND `ud`.`abc` = 'C' GROUP BY `u`.`op` "); $r6_C = mysql_query($sql6_C); $total6_C = mysql_num_rows($r6_C); //------------------------- //------------------------- // CURVA D $sql6_D = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-6' AND `ud`.`abc` = 'D' GROUP BY `u`.`op` "); $r6_D = mysql_query($sql6_D); $total6_D = mysql_num_rows($r6_D); //------------------------- //------------------------- // CURVA E $sql6_E = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-6' AND `ud`.`abc` = 'E' GROUP BY `u`.`op` "); $r6_E = mysql_query($sql6_E); $total6_E = mysql_num_rows($r6_E); //------------------------- //------------------------- // CURVA D $sql6_D = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-6' AND `ud`.`abc` = 'D' GROUP BY `u`.`op` "); $r6_D = mysql_query($sql6_D); $total6_D = mysql_num_rows($r6_D); //------------------------- //------------------------- // CURVA E $sql6_E = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-6' AND `ud`.`abc` = 'E' GROUP BY `u`.`op` "); $r6_E = mysql_query($sql6_E); $total6_E = mysql_num_rows($r6_E); //------------------------- //------------------------- // CURVA A $sql6_S = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-6' AND `ud`.`abc` = 'S' GROUP BY `u`.`op` "); $r6_S = mysql_query($sql6_S); $total6_S = mysql_num_rows($r6_S); //------------------------- //------------------------- $sql6_so = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-6' AND situacao = 'SO' "); $r6_so = mysql_query($sql6_so); $total6_so = mysql_num_rows($r6_so); //------------------------- $sql6_fc = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-6' AND situacao = 'FC' "); $r6_fc = mysql_query($sql6_fc); $total6_fc = mysql_num_rows($r6_fc); //--------------------------------------------------- $sql6_pr = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-6' AND situacao = 'PR' "); $r6_pr = mysql_query($sql6_pr); $total6_pr = mysql_num_rows($r6_pr); //--------------------------------------------------- $sql6_mt = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-6' AND situacao = 'MT' "); $r6_mt = mysql_query($sql6_mt); $total6_mt = mysql_num_rows($r6_mt); //--------------------------------------------------- /* echo "IKS-6: ".$total6; echo "<br>"; echo "CURVA A: ".$total6_A."<br>"; echo "CURVA B: ".$total6_B."<br>"; echo "CURVA C: ".$total6_C."<br>"; echo "CURVA D: ".$total6_D."<br>"; echo "CURVA E: ".$total6_E."<br>"; echo "CURVA S: ".$total6_S."<br>"; echo "Separando(SO): ".$total6_so."<br>"; echo "Separando(FC): ".$total6_fc."<br>"; echo "Separando(PR): ".$total6_pr."<br>"; echo "Separando(MT): ".$total6_mt."<br>"; echo "<br>"; echo "************************************************************************* <br>"; */ //***** IKS-7 ************************************************************************************ $sql7 = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-7' "); $r7 = mysql_query($sql7); $total7 = mysql_num_rows($r7); //------------------------- //------------------------- // CURVA A $sql7_A = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-7' AND `ud`.`abc` = 'A' GROUP BY `u`.`op` "); $r7_A = mysql_query($sql7_A); $total7_A = mysql_num_rows($r7_A); //------------------------- // CURVA B $sql7_B = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-7' AND `ud`.`abc` = 'B' GROUP BY `u`.`op` "); $r7_B = mysql_query($sql7_B); $total7_B = mysql_num_rows($r7_B); //------------------------- // CURVA C $sql7_C = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-7' AND `ud`.`abc` = 'C' GROUP BY `u`.`op` "); $r7_C = mysql_query($sql7_C); $total7_C = mysql_num_rows($r7_C); //------------------------- // CURVA D $sql7_D = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-7' AND `ud`.`abc` = 'D' GROUP BY `u`.`op` "); $r7_D = mysql_query($sql7_D); $total7_D = mysql_num_rows($r7_D); //------------------------- // CURVA E $sql7_E = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-7' AND `ud`.`abc` = 'E' GROUP BY `u`.`op` "); $r7_E = mysql_query($sql7_E); $total7_E = mysql_num_rows($r7_E); //------------------------- // CURVA S $sql7_S = ("SELECT * FROM `dia` `u` INNER JOIN `estf004` `ud` ON `ud`.`estf_codiks` = `u`.`codiks` INNER JOIN `dia_falta` `udf` ON `udf`.`id_op` = `u`.`op` WHERE `u`.`status` = 'A' AND `u`.`planejador` = 'IKS-7' AND `ud`.`abc` = 'S' GROUP BY `u`.`op` "); $r7_S = mysql_query($sql7_S); $total7_S = mysql_num_rows($r7_S); //------------------------- //------------------------------------------ $sql7_so = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-7' AND situacao = 'SO' "); $r7_so = mysql_query($sql7_so); $total7_so = mysql_num_rows($r7_so); //------------------------- $sql7_fc = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-7' AND situacao = 'FC' "); $r7_fc = mysql_query($sql7_fc); $total7_fc = mysql_num_rows($r7_fc); //--------------------------------------------------- $sql7_pr = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-7' AND situacao = 'PR' "); $r7_pr = mysql_query($sql7_pr); $total7_pr = mysql_num_rows($r7_pr); //--------------------------------------------------- $sql7_mt = ("SELECT * FROM dia WHERE status = 'A' AND planejador = 'IKS-7' AND situacao = 'MT' "); $r7_mt = mysql_query($sql7_mt); $total7_mt = mysql_num_rows($r7_mt); //--------------------------------------------------- /* echo "IKS-7: ".$total7; echo "<br>"; echo "CURVA A: ".$total7_A."<br>"; echo "CURVA B: ".$total7_B."<br>"; echo "CURVA C: ".$total7_C."<br>"; echo "CURVA D: ".$total7_D."<br>"; echo "CURVA E: ".$total7_E."<br>"; echo "CURVA S: ".$total7_S."<br>"; echo "Separando(SO): ".$total7_so."<br>"; echo "Separando(FC): ".$total7_fc."<br>"; echo "Separando(PR): ".$total7_pr."<br>"; echo "Separando(MT): ".$total7_mt."<br>"; echo "<br>"; echo "************************************************************************* <br>"; <tr><td align="center" valign="middle"> */ //total situacao $total_so = $total0_so + $total1_so + $total2_so + $total3_so + $total4_so + $total5_so + $total6_so + $total7_so; $total_fc = $total0_fc + $total1_fc + $total2_fc + $total3_fc + $total4_fc + $total5_fc + $total6_fc + $total7_fc; $total_pr = $total0_pr + $total1_pr + $total2_pr + $total3_pr + $total4_pr + $total5_pr + $total6_pr + $total7_pr; $total_mt = $total0_mt + $total1_mt + $total2_mt + $total3_mt + $total4_mt + $total5_mt + $total6_mt + $total7_mt; //total curvas $total_A = $total0_A + $total1_A + $total2_A + $total3_A + $total4_A + $total5_A + $total6_A + $total7_A; $total_B = $total0_B + $total1_B + $total2_B + $total3_B + $total4_B + $total5_B + $total6_B + $total7_B; $total_C = $total0_C + $total1_C + $total2_C + $total3_C + $total4_C + $total5_C + $total6_C + $total7_C; $total_D = $total0_D + $total1_D + $total2_D + $total3_D + $total4_D + $total5_D + $total6_D + $total7_D; $total_E = $total0_E + $total1_E + $total2_E + $total3_E + $total4_E + $total5_E + $total6_E + $total7_E; $total_S = $total0_S + $total1_S + $total2_S + $total3_S + $total4_S + $total5_S + $total6_S + $total7_S; //total geral $geral = $total0 + $total1 + $total2 + $total3 + $total4 + $total5 + $total6 + $total7; ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=1.0, maximum-scale=2.0"> <title>Ordem de Produção</title> <!-- DataTables CSS --> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.12/css/jquery.dataTables.min.css"> <!-- jQuery --> <script type="text/javascript" charset="utf8" src="//code.jquery.com/jquery-1.12.3.js"></script> <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.12/js/jquery.dataTables.min.js"></script> <!-- ********************************************************************* --> <!-- Bootstrap --> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="assets/css/bootstrap-responsive.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="css/styles.css" /> <script src="js/bootstrap.min.js"></script> <!-- ********************************************************************* --> <style type="text/css" class="init"> .container { width: 85%; margin: auto; } .table td { text-align: center; font-family: verdana; font-size: 10pt; } .table th { text-align: center; font-family: verdana; font-size: 10pt; } .total1{ text-align: center; font-family: verdana; font-size: 10pt; font-weight: bold; background:#FFB90F; color:#000000; } .cinza {background:#f9f9f9;} .preto {background:#000000;} .branco {color:#AAAAAA;} .topo { background:#e6e6e6; color:#000000; } .plan { background:#B9D3EE; color:#000000; } </style> <script type="text/javascript"> function goBack() { window.history.go(-1); } </script> </head> <body> <div class="container"><!-- INICIO DO WELL --> <a href="#" class="btn btn-block btn-primary disabled" ><strong>Relatório de Ordem de Produção</strong></a> <br> <div class="well well-small"> <table class="table table-striped table-bordered table-condensed "> <thead> <tr heigth> <th class="plan">Planejador</th> <th class="plan">Separando (SO)</th> <th class="plan">Faltando Componente (FC)</th> <th class="plan">Processo (PR)</th> <th class="plan">Montando (MT)</th> <th class="plan" width="3%">A</th> <th class="plan" width="3%">B</th> <th class="plan" width="3%">C</th> <th class="plan" width="3%">D</th> <th class="plan" width="3%">E</th> <th class="plan" width="3%">S</th> <th class="plan">Subtotal</th> </tr> </thead> <tbody> <tr> <td class="plan">IKS-0</td> <td><?= $total0_so ?></td> <td><?= $total0_fc ?></td> <td><?= $total0_pr ?></td> <td><?= $total0_mt ?></td> <td><?= $total0_A ?></td> <td><?= $total0_B ?></td> <td><?= $total0_C ?></td> <td><?= $total0_D ?></td> <td><?= $total0_E ?></td> <td><?= $total0_S ?></td> <td><?= $total0 ?></td> </tr> <tr> <td class="plan">IKS-1</td> <td><?= $total1_so ?></td> <td><?= $total1_fc ?></td> <td><?= $total1_pr ?></td> <td><?= $total1_mt ?></td> <td><?= $total1_A ?></td> <td><?= $total1_B ?></td> <td><?= $total1_C ?></td> <td><?= $total1_D ?></td> <td><?= $total1_E ?></td> <td><?= $total1_S ?></td> <td><?= $total1 ?></td> </tr> <tr> <td class="plan">IKS-2</td> <td><?= $total2_so ?></td> <td><?= $total2_fc ?></td> <td><?= $total2_pr ?></td> <td><?= $total2_mt ?></td> <td><?= $total2_A ?></td> <td><?= $total2_B ?></td> <td><?= $total2_C ?></td> <td><?= $total2_D ?></td> <td><?= $total2_E ?></td> <td><?= $total2_S ?></td> <td><?= $total2 ?></td> </tr> <tr> <td class="plan">IKS-3</td> <td><?= $total3_so ?></td> <td><?= $total3_fc ?></td> <td><?= $total3_pr ?></td> <td><?= $total3_mt ?></td> <td><?= $total3_A ?></td> <td><?= $total3_B ?></td> <td><?= $total3_C ?></td> <td><?= $total3_D ?></td> <td><?= $total3_E ?></td> <td><?= $total3_S ?></td> <td><?= $total3 ?></td> </tr> <tr> <td class="plan">IKS-4</td> <td><?= $total4_so ?></td> <td><?= $total4_fc ?></td> <td><?= $total4_pr ?></td> <td><?= $total4_mt ?></td> <td><?= $total4_A ?></td> <td><?= $total4_B ?></td> <td><?= $total4_C ?></td> <td><?= $total4_D ?></td> <td><?= $total4_E ?></td> <td><?= $total4_S ?></td> <td><?= $total4 ?></td> </tr> <tr> <td class="plan">IKS-5</td> <td><?= $total5_so ?></td> <td><?= $total5_fc ?></td> <td><?= $total5_pr ?></td> <td><?= $total5_mt ?></td> <td><?= $total5_A ?></td> <td><?= $total5_B ?></td> <td><?= $total5_C ?></td> <td><?= $total5_D ?></td> <td><?= $total5_E ?></td> <td><?= $total5_S ?></td> <td><?= $total5 ?></td> </tr> <tr> <td class="plan">IKS-6</td> <td><?= $total6_so ?></td> <td><?= $total6_fc ?></td> <td><?= $total6_pr ?></td> <td><?= $total6_mt ?></td> <td><?= $total6_A ?></td> <td><?= $total6_B ?></td> <td><?= $total6_C ?></td> <td><?= $total6_D ?></td> <td><?= $total6_E ?></td> <td><?= $total6_S ?></td> <td><?= $total6 ?></td> </tr> <tr> <td class="plan">IKS-7</td> <td><?= $total7_so ?></td> <td><?= $total7_fc ?></td> <td><?= $total7_pr ?></td> <td><?= $total7_mt ?></td> <td><?= $total7_A ?></td> <td><?= $total7_B ?></td> <td><?= $total7_C ?></td> <td><?= $total7_D ?></td> <td><?= $total7_E ?></td> <td><?= $total7_S ?></td> <td><?= $total7 ?></td> </tr> <tr> <td class="total1">TOTAL</td> <td class="total1"><?= $total_so ?></td> <td class="total1"><?= $total_fc ?></td> <td class="total1"><?= $total_pr ?></td> <td class="total1"><?= $total_mt ?></td> <td class="total1"><?= $total_A ?></td> <td class="total1"><?= $total_B ?></td> <td class="total1"><?= $total_C ?></td> <td class="total1"><?= $total_D ?></td> <td class="total1"><?= $total_E ?></td> <td class="total1"><?= $total_S ?></td> <td class="total1"><?= $geral ?></td> </tr> </tbody> </table> </div> </div> <br> <center><button onclick="goBack()" class="btn btn-warning">Voltar</button></center>
  15. empirerock

    Ajuda com Select Count

    Boa tarde. Sim tentei, más não deu certo.
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.