lundi 21 novembre 2016

Display pictures based on specific value in datatable

I need a help with a simple Avatar system.

I have three tables - "LoginDetails" (consists of LoginDetails_ID, Username, Password), then "PersonalInfo" (consists of PersonalInfo_ID, FirstName, LastName, Age, Country, Phone, E-mail) and "PersonalAvatar" (Consists of PersonalAvatar_ID, Head, Body, Legs).

The logic behind is the following:

1.User inserts his Username and Password into a login form, these are checked with details in "LoginDetails" table and if there is a match, it will create a new session called same as his username and he will be redirected to the "Profile Page", which in simple grid view displays only his information from "PersonalInfo" table

// until this point I am fine


2. Out of this grid view, webpage should also contain 12 different pictures (100px x 100px) - 4 pictures of different heads, 4 pictures of different bodies and 4 pictures of different legs which all will represent some kind of "menu to choose from". Once user clicks on the first picture of head, value in Head column of "PersonalAvatar" table connected with his account will be "1", if he clicks on the next one, the value will be changed into "2", if third, then "3" and so on (same for body and legs).


3. All of these pictures in their bigger resolution should be displayed below in one big div, one below each other:

  • Picture_Head_1.jpg
  • Picture_Head_2.jpg
  • Picture_Head_3.jpg
  • Picture_Head_4.jpg
  • Picture_Body_1.jpg
  • Picture_Body_2.jpg
  • Picture_Body_3.jpg
  • Picture_Body_4.jpg
  • Picture_Legs_1.jpg
  • Picture_Legs_2.jpg
  • Picture_Legs_3.jpg
  • Picture_Legs_4.jpg


4. And finally, by default, these all should be hidden and then, once the webpage loads, it should check the values for this specific user in the PersonalAvatar and do something like:

  • if value of Head == 1, display Picture_Head_1.jpg
  • if value of Head == 2, display Picture_Head_2.jpg

etc. ...

Can anyone please help me with the code which will on Page_Load check these values and show only the correct pictures?

Thanks for help,

Martin

Aucun commentaire:

Enregistrer un commentaire