Просмотр файла phpmytourney/reportloss.php

Размер файла: 1.8Kb
<?php
/***********************************************************
* This file was created by Jйrфme Poulin under the phpmytourney
* project.  
* You can modify and redistribute this file as long as this
* copyright notice stays in the file.
*
* If you want to do major upgrades on my script, please contact
* me and we could work together.
* 
* Jйrфme Poulin
* Student University of Sherbrooke
* [email protected] <== dont use for support !!!
* http:/phpmytourney.sourceforge.net/ <== use sourceforce forum for support
* 
*  phpMyTourney <C> 2001-2002
************************************************************/

if(!isset($tourney_id)) echo("ERROR : page not properly called");
else{
	include('config.inc');
	include($header_file);
	$status = get_status($tourney_id);
	if($status != 7 && $status != 8) print_error("Can't report loss now");
	else{
	if (!isset($action)){
?>
	<p>
	
	</p>
<?php
	print_reportloss_form();	
	}
	else
		$action();
	}
	do_not_remove_please();

	include($footer_file);
	
}
//This prints the reportloss form
function print_reportloss_form(){
	global $tourney_id;
	
	print_top_form("Report Loss");
	print_textbox("Nickname","name");
	print_password("Password","passwd");
	print_textbox("Comment","comment",50,100);
	echo("<input type=\"HIDDEN\" name=\"tourney_id\" value=\"" . $tourney_id . "\">");
	echo("<input type=\"HIDDEN\" name=\"action\" value=\"reportloss\">");
	print_submit("Report Loss");
}
function reportloss(){
	global $name,$passwd,$comment;
	global $tourney_id;
	
	if ($pid = login_name($name,$passwd)){	
			if(report_loss_tourney($pid,$comment))
				echo("<br>Thank You for Reporting Your loss... ");
			else
				print_error("An Error Occured While Reporting your loss");
	}
	else
		print_reportloss_form("Signup");
}

?>