PageRenderTime 18ms CodeModel.GetById 15ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/apps/fitness/zones/ZonePerson.php

http://zoop.googlecode.com/
PHP | 40 lines | 34 code | 6 blank | 0 comment | 2 complexity | b9f8d7a6aa8c7980530a1d4c1f9c9b37 MD5 | raw file
 1<?php
 2class ZonePerson extends AppZone
 3{
 4	function pageDefault()
 5	{
 6		$this->redirect('list');
 7	}
 8	
 9	function pageList($p, $z)
10	{
11		$people = DbObject::_find('Person');
12		$this->assign('people', $people);
13	}
14	
15	function pageEdit($p, $z)
16	{
17		$personId = $p[1];
18		$person = new Person($personId);
19	}
20	
21	function postEdit($p, $z)
22	{
23		$personId = $p[1];
24		$person = new Person($personId);
25		$person->firstname = $_POST['firstname'];
26		$person->lastname = $_POST['lastname'];
27		$person->save();
28		
29		if($z['personId'] == 0)
30			$this->setParam('personId', $person->id);
31		
32		$this->redirect('view');
33	}
34	
35	function pageView($p, $z)
36	{
37		$person = new Person($z['personId']);
38		$this->assign('person', $person);
39	}
40}