blob: 1505e94a4f93976cfc213907aa954e5d41cb8e02 [file] [log] [blame]
<?php
require_once "/home/data/httpd/eclipse-php-classes/system/dbconnection_bugs_ro.class.php";
$dbc = new DBConnectionBugs();
$dbh = $dbc->connect();
$sql_info = "SELECT bugs.bug_id as bug_id,
bugs.bug_status as bug_status,
bugs.resolution as bug_resolution,
bugs.target_milestone as bug_target_milestone,
attachments.filename as filename,
attachments.thedata as thedata,
profiles.login_name as attachment_login_name
FROM bugs,
attachments,
profiles
WHERE attachments.bug_id = bugs.bug_id
AND attachments.isobsolete = 0
AND (bugs.bug_status = 'RESOLVED'
OR bugs.bug_status = 'CLOSED'
OR bugs.bug_status = 'VERIFIED')
AND bugs.resolution = 'FIXED'
AND bugs.product_id = 20
AND attachments.submitter_id = profiles.userid
ORDER BY bugs.bug_id";
$rs = mysql_query($sql_info, $dbh);
$output_file = "timquerys.csv";
@ini_set('zlib.output_compression', 'Off');
header('Pragma: public');
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
header('Content-Transfer-Encoding: none');
// This should work for IE & Opera
header('Content-Type: application/octetstream; name="' . $output_file . '"');
// This should work for the rest
header('Content-Type: application/octet-stream; name="' . $output_file . '"');
header('Content-Disposition: inline; filename="' . $output_file . '"');
echo "bug_id,bug_status,resolution,target_milestone,filename,filename_is_patch,content_is_patch,attachment_login_name\n";
while( $myrow = mysql_fetch_assoc($rs) ) {
echo $myrow['bug_id'];
echo ",";
echo $myrow['bug_status'];
echo ",";
echo $myrow['bug_resolution'];
echo ",";
echo $myrow['bug_target_milestone'];
echo ",";
echo $myrow['filename'];
echo ",";
$count = preg_match( '/patch/', $myrow['filename'] );
if( $count > 0 ) {
echo "TRUE,";
} else {
echo "FALSE,";
}
$count = preg_match( '/RCS file:/', $myrow['thedata'] );
if( $count > 0 ) {
echo "TRUE,";
} else {
echo "FALSE,";
}
echo $myrow['attachment_login_name'];
echo "\n";
}
$dbc->disconnect();
$rs = null;
$dbh = null;
$dbc = null;
exit();
?>