diff --git a/web/includes/Event.php b/web/includes/Event.php index ada81a00f..392973a6a 100644 --- a/web/includes/Event.php +++ b/web/includes/Event.php @@ -186,7 +186,10 @@ class Event { return( $streamSrc ); } // end function getStreamSrc - function DiskSpace() { + function DiskSpace( $new='' ) { + if ( $new != '' ) { + $this->{'DiskSpace'} = $new; + } if ( null === $this->{'DiskSpace'} ) { $this->{'DiskSpace'} = folder_size( $this->Path() ); dbQuery( 'UPDATE Events SET DiskSpace=? WHERE Id=?', array( $this->{'DiskSpace'}, $this->{'Id'} ) ); @@ -380,10 +383,11 @@ class Event { } public function save( ) { - $sql = 'UPDATE Events SET '.implode(' AND', array_map( function($field) {return $field.'=?';}, $fields ) ) . ' WHERE Id=?'; - $values = array_map( function($field){return $this->{$field};}, $fields ); + + $sql = 'UPDATE Events SET '.implode(', ', array_map( function($field) {return $field.'=?';}, $this->fields ) ) . ' WHERE Id=?'; + $values = array_map( function($field){return $this->{$field};}, $this->fields ); $values[] = $this->{'Id'}; - dbQuery( $sql, NULL, $values ); + dbQuery( $sql, $values ); } } # end class