本文整理汇总了PHP中Participant类的典型用法代码示例。如果您正苦于以下问题:PHP Participant类的具体用法?PHP Participant怎么用?PHP Participant使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Participant类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: updateDetails
public function updateDetails()
{
if (Session::has('collId')) {
$cId = Session::get('collId');
$tmp = Participant::where('cId', $cId);
$phone = Input::get('pPhone');
$destination = getcwd() . "\\public\\img\\participants\\";
if ($tmp) {
$tmp->delete();
}
foreach (Input::get('pName') as $key => $name) {
if (strlen($name) > 0) {
$p = new Participant();
$p->cId = $cId;
$p->pid = $key + 1;
$p->name = $name;
if (strlen($phone[$key]) > 0) {
$p->phone = $phone[$key];
}
$p->save();
}
}
for ($i = 0; $i < sizeof(Input::file('image')); $i++) {
if (Input::hasFile('image')) {
$file = Input::file('image');
$filename = "myfile" . $i . "." . $file[$i]->getClientOriginalExtension();
$flag = $file[$i]->move($destination, $filename);
}
}
return Redirect::to('member');
}
return Redirect::to('reg');
}
示例2: createParticipant
/**
* Simple function to create a participant associated with this registration
*
* @param mixed $data
*
* @return Participant
*/
public function createParticipant($data)
{
$participant = new Participant($this->client, $data, $this->event, $this);
$this->participants[] = $participant;
$participant->create();
return $participant;
}
示例3: run
public function run()
{
$participants = DB::table('event_participant')->get();
foreach ($participants as $participant) {
$player = Player::find($participant->player_id);
$user = User::find($participant->user_id);
$event = Evento::find($participant->event_id);
$payment = Payment::find($participant->payment_id);
$uuid = Uuid::generate();
$new = new Participant();
$new->id = $uuid;
$new->firstname = $player->firstname;
$new->lastname = $player->lastname;
$new->due = $event->getOriginal('fee');
$new->early_due = $event->getOriginal('early_fee');
$new->early_due_deadline = $event->early_deadline;
$new->method = 'full';
$new->plan_id = Null;
$new->player_id = $player->id;
$new->event_id = $participant->event_id;
$new->accepted_on = $participant->created_at;
$new->accepted_by = $user->profile->firstname . " " . $user->profile->lastname;
$new->accepted_user = $participant->user_id;
$new->status = 1;
$new->created_at = $participant->created_at;
$new->updated_at = $participant->updated_at;
$new->save();
$update = Item::where('payment_id', '=', $payment->id)->firstOrFail();
$update->participant_id = $uuid;
$update->save();
}
}
示例4: updateDetails
public function updateDetails()
{
if (Session::has('sense')) {
$cId = Session::get('sense')[1];
$tmp = Participant::where('cId', $cId);
$phone = Input::get('pPhone');
if ($tmp) {
$tmp->delete();
}
foreach (Input::get('pName') as $key => $name) {
if (strlen($name) > 0) {
$p = new Participant();
$p->cId = $cId;
$p->pid = $key + 1;
$p->name = $name;
if (strlen($phone[$key]) > 0) {
$p->phone = $phone[$key];
}
$p->save();
}
}
return Redirect::to('member/coll');
}
return Redirect::to('reg');
}
示例5: smarty_function_part
/**
* get data for a participant and create a smarty $part variable
*/
function smarty_function_part($params, &$smarty)
{
if (!Check::digits($params['part_id'], $empty = false)) {
return;
}
$p = new Participant();
$smarty->assign('part', $p->getone($params['part_id']));
}
示例6: contains
/**
* Check if a participant can be found within the list.
*
* @param \model\Participant $participant The needle to look for.
*
* @return Boolean
*/
public function contains(Participant $participant)
{
foreach ($this->portfolioOwners as $key => $owner) {
if ($owner->getUnique() == $participant->getUnique() && $owner->getName() == $participant->getName()) {
return true;
}
}
return false;
}
示例7: delete
/**
* Delete this student or related object.
* If no parameters are set, this method deletes current student and all participant record related with this student.
* @param DataMapper|string $object related object to delete from relation.
* @param string $related_field relation internal name.
*/
public function delete($object = '', $related_field = '')
{
if (empty($object) && !is_array($object) && !empty($this->id)) {
$participant = new Participant();
$participant->where_related($this);
$participant->get();
$participant->delete_all();
}
parent::delete($object, $related_field);
}
示例8: getRankOf
public function getRankOf(Participant $participant)
{
$ticket = $this->findOneBy(array('participant' => $participant));
$parent_ticket = $this->findOneBy(array('participant' => $participant->getInvitedBy()));
if ($parent_ticket != null && $ticket->getTime() > $parent_ticket->getTime()) {
$ticket = $parent_ticket;
}
if ($ticket == null) {
return -1;
}
return $this->createQueryBuilder('ticket')->select("count(ticket.id)")->where('ticket.time < :date')->setParameter('date', $ticket->getTime())->getQuery()->getSingleScalarResult() + 1;
}
示例9: smarty_function_parts
/**
* get data for all participants in a study and create a smarty $parts variable
*/
function smarty_function_parts($params, &$smarty)
{
if (!Check::digits($params['study_id'], $empty = false)) {
return;
}
if ($params['all']) {
$active = null;
} else {
$active = 1;
}
$p = new Participant();
$smarty->assign('parts', $p->studyparts($_SESSION['user']['researcher_id'], $params['study_id'], $active));
}
示例10: add
public function add(Participant $participant)
{
$db = $this->connection();
$sql = "INSERT INTO {$this->dbTable} (" . self::$key . ", " . self::$name . ") VALUES (?, ?)";
$params = array($participant->getUnique(), $participant->getName());
$query = $db->prepare($sql);
$query->execute($params);
foreach ($participant->getProjects()->toArray() as $project) {
$sql = "INSERT INTO " . self::$projectTable . " (" . self::$key . ", " . self::$name . ", participantUnique) VALUES (?, ?, ?)";
$query = $db->prepare($sql);
$query->execute(array($project->getUnique(), $project->getName(), $participant->getUnique()));
}
}
示例11: validateLogin
function validateLogin()
{
if (!Check::isemail($email = $_REQUEST['email'])) {
return "ERROR: invalid email!";
}
if (!Check::ismd5($password = $_REQUEST['password'])) {
return "ERROR: bad password hash!";
}
$p = new Participant();
if ($p->enrolled($email, $password)) {
return "OK";
}
return "ERROR: participant {$email} not found";
}
示例12: list_import_prepare
function list_import_prepare()
{
$CI =& get_instance();
$periods = new Period();
$periods->truncate();
echo 'LIST periods table truncated ...' . "\n";
$courses = new Course();
$courses->truncate();
echo 'LIST courses table truncated ...' . "\n";
$groups = new Group();
$groups->truncate();
echo 'LIST groups table truncated ...' . "\n";
$rooms = new Room();
$rooms->truncate();
echo 'LIST rooms table truncated ...' . "\n";
$participants = new Participant();
$participants->truncate();
echo 'LIST participants table truncated ...' . "\n";
$CI->db->simple_query('TRUNCATE TABLE `course_task_set_type_rel`');
echo 'LIST course_task_set_type_rel table truncated ...' . "\n";
$categories = new Category();
$categories->truncate();
echo 'LIST categories table truncated ...' . "\n";
$tasks = new Task();
$tasks->truncate();
$CI->lang->delete_overlays('tasks');
unlink_recursive('private/uploads/task_files/', FALSE);
unlink_recursive('private/uploads/unit_tests/', FALSE);
echo 'LIST tasks table truncated ...' . "\n";
$CI->db->simple_query('TRUNCATE TABLE `task_category_rel`');
echo 'LIST task_category_rel table truncated ...' . "\n";
$task_set_types = new Task_set_type();
$task_set_types->truncate();
echo 'LIST task_set_types table truncated ...' . "\n";
$task_sets = new Task_set();
$task_sets->truncate();
$CI->lang->delete_overlays('task_sets');
echo 'LIST task_sets table truncated ...' . "\n";
$comments = new Comment();
$comments->truncate();
echo 'LIST comments table truncated ...' . "\n";
$solutions = new Solution();
$solutions->truncate();
unlink_recursive('private/uploads/solutions/', FALSE);
echo 'LIST solutions table truncated ...' . "\n";
$CI->db->simple_query('TRUNCATE TABLE `task_task_set_rel`');
echo 'LIST task_task_set_rel table truncated ...' . "\n";
}
示例13: profile
/**
* @before _secure
*/
public function profile()
{
$this->seo(array("title" => "Profile", "view" => $this->getLayoutView()));
$view = $this->getActionView();
$participants = Participant::all(array("user_id = ?" => $this->user->id), array("campaign_id", "id", "created"));
$view->set("participants", $participants);
}
示例14: destroy
public static function destroy($id)
{
self::check_admin_logged_in();
$participant = Participant::find($id);
Participant::delete($id);
Participant::nullify_and_update_competition_standings($participant->competition_id);
Redirect::to('/competition/' . $participant->competition_id . '/participants', array('message' => 'Kilpailija ' . $participant->competitor_name . ' poistettiin onnistuneesti kilpailusta ' . $participant->competition_name));
}
示例15: isActive
function isActive($db)
{
if ($this->private) {
return ExceptionTrigger::raise(new GenericException('このイベントに参加することは出来ません'));
}
if ($this->periodDate < time()) {
return ExceptionTrigger::raise(new GenericException('参加登録期限が過ぎています'));
}
if ($db->count(new Participant(), new C(Q::eq(Participant::columnEvent(), $this->id))) >= $this->maxParticipant) {
return ExceptionTrigger::raise(new GenericException('参加登録可能人数を超えています'));
}
return true;
}