Blame | Last modification | View Log | Download | RSS feed
<?php
define ('SQL_GET_BACKUPS', "select
concat( '<a href=\"index.html?backups_id=', backups.backups_id, '\">',device.name,'</a>') 'Device',
server_device.name 'Server',
round ( backups.allocated_size / 1024 / 1024, 0 ) 'Size (M)',
backups.start_time 'Start Time',
backups.bandwidth_allocated 'Bandwidth (Mb/s)',
backups.responsible_party 'Responsible',
lastrun.last_run 'Last Report',
concat('<a href=\"edit.html?backups_id=',backups.backups_id,'\">Edit</a>') Action
from
backups join device using (device_id)
join (
backups_server join device server_device using (device_id)
)
using ( backups_server_id )
join (
select
backups_id,
max(report_date) last_run
from
backups_run
group by backups_id
) lastrun
on lastrun.backups_id = backups.backups_id
where
<whereClause>
order by
server_device.name,
device.name"
);
/*
"select
concat( '<a href=\"index.html?backups_id=', backups.backups_id, '\">',device.name,'</a>') 'Device',
server_device.name 'Server',
round ( backups.allocated_size / 1024 / 1024, 0 ) 'Size (M)',
backups.start_time 'Start Time',
backups.bandwidth_allocated 'Bandwidth (Mb/s)',
backups.responsible_party 'Responsible',
run.last_run 'Last Run',
concat('<a href=\"edit.html?backups_id=',backups.backups_id,'\">Edit</a>') Action
from
backups join device using (device_id)
join (
backups_server join device server_device using (device_id)
)
using ( backups_server_id )
join (
select max(report_date) last_run, backups_id from backups_run
) run using (backups_id)
where
<whereClause>
order by
server_device.name,
device.name" );
*/
?>