Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 76c486e3

Von Sven Schöling vor fast 15 Jahren hinzugefügt

  • ID 76c486e3bf157e844b0cf11828d55dae2cb7e439
  • Vorgänger 3d967be3
  • Nachfolger c510d88b

Und wieder ein Schwung strict.

Unterschiede anzeigen:

SL/LICENSES.pm
35 35

  
36 36
use SL::Form;
37 37

  
38
use strict;
39

  
38 40
sub save_license {
39 41
  $main::lxdebug->enter_sub();
40 42

  
41 43
  my ($self, $myconfig, $form) = @_;
42 44

  
43
  $dbh = $form->dbconnect($myconfig);
45
  my $dbh = $form->dbconnect($myconfig);
44 46

  
45
  $query =
47
  my $query =
46 48
    qq| INSERT INTO license (licensenumber) VALUES ('$form->{licensenumber}')|;
47
  $sth = $dbh->prepare($query);
49
  my $sth = $dbh->prepare($query);
48 50
  $sth->execute || $form->dberror($query);
49 51
  $sth->finish();
50 52

  
......
52 54
    qq|SELECT l.id FROM license l WHERE l.licensenumber = '$form->{licensenumber}'|;
53 55
  $sth = $dbh->prepare($query);
54 56
  $sth->execute || $form->dberror($query);
55
  ($license_id) = $sth->fetchrow_array;
57
  my ($license_id) = $sth->fetchrow_array;
56 58
  $sth->finish();
57 59

  
58 60
  # save license
......
88 90
  my $sth   = $dbh->prepare($query);
89 91
  $sth->execute || $form->dberror($query);
90 92
  $form->{"all_customers"} = [];
91
  while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
93
  while ($ref = $sth->fetchrow_hashref("NAME_lc")) {
92 94
    push(@{ $form->{"all_customers"} }, $ref);
93 95
  }
94 96
  $sth->finish();
......
174 176
  $sth = $dbh->prepare($query);
175 177
  $sth->execute() || $form->dberror($query);
176 178
  $form->{"licenses"} = [];
177
  while ($ref = $sth->fetchrow_hashref(NAME_lc)) {
179
  while ($ref = $sth->fetchrow_hashref("NAME_lc")) {
178 180
    push(@{ $form->{"licenses"} }, $ref);
179 181
  }
180 182

  
......
207 209
    . $form->{"id"};
208 210
  $sth = $dbh->prepare($query);
209 211
  $sth->execute() || $form->dberror($query);
210
  $form->{"license"} = $sth->fetchrow_hashref(NAME_lc);
212
  $form->{"license"} = $sth->fetchrow_hashref("NAME_lc");
211 213
  $sth->finish();
212 214
  $dbh->disconnect();
213 215
  $main::lxdebug->leave_sub();

Auch abrufbar als: Unified diff