コード例 #1
0
ファイル: bilan.php プロジェクト: rhertzog/lcs
function affiche_abs($potache)
{
    global $dtajadebut, $dtajafin;
    //$potache=$_POST["eleve"];
    $horaire = array("M1", "M2", "M3", "M4", "M5", "S1", "S2", "S3", "S4", "S5");
    $nbabs = 0;
    $nbrtd = 0;
    foreach ($horaire as $cle => $val) {
        $rq4 = "SELECT count(*) FROM absences WHERE uidprof='{$_SESSION['login']}'  AND  {$val}='A'  AND uideleve='{$potache}' AND date >='{$dtajadebut}' AND date<='{$dtajafin}' ";
        $result4 = mysqli_query($dbc, $rq4) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
        while ($nb = mysqli_fetch_array($result4, MYSQLI_NUM)) {
            $nbabs += $nb[0];
        }
        $rq5 = "SELECT count(*) FROM absences WHERE uidprof='{$_SESSION['login']}'  AND  {$val}='R'  AND uideleve='{$potache}' AND date >='{$dtajadebut}' AND date<='{$dtajafin}' ";
        $result5 = @mysqli_query($GLOBALS["___mysqli_ston"], $rq5) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
        while ($nb = mysqli_fetch_array($result5, MYSQLI_NUM)) {
            $nbrtd += $nb[0];
        }
    }
    //fin foreach $horaire
    if ($nbabs > 0) {
        echo "<h3 class='perso'><i>" . $nbabs . "h d'absence  - ";
    } else {
        echo "<h3 class='perso'><i>Aucune absence - ";
    }
    if ($nbrtd > 0) {
        if ($nbrtd > 1) {
            echo $nbrtd . " retards  <br /></i>";
        } else {
            echo $nbrtd . " retard  <br /></i>";
        }
    } else {
        echo "Aucun retard <br /></i>";
    }
    $rq = "SELECT DATE_FORMAT(date,'%d/%m/%Y'),M1,motifM1,M2,motifM2,M3,motifM3,M4,motifM4,M5,motifM5,\n    S1,motifS1,S2,motifS2,S3,motifS3,S4,motifS4,S5,motifS5,date FROM absences WHERE  uidprof='{$_SESSION['login']}' \n    AND uideleve='{$potache}' AND date >='{$dtajadebut}' AND date<='{$dtajafin}' ORDER BY date ASC";
    // lancer la requete
    $result = mysqli_query($GLOBALS["___mysqli_ston"], $rq) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
    // Combien y a-t-il d'enregistrements ?
    $nb2 = mysqli_num_rows($result);
    while ($ligne = mysqli_fetch_array($result, MYSQLI_NUM)) {
        $typmat = "";
        foreach ($horaire as $cle => $val) {
            if ($ligne[2 * $cle + 1] == A) {
                $typmat .= " : absence en {$val} ( " . utf8_encode($ligne[2 * $cle + 2]) . " )";
            } elseif ($ligne[2 * $cle + 1] == R) {
                $typmat .= " : retard en {$val} ( " . utf8_encode($ligne[2 * $cle + 2]) . " )";
            } else {
                $typmat .= "";
            }
        }
        echo "&nbsp;&nbsp;- Le " . LeJour(strToTime($ligne[21])) . " " . $ligne[0] . " " . $typmat . "<br />";
    }
    echo '</h3>';
}
コード例 #2
0
ファイル: plan_eleves.php プロジェクト: rhertzog/lcs
" />
<table id="btn-plan-cdt">
<tr>
<td ><input type="submit" name="prec" value="&lt;&lt;" class="bt50" /></td>
<td><input type="submit" name="quit" id="quit" value="" class="bt-exit" /></td>
<td ><input type="submit" name="suiv" value="&gt;&gt;" class="bt50" /> </td>
</tr>
</table>
<table id="plan-cdt" cellpadding="1" cellspacing="1">
<thead>
<tr><th> <img src="../images/livre.gif" alt="." /> </th>
<?php 
// Affichage des jours et dates de la semaine en haut du tableau"j-M-Y",
for ($i = 0; $i <= 5; $i++) {
    $TS = $Lundi + $i * 86400;
    echo '<td colspan="2"> ' . LeJour($TS) . "<br />" . datefr($TS) . "</td>\n";
}
?>
</tr>
</thead>
<tbody>
<?php 
$horaire = array("M1<br />", "M2<br />", "M3<br />", "M4<br />", "M5<br />", "S1<br />", "S2<br />", "S3<br />", "S4<br />", "S5<br />");
for ($h = 0; $h <= 9; $h++) {
    if (in_array(substr($horaire[$h], 0, 2), $cren_off)) {
        echo '<tr><td class="mi-jour" colspan="13"></td></tr>';
        continue;
    }
    //Affichage de la designation des creneaux horaires
    echo "<tr><th>" . $horaire[$h] . date('G:i', $deb[$h]) . "-" . date('G:i', $fin[$h]) . "</th>\n";
    //Affichage du contenu des creneaux horaires
コード例 #3
0
     setlocale(LC_TIME, "french");
 } else {
     setlocale("LC_TIME", "french");
 }
 $rq = "SELECT DATE_FORMAT(date,'%d/%m/%Y'),contenu,afaire,DATE_FORMAT(datafaire,'%d/%m/%Y'),id_rubrique,date,date FROM cahiertxt" . $ann_arch . "\n        WHERE id_auteur={$cible}  ORDER BY date asc";
 // lancer la requete
 $result = @mysqli_query($GLOBALS["___mysqli_ston"], $rq) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
 // Combien y a-t-il d'enregistrements ?
 $nb2 = mysqli_num_rows($result);
 echo '<table id="tb-cdt" cellpadding="1" cellspacing="2">';
 while ($ligne = mysqli_fetch_array($result, MYSQLI_NUM)) {
     $textcours = utf8_encode(stripslashes($ligne[1]));
     //$textcours=$ligne[1];
     $textafaire = utf8_encode(stripslashes($ligne[2]));
     //$day="1,0,0,12,1,2007";echo $day;
     $jour = LeJour(strToTime($ligne[5]));
     //debut
     if ($ligne[1] != "") {
         echo '<tbody><tr><th colspan="2"></th></tr></tbody>';
         echo '<tbody>';
         echo '<tr>';
         //affichage de la seance
         echo '<td class="seance">S&eacute;ance du <br/>' . $jour . '&nbsp;' . $ligne[0] . '<br />Visible le ' . $ligne[7] . ' </td>';
         if ($ligne[1] != "" && $ligne[6] == 1) {
             echo '<td class="contenu2">';
         } elseif ($ligne[1] != "" && $ligne[6] == 2) {
             echo '<td class="contenu3">';
         } else {
             echo '<td class="contenu">';
         }
         echo $textcours . '</td></tr>';
コード例 #4
0
ファイル: imprim.php プロジェクト: rhertzog/lcs
function Imprime_seance_seq($param)
{
    //affiche une sequence associee a une sequence
    global $cible;
    $rq = "SELECT DATE_FORMAT(date,'%d/%m/%Y'),contenu,afaire,DATE_FORMAT(datafaire,'%d/%m/%Y'),id_rubrique,date,on_off,DATE_FORMAT(datevisibi,'%d/%m/%Y') FROM cahiertxt\n    WHERE (id_rubrique={$param}) ";
    $result = @mysqli_query($GLOBALS["___mysqli_ston"], $rq) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
    if (mysqli_num_rows($result) > 0) {
        while ($ligne = mysqli_fetch_array($result, MYSQLI_NUM)) {
            $textcours = utf8_encode(stripslashes($ligne[1]));
            $textafaire = utf8_encode(stripslashes($ligne[2]));
            $jour = LeJour(strToTime($ligne[5]));
            //debut
            if ($ligne[1] != "") {
                echo '<tbody><tr>';
                //affichage de la seance
                echo '<td><span  class="cours">S&eacute;ance du ' . $jour . '&nbsp;' . $ligne[0] . ' </span></td></tr>';
                echo '<tr ><td>';
                echo $textcours . '</td></tr>';
                //affichage, s'il existe, du travail a effectuer
                if ($ligne[2] != "") {
                    echo '<tr><td class="afR">A faire pour le : ' . $ligne[3] . '</td><tr>';
                    echo '<tr><td>' . $textafaire . '</td></tr></tbody>';
                }
            } else {
                echo '<tbody><tr>';
                //affichage de la seance
                echo '<td><span  class="cours">Donn&eacute; le :&nbsp;' . $ligne[0] . ' </span></td></tr>';
                //affichage, s'il existe, du travail a effectuer
                if ($ligne[2] != "") {
                    echo '<tr><td >Pour le :&nbsp;' . $ligne[3] . '</td></tr>';
                    echo '<tr><td >';
                    echo $textafaire . '</td></tr>';
                }
            }
            echo ' <tr><td ><hr /></td></tr></tbody>';
        }
    }
}
コード例 #5
0
ファイル: fonctions.inc.php プロジェクト: rhertzog/lcs
function Affiche_seance_seq($param, $boutons = FALSE, $tick = "")
{
    //affiche une sequence associee a une sequence
    global $cible;
    if ($cible == "") {
        $my_rq = "SELECT `id_auteur` FROM `cahiertxt` WHERE `id_rubrique` =" . $param;
        $r = @mysqli_query($GLOBALS["___mysqli_ston"], $my_rq) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
        $ret = mysqli_fetch_array($r, MYSQLI_NUM);
        $cible = $ret[0];
    }
    if ($tick == "") {
        $tick = md5($_SESSION['RT'] . htmlentities($_SERVER['PHP_SELF']));
    }
    $rq = "SELECT DATE_FORMAT(date,'%d/%m/%Y'),contenu,afaire,DATE_FORMAT(datafaire,'%d/%m/%Y'),id_rubrique,date,on_off,DATE_FORMAT(datevisibi,'%d/%m/%Y') FROM cahiertxt\n WHERE (id_rubrique={$param}) ";
    $result = @mysqli_query($GLOBALS["___mysqli_ston"], $rq) or die(is_object($dbc) ? mysqli_error($dbc) : (($___mysqli_res = mysqli_connect_error()) ? $___mysqli_res : false));
    if (mysqli_num_rows($result) > 0) {
        while ($ligne = mysqli_fetch_array($result, MYSQLI_NUM)) {
            //$textcours=stripslashes(markdown($ligne[1]));
            $textcours = utf8_encode($ligne[1]);
            //$textafaire=stripslashes(markdown($ligne[2]));
            $textafaire = utf8_encode($ligne[2]);
            //$day="1,0,0,12,1,2007";echo $day;
            $jour = LeJour(strToTime($ligne[5]));
            //debut
            if ($ligne[1] != "") {
                echo '<tr>';
                //affichage de la seance
                echo '<td class="seance">S&eacute;ance du <br/>' . $jour . '&nbsp;' . $ligne[0] . '<br />Visible le ' . $ligne[7] . ' </td>';
                if ($ligne[1] != "" && $ligne[6] == 1) {
                    echo '<td class="contenu2">';
                } elseif ($ligne[1] != "" && $ligne[6] == 2) {
                    echo '<td class="contenu3">';
                } else {
                    echo '<td class="contenu">';
                }
                echo $textcours . '</td></tr>';
                //affichage, s'il existe, du travail a effectuer
                if ($ligne[2] != "") {
                    echo '<tr><td class="afaire">A faire pour le :<br/>' . $ligne[3] . '</td><td class="contenu">';
                    echo $textafaire . '</td></tr>';
                }
                //fin
                echo '<tr><th class="bas" colspan="2">';
                if ($_SESSION['cequi'] == "prof" && mb_ereg('prof\\.', $_SERVER['REQUEST_URI']) || $boutons == true) {
                    echo '<form action="';
                    echo 'cahier_texte_prof.php';
                    echo '" method="post"><div><input type="hidden" name="number" value="';
                    echo $ligne[4];
                    echo '" /><input type="hidden" name="rubriq" value="';
                    echo $cible;
                    echo ' " /><input name="date" type="hidden" value="' . $date . '" />';
                    if ($ligne[6] == "0") {
                        echo '<input type="submit" name="modif" value="" class="bt-modifier" />&nbsp;
                                      <input type="submit" name="suppr" value="" class="bt-supprimer" />';
                    }
                    echo '<input name="TA" type="hidden"  value="' . $tick . '" />';
                    echo '</div></form>';
                }
                echo '</th></tr>';
            } else {
                echo '<tr>';
                //affichage de la seance
                echo '<td class="afaire">Donn&eacute; le :&nbsp;' . $ligne[0] . '<br />Visible le ' . $ligne[7];
                //affichage, s'il existe, du travail a effectuer
                if ($ligne[2] != "") {
                    echo '<br />Pour le :&nbsp;' . $ligne[3] . '</td>';
                    if ($ligne[6] == 1) {
                        echo '<td class="contenu2">';
                    } elseif ($ligne[6] == 2) {
                        echo '<td class="contenu3">';
                    } else {
                        echo '<td class="contenu">';
                    }
                    echo $textafaire . '</td></tr>';
                }
                //fin
                echo '<tr><th class="bas" colspan="2">';
                if ($_SESSION['cequi'] == "prof" && mb_ereg('prof\\.', $_SERVER['REQUEST_URI']) || $boutons == true) {
                    echo '<form action="';
                    echo 'cahier_texte_prof.php';
                    echo '" method="post"><div><input type="hidden" name="number" value="';
                    echo $ligne[4];
                    echo '" /><input type="hidden" name="rubriq" value="';
                    echo $cible;
                    echo ' " /><input name="date" type="hidden"  value="' . $date . '" />';
                    if ($ligne[6] == "0") {
                        echo '<input type="submit" name="modif" value="" class="bt-modifier" />&nbsp;
                    <input type="submit" name="suppr" value="" class="bt-supprimer" />';
                    }
                    echo '<input name="TA" type="hidden"  value="' . $tick . '" />';
                    echo '</div></form>';
                }
                echo '</th></tr>';
            }
        }
    }
}
コード例 #6
0
ファイル: pop_abs.php プロジェクト: rhertzog/lcs
" />
<table id="btn-plan-cdt">
<tr>
<td  ><input type="submit" name="prec" value="&lt;&lt;" class="bt50" /></td>
<td class="hebdo"> <?echo datefr2($Lundi)?> - <?echo datefr2($Samedi);?></td>
<td ><input type="submit" name="suiv" value="&gt;&gt;" class="bt50" /></td>
</tr>
</table>
<table id="plan-cdt" cellpadding="1" cellspacing="1">
<thead>
<tr><th> </th>
<?php 
// Affichage des jours et dates de la semaine en haut du tableau"j-M-Y",
for ($i = 0; $i <= 5; $i++) {
    $TS = $Lundi + $i * 86400;
    echo '<td class="abs" >' . LeJour($TS) . "</td>";
}
?>
</tr></thead>
<tbody>
<?php 
$horaire = array("M1", "M2", "M3", "M4", "M5", "S1", "S2", "S3", "S4", "S5");
for ($h = 0; $h <= 9; $h++) {
    if (in_array($horaire[$h], $cren_off)) {
        echo '<tr><td class="mi-jour" colspan="7"></td></tr>';
        continue;
    }
    //Affichage de la designation des creneaux horaires
    echo "<tr><th>" . $horaire[$h] . "</th>\n";
    //Affichage du contenu des creneaux horaires
    for ($j = 0; $j <= 5; $j++) {
コード例 #7
0
ファイル: exporthtml.php プロジェクト: rhertzog/lcs
 if ($result) {
     $id = array();
     $cours = array();
     $afR = array();
     $n = 0;
     while ($enrg = mysqli_fetch_array($result, MYSQLI_NUM)) {
         $id[$n] = $enrg[0];
         $cours[$n] = utf8_encode(mb_ereg_replace("../../../", "http://" . $hostname . "." . $domain . "/", $enrg[1]));
         $afR[$n] = utf8_encode(mb_ereg_replace("../../../", "http://" . $hostname . "." . $domain . "/", $enrg[2]));
         $n++;
     }
 }
 mysqli_free_result($result) || is_object($result) && get_class($result) == "mysqli_result" ? true : false;
 echo '<tr>
         <td rowspan="' . count($id) . '" class="date">
         <p>' . LeJour(strToTime($list_dates[$loop1])) . '<br />' . $list_dattes[$loop1] . '</p>
         </td>';
 // pour chaque jour
 for ($loop2 = 0; $loop2 < count($id); $loop2++) {
     //recherche donnes auteur
     $rq = "SELECT prefix,prof,matiere from onglets WHERE id_prof='{$id[$loop2]}'";
     //echo $rq;exit;
     $result = @mysqli_query($GLOBALS["___mysqli_ston"], $rq);
     if ($result) {
         while ($enrg = mysqli_fetch_array($result, MYSQLI_NUM)) {
             $Prof = utf8_encode($enrg[0]) . " " . utf8_encode($enrg[1]);
             $matiere = utf8_encode($enrg[2]);
         }
     }
     mysqli_free_result($result) || is_object($result) && get_class($result) == "mysqli_result" ? true : false;
     if ($loop2 > 0) {