SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2005
    Location
    alabama
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ? about email organization

    Alright so in my attachment, youll find 1 html form, and a 1 php emailer. Its not very complicated but im having trouble. Basically what happens is for dinner we take attendance here at school, and then I have to go and take out slips of paper with names and cross out who is there, and then give the lists of names to the people in charge of the dorms. I figured why not do it in email.

    So the system i have now is a list of some people (there will be more, but 6 for now) And they are all checked, that means they are ABSENT from dinner. When you check there name (acctually unchecking) then that means that they are at dinner and will not have their name emailed out. Because i only care about who is NOT at dinner.

    Now it works, itll email me the list of names, but my problem is that i want, in the email, the lists of names to be organized by what dorm they are in. I dont need them in 2 colums like they are in the html, just a list of them is fine, with the name at the top in front of the people. It doesnt have to be too dynamic, seeing as it will be updated only once a year.

    Any help would be appreciated.
    Attached Files Attached Files

  2. #2
    SitePoint Guru
    Join Date
    Aug 2001
    Location
    Amsterdam
    Posts
    788
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds to me you want to group the results..

    the attachment hasn't come through so I'm guessing here that a person can only be in one dorm.. so if everyone is in a database you can just order or group by the dorm..

    ie.

    PHP Code:
    table persons
    id
    name
    dorm
     
    $sql 
    'select id, name, dorm from persons order by dorm asc, name asc';
    $result mysql_query($sql); // I'm assuming you already have a db connection
    $dorm '';
    while(
    $row Mysql_fetch_array($result))
    {
    if (
    $dorm != $row['dorm'])
    {
    echo 
    $dorm.'<br/><hr/>';
    $dorm $row['dorm'];
    }
    echo 
    '<input type=checkbox name="person[]" value="'.$row['id'].'" checked />'.$row['name'].'<br/>';

    that would be a quick list of checkboxes..

    Hope it helps..

    Peanuts
    the neigbours (free) WIFI makes it just a little more fun

  3. #3
    SitePoint Member
    Join Date
    Jan 2005
    Location
    alabama
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any more help now that is attached?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •