示例#1
0
文件: index.php 项目: rhertzog/lcs
    //
    $call_data = mysqli_query($GLOBALS["mysqli"], "SELECT * FROM tempo");
    $nb_enr = mysqli_num_rows($call_data);
    $nb = 0;
    while ($nb < $nb_enr) {
        $num = old_mysql_result($call_data, $nb, 'num');
        $test = mysqli_query($GLOBALS["mysqli"], "SELECT * FROM log WHERE SESSION_ID = '{$num}'");
        $nb_en = mysqli_num_rows($test);
        if ($nb_en == 0) {
            mysqli_query($GLOBALS["mysqli"], "DELETE FROM tempo WHERE num = '{$num}'");
        }
        $nb++;
    }
    $periode_query = mysqli_query($GLOBALS["mysqli"], "SELECT * FROM periodes WHERE id_classe = '{$id_classe}' ORDER BY num_periode");
    $nb_periode = mysqli_num_rows($periode_query);
    $call_reg = mysqli_query($GLOBALS["mysqli"], "insert into tempo Values('{$id_classe}','{$nb_periode}', '" . SESSION_ID() . "')");
}
// Le statut scolarite ne devrait pas être proposé ici.
// La page confirm_query.php n'est accessible qu'en administrateur
if ($_SESSION['statut'] == "administrateur" || $_SESSION['statut'] == "scolarite") {
    if (isset($is_posted) and $is_posted == '1') {
        check_token();
        $delete_eleve = isset($_POST['delete_eleve']) ? $_POST['delete_eleve'] : array();
        if (!is_array($delete_eleve)) {
            $delete_eleve = array();
            $msg = "Erreur: La liste d'élèves à supprimer devrait être un tableau.<br />";
        }
        $calldata = mysqli_query($GLOBALS["mysqli"], "SELECT * FROM eleves");
        $nombreligne = mysqli_num_rows($calldata);
        $i = 0;
        $liste_cible = '';
示例#2
0
} else {
    $retour = "../accueil.php";
}
if (isset($quelles_classes)) {
    $retour = "index.php";
}
// 20140826
/*
debug_var();
echo "\$id_classe=$id_classe<br />
\$id_classe_demande=$id_classe_demande<br />";
*/
echo "<form action='index.php' method='post' name='form_lien_sous_bandeau'>\n<p class='bold'><a href=\"" . $retour . "\"><img src='../images/icons/back.png' alt='Retour' class='back_link'/> Retour </a>\n";
if ($_SESSION['statut'] == "administrateur" || $_SESSION['statut'] == "scolarite") {
    if (!isset($id_classe_demande) && isset($quelles_classes) && $quelles_classes == "certaines") {
        $sql_tempo = "SELECT * FROM tempo WHERE num='" . SESSION_ID() . "';";
        //echo "$sql_tempo<br />";
        $res_tempo = mysqli_query($GLOBALS["mysqli"], $sql_tempo);
        if (mysqli_num_rows($res_tempo) == 1) {
            $lig_tempo = mysqli_fetch_object($res_tempo);
            $id_classe_demande = $lig_tempo->id_classe;
            //echo "\$id_classe_demande=$id_classe_demande<br />";
        }
    }
    $id_classe_prec = "";
    $nom_classe_prec = "";
    $id_classe_suiv = "";
    $nom_classe_suiv = "";
    $classe_trouvee = 0;
    $tab_classe = array();
    $sql = "SELECT id, classe, nom_complet FROM classes ORDER BY classe, nom_complet;";
示例#3
0
unset($aid_id);
$aid_id = isset($_POST["aid_id"]) ? $_POST["aid_id"] : (isset($_GET["aid_id"]) ? $_GET["aid_id"] : NULL);
// On appelle les informations de l'aid pour les afficher :
$call_data = mysqli_query($GLOBALS["mysqli"], "SELECT * FROM aid_config WHERE indice_aid = '{$indice_aid}'");
$nom_aid = @old_mysql_result($call_data, 0, "nom");
$note_max = @old_mysql_result($call_data, 0, "note_max");
$type_note = @old_mysql_result($call_data, 0, "type_note");
$display_begin = @old_mysql_result($call_data, 0, "display_begin");
$display_end = @old_mysql_result($call_data, 0, "display_end");
//===========================
// Couleurs utilisées
$couleur_devoirs = '#AAE6AA';
$couleur_fond = '#AAE6AA';
$couleur_moy_cn = '#96C8F0';
//===========================
$nom_table = "class_temp" . md5(SESSION_ID());
if (isset($_POST['is_posted'])) {
    check_token();
    $indice_max_log_eleve = $_POST['indice_max_log_eleve'];
    //echo "\$indice_max_log_eleve=$indice_max_log_eleve<br />";
    $sql = "SELECT e.* FROM eleves e, j_aid_eleves j WHERE (j.id_aid='{$aid_id}' and e.login = j.login and j.indice_aid='{$indice_aid}')";
    //echo "$sql<br />";
    $quels_eleves = mysqli_query($GLOBALS["mysqli"], $sql);
    $lignes = mysqli_num_rows($quels_eleves);
    //echo "\$lignes=$lignes (nombre d'élèves inscrits dans l'AID)<br />";
    $j = '0';
    while ($j < $lignes) {
        $reg_eleve_login = old_mysql_result($quels_eleves, $j, "login");
        //echo "<hr /><p>Elève $reg_eleve_login<br />";
        //echo "\$reg_eleve_login=$reg_eleve_login<br />";
        //$call_classe = mysql_query("SELECT DISTINCT id_classe FROM j_eleves_classes WHERE login = '******' ORDER BY periode DESC");
示例#4
0
$type_note = @old_mysql_result($call_data, 0, "type_note");
$display_begin = @old_mysql_result($call_data, 0, "display_begin");
$display_end = @old_mysql_result($call_data, 0, "display_end");



//===========================
// Couleurs utilisées
$couleur_devoirs = '#AAE6AA';
$couleur_fond = '#AAE6AA';
$couleur_moy_cn = '#96C8F0';
//===========================



$nom_table = "class_temp".SESSION_ID();

if (isset($_POST['is_posted'])) {
	check_token();

	$indice_max_log_eleve=$_POST['indice_max_log_eleve'];
	//echo "\$indice_max_log_eleve=$indice_max_log_eleve<br />";

	$sql="SELECT e.* FROM eleves e, j_aid_eleves j WHERE (j.id_aid='$aid_id' and e.login = j.login and j.indice_aid='$indice_aid')";
	//echo "$sql<br />";
	$quels_eleves=mysqli_query($GLOBALS["mysqli"], $sql);
	$lignes = mysqli_num_rows($quels_eleves);
	//echo "\$lignes=$lignes (nombre d'élèves inscrits dans l'AID)<br />";
	$j = '0';
	while($j < $lignes) {
		$reg_eleve_login = old_mysql_result($quels_eleves, $j, "login");
示例#5
0
function outputLogout()
{
    mysql_query('UPDATE accounts SET session = "" WHERE id = "' . $_SESSION['USER_I'] . '" AND session = "' . SESSION_ID() . '"');
    unset($_SESSION['USER_S']);
    unset($_SESSION['USER_I']);
    unset($_SESSION);
    session_unset();
    echo '<div class="notice"><p class="warn">You just logged out. <a href="index.php">Back to the frontpage.</a></p></div>';
}
示例#6
0
    } else {
        // Message alternatif depuis modify_eleve.php
    }
} else {
    if ($quelles_classes == 'certaines') {
        /*
        $calldata = mysql_query("SELECT DISTINCT e.* FROM eleves e, tempo t, j_eleves_classes j, classes cl
        WHERE (t.num = '".SESSION_ID()."' AND
        	t.id_classe = j.id_classe and
        	j.login = e.login AND
        	cl.id=t.id_classe and
        	j.periode=t.max_periode
        	)
        ORDER BY $order_type");
        */
        $sql = "SELECT DISTINCT e.*,jer.* FROM eleves e, tempo t, j_eleves_classes j, classes cl, j_eleves_regime jer\n\t\t\tWHERE (t.num = '" . SESSION_ID() . "' AND\n\t\t\t\tt.id_classe = j.id_classe and\n\t\t\t\tj.login = e.login AND\n\t\t\t\tjer.login = e.login AND\n\t\t\t\tcl.id=t.id_classe and\n\t\t\t\tj.periode=t.max_periode\n\t\t\t\t)\n\t\t\tORDER BY {$order_type};";
        $calldata = mysqli_query($GLOBALS["mysqli"], $sql);
        if (!isset($page_courante) || $page_courante != "modify_eleve") {
            echo "<p align='center'>Liste des élèves de la ou des classes choisies.</p>\n";
        } else {
            // Message alternatif depuis modify_eleve.php
        }
    } else {
        if ($quelles_classes == 'toutes') {
            if ($order_type == "classe,nom,prenom") {
                /*
                $calldata = mysql_query("SELECT DISTINCT e.* FROM eleves e, j_eleves_classes j, classes cl
                WHERE (
                j.login = e.login AND
                j.id_classe =cl.id
                )
示例#7
0
//$lname=$_POST['lname'];
//$email=$_POST['email'];
//$password=$_POST['password'];
//check if the fields are empty
$name = isset($_POST['name']) ? $_POST['name'] : null;
$lname = isset($_POST['lname']) ? $_POST['lname'] : null;
$password = isset($_POST['password']) ? $_POST['password'] : null;
$email = isset($_POST['email']) ? $_POST['email'] : null;
$gender = isset($_POST['gender']) ? $_POST['gender'] : null;
$dob = "{$_POST['Year']}/{$_POST['month']}/{$_POST['Day']}";
$name = mysql_real_escape_string($_POST['name']);
$lname = mysql_real_escape_string($_POST['lname']);
$password = mysql_real_escape_string($_POST['password']);
$email = mysql_real_escape_string($_POST['email']);
$gender = mysql_real_escape_string($_POST['gender']);
$id = SESSION_ID();
$unique = md5($email);
//secure password
$password = md5($password);
// Insert data into database
$sql = "INSERT INTO temp_members_db(id, unique_id, confirm_code, name, lname, email, password, dob, gender)VALUES('{$id}', '{$unique}', '{$confirm_code}', '{$name}', '{$lname}', '{$email}', '{$password}', '{$dob}', '{$gender}')";
$result = mysql_query($sql);
// if suceesfully inserted data into database, send confirmation link to email
if ($result) {
    // ---------------- SEND MAIL FORM ----------------
    // send e-mail to ...
    $to = $email;
    // Your subject
    $subject = "Your confirmation link here";
    // From
    $header = "from: socialnova.com <*****@*****.**>";