1

Hi I am a beginner and I have a little project to organise people in groups on screen:

I have a php code which can list on screen Distribution lists Member lists and Peoples. But I haven't had to much experience with this case. I wonder if someone could give me some hint to be able to build it:

Distribution lists         |       Member list        |          People
                         ADD->                     <-ADD

   All                     |       Group 3            |      []  Contact A
[] Group 1                 |       Contact 3          |      []  Contact B
[] Group 2                 |       Contact 5          |      []  Contact C
[] Group 3                 |       Group  6           |      []  Contact D
[] ...                     |       ...                |          ...

So when you click on any Distribution list you'll get the Member list and you can add people to it. Ideally would be nice to do without recall the whole page but I don't want to ask too much.

Is there anybody out there to help a bit? Thanks a lot - I know is a complex question but there is always hope.

php code of my:

<?php

// left table
echo "<div id='left'><label>Distribution list</label><table id='tblist'><tr><th>&nbsp;</th><th>Dist list</th></tr>";
$sql=... //done
foreach ($pdo->query($sqla) as $rowa) {
  $rowsa=$rowsa.'<tr><td><input type="checkbox" name="" value="" /></td><td>'.$rowa['grname'].'</td></tr>';
echo $rowsa."</table></div>";

// moving buttons
echo "<div id='leftbuttons'><input type='submit' value='Add ->> '><br /></div>";

// mid table
<?php
echo "<div id='mid'><label>Member list</label><table id='tblist'><tr><th>&nbsp;</th><th>Members:</th></tr>";
// left table
$sql=... //done
... // same as above
echo $rowsa."</table></div>";

// moving buttons
echo "<div id='rightbuttons'><input type='submit' value='<<- Add '><br /></div>";

// right table
<?php
echo "<div id='right'><label>People</label><table id='tblist'><tr><th>&nbsp;</th><th>Names</th></tr>";
// left table
$sql=... //done
... // same as above
echo $rowsa."</table></div>";

?>

Hope it is not too messy like this. Thanks again.

TryHarder
  • 750
  • 1
  • 9
  • 22

2 Answers2

0

You should have a look at some Javascript libraries. Here's an example in Ext JS: http://docs.sencha.com/ext-js/4-0/#!/example/dd/dnd_grid_to_grid.html

Rijk
  • 11,032
  • 3
  • 30
  • 45
  • thanks for the hint I am looking at right now, but I still don't know when will record it to the SQL make sure that nothing will be lost. Also we talking about 3000 record... would JS cope with it? These are just questions before I start to build together. thanks again – TryHarder Aug 26 '11 at 11:59
0

After a little homework doing and lots of questioning this link gives a working solution. Probably not the best but it works.

php form submit - Q2

if anybody's got a better one please don't hesitate to let me know!!! thanks

Community
  • 1
  • 1
TryHarder
  • 750
  • 1
  • 9
  • 22