Exemplo n.º 1
0
<?
require_once "lib_com.php";
require_once "lib_ref_admin.php";
require_once "lib_get.php";

$wcaid = _GET_fld("wcaid");
$name = _GET_name("name");
$birthday = _GET_birthday("birthday");
$country = _GET_fld("country");
$gender = _GET_fld("gender");

if (isset($wcaid) && $name && $birthday && $country && $gender)
{
	require_once "db.php";
	$res = addCom ($wcaid,$name,$birthday,$country,$gender);
	echo (is_int($res) ? "" : $res); 
	sql_close();
}
else
	echo "Incorrect parameters calling \"addcompetitor\"";
?>
Exemplo n.º 2
0
			if (!sql_num_rows($country))
				$errors .= "Country name \"".$line[$headers["country"]]."\" not found in database<br>";
			else
			{
				$birthday = $line[$headers["birth date"]];
				$l = strlen($birthday);
				if ($l < 10 && $l > 7)
				{
					if (strpos($birthday,'-',5)==6) $birthday = substr_replace($birthday,"0",5,0);
					if (strlen($birthday)<10) $birthday = substr_replace($birthday,"0",8,0);
				}
				//
				$err = addCom(
					$line[$headers["wca id"]], 
					$line[$headers["name"]], 
					$birthday, 
					cased_mysql_result($country,0,"id"), 
					$line[$headers["gender"]], 
					true);
				if (is_int($err))
				{
					$nimp++;
					//
					foreach($line as $x => $value)
						if (isset($cats[$x]) && $value=="1")
							toggleReg($err,$cats[$x]);		
				}
				else
					$errors .= $err."<br>";
			}
		}
Exemplo n.º 3
0
<?
require_once "lib_com.php";
require_once "lib_ref_admin.php";
require_once "lib_get.php";

$id = _GET_num("id");
$wcaid = _GET_fld("wcaid");
$name = _GET_name("name");
$birthday = _GET_birthday("birthday");
$country = _GET_fld("country");
$gender = _GET_fld("gender");

if ($id && isset($wcaid) && $name && $birthday && $country && $gender)
{
	require_once "db.php";
	$res = addCom ($wcaid,$name,$birthday,$country,$gender,false,$id);
	echo (is_int($res) ? "" : $res); 
	sql_close();
}
else
	echo "Incorrect parameters calling \"updcompetitor\"";
?>
Exemplo n.º 4
0
	$value = $sheet->getCell("F$i")->getValue();
	if (!$value) error ("Birth date can't be blank at cell F$i");
	if (!is_numeric($value)) 
	{
		$birthday = $value;
		if (!checkdate((int)substr($birthday,5,2),(int)substr($birthday,8,2),(int)substr($birthday,0,4)))
			error ("Invalid birth date format ('$value') at cell F$i");
	}
	else
	{
		$date = PHPExcel_Shared_Date::ExcelToPHPObject($value);
		//echo "<td>".$date->format("Y-m-d")."</td>";
		$birthday = $date->format("Y-m-d");
	}

	$r = addCom($wcaid,$name,$birthday,$countryid,$gender,true);
	if (!is_numeric($r)) error ("Error inserting in database: $r");

	//echo "</tr>";
	$i++;
}
//echo "</table>";
echo " Done! <b>".($i-4)." competitors</b> imported.<p>";

$lastabbr = "";
$round = 0;
$tsn = $xlsx->getSheetCount();
for ($sn=1;$sn<$tsn;$sn++)
{
	$xlsx->setActiveSheetIndex($sn);
	$sheet = $xlsx->getActiveSheet();
Exemplo n.º 5
0
        $_SESSION['msg'][0] = 'error';
        $_SESSION['msg'][1] = "Vous devez être connecté pour rejoindre une section !";
        header('Location : index.php?page=login');
    }
    addJoueur($jeu->idjeux, $_SESSION['iduser']);
    header('Location : index.php?page=section&jeu=' . $jeu->idjeux);
}
if (isset($_GET['participer'])) {
    if (!addParticipant($_GET['id'])) {
        echo '<div class=error>Vous etes déjà inscrit !</div>';
    } else {
        header('Location : index.php?page=section&jeu=' . $jeu->idjeux . '&id=' . $_GET['id']);
    }
}
if (isset($_POST['creerCom'])) {
    addCom($_POST['com'], $news->idnews);
    header('Location : index.php?page=section&jeu=' . $jeu->idjeux . '&post=' . $_GET['post']);
}
if (isset($_GET['delete'])) {
    removeParticipant($event->idevent, $_GET['delete']);
    header('Location : index.php?page=section&jeu=' . $jeu->idjeux . '&id=' . $_GET['id']);
}
require_once Config::$path['views'] . 'HTML.class.php';
if (isset($_GET['post'])) {
    require_once Config::$path['views'] . 'news.php';
} else {
    if (isset($_GET['id'])) {
        require_once Config::$path['views'] . 'event.php';
    } else {
        require_once Config::$path['views'] . 'section.php';
    }
Exemplo n.º 6
0
<?php

include 'includes/reqConnexion.php';
include 'includes/reqPost.php';
changeStatutPost($bdd);
//pour suppression et moderation
addCom($bdd);
$post = post($bdd);
$infoPost = $post[0];
//recuperation info post
$commentaire = $post[1][0];
// recuperation commentaire du post
$nbPages = $post[1][1];
$currentPage = $post[1][2];
$limit = $post[1][3];
$id_post = $post[2];
?>

<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8" />
	<link rel="stylesheet" href="css/style.css" />
	<link rel="stylesheet" href="css/styleAddCom.css" />
	<script type="text/javascript" src="js/addPost.js"></script>

	<title>My_Weblog</title>
</head>
<body>
	<div id="main">
		<?php