Advertisement
Guest User

Untitled

a guest
Jun 30th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. $arr1=[];
  2.  
  3. $sqlquery="Select codart,canped,codpro
  4. from gcpedl
  5. where gcpedl.numped in (
  6. select numped
  7. from gcpedc
  8. where texto like '".$_POST['codobra']."'
  9. )";
  10. $query_execute = mssql_query($sqlquery);
  11.  
  12. while($query_result=mssql_fetch_array($query_execute)){
  13. $arr1=$query_result;
  14. $sqlq="Select distinct alart.codart,pultcomp,alart.codpro from alart,gcpedl where gcpedl.numped in (select numped from gcpedc where texto like '".$_POST['codobra']."') and alart.codart in (Select codart from gcpedl where numped in (select numped from gcpedc where texto like '".$_POST['codobra']."')) ";
  15. $sqlex =mssql_query($sqlq);
  16.  
  17. while($sqlre=mssql_fetch_array($sqlex)){
  18. if ( trim(strtoUPPER($sqlre['codart'])," ")==trim(strtoUPPER($query_result['codart'])," ")
  19. and $sqlre['codpro']==$query_result['codpro'] )
  20. {
  21. if ( $arr1['codart'] != 'CUADRO'
  22. and $arr1['codart'] != 'cuadro'
  23. and $arr1['codart'] != 'instalacion'
  24. and $arr1['codart'] != 'INSTALACION')
  25. {
  26. $materiales= $materiales+ ($sqlre['pultcomp']*$arr1['canped']);
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement