143 Posts
Stef
10 years ago
8
Topic

Hi Seblod team...

I have a form where user can add several names on courses with a groupx (First name, Last name, job).

When I show the list type of this, i would like (in a table) to show how much people (like a "SUM" or whatever) is registred (instead of the details of each people registred).

Example : 

Now in a row I have :

Enterprise : 01 | responsable : Henri | Contact : 45 78 78 | Registred : Dupont Caro Fraiseur - Dupont Bob Conducteur

I would like :

Enterprise : 01 | responsable : Henri | Contact : 45 78 78| Registred : 2

I have no idea of the how to and help would be really appreciated here, thanks by advance ...

Get a Book for SEBLOD
4229 Posts
Kadministrator
10 years ago
1
Level 1

This should help you http://www.seblod.com/products/2239 - with the course id passed to WHERE you should be able to construct a COUNT query on your registered users.

143 Posts
Stef
10 years ago
0
Level 2

Sorry to bump this topic, i would really appreciate if somebody could help me to write the code here... To newbie to go on with this problem...

143 Posts
Stef
10 years ago
1
Level 1

Hi Klas, and thank you for answer...

The groupx i created is stored like this :

Custom | Article | introtex [field_groupx_name ]

So, data of the groupx for one record look like (example) :

::cck::62::/cck::<br />
::inscription_groupx_participants::1::/inscription_groupx_participants::<br />
<br />
::cck_inscription_groupx_participants::inscription_participants::/cck_inscription_groupx_participants::<br />
::inscription_participants_nom|0|inscription_groupx_participants::Bof::/inscription_participants_nom|0|inscription_groupx_participants::<br />
::inscription_participants_prenom|0|inscription_groupx_participants::Caroline::/inscription_participants_prenom|0|inscription_groupx_participants::<br />
::inscription_participants_fonction|0|inscription_groupx_participants::Manger des glaces::/inscription_participants_fonction|0|inscription_groupx_participants::<br />
::cckend_inscription_groupx_participants::::/cckend_inscription_groupx_participants::<br />

But I don't know how to write a SQL for that kind of data...

Have any suggestion ?

143 Posts
Stef
10 years ago
0
Level 2

I have noticed one thing in that example with 3 entries in groupx :

::cck::63::/cck::<br />
::inscription_groupx_participants::3::/inscription_groupx_participants::<br />
<br />
::cck_inscription_groupx_participants::inscription_participants::/cck_inscription_groupx_participants::<br />
::inscription_participants_nom|0|inscription_groupx_participants::Hack::/inscription_participants_nom|0|inscription_groupx_participants::<br />
::inscription_participants_prenom|0|inscription_groupx_participants::Bob::/inscription_participants_prenom|0|inscription_groupx_participants::<br />
::inscription_participants_fonction|0|inscription_groupx_participants::Perceur::/inscription_participants_fonction|0|inscription_groupx_participants::<br />
::cckend_inscription_groupx_participants::::/cckend_inscription_groupx_participants::<br />

::cck_inscription_groupx_participants::inscription_participants::/cck_inscription_groupx_participants::<br />
::inscription_participants_nom|1|inscription_groupx_participants::Spam::/inscription_participants_nom|1|inscription_groupx_participants::<br />
::inscription_participants_prenom|1|inscription_groupx_participants::John::/inscription_participants_prenom|1|inscription_groupx_participants::<br />
::inscription_participants_fonction|1|inscription_groupx_participants::Debiteur::/inscription_participants_fonction|1|inscription_groupx_participants::<br />
::cckend_inscription_groupx_participants::::/cckend_inscription_groupx_participants::<br />

::cck_inscription_groupx_participants::inscription_participants::/cck_inscription_groupx_participants::<br />
::inscription_participants_nom|2|inscription_groupx_participants::Troll::/inscription_participants_nom|2|inscription_groupx_participants::<br />
::inscription_participants_prenom|2|inscription_groupx_participants::Edouard::/inscription_participants_prenom|2|inscription_groupx_participants::<br />
::inscription_participants_fonction|2|inscription_groupx_participants::Fournaise::/inscription_participants_fonction|2|inscription_groupx_participants::<br />
::cckend_inscription_groupx_participants::::/cckend_inscription_groupx_participants::<br />

On each entry, there's a number like |2| for the last one here wich look increased on each entry...

Maybe can i get this number, add +1 to have the good total ?

If this is a good solution, could anybody help me to write the code to get this number ? Thanks by adavnce if it is possible...

4229 Posts
Kadministrator
10 years ago
1
Level 1

Hi,

I was wrong in my previous answer, this can't be done with databaser typography field as data is stored in introtext. 

I made a new small typography plugin Count Group X for this, you can find it in the attachment. Please report if it work ok for you.

143 Posts
Stef
10 years ago
0
Level 2

Hi Klas,

thank you ver much for your work, that's really appreciated... :-)

I have installed the plugin, checked if enabled. Then go back to my List & search, find the group X field in List vue. Go on "2" for typographie but didn't find any "Count Group X" choise there, did I miss something ?

4229 Posts
Kadministrator
10 years ago
1
Level 1

Hi,

sorry, I made a small mistake packing the plugin, please use this version

Also, you need to reinstall Seblod, just install version you have already installed once more (do NOT uninstall existing one). First version of the plugin mistakenly installed in date type plugin folder, so this needs to be overwritten with the right files.

143 Posts
Stef
10 years ago
0
Level 2

Hi Klas,

OK every things works wfine for me. That's great, THanks a lot for your help here...

Get a Book for SEBLOD