<?php

	include "library.php";

	$cxn = start_code();
	
    $cxn_common = db_common_login();
	
	
	page_header( "Rename task file", $cxn, $cxn_common );
	
	$task_id = val( $_GET, "taskid" );

	$task_file_id = val( $_GET, "taskfileid" );
	
	$_SESSION['task_id'] = $task_id;
	
	$_SESSION['task_file_id'] = $task_file_id;	

	
	$query = "SELECT filename FROM task_file WHERE id = ".$task_file_id;

	$result = run_query( $query, $cxn );

	$data = get_row( $result );
	
	form_start( "rename_task_file.php" );

	write_yellow_input_boxes();
	
	echo "<tr><td>&nbsp;</td></tr>";

	echo "<tr><td>".blue( "Current filename" )."</td><td>".black( $data['filename'] )."</td></tr>";
	
	echo "<tr><td>&nbsp;</td></tr>";
	
	echo "<tr><td>".red( "Include file extension, e.g .docx" )."</td></tr>";
		
	echo "<tr><td>&nbsp;</td></tr>";
			
	form_text( "New filename", "new_filename", 60, "", "true" );

//	form_submit( "go" );


	form_submit_new( "Go", 55 );
	

	form_end();

?>