function admission_display($row) { $lvl = RegistrationLevel::cached_find_by_db_name($row->admission_level); $level = reg_level_with_price($lvl, $row->override_price); $badge = badge_label($row->badge_type); return "{$level} {$badge}"; }
function price_for(Attendee $attendee) { if (is_null($attendee->override_price) || $attendee->override_price == 0) { // NULL or 0 return $this->price(); } else { $lvl = RegistrationLevel::find_by_db_name($attendee->admission_level); $price_diff = $lvl->price - $attendee->override_price; return $this->price() + $price_diff; } }
public function validate() { $this->error_if_empty("legal_name"); $this->error_if_empty("birthdate"); if (!$this->error_on("birthdate")) { $this->error_if_invalid_date("birthdate"); } $this->error_if_empty("address1"); $this->error_if_empty("city"); $this->error_if_empty("state_prov"); $this->error_if_empty("postal_code"); $this->error_if_empty("phone_number"); // $this->error_if_empty("email"); // if(!$this->error_on("email")){ // $this->error_unless_regex_match("email", "/@/"); // } if (!empty($this->params["email"])) { $this->error_unless_regex_match("email", "/@/"); } $age = age_from_birthdate(@$this->params["birthdate"]); if ($age && $age < MINOR_AGE) { $this->error_if_empty("adult_legal_name"); $this->error_if_empty("adult_relationship"); $this->error_if_empty("adult_phone_number"); } $this->error_if_empty("badge_name"); $this->error_if_empty("admission_level"); if (!$this->error_on("admission_level")) { $lvl = RegistrationLevel::find_by_db_name(@$this->params["admission_level"]); if ($lvl && $lvl->includes_tshirt) { $this->error_if_empty("tshirt_size", "{$lvl->name} includes a T-Shirt."); } else { $this->error_unless_empty("tshirt_size", "Level doesn't include T-Shirt."); } } $this->error_if_empty("payment_method", "Select a payment method."); }
<?php include_once '../../../_includes/framework.php'; require_login(); if (!isset($form)) { $id = @$_GET['id']; $id or die("<p>Error, no attendee id.</p>"); $form = new UpgradeForm(["id" => $id]); } $current_level = RegistrationLevel::find_by_db_name($form->attendee->admission_level); $upgrades = RegistrationUpgrade::from_with_prices($form->attendee->admission_level); ?> <input type="hidden" name="id" value="<?php echo $id; ?> "> <div class="text-center"> <h2><?php echo $form->attendee->display_name(); ?> </h2> <?php if ($form->attendee->vendor()) { ?> <h4 class="text-muted"><?php echo $form->attendee->vendor()->display_name(); ?> </h4> <?php }
<?php include_once '../../../_includes/framework.php'; require_login(); if (!isset($form)) { $form = new AddAttendeeForm(); } $badge_types = BadgeType::all(); $reg_levels = RegistrationLevel::all(); $tshirt_sizes = TShirtSize::all(); $payment_types = PaymentType::all(); $vendors = Vendor::all(); ?> <div class="row"> <div class="form-group col-md-6 <?php echo $form->error_on("badge_name") ? "has-error" : ""; ?> "> <?php echo label_tag("badge_name", "Badge Name"); ?> <?php echo input_tag($form, "badge_name"); ?> <?php echo error_display($form, "badge_name"); ?> </div> <div class="form-group col-md-6 <?php
<?php include_once '../_includes/framework.php'; require_login(); $page_title = "Registration Levels"; include "_partials/admin-header.php"; $pre_reg_reg_levels = RegistrationLevel::pre_reg(); $at_door_reg_levels = RegistrationLevel::at_door(); $upgrades = RegistrationUpgrade::all_with_prices(); ?> <div class="container"> <div class="col-md-12"> <h1>Registration Levels</h1> </div> <div class="col-md-4 col-offset-4"> <h2>Pre Registered</h2> <table class="table"> <thead> <tr> <th>Level</th> <th>Price</th> </tr> </thead> <tbody> <?php foreach ($pre_reg_reg_levels as $level) { ?> <tr> <td><?php
protected static function valid_admission_levels() { return array_map(function ($lvl) { return $lvl->db_name; }, RegistrationLevel::cached_all()); }
<?php include_once '../../../_includes/framework.php'; require_admin(); $page_title = "Admin"; include "_partials/admin-header.php"; $levels = RegistrationLevel::pre_reg(); $badge_types = BadgeType::all(); $tshirt_sizes = TShirtSize::all(); $payment_types = PaymentType::all(); ?> <div class="container"> <div class="col-md-12"> <h1> Import Attendees from CSV </h1> <div class="well"> <form action="post-attendees.php" method="post" enctype="multipart/form-data" class="form"> <div class="form-group"> <label for="file">Select csv to upload:</label> <input type="file" name="file" id="file"> </div> <input type="submit" value="Import" name="submit" class="btn btn-default"> </form> </div> <p> To import from CSV, you'll need a CSV file with the following columns: </p> <table class="table"> <tr>