public function testJsonSerialize() { $attendeeObject = new Attendee($this->responseArray); $attendeeJson = $attendeeObject->jsonSerialize(); $this->assertArrayHasKey('firstName', $attendeeJson); $this->assertArrayHasKey('lastName', $attendeeJson); $this->assertArrayHasKey('email', $attendeeJson); $this->assertArrayHasKey('groupName', $attendeeJson); }
function save() { if ($this->valid()) { $attendee = new Attendee($this->params); $attendee->apply_blacklist(); return $attendee->save(); } else { return false; } }
function attendees() { if (isset($this->attendees_records)) { return $this->attendees_records; } $this->attendees_records = Attendee::by_blacklist_id($this->id); return $this->attendees_records; }
function getAttendees(&$event) { global $tblprefix; $query = "SELECT " . Attendee::getFields('a') . "," . PersonDetail::getFields('p') . "," . Location::getFields('l') . " FROM " . $tblprefix . "attendee a" . " JOIN " . $tblprefix . "people p ON a.person_id = p.person_id" . " LEFT JOIN " . $tblprefix . "locations l ON l.location_id = a.location_id" . PersonDetail::getJoins(); $query .= " WHERE a.event_id = " . $event->event_id; $query .= $this->addPersonRestriction(" AND "); //TODO error message $result = $this->runQuery($query, ''); $res = array(); while ($row = $this->getNextRow($result)) { $e = new Attendee(); $e->loadFields($row, "a_"); $per = new PersonDetail(); $per->loadFields($row, L_HEADER, "p_"); $per->name->loadFields($row, "n_"); $per->name->person_id = $per->person_id; $e->person = $per; $e->location->loadFields($row, "l_"); $res[] = $e; } $this->freeResultSet($result); $event->attendees = $res; }
public function validate() { $this->error_if_empty("badge_name"); $this->error_if_empty("badge_number"); if (!$this->error_on("badge_number")) { if (!Attendee::is_unique_badge_number(@$this->params["badge_number"], $this->attendee)) { $this->add_error("badge_number", "Number is already assigned."); } } $this->error_if_empty("badge_type"); if (!$this->error_on("badge_type")) { $badge_type = BadgeType::find_by_db_name(@$this->params["badge_type"]); if (!$badge_type->minor && $this->attendee->minor()) { $this->add_error("badge_type", "Attendee is a minor."); } elseif ($badge_type->minor && !$this->attendee->minor()) { $this->add_error("badge_type", "Attendee is not a minor."); } } }
public function validate() { $age = age_from_birthdate(@$this->params["birthdate"]); $minor = $age && $age < MINOR_AGE; $this->error_if_empty("legal_name"); $this->error_if_empty("birthdate"); if (!$this->error_on("birthdate")) { $this->error_if_invalid_date("birthdate"); } // if($minor){ // $this->error_if_empty("adult_legal_name"); // $this->error_if_empty("adult_phone_number"); // } if (@$this->params["checked_in"]) { $this->error_if_empty("badge_number", "Already checked in, field required."); } if (!empty(@$this->params["badge_number"])) { if (!Attendee::is_unique_badge_number(@$this->params["badge_number"], $this->attendee)) { $this->add_error("badge_number", "Number is already assigned."); } } $this->error_if_empty("badge_name"); $this->error_if_empty("admission_level"); #$this->error_if_empty("payment_method", "Select a payment method."); $this->error_if_empty("badge_type"); if (!$this->error_on("badge_type")) { $badge_type = BadgeType::find_by_db_name(@$this->params["badge_type"]); if (!$badge_type->minor && $minor) { $this->add_error("badge_type", "Attendee is a minor."); } elseif ($badge_type->minor && !$minor) { $this->add_error("badge_type", "Attendee is not a minor."); } if ($badge_type->vendor && !$this->params["vendor_id"]) { $this->add_error("vendor_id", "Vendor Required."); } } if (@$this->params["blacklisted"]) { $this->error_if_empty("blacklist_type", "Blacklisted, type required."); $this->error_if_empty("blacklist_message", "Blacklisted, message required."); } }
public function validate() { $age = age_from_birthdate(@$this->params["birthdate"]); $minor = $age && $age < MINOR_AGE; $this->error_if_empty("badge_name"); $this->error_if_empty("badge_number"); if (!$this->error_on("badge_number")) { if (!Attendee::is_unique_badge_number(@$this->params["badge_number"], $this->attendee)) { $this->add_error("badge_number", "Number is already assigned."); } } $this->error_if_empty("badge_type"); if (!$this->error_on("badge_type")) { $badge_type = BadgeType::find_by_db_name(@$this->params["badge_type"]); if (!$badge_type->minor && $minor) { $this->add_error("badge_type", "Attendee is a minor."); } elseif ($badge_type->minor && !$minor) { $this->add_error("badge_type", "Attendee is not a minor."); } if ($badge_type->vendor && !$this->params["vendor_id"]) { $this->add_error("vendor_id", "Vendor Required."); } } $this->error_if_empty("legal_name"); $this->error_if_empty("birthdate"); if (!$this->error_on("birthdate")) { $this->error_if_invalid_date("birthdate"); } if (!$this->attendee->paid) { $this->error_if_empty("admission_level"); $this->error_if_empty("payment_method"); } if ($minor) { $this->error_if_empty("adult_relationship"); if ($this->params["adult_relationship"] != AdultRelationship::EMANCIPATED) { $this->error_if_empty("adult_legal_name"); $this->error_if_empty("adult_phone_number"); } } }
<?php include_once '../../../../_includes/framework.php'; require_admin(); $return_url = @$_POST['return_url'] ?: "/admin/index.php"; foreach (Attendee::all() as $attendee) { $attendee->apply_blacklist(); $attendee->save_without_callbacks(); } ?> <script> window.location = "<?php echo $return_url; ?> "; </script>
function getAttendeePlaces(&$locations, $person = null) { global $tblprefix, $strEvent, $datefmt; global $strBirthPlace, $strAddress; $query = "SELECT " . Attendee::getFields('a') . "," . PersonDetail::getFields('p') . ", " . Event::getFields("e") . "," . Location::getFields("l") . "," . Location::getFields("el") . " FROM " . $tblprefix . "attendee a" . " JOIN " . $tblprefix . "people p ON a.person_id = p.person_id" . " JOIN " . $tblprefix . "event e ON a.event_id = e.event_id" . " LEFT JOIN " . $tblprefix . "locations el ON el.location_id = e.location_id" . " LEFT JOIN " . $tblprefix . "locations l ON l.location_id = a.location_id" . PersonDetail::getJoins() . " WHERE (a.location_id is not null OR e.location_id is not null)" . " AND (NOT (e.etype = " . BANNS_EVENT . " OR e.etype=" . MARRIAGE_EVENT . "))"; $query .= $this->addPersonRestriction(" AND "); if ($locations->location_id > 0) { $query .= " AND (a.location_id = " . $locations->location_id . " OR e.location_id = " . $locations->location_id . ")"; } $presult = $this->runQuery($query, ""); while ($prow = $this->getNextRow($presult)) { $per = new PersonDetail(); $per->loadFields($prow, L_HEADER, 'p_'); $per->name->loadFields($prow, 'n_'); $per->setPermissions(); $e = new Event(); $e->loadFields($prow, "e_"); $loc = new Location(); $loc->loadFields($prow, "l_"); $loc->setPermissions(); if ($per->isViewable() && $loc->hasData()) { $text = $per->getLink() . ' '; switch ($e->type) { case CENSUS_EVENT: $text .= $strEvent[$e->type] . " " . $strBirthPlace; break; default: $text .= $strAddress; break; } $text .= ' ' . $e->getDate1(); if ($locations->location_id > 0 && $loc->location_id == $locations->location_id || $locations->location_id <= 0) { $p = $this->createPlace($locations, $loc, $text); } } $e->location->loadFields($prow, "el_"); $e->location->setPermissions(); if ($per->isViewable() && $e->location->hasData()) { $text = $per->getLink() . ' ' . $strEvent[$e->type] . ' ' . $e->getDate1(); if ($locations->location_id > 0 && $e->location->location_id == $locations->location_id || $locations->location_id <= 0) { $p = $this->createPlace($locations, $e->location, $text); } } } $this->freeResultSet($presult); }
//检查attendee数据 $check_ret = check_data($attendees_data[$key], $attendee_config); if ($check_ret['r'] == 'error') { die(json_encode($check_ret)); } else { $attendees_data[$key] = $check_ret['msg']; } ##检查email foreach ($attendees_data as $k => $v) { if ($attendee_data['email'] == $v['email'] && $key != $k) { $ret['r'] = 'error'; $ret['msg'] = '40002:' . $texts['email_repeat_error_1']; die(json_encode($ret)); } } $check_ret = Attendee::check_email_exists($activity_id, $attendee_data['email']); if ($check_ret['r'] == 'error') { $ret['r'] = 'error'; $ret['msg'] = '40002:' . $attendee_data['email'] . ' ' . $texts['email_repeat_error_2']; die(json_encode($ret)); } $attendees_data[$key]['ticket_id'] = $ticket_id; $attendees_data[$key]['company'] = $order_data['company_name']; } $write_order['attendees'] = $attendees_data; $order = new Order(); $create_ret = $order->create($write_order); if ($create_ret['r'] == 'error') { die(json_encode($create_ret)); } $order->generate_certificate();
switch ($tab) { case "badge": $type = BadgeType::cached_find_by_db_name($_GET["type"]); $query = Attendee::by_badge_type($type->db_name); break; case "under_minor_age": $query = Attendee::minors(); break; case "blacklisted": $query = Attendee::blacklisted(); break; case "canceled": $query = Attendee::canceled(); break; default: $query = Attendee::all(); } ?> <div class="container"> <div class="col-md-12"> <h1>All Attendees</h1> <ul class="nav nav-tabs"> <?php echo nav_link("All", "/admin/index.php", $tab == "all"); ?> <?php foreach ($badge_types as $bt) { ?> <?php echo nav_link($bt->name, "/admin/index.php?tab=badge&type={$bt->db_name}", $tab == "badge" && $bt->db_name == $type->db_name);
function __construct($params = []) { $this->attendee = Attendee::find($params["id"]); $this->params["canceled"] = $this->attendee->canceled; parent::__construct($params); }
<tr data-id="<?php echo $vendor->id; ?> "> <td><?php echo $vendor->display_name(); ?> </td> <td><?php echo $vendor->assigned_tables; ?> </td> <td> <ol class=""> <?php foreach (Attendee::by_vendor_id($vendor->id) as $attendee) { ?> <li> <?php echo $attendee->display_name(); ?> <?php echo badge_label($attendee->badge_type); ?> <?php echo edit_button_for($attendee, ["class" => ["btn-xs"]]); ?> </li> <?php
<?php include_once '../_includes/framework.php'; require_login(); $page_title = "Admin"; include "_partials/admin-header.php"; $query = Attendee::at_door_pending(); $count = count($query); ?> <div class="container"> <div class="col-md-12"> <h1> At Door Check In (<?php echo $count; ?> ) <small><?php echo add_attendee_button(); ?> </small> </h1> <?php foreach ($query as $attendee) { ?> <div class="col-md-6"> <div class="panel panel-default <?php echo row_highlight($attendee, "panel"); ?> " id="attendee-<?php echo $attendee->id;
$old->person_id = $rel->oldRelation; $pdao->getPersonDetails($old); $old = $old->results[0]; if (!$old->isEditable()) { die(include "inc/forbidden.inc.php"); } else { stamppeeps($old); } } $rel->setFromPost(); $e = new Event(); $e->setFromPost(); $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()) { $e->attendees[] = $a; } $prefix++; } $e->person = $rel->person; $rel->event = $e; $dao->saveRelationshipDetails($rel); $edao = getEventDAO(); $edao->stampAttendees($rel->event); }
assertequal($e1->exceptionDates()->size(), 1, "Read Event::exceptionDates()"); $va = $e1->alarms(); assertequal($va->size(), 2, "Event::alarms()"); $rr = new RecurrenceRule(); $rr->setFrequency(RecurrenceRule::Monthly); $byday = new vectordaypos(); $byday->push(new DayPos(2, kolabformat::Monday)); $byday->push(new DayPos(-1, kolabformat::Friday)); $rr->setByday($byday); $e1->setRecurrenceRule($rr); $xml = kolabformat::writeEvent($e1); #print $xml; assertcontains($xml, '<byday>2MO</byday><byday>-1FR</byday>', "Recurrence by weekday"); $att1 = new Attendee(new ContactReference("*****@*****.**")); $att1->setPartStat(kolabformat::PartDelegated); $att2 = new Attendee(new ContactReference("*****@*****.**")); $att1->setPartStat(kolabformat::PartNeedsAction); $vdelegatees = new vectorcontactref(); $vdelegatees->push($att2->contact()); $att1->setDelegatedTo($vdelegatees); $vdelegators = new vectorcontactref(); $vdelegators->push($att1->contact()); $att2->setDelegatedFrom($vdelegators); $attendees = new vectorattendee(); $attendees->push($att1); $attendees->push($att2); $e1->setAttendees($attendees); $xml = kolabformat::writeEvent($e1); assertcontains($xml, '<delegated-to><cal-address>mailto:%3Cjane%40kolab.org%3E</cal-address>', "Delegated-To"); assertcontains($xml, '<delegated-from><cal-address>mailto:%3Cjohn%40kolab.org%3E</cal-address>', "Delegated-From"); $e2 = kolabformat::readEvent($xml, false);
<?php include_once '../../../_includes/framework.php'; require_login(); $id = @$_POST['id']; $id or die("<p>Error, no attendee id.</p>"); $attendee = Attendee::find($id); $attendee or die("<p>No attendee with (ID={$id})"); $return_url = @$_POST['return_url'] ?: "/admin/index.php"; $form = new CheckInForm($_POST); if ($form->valid()) { $form->save(); # Kind of a bad hack but it works. ?> <script> window.location = "<?php echo $return_url; ?> "; </script> <?php } else { include "../forms/check-in-form.php"; }
<?php include_once '../_includes/framework.php'; require_login(); $page_title = "Admin"; include "_partials/admin-header.php"; $query = Attendee::pre_reg_pending(); $count = count($query); ?> <div class="container"> <div class="col-md-12"> <h1> Pre Reg Check In (<?php echo $count; ?> ) </h1> <table class="table table-striped table-condensed"> <thead> <tr> <th>Badge #</th> <th>Badge Name</th> <th>Legal Name</th> <th>Birthdate</th> <th>Level</th> <th>TShirt</th> <th class="hidden-print">Actions</th> </tr> </thead> <tbody>
<table class="table table-striped table-condensed"> <thead> <tr> <th>Number</th> <th>Badge Name</th> <th>Legal Name</th> <th>Birthdate</th> <th>Admission Level</th> <th>Adult</th> <th>Action</th> </tr> </thead> <tbody> <?php foreach (Attendee::search($search_string) as $attendee) { ?> <tr class="<?php echo row_highlight($attendee); ?> "> <td><?php echo hilight_search($search_string, $attendee->badge_number); ?> </td> <td><?php echo hilight_search($search_string, $attendee->badge_name); ?> </td> <td><?php echo hilight_search($search_string, $attendee->legal_name);
include_once '../../../_includes/framework.php'; require_login(); if (!isset($form)) { $id = @$_GET['id']; $id or die("<p>Error, no attendee id.</p>"); $form = new EditForm(["id" => $id]); } $badge_types = BadgeType::all(); $reg_levels = RegistrationLevel::all(); $tshirt_sizes = TShirtSize::all(); $payment_types = PaymentType::all(); $vendors = Vendor::all(); $adult_badge = null; if (!empty(@$form->params["adult_badge_number"])) { $adult_badge = Attendee::find_by_badge_number($form->params["adult_badge_number"]); } ?> <input type="hidden" name="id" value="<?php echo $id; ?> "> <div class="text-center <?php if ($form->attendee->canceled) { ?> canceled<?php } ?> "> <h2><?php
$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);
function __construct($params = []) { $this->attendee = Attendee::find($params["id"]); $this->params["admission_level"] = $this->attendee->admission_level; parent::__construct($params); }
public function inviteguest($id) { $invitee = DB::table('users')->where('email', Input::get('email'))->pluck('id'); $attendee = new Attendee(); $attendee->meetup_id = $id; $attendee->attendee_id = $invitee; $checkforinvite = DB::table('attendees')->where('meetup_id', $id)->where('attendee_id', $invitee)->pluck('attendee_id'); if ($invitee != null) { if ($checkforinvite == null) { $attendee->save(); Session::flash('successMessage', 'Guest successfully invited!'); return Redirect::action('MeetupsController@showinvite', array($id)); } else { Session::flash('errorMessage', 'This guest has already been invited!'); return Redirect::back(); } } else { Session::flash('errorMessage', 'This email does not exist in our system!'); return Redirect::back(); } }
private function _loadAttendees() { $this->_attendees = Attendee::loadByRaid($this->_id); }
$loc = "index.php"; } else { $peep->setFromPost(); 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;
function getCensusDetails(&$input) { global $tblprefix, $err_census_ret; $res = array(); $input->results = $res; $edquery = "SELECT cen.census_id, cen.census, schedule, year, census_date, cy.country, " . Event::getFields('e') . "," . PersonDetail::getFields() . "," . Attendee::getFields('a') . "," . Location::getFields('l') . "," . Location::getFields('al') . " FROM " . $tblprefix . "attendee a" . " JOIN " . $tblprefix . "event e ON a.event_id = e.event_id" . " JOIN " . $tblprefix . "census cen ON cen.event_id = e.event_id" . " JOIN " . $tblprefix . "people p ON a.person_id = p.person_id" . " LEFT JOIN " . $tblprefix . "locations l ON l.location_id = e.location_id" . " LEFT JOIN " . $tblprefix . "locations al ON al.location_id = a.location_id" . " LEFT JOIN " . $tblprefix . "census_years cy ON cen.census = cy.census_id" . PersonDetail::getJoins(); switch ($input->queryType) { case Q_TYPE: $where = ""; if (isset($input->schedule)) { $where = " WHERE e.reference =" . $input->schedule; } break; case Q_FAMILY: $where = " WHERE e.event_id = " . $input->event->event_id; if (!isset($input->event->event_id) || $input->event->event_id == '') { return; } break; default: $where = " WHERE p.person_id = " . $input->person->person_id; break; } $where .= $this->addPersonRestriction(" AND "); $orderby = " ORDER BY e.date1, b.date1"; $edquery .= $where . $orderby; if ($edresult = $this->runQuery($edquery, $err_census_ret)) { $input->numResults = 0; $events = array(); while ($edrow = $this->getNextRow($edresult)) { $cen = new CensusDetail(); $cen->loadFields($edrow); $e = new Event(); $e->loadFields($edrow, "e_"); $e->location->loadFields($edrow, "l_"); $new = false; if (isset($events[$e->event_id])) { $event = $events[$e->event_id]; } else { $new = true; $e->attendees = array(); $events[$e->event_id] = $e; $event = $e; } $a = new Attendee(); $a->person->loadFields($edrow, L_HEADER, "p_"); $a->person->name->loadFields($edrow, "n_"); if ($a->person->person_id == $event->person->person_id) { $event->person = $a->person; } $a->loadFields($edrow, "a_"); $a->location->loadFields($edrow, "al_"); $event->attendees[] = $a; //This is needed for php 4 $events[$event->event_id] = $event; if ($new) { $cen->event = $event; $input->numResults++; $res[] = $cen; } //This is also needed for php 4 for ($i = 0; $i < count($res); $i++) { if ($res[$i]->event->event_id == $event->event_id) { $c = $res[$i]; $c->event = $event; $res[$i] = $c; } } } $this->freeResultSet($edresult); } $input->results = $res; }
public function set_order($id) { $ret = array(); $set_ret = $this->set_order_data($id); if ($set_ret['r'] == 'error') { return $set_ret; } if ($this->order_data['show_attendee_info'] == '1') { $attendee = new Attendee(); $attendees_ret = $attendee->get_attendees_by_order($this->order_data['order_id']); if ($attendees_ret['r'] == 'error') { return $attendees_ret; } $this->attendees = $attendees_ret['msg']; } $tickets_ret = $this->set_tickets(); if ($tickets_ret['r'] == 'error') { return $tickets_ret; } $ret['r'] = 'ok'; return $ret; }
/** * @param Attendee $winner */ public function setWinner(Attendee $winner) { $this->setTweetMessage(sprintf($this->tweetMessage, $winner->getTweetName())); $this->winner = $winner; }