Note that there are some explanatory texts on larger screens.

plurals
  1. POMulti-record edit with related data on Cakephp?
    primarykey
    data
    text
    <p>I'm developing a simple application with CakePhp, and need some help on creating a multi-record edit form using some related data. </p> <p>The application I'm developing is pretty straightforward, its main purpose is managing students records: updating, deleting, changing a student from one group to another, the usual suspects. </p> <p>The relevant tables of the database are:</p> <p><strong>group</strong> = (<em>id</em>, teacher, classroom, etc)<br> <strong>groups_students</strong>=(<em>groupID</em>, <em>studentID</em>, since, until)<br> <strong>students</strong> = (<em>id</em>, name, last_name, etc)<br> <strong>assitance</strong> = (<em>id</em>, assitance, date)<br> <strong>assistance_students</strong> (<em>studentID</em>, <em>assitanceID</em>, meta_information ) </p> <p>As you might have gathered from the tables above, the application is supposed to aid in recording assitance. Which is where I'm having some issues.</p> <p>What I want to do is this:</p> <ul> <li>Have the user select a group</li> <li>In de detail group, I'll have an action called "Register Assistance"</li> <li><p>Register assitance should redirect to a view in wich for every student belonging to that group, the user can see the student's assitance, edit them, and save. Something like this:</p> <p><img src="https://i.stack.imgur.com/Sw13d.jpg" alt="example of table/form"></p></li> </ul> <p>In which <strong>A</strong> stands for "Absent" and <strong>P</strong> for "Present" and the user can edit everyone, and the save.</p> <p>I just don't know how to go about that? How do I manage that? I've managed to create a multi-edit form for the assitance, but adding the related data is a pain, I don't know if I should query the students from the groups controllers and then pass that to the action to register assitance, or manage all the logic inside the assitance controller? </p> <p>Any help would be great,</p> <p>thanks!</p> <p>Edit: Here's the output of <code>$this-&gt;Student-&gt;find('first');</code></p> <pre><code>Array ( [Alumno] =&gt; Array ( [id] =&gt; 14 [tipo] =&gt; dni [dni] =&gt; 2321312312 [apellido] =&gt; COQUITO [nombre] =&gt; Pepe [carrera] =&gt; Composición Musical [creado] =&gt; 2011-01-08 17:59:00 [modificado] =&gt; 2011-01-08 17:59:00 ) ) </code></pre> <p>The output is in spanish. <strong>Alumno</strong> = Student, <strong>nombre</strong>= first name, <strong>apellido</strong>= last_name. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload