Hello everyone,
My researches didn't show me how to resolve my problem so I explain it here.
First, I beg you to accept my apologies if I don't speak a "good" english (I'm french ^^') and if the same topic had already been posted. I've found nothing during my researches...
After, I want to thank the developers because I think that Chronoform is really a very useful module! I'm very surprised because it offers a lot of options and it's very adaptable too. I've realised the most of my forms and data display with it. Just great !
For my studies, I have a annual project and it's about oral exams managements, etc. Then, I want to load some data from a table using the DB Record Loader. So, I've read and tested a tutorial called "CFV4_db_record_loader.pdf" because I have the last Chronoforms module. I've followed it step by step but nothing is working... I've tried to test et modify some fields in the parameters but nothing...
More about my datas :
- my table is called "#__chronoforms_data_Planning_Etudiant" and contains the following fields :
[list]
cf_id = primary key
cf_user_id = user_id of the current logged student
cf_id_soutenant = user_id of the student who has oral exam
resume = abstract of the oral exam
mot_cle_1 = keyword #1
...
mot_cle_5 = keyword #5 [/list]
- I've selected this table in the Table field
- I want to load my data according to one "cf_id_soutenant" so I've put it in the DB Field
- Like the tutorial, I've put "token" in Request Param
- I've displayed my form in my navigator and I added to the URL : "&token=389"
After that, I've had no data displayed into my forms. So I've took care about name all the fields of my form like the name of the columns of my table as you can see on the following picture.
[attachment=1]01.png[/attachment]
I've retried but nothing has worked... So I've enabled to load the data under a Model ID that I've called "SelectSoutenant". I've changed the name of all the fields in my form like the following picture :
[attachment=0]02.png[/attachment]
I've tried with or without quotes but it hasn't worked too...
Obviously, before each test, I've saved my form and reload it in a navigator.
I hope that you can help me and I can explain certain points that you won't understand well. I really thank you for reading and helping (I hope🙂 ).
Kat.
My researches didn't show me how to resolve my problem so I explain it here.
First, I beg you to accept my apologies if I don't speak a "good" english (I'm french ^^') and if the same topic had already been posted. I've found nothing during my researches...
After, I want to thank the developers because I think that Chronoform is really a very useful module! I'm very surprised because it offers a lot of options and it's very adaptable too. I've realised the most of my forms and data display with it. Just great !
For my studies, I have a annual project and it's about oral exams managements, etc. Then, I want to load some data from a table using the DB Record Loader. So, I've read and tested a tutorial called "CFV4_db_record_loader.pdf" because I have the last Chronoforms module. I've followed it step by step but nothing is working... I've tried to test et modify some fields in the parameters but nothing...
More about my datas :
- my table is called "#__chronoforms_data_Planning_Etudiant" and contains the following fields :
[list]
- I've selected this table in the Table field
- I want to load my data according to one "cf_id_soutenant" so I've put it in the DB Field
- Like the tutorial, I've put "token" in Request Param
- I've displayed my form in my navigator and I added to the URL : "&token=389"
After that, I've had no data displayed into my forms. So I've took care about name all the fields of my form like the name of the columns of my table as you can see on the following picture.
[attachment=1]01.png[/attachment]
I've retried but nothing has worked... So I've enabled to load the data under a Model ID that I've called "SelectSoutenant". I've changed the name of all the fields in my form like the following picture :
[attachment=0]02.png[/attachment]
I've tried with or without quotes but it hasn't worked too...
Obviously, before each test, I've saved my form and reload it in a navigator.
I hope that you can help me and I can explain certain points that you won't understand well. I really thank you for reading and helping (I hope🙂 ).
Kat.
Salut Kat,
Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.
That should show the DB Query that is being created and any data that is being loaded.
Bob
Please drag a Debugger action into the On Submit event, then submit the form and post the debug results here.
That should show the DB Query that is being created and any data that is being loaded.
Bob
Thank you very much for your answer. I didn't know that the debug permits this kind of things but I'll test it because it could help me for other queries, I'm sure. I'll post you all the results as soon as possible🙂 !
So, this is the result displayed by the debugger :
Perhaps should I explain more about what I want to do with my table... As I said on my previous post, my annual project is about oral exam of students called "Soutenant" in french. This evaluation is based on a web form that I have to realise. First, the examinator has to choose the name of the student in a select. To realise this part, I've created a form composed by one custom code and one submit button :

This is the content of my custom code :
My events part is composed by JOIN SQL query which is represented like this :

The DB Multi Record Loader (21) selects my table "#__chronoforms_data_Planning_Etudiant" and save the results under a ModelID called "PlanningPerso". I indicate the associated model which is called ComProfiler and the DB Multi Record Loader (21) loads the data where : "cf_user_id = <?php $user =& JFactory::getUser();
$userId = $user->get('id'); echo $userId; ?>" and I display the field "cf_id_soutenant".
This code allows me to gather the id of the current logged user (who is the examinator or student who is giving his/her opinion about the oral exam) :
If there are any records found, I launch the DB Multi Record Loader (22) which selects my table called "#__comprofiler" (created by Community Builder) and save the records under another Model ID called "ComProfiler". I indicate that I'm using a INNER JOIN type with this rule : "ComProfiler.id = PlanningPerso.cf_id_soutenant'". I also indicate the associated model "PlanningPerso" and I rewrite the join rule in the "WHERE statement" because I've realised that without this statement, the query doesn't work (join rule : "ComProfiler.id = PlanningPerso.cf_id_soutenant"). Then, I display this fields : firstname, lastname, cb_heuresoutenance, cb_lieusoutenance.
If there are any records found, I show the HTML. I also indicate which query could be empty thanks to custom code where I've put "Table vide !" ("Empty table in french").
On Submit of the FIRST form, I've put the Debugger, a custom code and show form (the second composed by resume, mot_cle_1, etc). This is my custom code which extracts the "cf_id_soutenant" (here it's 389):
So, I've finished with the first form... The second form is represented like this :

There is also another custom code only to recap the previous data like the firstname, lastname, etc. You can see the code here :
I've created one field per column of my table (#__chronoforms_data_Planning_Etudiant) because I've understood that it works like this when we want to load data into a form. Perhaps I'm making a mistake ^^'. I don't want to display them so I've created hidden filed. They could also be useful to gather the various id for example. At last, I've put a submit button called "Modifier" (french word for "Modify").
So, this is my events part :

In this part, I've wanted to load only one record then I've used the DB Record Loader (17). I've wanted to load all the columns of my table where the "cf_id_soutenant" equals to "389" for example. You can see on the following picture all the parameters that I've put :


I haven't put more things in the advanced part.
Then, if there is a record, the form is shown. Else, an error message os displayed.
On submit, I've put a custom code which contains this code :
If there are data in my table, I want to display them into my form because the examintor could modify them. Else, the form is empty because there are no data saved and the examinator could fill it and save his/her new data in the table.
If there are data in my table, I want to display them into my form because the examinator could modify them. Else, the form is empty because there are no data saved and the examinator could fill it and save his/her new data in the table.
I don't know if my explanations are helpful and clear. One more time, thank you very much to help me🙂 (and sorry for the long, long, very long post ^^').
Kat.
So, this is the result displayed by the debugger :
Data Array:
Array
(
[chronoform] => Planning-Etudiant-Selection-Formulaire
[event] => submit
[Itemid] => 138
[option] => com_chronoforms
[view] => form
[soutenants] => 389-_-GARON-_-Jeff-_-14h-_-Amphi Chimie I-_-Traitement de données
[input_modify] => Modifier
[39f94bb648bf462cd4a2531670e61b8c] => 1
)
Validation Errors:
Array
(
)
Perhaps should I explain more about what I want to do with my table... As I said on my previous post, my annual project is about oral exam of students called "Soutenant" in french. This evaluation is based on a web form that I have to realise. First, the examinator has to choose the name of the student in a select. To realise this part, I've created a form composed by one custom code and one submit button :

This is the content of my custom code :
<?php
//$tab = split('-_-', $_POST['soutenants']);
echo "tab : ".$tab['0']."<br>";
?>
<table>
<tr>
<td>
Sélectionnez une soutenance à modifier :
</td>
<td>
<select name = "soutenants">
<?php
foreach ($form->data['ComProfiler'] as $details):
$lastname = strtoupper($details['lastname']);
$data = $details['user_id']."-_-".$lastname."-_-".$details['firstname']."-_-".$details['cb_heuresoutenance']."-_-".$details['cb_lieusoutenance']."-_-".$details['cb_sujetstage'];
echo "<option value = \"".$data."\">";
echo $lastname ." ". $details['firstname'] ." - ". $details['cb_sujetstage'];
echo "</option>";
endforeach;
?>
</select>
</td>
</tr>
</table>
My events part is composed by JOIN SQL query which is represented like this :

The DB Multi Record Loader (21) selects my table "#__chronoforms_data_Planning_Etudiant" and save the results under a ModelID called "PlanningPerso". I indicate the associated model which is called ComProfiler and the DB Multi Record Loader (21) loads the data where : "cf_user_id = <?php $user =& JFactory::getUser();
$userId = $user->get('id'); echo $userId; ?>" and I display the field "cf_id_soutenant".
This code allows me to gather the id of the current logged user (who is the examinator or student who is giving his/her opinion about the oral exam) :
cf_user_id = <?php $user =& JFactory::getUser();
$userId = $user->get('id'); echo $userId; ?>
If there are any records found, I launch the DB Multi Record Loader (22) which selects my table called "#__comprofiler" (created by Community Builder) and save the records under another Model ID called "ComProfiler". I indicate that I'm using a INNER JOIN type with this rule : "ComProfiler.id = PlanningPerso.cf_id_soutenant'". I also indicate the associated model "PlanningPerso" and I rewrite the join rule in the "WHERE statement" because I've realised that without this statement, the query doesn't work (join rule : "ComProfiler.id = PlanningPerso.cf_id_soutenant"). Then, I display this fields : firstname, lastname, cb_heuresoutenance, cb_lieusoutenance.
If there are any records found, I show the HTML. I also indicate which query could be empty thanks to custom code where I've put "Table vide !" ("Empty table in french").
On Submit of the FIRST form, I've put the Debugger, a custom code and show form (the second composed by resume, mot_cle_1, etc). This is my custom code which extracts the "cf_id_soutenant" (here it's 389):
<?php
$tab = split('-_-', $_POST['soutenants']);
//echo "tab : ".$tab['0']."<br>";
?>
So, I've finished with the first form... The second form is represented like this :

There is also another custom code only to recap the previous data like the firstname, lastname, etc. You can see the code here :
<?php
$tab = split('-_-', $_POST['soutenants']);
echo "tab : ".$tab['0']."<br>";
?>
<?php
$tab = array();
$tab = explode('-_-', $_POST['soutenants']);
?>
<table>
<?php
echo "<br>";
if (!empty($tab[1])) {
echo "<tr>";
echo "<td>";
echo "Nom : ";
echo "</td>";
echo "<td>";
echo strtoupper($tab[1]);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "Prénom : ";
echo "</td>";
echo "<td>";
echo $tab[2];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "Heure : ";
echo "</td>";
echo "<td>";
echo $tab[3];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "Lieu : ";
echo "</td>";
echo "<td>";
echo $tab[4];
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td>";
echo "Titre du stage : ";
echo "</td>";
echo "<td>";
echo $tab[5];
echo "</td>";
echo "</tr>";
}
?>
</table>
I've created one field per column of my table (#__chronoforms_data_Planning_Etudiant) because I've understood that it works like this when we want to load data into a form. Perhaps I'm making a mistake ^^'. I don't want to display them so I've created hidden filed. They could also be useful to gather the various id for example. At last, I've put a submit button called "Modifier" (french word for "Modify").
So, this is my events part :

In this part, I've wanted to load only one record then I've used the DB Record Loader (17). I've wanted to load all the columns of my table where the "cf_id_soutenant" equals to "389" for example. You can see on the following picture all the parameters that I've put :


I haven't put more things in the advanced part.
Then, if there is a record, the form is shown. Else, an error message os displayed.
On submit, I've put a custom code which contains this code :
<?php
$db = &JFactory::getDBO();
$update = "
UPDATE desstaup_chronoforms_data_Planning_Etudiant
SET resume = '".$_POST['input_resume']."',
mot_cle_1 = '".$_POST['input_mot_cle_1']."',
mot_cle_2 = '".$_POST['input_mot_cle_2']."',
mot_cle_3 = '".$_POST['input_mot_cle_3']."',
mot_cle_4 = '".$_POST['input_mot_cle_4']."',
mot_cle_5 = '".$_POST['input_mot_cle_5']."'
WHERE cf_id_soutenant = '"./*$_POST['input_id']*/ $tab['0'] ."';
";
echo "<br><br>UPDATE : ". $update;
$db->setQuery($update);
if ($db->query()) {
echo "Modifications enregistrées !";
}
else {
echo "Une erreur est survenue. <br>Veuillez contacter l'administrateur.";
}
?>
If there are data in my table, I want to display them into my form because the examintor could modify them. Else, the form is empty because there are no data saved and the examinator could fill it and save his/her new data in the table.
If there are data in my table, I want to display them into my form because the examinator could modify them. Else, the form is empty because there are no data saved and the examinator could fill it and save his/her new data in the table.
I don't know if my explanations are helpful and clear. One more time, thank you very much to help me🙂 (and sorry for the long, long, very long post ^^').
Kat.
Nobody has any idea ? Please, tell me if you could help me or not🙂. This project is very important to me. So if there is no solution, it doesn't matter, I will code the entire form without using features but it could be a waste if I don't use the features of Chronoform ^^'.
Kat.
Kat.
Hi Kat,
I have your post open waiting for me to find the time to understand it. I'm afraid that the simple five-minute answers take priority over those that take fifteen minutes to read :-(
Bob
I have your post open waiting for me to find the time to understand it. I'm afraid that the simple five-minute answers take priority over those that take fifteen minutes to read :-(
Bob
Hello🙂 !
Aawww ok I understand ! Sorry for the previous message, I thought that you've forgot my post ^^'.
I will search again and again but do not hesitate to ask me for more information🙂.
PS : I will host my images in another host because pix-toile-libre has apparently shut down...
Thank you🙂
Kat.
Aawww ok I understand ! Sorry for the previous message, I thought that you've forgot my post ^^'.
I will search again and again but do not hesitate to ask me for more information🙂.
PS : I will host my images in another host because pix-toile-libre has apparently shut down...
Thank you🙂
Kat.
Hi Kat,
You can add images directly here - use the Add Attachment link under the post editor.
Bob
You can add images directly here - use the Add Attachment link under the post editor.
Bob
Salut Kat,
I've read this several times . . . and I don't' know what your question is? Which part isn't working?
It all looks very complex and I'm not sure if that is how you've coded it or a result of working with Community Builder tables - I think a part of each.
Please ask me a single question to start with to help me focus where it is useful.
Bob
I've read this several times . . . and I don't' know what your question is? Which part isn't working?
It all looks very complex and I'm not sure if that is how you've coded it or a result of working with Community Builder tables - I think a part of each.
Please ask me a single question to start with to help me focus where it is useful.
Bob
Hmm... Yes I understand, it's very complex. So first, are you sure that your tutorial (here) is correct with the new version of ChronoForms? (I don't say that to offense you but sometimes, some things change between two versions). Second, according to you, how can I load only one table record in my form using a variable saved in the $_POST array?
Don't hesitate to flood me with question, I will glad to answer them !
Also, I have already said that but I repeat it again : thank you a LOT for your patience and your help.
You are better than French admins😉 !
Don't hesitate to flood me with question, I will glad to answer them !
Also, I have already said that but I repeat it again : thank you a LOT for your patience and your help.
You are better than French admins😉 !
This topic is locked and no more replies can be posted.
