How to put the list-item overlapping the form groups - twitter-bootstrap-3

Good day everyone, I want my search results to show on top of school association so that my form won't be broken, I want it to overlap the school association form-groups

Related

Display data horizontally in MS Access report

I am currently working with a MS Access database, which should store courses and their participants. Each course has multiple course days and I want to create a report on which the teacher can tick (if printed out) if the student is attending the current lesson.
Therefore I would like to display the names of the participants vertically and the course dates horizontally, but I got stuck at this point.
Like in the screenshot here:

order a table based on another column attribute

Ok so in my rails project I have these models: pools, memberships, and week_scores
Pool has_many :memberships
Membership has_many :week_scores
WeekScore also has an attribute week:integer that tells what week it is. That way I know if that table is of week 1 or week 6, etc.
WeekScore has an attribute score:integer where I save the points of each user. This makes me think I should change my model name to week_points...
Anyways, I want to show a table of all me the members of a pool sorted by the score they got in a certain week_score.
Just to clarify
The way I get to a ceratin week score right now is
member_score = member.week_scores.find_by(week: 5).score
//member is a member of a pool
For example,
Lets say its week 5,
I want to display the week 5 score of each member of the pool sorted by the score in descending order like so,
David.... 30pts
John..... 28pts
Josh..... 28pts
Mike..... 21pts
...so on
what would be the query i need to achieve this? Ive tried joins but it wont work but im new at this so im pretty sure this is easy to do Im just too newb to know.
Also.. I want to read more about databases and sql for rails so I get more familiar with this. Anyone care to recommend a book?
week5 = Pool.first.memberships.includes(:week_scores)
.where(:week_scores => {week: 5}).order('week_scores.score DESC')
week5.each do |membership|
puts "#{membership.member_name}: #{membership.week_scores.first.score}"
end

SQL query for game rental website - game delivery report

http://sqlfiddle.com/#!3/f2da70/13
I am creating a game rental website using MS SQL 08 and I have to create a report which will give me a list of all the games that need to be posted and to who.
This query will have to go through different stages:-
List the users that have not reached their game quota for that month based on the subscription package they have chosen and rental table.
Compare this list of users to their favourites list and asign a game to them based on what game is their highest priority and by date.
The game or games selected must be in stock which needs compared to quantity levels in games table.
I have a SQL query but it is not taking into consideration the dates that a user added a game to their favourites list, it works solely on priority level. I need to change this query so it picks the oldest date added if the priority of the games are the same. In this sample data in SQL Fiddle it should be giving me barcode 27 to match with Need for Speed Rivals but it is giving me FIFA 14 as it is the first favourite record it sees.
Also the report needs to show more than the game barcode, it needs to show user name and game details. It is also only working for a single user at the moment with with me entering a user ID manually but it should just go through all users.
If anyone can help me with this query it would be much appreicated it, just really dont know where to go from here.
change
ORDER BY Favourites.Priority
to
ORDER BY Favourites.Priority, Favourites.DatePicked asc

How do I make a shopping list from multiple recipes in an SQL database?

I'm working on using a recipe database in SQLw, like the one in this question (which has helped a lot already) Structuring a recipe database , to combine the ingredients of several user selected recipes to a shopping list.
Also, the items on this shopping list are to be divided in two categories (eg: "groceries" and "check pantry")
Example case:
User can select 7 recipes to make a weekly mealplan in a form (almost got this part)
The given output is a shopping list of all the ingredients marked as "groceries" and a "check stock" list of all the ingredients marked as "pantry".
Any help at all would be much appreciated!
I had just posted a full solution, but given the subject here looks like it may be homework, I'm just going to point you in the right direction. If this isn't homework, leave a comment and I'll put the full solution back.
Since you have multiple recipes, a normal selection based on joins would give you back multiple rows per ingredient. You want some way to roll up all of the rows for a given ingredient into a single row and show a total of the quantity that you need.

Ruby on Rails 3 - Modeling Products with Many Categories / Attributes

I am working on my first Rails website, a sort of shopping website: there are products sold through the website, each with multiple unique attributes.
The use case I am imagining is: a user visits the site looking to buy a used bed, they click through several higher categories until they find a bed of the correct size, something like this:
Furniture
---> Couch
---> Dresser
---> Bed
-------> Size
----------> King
----------> Queen
...
At each time the user clicks a more narrow category, they are supplied a menu with the next level of detail (a la NewEgg). When "Furniture" is clicked, all furniture is displayed, and a menu with the types of furniture appears. When "Bed" is clicked, all beds are displayed, and a menu showing the various attributes of a bed appears, etc.
So far, I have an "Item" parent class which contains all the attributes of every item sold through the website (price, description, etc...). I am stuck with what to do next.
My first instinct is to have subclasses, but they don't seem to be that useful. There is nothing about the "Furniture" subclass that would have anything new in it, other than definiting it to be furniture. Also, each parent class needs to know about its subclasses.
What sort of design pattern should I pursue to cleanly implement this model? I've been looking into nested sets, but I am not completely sure that's the way to go. Any guidance is appreciated.
Thanks!
Your categories clearly form a tree, which is probably why you're thinking about a class inheritance tree. However, you are correct that this isn't the right model, since subclasses do not add any functionality over their parents.
You should have a single "Item" class, which is a node in the category tree - with references to its parent category (another "Item", or null for the root) and its array of children (all "Item"s).
The correct place to store the information about the tree structure is the database. In your items table, add a "parent_id" column as a foreign key - to the items table.
As the user navigates down in the tree you show the subcategories by querying for the items whose parent_id equals the current item id.