示例#1
0
    $e = new Event();
    $e->setFromPost();
    $prefix = 'a';
    $e->sources = array();
    while (isset($_POST[$prefix . "_title"])) {
        $s = new Source();
        $s->setFromPost($prefix . "_");
        if ($s->hasData()) {
            $e->sources[] = $s;
        }
        $prefix++;
    }
    $prefix = 'a';
    $e->attendees = array();
    while (isset($_POST[$prefix . "person_id"])) {
        $a = new Attendee();
        $a->setFromPost($prefix);
        $l = new Location();
        $l->setFromPost($prefix);
        $a->location = $l;
        if ($a->hasData() || $a->person->person_id == $e->person->person_id) {
            $e->attendees[] = $a;
        }
        $prefix++;
    }
    $cen->event = $e;
    $dao->saveCensusDetails($cen);
    $edao = getEventDAO();
    $edao->stampAttendees($cen->event);
}
header("Location: people.php?person=" . $cen->person->person_id);
示例#2
0
 if (isset($peep->person_id)) {
     $peep->name = new Name();
     unset($peep->date_of_birth);
     unset($peep->gender);
     $peep->queryType = Q_IND;
     $dao->getPersonDetails($peep);
     $peep = $peep->results[0];
     if (!$peep->isEditable()) {
         die(include "inc/forbidden.inc.php");
     }
 }
 $per->setFromPost();
 $a = new Attendee();
 $a->setFromPost('');
 $attendee = false;
 if ($a->hasData()) {
     $attendee = true;
 }
 $per->events = array();
 for ($i = 0; $i < 4; $i++) {
     $e = new Event();
     $e->setFromPost($strEvent[$i]);
     $addEvent = false;
     if ($e->hasData()) {
         $addEvent = true;
     }
     if ($e->type == BIRTH_EVENT && $attendee) {
         $addEvent = true;
         $e->attendees = array();
         if ($a->person->person_id == '') {
             $a->person->person_id = $per->father->person_id;