$body_object->parent_id = $layout_id; foreach ($scalar_body_array as $key => $value) { $body_object->{$key} = $value; } $body_object->save(); $head_object = new DataSet_Attribute(); $head_object->parent_id = $layout_id; foreach ($scalar_head_array as $key => $value) { $head_object->{$key} = $value; } $head_object->save(); //end the for loop on scalar } ////Fill in attributes for all the scalar columns for ($i = 0; $i <= 5; $i++) { $layout_id = $format_object2->get_layout_id_from_parent_value("{sc}0{sc}" . $i . ""); $body_object = new DataSet_Attribute(); $body_object->parent_id = $layout_id; foreach ($scalar_body_array as $key => $value) { $body_object->{$key} = $value; } $body_object->save(); $head_object = new DataSet_Attribute(); $head_object->parent_id = $layout_id; foreach ($scalar_head_array as $key => $value) { $head_object->{$key} = $value; } $head_object->save(); //end the for loop on scalar } //////////////////Fill the Total Revenue Columns