wiki:ViewComponents

Version 10 (modified by 233051, 14 hours ago) ( diff )

--

View of all components & their details

Actors

Guest, User, Admin

Scenario

  1. The user clicks on the "COMPONENTS" dropdown

  1. A list of all the component types is displayed and the users chooses one

  1. A popup of all the components of that type is displayed
SELECT *
FROM components
WHERE name ILIKE ('%' || $q || '%')
ORDER BY
  CASE WHEN $sort = 'price_asc'  THEN price END ASC,
  CASE WHEN $sort = 'price_desc' THEN price END DESC,
  price DESC
LIMIT COALESCE($limit, 100);

  1. The user can sort by price

  1. The users can view the details of a component by clicking on it
SELECT *
FROM components
WHERE id = $componentId
LIMIT 1;

SELECT *
FROM $details_table   -- cpu/gpu/memory/storage/power_supply/motherboard/pc_case/cooler/...
WHERE component_id = $componentId
LIMIT 1;

-- if type == pc_case:
SELECT * FROM case_storage_form_factors WHERE case_id = $componentId;
SELECT * FROM case_ps_form_factors      WHERE case_id = $componentId;
SELECT * FROM case_mobo_form_factors    WHERE case_id = $componentId;

-- if type == 'cooler':
SELECT * FROM cooler_cpu_sockets WHERE cooler_id = $componentId;

Attachments (5)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.