Commit | Line | Data |
---|---|---|
696f20d5 MS |
1 | <?\r |
2 | class FormAdminUsuario extends Form {\r | |
3 | function FormAdminUsuario() {\r | |
4 | parent::Form("admin_usuario");\r | |
5 | \r | |
6 | }\r | |
7 | \r | |
8 | function configFields() {\r | |
9 | $f = $this->newField("char", array("nome", "Nome"));\r | |
10 | $f->maxlength = "100";\r | |
11 | $this->addField($f, "LOFIU");\r | |
12 | \r | |
13 | $f = $this->newField("char", array("email", "E-mail"));\r | |
14 | $f->loadConfig("email");\r | |
15 | $f->maxlength = "150";\r | |
16 | $this->addField($f, "LOFIU");\r | |
17 | \r | |
18 | $f = $this->newField("items", array("nivel", "Nível de Usuário"));\r | |
19 | $f->setInputType('radio');\r | |
20 | $f->addElementsByArray(array('1' => 'Administrador','2' => 'Professor'));\r | |
21 | $this->addField($f, "LOFIU");\r | |
22 | \r | |
23 | $f = $this->newField("ativo");\r | |
24 | $f->value_initial = 1;\r | |
25 | $this->addField($f, "LOFIU");\r | |
26 | \r | |
27 | $f = $this->newField("html", array("separador"));\r | |
28 | $this->addField($f);\r | |
29 | \r | |
30 | $f = $this->newField("char", array("usuario", "Usuário"));\r | |
31 | $f->maxlength = "60";\r | |
32 | $this->addField($f, "IU");\r | |
33 | \r | |
34 | $f = $this->newField("password", array("senha"));\r | |
35 | $f->maxlength = "15";\r | |
36 | $this->addField($f, "UI");\r | |
37 | \r | |
38 | $f = $this->newField('html',array('box'));\r | |
39 | $this->addField($f);\r | |
40 | \r | |
41 | $f = $this->newField('html',array('label', 'Sessões'));\r | |
42 | $this->addField($f);\r | |
43 | \r | |
44 | $f = $this->newField('multiItems', array('sessao','','admin_usuario_sessao','id_usuario','id_sessao'));\r | |
45 | $f->addElementsByTable('admin_sessao');\r | |
46 | $this->addField($f,'IU');\r | |
47 | \r | |
48 | }\r | |
49 | \r | |
50 | function getListSql($tmp_sql_filter, $tmp_sql_order) {\r | |
51 | global $profile;\r | |
52 | if ($profile->fields("id") != 1) {\r | |
53 | return "select * from ".$this->table." where id <> 1 ".$tmp_sql_filter." ".$tmp_sql_order;\r | |
54 | } else {\r | |
55 | return "select * from ".$this->table." where 1 = 1 ".$tmp_sql_filter." ".$tmp_sql_order;\r | |
56 | }\r | |
57 | }\r | |
58 | }\r | |
59 | ?> |