Minor - clean main/extra code BT#14111

pull/2539/head
jmontoyaa 7 years ago
parent 74a53d2d37
commit b829d45225
  1. 6
      main/extra/create_exam.php
  2. 4
      main/extra/create_school_calendar.php
  3. 3
      main/extra/delete_exam.php
  4. 2
      main/extra/edit_exam.php
  5. 18
      main/extra/edit_intervention.php
  6. 72
      main/extra/my_progress_ind.php

@ -8,7 +8,7 @@ if (empty($allow)) {
exit;
}
$tbl_stats_exercices = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$table = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);
$ex_user_id = isset($_GET['ex_user_id']) ? (int) $_GET['ex_user_id'] : '';
$mod_no = isset($_GET['mod_no']) ? Database::escape_string($_GET['mod_no']) : '';
$score_ex = isset($_GET['score_ex']) ? Database::escape_string($_GET['score_ex']) : '';
@ -16,8 +16,8 @@ $score_rep1 = isset($_GET['score_rep1']) ? Database::escape_string($_GET['score_
$score_rep2 = isset($_GET['score_rep2']) ? Database::escape_string($_GET['score_rep2']) : '';
$coment = isset($_GET['coment']) ? Database::escape_string($_GET['coment']) : '';
$sql = "INSERT INTO $tbl_stats_exercices "."(exe_user_id,c_id,mod_no,score_ex,score_rep1,score_rep2,coment) ".
"VALUES "."('$ex_user_id','0','$mod_no','$score_ex', '$score_rep1', '$score_rep2', '$coment' )";
$sql = "INSERT INTO $table (exe_user_id,c_id,mod_no,score_ex,score_rep1,score_rep2,coment)
VALUES ('$ex_user_id','0','$mod_no','$score_ex', '$score_rep1', '$score_rep2', '$coment')";
Database::query($sql);
header("location: myStudents.php?student=$ex_user_id");
exit;

@ -65,8 +65,8 @@ if (empty($title)) {
echo '</td>';
echo "<td><input type='text' NAME='day_number' size='4' value=".$number."/></td>";
echo "<td><input type='text' NAME='d_title' size='4' value=".$title."/></td>";
$sql4 = "INSERT INTO set_module "."(cal_name,cal_day_num,cal_date)
VALUES "."('$title','$number','".date('Y-m-d', $date1)."')";
$sql4 = "INSERT INTO set_module (cal_name,cal_day_num,cal_date)
VALUES ('$title','$number','".date('Y-m-d', $date1)."') ";
Database::query($sql4);
if ($i % $nbcol == ($nbcol - 1)) {
echo "</tr>";

@ -8,10 +8,9 @@ if (empty($allow)) {
exit;
}
$is_allowedToTrack = $is_courseAdmin || $is_platformAdmin;
api_block_anonymous_users();
$ex_user_id = isset($_GET['student_id']) ? $_GET['student_id'] : "";
$ex_user_id = isset($_GET['student_id']) ? (int) $_GET['student_id'] : 0;
$num = isset($_GET['num']) ? (int) $_GET['num'] : 0;
$table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);

@ -33,7 +33,7 @@ $student_idd = isset($_GET['student_id']) ? (int) $_GET['student_id'] : '';
</tr>
<?php
$sqlexam = "SELECT * FROM $tbl_stats_exercices WHERE exe_id = $num";
$sqlexam = "SELECT * FROM $tbl_stats_exercices WHERE exe_id = $num";
$resultexam = Database::query($sqlexam);
while ($a_exam = Database::fetch_array($resultexam)) {
$exe_id = $a_exam['exe_id'];

@ -19,12 +19,12 @@ $tbl_stats_exercices = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCIS
<form action="update_intervention.php" method="post" name="save_intercention">
<table class='data_table'>
<tr>
<th colspan="4"><?php echo get_lang('edit_save'); ?>
<th colspan="4"><?php echo get_lang('Edit'); ?>
<tr>
<th><?php echo get_lang('level'); ?></th>
<th><?php echo get_lang('lang_date'); ?></th>
<th><?php echo get_lang('Level'); ?></th>
<th><?php echo get_lang('Date'); ?></th>
<th><?php echo get_lang('interventions_commentaires'); ?></th>
<th><?php echo get_lang('action'); ?></th>
<th><?php echo get_lang('Action'); ?></th>
</tr>
<?php
$sqlinter = "SELECT * FROM $tbl_stats_exercices WHERE exe_id = $num";
@ -35,10 +35,10 @@ $tbl_stats_exercices = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCIS
$score_ex = $a_inter['score_ex'];
$inter_coment = stripslashes($a_inter['inter_coment']);
echo "
<tr><center>
<tr>
<td> ".$a_inter['level']."
</td>
<td><center>
<td>
".$a_inter['exe_date']."
</td>";
$exe_id = $a_inter['exe_id'];
@ -47,12 +47,10 @@ $tbl_stats_exercices = Database:: get_main_table(TABLE_STATISTIC_TRACK_E_EXERCIS
<textarea name="inter_coment" cols="65" rows="2">
<?php echo $inter_coment; ?>
</textarea>
<br>
</td>
<INPUT type=hidden name=exe_id value= <?php echo "$exe_id" ?>>
<INPUT type=hidden name=student_id value= <?php echo "$student_idd" ?>>
<INPUT type=hidden name=exe_id value= <?php echo "$exe_id"; ?>/>
<INPUT type=hidden name=student_id value= <?php echo "$student_idd"; ?>/>
<td><input type="submit" value="Sauvegarder" name="B1"></td>
</td>
</tr>
<?php
}

@ -22,8 +22,8 @@ Display::display_header($nameTools);
$result = Database::query(
"SELECT DISTINCT session.id as id, name, access_start_date date_start, access_end_date date_end
FROM session_rel_course_rel_user,session
WHERE session_id=session.id AND user_id=".
$_user['user_id']." ORDER BY date_start, date_end, name");
WHERE session_id=session.id AND user_id=".$_user['user_id']."
ORDER BY date_start, date_end, name");
$Sessions = Database::store_result($result);
$Courses = [];
@ -76,9 +76,8 @@ while ($a_courses = Database::fetch_array($result2)) {
$c_id = $courses_code;
//pours chaque cours dans lequel il est inscrit, on cherche les jours complétés
$Req1 = "SELECT *
FROM c_lp_view
WHERE user_id = '$user_c_id'
AND c_id = '$c_id'
FROM c_lp_view
WHERE user_id = '$user_c_id' AND c_id = '$c_id'
";
$res = Database::query($Req1);
while ($result = Database::fetch_array($res)) {
@ -96,21 +95,21 @@ while ($a_courses = Database::fetch_array($result2)) {
while ($resulta = Database::fetch_array($res2)) {
$lp_item_id = $resulta['id'];
$Req3 = " SELECT Max(id)
FROM c_lp_item_view
WHERE lp_item_id = '$lp_item_id'
AND lp_view_id = '$lp_id_view'
AND c_id = '$c_id_view'
AND status = 'completed'
";
FROM c_lp_item_view
WHERE
lp_item_id = '$lp_item_id' AND
lp_view_id = '$lp_id_view' AND
c_id = '$c_id_view' AND
status = 'completed'
";
$res3 = Database::query($Req3);
while ($resul = Database::fetch_array($res3)) {
$max = $resul['0'];
$Req4 = "SELECT COUNT( id )
FROM c_lp_item_view
WHERE id = '$max'
AND c_id = '$c_id_view'
FROM c_lp_item_view
WHERE
id = '$max' AND
c_id = '$c_id_view'
";
$res4 = Database::query($Req4);
while ($resultat = Database::fetch_array($res4)) {
@ -176,11 +175,11 @@ $diff = abs($diff);
$pt[] = '0';
$pt[] = '0';
$sqlcontrole = "SELECT diff
FROM $tbl_stats_exercices
WHERE exe_user_id = ".$_user['user_id']."
AND diff != ''
ORDER BY exe_date ASC
";
FROM $tbl_stats_exercices
WHERE exe_user_id = ".$_user['user_id']."
AND diff != ''
ORDER BY exe_date ASC
";
$result = Database::query($sqlcontrole);
while ($ptctl = Database::fetch_array($result)) {
$pt[] = $ptctl ['diff'];
@ -223,25 +222,25 @@ $diff = abs($diff);
?>
<tr>
<th align="left" width="412">
<?php echo get_lang('Cumulatif_agenda'); ?>: <b><font
color=#CC0000> <?php echo $jour_realise_tot ?></font></b></p>
<?php echo get_lang('Cumulatif_agenda'); ?>:
<b><font color=#CC0000> <?php echo $jour_realise_tot ?></font></b>
</th>
</tr>
<tr>
<th align="left">
<?php echo get_lang('Cumulatif'); ?> <b><font color=#CC0000> <?php echo $Total ?></font></b></p>
<?php echo get_lang('Cumulatif'); ?> <b><font color=#CC0000> <?php echo $Total ?></font></b>
</th>
</tr>
<tr>
<th align="left">
<?php echo get_lang('jours_selon_horaire'); ?>: <b><font
color=#CC0000> <?php echo $jour_agenda ?><?php echo $Days ?></font></b></p>
<?php echo get_lang('jours_selon_horaire'); ?>:
<b><font color=#CC0000> <?php echo $jour_agenda ?><?php echo $Days ?></font></b>
</th>
</tr>
<tr>
<th align="left">
<?php echo get_lang('diff2'); ?>: <b><font
color=#CC0000> <?php echo $diff ?><?php echo $Days, $sing ?></font></b></p>
<?php echo get_lang('diff2'); ?>:
<b><font color=#CC0000> <?php echo $diff ?><?php echo $Days, $sing ?></font></b>
</th>
</tr>
</table>
@ -271,16 +270,10 @@ $diff = abs($diff);
$inter_coment = Security::remove_XSS($a_inter['inter_coment']);
$inter_date = substr($a_inter['exe_date'], 0, 11);
echo "
<tr><center>
<td> ".$a_inter['level']."
</td>
<td><center>
$inter_date
</td>
<td>$inter_coment
</td>
";
<tr>
<td> ".$a_inter['level']."</td>
<td> $inter_date </td>
<td>$inter_coment</td>";
$exe_id = $a_inter['exe_id'];
}
if ($level == 3) {
@ -302,7 +295,7 @@ $sql = "SELECT *
";
$result = Database::query($sql);
$horaire_id = Database::fetch_array($result);
$nom_hor = $horaire_id ['official_code'];
$nom_hor = $horaire_id['official_code'];
$c_id_horaire = strstr($nom_hor, '.');
$c_id_horaire = str_replace(".", "", "$c_id_horaire");
// Courses
@ -380,7 +373,6 @@ while ($a_courses = Database::fetch_array($result2)) {
}
//on arrondi
$nombre_jours_module = (int) $nombre_jours_module;
//on trouve la date de fin de chaque module AND date = date_format('$first_connection_date_to_module','%Y-%m-%d')
$sql = "SELECT * FROM c_cal_dates
WHERE

Loading…
Cancel
Save