diff options
author | Sashi20 | 2024-08-05 11:30:29 +0530 |
---|---|---|
committer | GitHub | 2024-08-05 11:30:29 +0530 |
commit | 8fc5ee962cb8a29f458b354e1ca9676b02ff5fef (patch) | |
tree | ef9b2342a27630cedbded12008cc65fef49d1268 /download.inc | |
parent | a2dc9e540c3392163862b4fd6e7a120b3d2e54b0 (diff) | |
parent | 3e4125b2568cdc8467e0f949560986ae7e722990 (diff) | |
download | cfd_lab_migration-master.tar.gz cfd_lab_migration-master.tar.bz2 cfd_lab_migration-master.zip |
Display list of experiments from the completed labs page, add field in proposal form for problem statement
Diffstat (limited to 'download.inc')
-rwxr-xr-x | download.inc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/download.inc b/download.inc index f16cf0f..821025b 100755 --- a/download.inc +++ b/download.inc @@ -18,6 +18,18 @@ function lab_migration_download_solution_file() header('Content-Length: ' . filesize($root_path . $solution_file_data->directory_name . '/' . $solution_file_data->filepath)); readfile($root_path . $solution_file_data->directory_name . '/' . $solution_file_data->filepath); } + function lab_migration_download_problem_statement() + { + $proposal_id = arg(3); + $root_path = lab_migration_path(); + $proposal_q = db_query("SELECT lmp.* FROM lab_migration_proposal lmp WHERE lmp.id = :proposal_id LIMIT 1", array(':proposal_id' => $proposal_id)); + $proposal_data = $proposal_q->fetchObject(); + header('Content-Type: doc'); + //header('Content-Type: application/octet-stram'); + header('Content-disposition: attachment; filename="' . str_replace(' ', '_', ($proposal_data->problem_statement_file)) . '"'); + header('Content-Length: ' . filesize($root_path . $proposal_data->directory_name . '/' . $proposal_data->problem_statement_file)); + readfile($root_path . $proposal_data->directory_name . '/' . $proposal_data->problem_statement_file); + } function lab_migration_download_dependency_file() { $dependency_file_id = arg(3); |