Subversion Repositories VORC

Rev

Rev 80 | Rev 105 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 80 Rev 91
Line 62... Line 62...
62
  
62
  
63
  my $dbh = WebDB::connect ();
63
  my $dbh = WebDB::connect ();
64
  if ($FTS->{$DBFields[0]} eq "NEW") {
64
  if ($FTS->{$DBFields[0]} eq "NEW") {
65
    $dbh->do (
65
    $dbh->do (
66
      "INSERT INTO $DBTable
66
      "INSERT INTO $DBTable
67
      (name,coach,date,location,start_time,end_time,capacity,note)
67
      (name,coach,date,location,level,start_time,end_time,capacity,note)
68
      VALUES(?,?,?,?,?,?,?,?)",
68
      VALUES(?,?,?,?,?,?,?,?)",
69
    	undef,
69
    	undef,
70
    	$FTS->{name}, $FTS->{coach}, $FTS->{date}, $FTS->{location}, $FTS->{start_time}, $FTS->{end_time}, $FTS->{capacity}, $FTS->{note}
70
    	$FTS->{name}, $FTS->{coach}, $FTS->{date}, $FTS->{location}, $FTS->{level}, $FTS->{start_time}, $FTS->{end_time}, $FTS->{capacity}, $FTS->{note}
71
    );
71
    );
72
  	($FTS->{id}) = $dbh-> selectrow_array ("select max(id) from $DBTable where name = ? and date = ? and location = ? and start_time = ? and end_time = ?", undef, $FTS->{name}, $FTS->{date}, $FTS->{location}, $FTS->{start_time}, $FTS->{end_time});
72
  	($FTS->{id}) = $dbh-> selectrow_array ("select max(id) from $DBTable where name = ? and date = ? and location = ? and start_time = ? and end_time = ?", undef, $FTS->{name}, $FTS->{date}, $FTS->{location}, $FTS->{start_time}, $FTS->{end_time});
Line 73... Line 73...
73
    logit ($RCid, "$username created new class ($FTS->{id}, $FTS->{name}, $FTS->{date}, $FTS->{location}, $FTS->{start_time}, $FTS->{end_time}, $FTS->{capacity})");
73
    logit ($RCid, "$username created new class ($FTS->{id}, $FTS->{name}, $FTS->{date}, $FTS->{location}, $FTS->{start_time}, $FTS->{end_time}, $FTS->{capacity})");
Line 81... Line 81...
81
      "COA", "Coach", "selected", $FTS->{date}, $FTS->{location}, $FTS->{start_time}, $FTS->{end_time}, 1, $FTS->{name}, $FTS->{coach}
81
      "COA", "Coach", "selected", $FTS->{date}, $FTS->{location}, $FTS->{start_time}, $FTS->{end_time}, 1, $FTS->{name}, $FTS->{coach}
82
    );      
82
    );      
83
  } else {
83
  } else {
84
    $dbh->do (
84
    $dbh->do (
85
      "UPDATE $DBTable
85
      "UPDATE $DBTable
86
      SET name=?, coach=?, date=?, location=?, start_time=?, end_time=?, capacity=?, note=?
86
      SET name=?, coach=?, date=?, location=?, level=?, start_time=?, end_time=?, capacity=?, note=?
87
      WHERE id = ?",
87
      WHERE id = ?",
88
      undef,
88
      undef,
89
      $FTS->{name}, $FTS->{coach}, $FTS->{date}, $FTS->{location}, $FTS->{start_time}, $FTS->{end_time}, $FTS->{capacity}, $FTS->{note}, $FTS->{id}
89
      $FTS->{name}, $FTS->{coach}, $FTS->{date}, $FTS->{location}, $FTS->{level}, $FTS->{start_time}, $FTS->{end_time}, $FTS->{capacity}, $FTS->{note}, $FTS->{id}
90
    );
90
    );
91
    logit ($RCid, "$username updated class ($FTS->{id}, $FTS->{name}, $FTS->{date}, $FTS->{location}, $FTS->{start_time}, $FTS->{end_time}, $FTS->{capacity})");
91
    logit ($RCid, "$username updated class ($FTS->{id}, $FTS->{name}, $FTS->{date}, $FTS->{location}, $FTS->{level}, $FTS->{start_time}, $FTS->{end_time}, $FTS->{capacity})");
Line 92... Line 92...
92
    
92
    
93
    # Update the volunteer shift for the coach too.
93
    # Update the volunteer shift for the coach too.
94
    if ($FTS->{classshiftid}) {
94
    if ($FTS->{classshiftid}) {
95
      $dbh->do (
95
      $dbh->do (