//NASTAVITVE
include('config.php');
$baza = mysql_connect ($dbhost , $dbuser , $dbpasswd );
@mysql_select_db($dbname);
if (!$baza) {
die('Could not connect: ' . mysql_error());
}
//preveri št. vpisov
$result1 = mysql_query("SELECT * FROM prijave WHERE event_id=3");
$vpisov = mysql_num_rows($result1);
//echo "vpisov je ".$vpisov;
if($vpisov < "151"){
if($_POST['poslji']=="1"){
?>
Rjavi Ris - Signup form
//pobiranje podatkov
$code = $_POST['code'];
$team_id = $_POST['team'];
$country = $_POST['country'];
$name = $_POST['name'];
$surname = $_POST['surname'];
$nick = $_POST['nick'];
$email = $_POST['email'];
$sex = $_POST['sex'];
$size = $_POST['size'];
$comments = $_POST['comments'];
$event_id = $_POST['event'];
$now = getdate();
//preverjanje prijavne kode
$code_verified=0;
if ($code == ""){
$error=1;
echo 'You need to enter the code we provided you with invitation. ';
} else {
$query = "SELECT COUNT(*) FROM invite_code WHERE code='$code' LIMIT 1";
$res = mysql_query($query);
$c = mysql_result ($res, 0);
if ($c == 0) {
$error=1;
echo 'Code '.$code.' not valid! This is an invite only event. ';
} else {
echo 'Code '.$code.' verified. ';
$code_verified=1;
}
}
//preverjanje team
if($team_id == ""){
$error=1;
echo 'You need to choose a team ';
}
//preverjanje country
if($country == ""){
$error=1;
echo 'You need to choose a country ';
}
//preverjanje imena
if($name == ""){
$error=1;
echo 'You need to enter a name ';
}
//preverjanje priimka
if($surname == ""){
$error=1;
echo 'You need to enter a surname ';
}
//preverjanje nicka
if($nick == ""){
$error=1;
echo 'You need to enter a nickname ';
}
//preverjanje emaila
//je email vpisan?
if($email == ""){
$error=1;
echo 'You need to enter an email address ';
} else {
//če je vpisan, je pravilen?
function check_email_address($email) {
// First, we check that there's one @ symbol, and that the lengths are right
if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
return false;
}
// Split it into sections to make life easier
$email_array = explode("@", $email);
$local_array = explode(".", $email_array[0]);
for ( $i = 0; $i < sizeof($local_array); $i++) {
if (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) {
return false;
}
}
if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) {
// Check if domain is IP. If not, it should be valid domain name
$domain_array = explode(".", $email_array[1]);
if (sizeof($domain_array) < 2) {
return false;
// Not enough parts to domain
}
for ($i = 0; $i < sizeof($domain_array); $i++) {
if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) {
return false;
}
}
}
return true;
}
if (check_email_address($email)) {
// echo $email . ' is a valid email address.';
} else {
echo $email . ' is not a valid email address.';
$error=1;
$emailerror=1;
}
}
//preverjanje size
if($size == ""){
$error=1;
echo 'You need to choose a size ';
}
//preverjanje date
if($now == ""){
$error=1;
echo 'Error! Is it 21st century already? ';
}
//ce ni napak, vpiše v bazo
if(!$error){
//sestavimo trenutni time
$sekunde=$now[seconds];
$minute=$now[minutes];
$ure=$now[hours];
$dan=$now[mday];
$mesec=$now[mon];
$leto=$now[year];
$time=$leto."-".$mesec."-".$dan." ".$ure.":".$minute.":".$sekunde;
//vpis v bazo
$query = "INSERT into prijave (event_id, code, name, surname, nick, sex, team_id, country, size, email, comment, time) values ('$event_id','$code','$name','$surname','$nick','$sex','$team_id','$country','$size','$email','$comments','$time')";
$result = mysql_query ($query);
if ($result){
echo '';
echo '';
echo '';
echo '';
echo 'Rjavi Ris - you are signed up';
echo '';
echo '';
echo '';
echo '
';
echo '
Congrats '.$nick.'! You have just signed up for Rjavi Ris 8...
';
echo '
';
// echo "
You slip into the form page, armed with your beloved Famas Assault gun forged by Cybergun. The Foreign Forces swarm about the form page, looking for blood. You whip out your +6 keystroke of trickery and begin battling your enemies. They cast a spell of offering one ton of free Guarder BBs, but you block with macho ego and then retaliate with a “for the good of my team” speech. The Foreign Forces begin to grow sleepy – your attack was successful. You practice your verbal agility and bullshit them into supplication.
You are victorious in your first battle of the day!(You gained 80 XP and €0,15 GP)
You are victorious, on a journey that you’ve never been on before, break through and live your life freely, independently and vibrantly. You let AKS bring life to you with it's ultimate RIS Event! You will never be the same. Watch the smile on a AKS face, you can have it too!
";
echo "
You'll get followups on ".$email."!
";
echo '
';
echo '
';
echo '
';
// include 'entries.php?list=all';¸
include 'stats.php';
echo '
';
echo '
';
echo '';
echo '';
}
else
{
echo 'Error! Signup failed. Results: '.$code.','.$event_id.','.$name.','.$surname.','.$nick.','.$sex.','.$team_id.','.$country.','.$size.','.$email.','.$comments.','.$time.'';
}
//je potreben email?
if($_POST['email_opomnik'] == "ON"){
include 'mail_signup.php';
}
}
//ce pa napake so, opozori
else
{
// obrazec z nafilanimi že izpolnjenimi podatki
echo '