Hello everybody, I’m developing a Time Bank ( sorry, cant link it because it’s my first post: en.wikipedia.org/wiki/Time_Banking ) I’ve started for the apprenticeship of IT degree.
I must say this is my first MVC framework and so far it’s far better than i would have expected! Considering that I’m learning MVC architecture and the framework I’m still saving at least half time in developing!
I don’t want to bore you so I’m going to the point now: in this time bank, users are supposed to select categories of services they can be helpful in, and those whom they may need help with. There are 20 category by now in my draft, and they are organized in main categories.
I’m now trying to store them in a class, under components folder, in this way:
$this->category = array(
'Lezioni'=>array(
0=>'Informatica',
1=>'Lingue',
2=>'Scuola ed universita\'',
3=>'Musica',
),
'Trasporto ed accompagnamento'=>array(
4=>'Trasporto',
5=>'Baby-sitting',
6=>'Animali domestici',
7=>'Gite'
),
'Casa'=>array(
8=>'Fai da te - Riparazioni',
9=>'Pulizia',
10=>'Giardinaggio',
11=>'Cucina - catering',
12=>'Cucito - maglieria',
13=>'Estetica - bellezza',
),
'Assistenza'=>array(
14=>'Informatica',
15=>'Consulenza',
16=>'Traduzioni',
),
'Attività'=>array(
17=>'Sport',
18=>'Artigianato',
19=>'Sartoria - abiti',
),
);
These are then needed so that users can select them by check-boxes and store selection in the database, and also select one of them as the category of their offers. The latter one is working pretty good with this method but I’m spending a lot of effort in implementing the first one, specially in the storing and fetching system.
By now I’m trying to use a binary string of 20 booleans and convert it to decimal, then store them in the user table.
The solution is working but looks definitively hackish, fancy and complex. So I wanted to ask if more experts users of this forum have any advice about it.
Thanks and sorry for the length…