sql:
SELECT ev_module.id, ev_module.name, ev_module.parent_id, ev_module.module_type, ev_module.pcs as qty, ev_module.details, ev_module.module_total_price, ev_module.notes as price, ev_module.notes as pcs FROM ev_module WHERE ev_module.module_type = 'module' AND ev_module.parent_id = '1' UNION ALL SELECT ev_module.id, ev_item.name, ev_module.parent_id, ev_module.module_type, ev_module.pcs as qty, ev_module.details, ev_module.module_total_price, ev_item.price, ev_item.pcs FROM ev_module, ev_item WHERE ev_module.pointer_id = ev_item.id AND ev_module.module_type = 'item' AND ev_module.parent_id = '1' UNION ALL SELECT ev_module.id, ev_fabrication.name, ev_module.parent_id, ev_module.module_type, ev_module.pcs as qty, ev_module.details, ev_module.module_total_price, ev_fabrication.price, ev_fabrication.vendor_id as pcs FROM ev_module, ev_fabrication WHERE ev_module.pointer_id = ev_fabrication.id AND ev_module.module_type = 'fabrication' AND ev_module.parent_id = '1' ORDER by parent_id ASC, id ASC

Array ( [0] => Array ( [id] => 2 [name] => Chassis [parent_id] => 1 [module_type] => module [qty] => 1 [details] => Nearly all t slot profile related areas. Maybe some switch panels or gauges would not be included. All structural items, whether necessary or not for functionality, are included under this module [e.g. floor, front suspension, brake mounts] [module_total_price] => 0 [price] => [pcs] => ) [1] => Array ( [id] => 3 [name] => Brake system [parent_id] => 1 [module_type] => module [qty] => 1 [details] => All non-mounting items of the brake system. From calipers to master cylinder to pedal and everything in between [module_total_price] => 0 [price] => [pcs] => ) [2] => Array ( [id] => 4 [name] => Front suspension [parent_id] => 1 [module_type] => module [qty] => 1 [details] => Control arms, coil overs, all brackets for mounting, bushings, ball joints, plates [module_total_price] => 0 [price] => [pcs] => ) [3] => Array ( [id] => 5 [name] => Steering system [parent_id] => 1 [module_type] => module [qty] => 1 [details] => Steering column out to the steering knuckle, but not the upright itself [module_total_price] => 0 [price] => [pcs] => ) [4] => Array ( [id] => 6 [name] => 12V system [parent_id] => 1 [module_type] => module [qty] => 1 [details] => All wiring and end points relying on 12V or 24V systems [module_total_price] => 0 [price] => [pcs] => ) [5] => Array ( [id] => 7 [name] => 72V system [parent_id] => 1 [module_type] => module [qty] => 1 [details] => Battery, breaker, wiring. switches, gauges, cases for gauges, cases for batteries [module_total_price] => 0 [price] => [pcs] => ) [6] => Array ( [id] => 8 [name] => Power Train [parent_id] => 1 [module_type] => module [qty] => 1 [details] => BLDC hub motor, upright, controller, mounting brackets, cases, [module_total_price] => 0 [price] => [pcs] => ) [7] => Array ( [id] => 9 [name] => Safety [parent_id] => 1 [module_type] => module [qty] => 1 [details] => This includes all things mandated for safety by the government, but not necessarily adding safety [e.g. windscreen on autocycle is required for manufacturers, but there is not definition nor is it necessary for the end user to keep it installed] [module_total_price] => 0 [price] => [pcs] => ) [8] => Array ( [id] => 291 [name] => Rear Suspension [parent_id] => 1 [module_type] => module [qty] => 1 [details] => Unlike the front suspension, this does include the aluminum bar that fits over the BLDC shaft. Also includes the 4 hole brackets that mount to the chassis [module_total_price] => 0 [price] => [pcs] => ) )
Module Data