function componentsEstimate($estimate_id) { $component_html = ""; $component_estimate = new ComponentEstimateCalc(); $component_list = $component_estimate->get_full_list("id", "estimate_id='" . $estimate_id . "'"); $total_paper = 0; $total_prepress = 0; $total_press = 0; $total_operations = 0; for ($i = 0; $i < count($component_list); $i++) { $component_html = $component_html . '<tr>'; $component_html = $component_html . '<td style="background:inherit;" width="20%" class=tabDetailViewDF><span sugar="slot1b"><input name="component_name_' . $i . '" style="background:inherit; border-style:none;text-align:center;" readOnly tabindex="1" size="35" maxlength="50" type="text" value="' . $component_list[$i]->component_name . '" /></span sugar="slot"></td>'; $component_html = $component_html . '<td style="background:inherit;" width="8%" class=tabDetailViewDF><span sugar="slot1b"><input name="total_paper_' . $i . '" style="text-align:center;" tabindex="1" size="6" maxlength="50" type="text" value="' . $component_list[$i]->total_paper . '" /></span sugar="slot"></td>'; $component_html = $component_html . '<td style="background:inherit;" width="8%" class=tabDetailViewDF><span sugar="slot1b"><input name="total_prepress_' . $i . '" style="text-align:center;" tabindex="1" size="6" maxlength="50" type="text" value="' . $component_list[$i]->total_prepress . '" /></span sugar="slot"></td>'; $component_html = $component_html . '<td style="background:inherit;" width="8%" class=tabDetailViewDF><span sugar="slot1b"><input name="total_press_' . $i . '" style="text-align:center;" tabindex="1" size="6" maxlength="50" type="text" value="' . $component_list[$i]->total_press . '" /></span sugar="slot"></td>'; $component_html = $component_html . '<td style="background:inherit;" width="8%" class=tabDetailViewDF><span sugar="slot1b"><input name="total_operations_' . $i . '" style="text-align:center;" tabindex="1" size="6" maxlength="50" type="text" value="' . $component_list[$i]->total_operations . '" /></span sugar="slot"></td>'; $component_html = $component_html . '<td style="background:inherit;" width="56%" ></td>'; $component_html = $component_html . '</tr>'; $total_paper = $total_paper + $component_list[$i]->total_paper; $total_prepress = $total_prepress + $component_list[$i]->total_prepress; $total_press = $total_press + $component_list[$i]->total_press; $total_operations = $total_operations + $component_list[$i]->total_operations; } $total = $total_paper + $total_prepress + $total_press + $total_operations; $return_data = array(); $return_data['component_html'] = $component_html; $return_data['total_paper'] = $total_paper; $return_data['total_prepress'] = $total_prepress; $return_data['total_press'] = $total_press; $return_data['total_operations'] = $total_operations; $return_data['total'] = $total; return $return_data; }