コード例 #1
0
    function component_estimate_details()
    {
        global $current_language, $app_list_strings;
        $object = new ComponentEstimateCalc();
        $mod_strings = return_module_language($current_language, $object->object_name);
        $html = '<br><table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabDetailView">
					  <tr> 
					    <td width="30%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot1">' . $mod_strings["LBL_NAME"] . '</span sugar="slot"></td> 
					    <td width="10%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot1">' . $mod_strings["LBL_TOTAL"] . '</span sugar="slot"></td> 
					    <td width="10%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot5">' . $mod_strings["LBL_PREPRESS_TOTAL"] . '</span sugar="slot"></td>
					    <td width="10%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot7">' . $mod_strings["LBL_PRESS_TOTAL"] . '</span sugar="slot"></td>
					    <td width="10%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot5">' . $mod_strings["LBL_PAPER_TOTAL"] . '</span sugar="slot"></td>
					    <td width="30%" style="text-align:left" class="tabDetailViewDL"><span sugar="slot7">' . $mod_strings["LBL_OPERATIONS_TOTAL"] . '</span sugar="slot"></td>
					  </tr></table>';
        echo $html;
        $query = 'SELECT id FROM componentestimatecalc WHERE estimate_id="' . $this->estimate_id . '" AND deleted=0 ';
        $result = $this->db->query($query, true, "Error filling layout fields: ");
        $i = 0;
        while (($row = $this->db->fetchByAssoc($result)) != null) {
            $i = $i + 1;
            $details = "details_" . $i;
            $update_estimate = "update_estimate_" . $i;
            $object->retrieve($row['id']);
            $total = $object->total_prepress + $object->total_press + $object->total_paper + $object->total_operations;
            $html = '<table  width="100%" border="0" cellspacing="0" cellpadding="0" class="tabDetailView"><tr>
					    <td align="left" width="30%" class="tabDetailViewDF"><span sugar="slot7b"><a href="index.php?module=ComponentEstimateCalc&action=DetailView&record=' . $object->id . '">' . $object->name . '</a></span sugar="slot"></td> 
					    <td width="10%" class="tabDetailViewDF"><span sugar="slot5b">' . $total . ' ' . $mod_strings["LBL_UNITS"] . '</span sugar="slot"></td>
					    <td width="10%" class="tabDetailViewDF"><span sugar="slot5b">' . $object->total_prepress . ' ' . $mod_strings["LBL_UNITS"] . '</span sugar="slot"></td>
					    <td width="10%" class="tabDetailViewDF"><span sugar="slot7b">' . $object->total_press . ' ' . $mod_strings["LBL_UNITS"] . '</span sugar="slot"></td>
					    <td width="10%" class="tabDetailViewDF"><span sugar="slot5b">' . $object->total_paper . ' ' . $mod_strings["LBL_UNITS"] . '</span sugar="slot"></td>
					    <td width="30%" class="tabDetailViewDF"><span sugar="slot7b">' . $object->total_operations . ' ' . $mod_strings["LBL_UNITS"] . '</span sugar="slot"></td>
					  </tr> 
					</table>';
            echo $html;
            $object->estimate_details($object->id, $details, $update_estimate);
        }
    }