/sonnax-html/includes/part_finder/backups/results_1_hpts_BAK_2008-01-23.php

https://github.com/sonnaxindustries/sonnax_php · PHP · 133 lines · 130 code · 1 blank · 2 comment · 27 complexity · 2be94c5379b56a1b04e3db54f4fec3ff MD5 · raw file

  1. <div id='scroll'><!--pl #1: hpt(s)-->
  2. <form method=get action="add_to_order.php">
  3. <input type="hidden" name="component" value="0">
  4. <input type="hidden" name="tc" value="0">
  5. <input type="hidden" name="pl" value="1">
  6. <!-- START OF TITLE ROW -->
  7. <div class='med_short' style='font-weight:bold;'>Product Line</div>
  8. <div class='med_short' style='font-weight:bold;'>Part Number</div>
  9. <div class='long1' style='font-weight:bold;'>Description</div>
  10. <div class='med_long' style='font-weight:bold;'><!-- Description 2 --></div>
  11. <div class='short' style='font-weight:bold;'>Make</div>
  12. <div class='short' style='font-weight:bold;'>Units</div>
  13. <div class='shortest' style='font-weight:bold;'>Price</div>
  14. <div class='shortest' style='font-weight:bold;'>Qty</div>
  15. <div class="line"></div>
  16. <!-- END OF TITLE ROW -->
  17. <?
  18. if ( !is_null($part_finder->part_stack) && !is_null($part_finder->part_stack->stack) && $part_finder->search_state ==2 ) {
  19. // we have parts in the stack
  20. $part_stack = $part_finder->part_stack;// PartStack object
  21. $counter = 0;
  22. while ($part = $part_stack->removePart()) { // a part object from the array of parts
  23. $product_line = new ProductLine($part->product_line);
  24. ?>
  25. <div class='med_short'><?=$product_line->name?></div>
  26. <?if ($part_finder_admin == true) {//this may be a relic?>
  27. <div class='med_short'><a href='table_edit.php?t=parts&if=id&strLookupField_Names=product_line&strLookupField_Fields=id,name&strLookupField_OrderBys=name&strLookupField_Tables=product_lines&id=<?=$part->id?>&pl=<?=$part_finder->product_line?>'><?=$part->part_number?></a></div>
  28. <?} else {
  29. if ($part->new_item == 1) {
  30. $str_highlighted = "_highlighted";
  31. $str_highlighted_link = "style='color: #EEEEEE;text-decoration: none;' ";
  32. } else {
  33. $str_highlighted = "";//"_".$part->new_item."_";
  34. $str_highlighted_link = "";
  35. }?>
  36. <div class='med_short<?=$str_highlighted?>'><a <?=$str_highlighted_link?>href='part_summary.php?id=<?=$part->id?>&pl=<?=$part_finder->product_line?>'><?=$part->part_number?></a></div>
  37. <?}?>
  38. <div class='long1'><?=cp1252_to_utf8($part->description)?></div>
  39. <div class='med_long'><?=cp1252_to_utf8($part->notes)?></div>
  40. <?
  41. $make = new Make($part_finder->make_id);
  42. $make_name = $make->make;
  43. $units = $part->getUnitsContainingPart($make->id);
  44. $unitsUpperBound = count($units) - 1;
  45. unset($unitList);
  46. for ($y=0; $y <= $unitsUpperBound; $y++) {
  47. $brief_unit = new UnitBrief($units[$y]);
  48. if ($y < $unitsUpperBound) {
  49. $unitList .= "<a href='part_finder.php?unit=$brief_unit->id&make=$make->id&pl=$part_finder->product_line'>$brief_unit->name</a>, ";
  50. } else {
  51. $unitList .= "<a href='part_finder.php?unit=$brief_unit->id&make=$make->id&pl=$part_finder->product_line'>$brief_unit->name</a>";
  52. }
  53. }
  54. $counter++;
  55. ?>
  56. <div class='short'><?=$make_name?></div>
  57. <div class='short'><?=$unitList?></div>
  58. <div class='shortest'>$<?=number_format($part->price,2)?></div>
  59. <div class='shortest'><input type="text" name="<?=$part->id?>" class="field"></div>
  60. <div class="line"></div>
  61. <?
  62. }
  63. } elseif ( !is_null($part_finder->part_stack) && !is_null($part_finder->part_stack->stack) && $part_finder->search_state ==1 ) {
  64. $store_part_id = 0;
  65. $part_stack = $part_finder->part_stack; // PartStack object
  66. $no_return = $part_stack->sortByPartNumber;
  67. while ($part = $part_stack->removePart()) { // a part object from the array of parts
  68. $product_line = new ProductLine($part->product_line);
  69. $makes = $part->getMakesPartAppliesTo();
  70. $makesUpperBound = count($makes) - 1;
  71. for ($x=0; $x <= $makesUpperBound; $x++) {
  72. ?>
  73. <div class='med_short'><?=$product_line->name?></div>
  74. <?if ($part_finder_admin == true) {//this may be a relic?>
  75. <div class='med_short'><a href='table_edit.php?t=parts&if=id&strLookupField_Names=product_line&strLookupField_Fields=id,name&strLookupField_OrderBys=name&strLookupField_Tables=product_lines&id=<?=$part->id?>&pl=<?=$part_finder->product_line?>'><?=$part->part_number?></a></div>
  76. <?} else {
  77. if ($part->new_item == 1) {
  78. $str_highlighted = "_highlighted";
  79. $str_highlighted_link = "style='color: #EEEEEE;text-decoration: none;' ";
  80. } else {
  81. $str_highlighted = "";//"_".$part->new_item."_";
  82. $str_highlighted_link = "";
  83. }?>
  84. <div class='med_short<?=$str_highlighted?>'><a <?=$str_highlighted_link?>href='part_summary.php?id=<?=$part->id?>&pl=<?=$part_finder->product_line?>&make=<?=$makes[$x]?>&unit='><?=$part->part_number?></a></div>
  85. <?}?>
  86. <div class='long1'><?=cp1252_to_utf8($part->description)?></div>
  87. <div class='med_long'><?=cp1252_to_utf8($part->notes)?></div>
  88. <?
  89. $make = new Make($makes[$x]);
  90. $make_name = $make->make;
  91. $units = $part->getUnitsContainingPart($makes[$x]);
  92. $unitsUpperBound = count($units) - 1;
  93. unset($unitList);
  94. for ($y=0; $y <= $unitsUpperBound; $y++) {
  95. $brief_unit = new UnitBrief($units[$y]);
  96. if ($y < $unitsUpperBound) {
  97. $unitList .= "<a href='part_finder.php?unit=$brief_unit->id&make=$makes[$x]&pl=$part_finder->product_line'>$brief_unit->name</a>, ";
  98. } else {
  99. $unitList .= "<a href='part_finder.php?unit=$brief_unit->id&make=$makes[$x]&pl=$part_finder->product_line'>$brief_unit->name</a>";
  100. }
  101. }
  102. ?>
  103. <div class='short'><?=$make_name?></div>
  104. <div class='short'><?=$unitList?></div>
  105. <div class='shortest'>$<?=number_format($part->price,2)?></div>
  106. <div class='shortest'>
  107. <?
  108. if ($part->id != $store_part_id) {
  109. ?>
  110. <input type="text" name="<?=$part->id?>" class="field">
  111. <?
  112. }
  113. ?>
  114. </div>
  115. <div class="line"></div>
  116. <?
  117. $store_part_id = $part->id;
  118. }
  119. }
  120. } else {
  121. // no parts in the stack
  122. ?>
  123. <div class="cleaner"></div>
  124. <div class='long1' style='width:760px;text-align:center;font-weight:bold;font-size:16px;'><?=$part_finder->search_message?></div>
  125. <?
  126. }
  127. ?>
  128. <div class="line"></div>
  129. </div>
  130. <div class="cleaner"></div>
  131. <input type='submit' name='add_to_order' value='ADD TO ORDER' class='submit' style='margin-left:570px;width:106px;'>&nbsp;&nbsp;<input type='submit' name='view_cart' value='VIEW ORDER' class='submit' style='width:90px;'>
  132. </form>