summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets/protected/pages/Ticket528.php
blob: 2e05dbfd9563de15d6f4e8d43d1d456990eb9c4a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
Prado::using('System.Web.UI.ActiveControls.*');
class Ticket528 extends TPage
{
	 public static $turnos = array(
                    'M' => array('id_turno' => 'M', 'descricao' => 'Manhã'),
                    'T' => array('id_turno' => 'T', 'descricao' => 'Tarde'),
                    'N' => array('id_turno' => 'N', 'descricao' => 'Noite')
                   );


    public function onLoad($param)
    {
        parent::onLoad($param);
        if (!$this->IsPostBack) {
            $this->DDropTurno->loadOptions();
            $this->loadDadosTurno($this->DDropTurno->getSelectedValue());
        }
    }


    protected function loadDadosTurno($id)
    {
        $this->Codigo->setText(self::$turnos[$id]['id_turno']);
        $this->Descricao->setText(self::$turnos[$id]['descricao']);
    }


    public function trocaTurno($sender,$param)
    {
        $this->loadDadosTurno($sender->getSelectedValue());
    }
}

?>