Revision ab598b02
Von Sven Schöling vor mehr als 12 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
2576 | 2576 |
# setup sales contacts |
2577 | 2577 |
$query = qq|SELECT e.id, e.name |
2578 | 2578 |
FROM employee e |
2579 |
WHERE (e.sales = '1') AND (NOT e.id = ?)|; |
|
2579 |
WHERE (e.sales = '1') AND (NOT e.id = ?) |
|
2580 |
ORDER BY name|; |
|
2580 | 2581 |
$self->{all_employees} = selectall_hashref_query($self, $dbh, $query, $self->{employee_id}); |
2581 | 2582 |
|
2582 | 2583 |
# this is for self |
... | ... | |
2584 | 2585 |
{ id => $self->{employee_id}, |
2585 | 2586 |
name => $self->{employee} }); |
2586 | 2587 |
|
2587 |
# sort the whole thing |
|
2588 |
@{ $self->{all_employees} } = |
|
2589 |
sort { $a->{name} cmp $b->{name} } @{ $self->{all_employees} }; |
|
2590 |
|
|
2591 |
|
|
2592 | 2588 |
# prepare query for departments |
2593 | 2589 |
$query = qq|SELECT id, description |
2594 | 2590 |
FROM department |
Auch abrufbar als: Unified diff
employees direkt in der Datenbank sortieren.