<?php

	include "library.php";

	$cxn = start_code();
	
    $cxn_common = db_common_login();
	
	
	page_header( "Rename file", $cxn, $cxn_common );
	
	$resource_group_id = val( $_GET, "resourcegroupid" );

	$resource_file_id = val( $_GET, "resourcefileid" );
	
	$_SESSION['resource_group_id'] = $resource_group_id;
	
	$_SESSION['resource_file_id'] = $resource_file_id;	

	
	$query = "SELECT filename FROM resource_file WHERE id = ".$resource_file_id;

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

	$data = get_row( $result );
	
//	echo "<br>";

//	form_start( "edit_task.php" );
	form_start( "rename_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();

?>