126 |
"", "", { RaiseError => 1, AutoCommit => 1 } ); |
"", "", { RaiseError => 1, AutoCommit => 1 } ); |
127 |
my $sql = |
my $sql = |
128 |
q{ |
q{ |
129 |
SELECT files.id AS fid, |
SELECT files.id AS fid, |
130 |
hosts.name AS hname, |
hosts.name AS hname, |
131 |
shares.name AS sname, |
shares.name AS sname, |
132 |
shares.share AS sharename, |
shares.share AS sharename, |
133 |
backups.num AS backupNum, |
files.backupNum AS backupNum, |
134 |
files.name AS filename, |
files.name AS filename, |
135 |
files.path AS filepath, |
files.path AS filepath, |
136 |
shares.share||files.fullpath AS networkPath, |
shares.share||files.fullpath AS networkPath, |
137 |
date(files.date, 'unixepoch', 'localtime') AS date, |
date(files.date, 'unixepoch', 'localtime') AS date, |
138 |
files.type AS filetype, |
files.type AS filetype, |
139 |
files.size AS size, |
files.size AS size, |
140 |
dvds.name AS dvd |
dvds.name AS dvd |
141 |
FROM |
FROM files |
142 |
files |
INNER JOIN shares ON files.shareID=shares.ID |
143 |
INNER JOIN shares ON files.shareID=shares.ID |
INNER JOIN hosts ON hosts.ID = shares.hostID |
144 |
INNER JOIN hosts ON hosts.ID = shares.hostID |
LEFT JOIN dvds ON dvds.ID = files.dvdid |
|
INNER JOIN backups ON backups.hostID = hosts.ID |
|
|
LEFT JOIN dvds ON dvds.ID = files.dvdid |
|
|
|
|
145 |
}; |
}; |
146 |
|
|
147 |
if (defined($where) && $where ne "") |
if (defined($where) && $where ne "") |